//// IsMovable ///////////////////////////////////////////////////////////////
//  Returns whether this node is "animated" (i.e. could move at runtime)
hsBool plMaxNodeBase::IsMovable()
{
    const char* dbgNodeName = GetName();
    hsBool      shouldBe = false;


    if( !CanConvert() )
        return false;

    if( GetMovable() )
        return true;

    if( GetItinerant() )
        shouldBe = true;
    else if( FindSkinModifier() )
        shouldBe = true;

    // Moved this to plAnimComponent (so GetMovable() will reveal it)
    /*
    else if( IsTMAnimated() )
        shouldBe = true;
    */
    if( shouldBe )
    {
        SetMovable( true );
        return true;
    }

    return ((plMaxNodeBase*)GetParentNode())->IsMovable();
}
Esempio n. 2
0
void CItem::SetLock( BOOL bLock )
{
	cIcon::SetLock( bLock );
	
	SetMovable( !bLock );
	//아이템 사용도 금지
}
GameMenuWindow::GameMenuWindow()
:   DarwiniaWindow("GameMenu"),
    m_currentPage(-1),
    m_newPage(PageDarwinia)
{
    int w = g_app->m_renderer->ScreenW();
    int h = g_app->m_renderer->ScreenH();
    SetPosition( 5, 5 );
    SetSize( w - 10, h - 10 );
    m_resizable = false;
    SetMovable( false );
}
EclWindow::EclWindow( char *_name )
:   m_x(0),
    m_y(0),
    m_w(0),
    m_h(0),
    m_dirty(false),
    m_resizable(true)
{    
    SetName (_name);
    SetTitle ( UnicodeString("New Window") );
    SetMovable ( true );
    strcpy( m_currentTextEdit, "None" );
}
void pawsNpcDialogWindow::SetupWindowWidgets()
{
    pawsWidget* lists = FindWidget("Lists");
    pawsWidget* bubbles = FindWidget("Bubbles");
    if(useBubbles)
    {
        if(border) border->Hide();
        if(close_widget) close_widget->Hide();
        lists->Hide();
        responseList->Hide();
        bubbles->Show();
        SetMovable(false);
        psengine->GetPSCamera()->LockCameraMode(true);
        psengine->GetCharManager()->LockTarget(true);
        defaultFrame = bubbles->GetScreenFrame();
        SetSize(defaultFrame.Width(), defaultFrame.Height());
        CenterTo(graphics2D->GetWidth() / 2, graphics2D->GetHeight() / 2);
        FindWidget("FreeBubble")->Show();
        textBox->Clear();
    }
    else
    {
        if(border) border->Show();
        if(close_widget) close_widget->Show();
        lists->Show();
        responseList->Show();
        bubbles->Hide();
        SetMovable(true);
        psengine->GetPSCamera()->LockCameraMode(false);
        psengine->GetCharManager()->LockTarget(false);
        defaultFrame = lists->GetDefaultFrame();
        SetSize(defaultFrame.Width(), defaultFrame.Height());
        CenterTo(graphics2D->GetWidth() / 2, graphics2D->GetHeight() / 2);
        PawsManager::GetSingleton().SetCurrentFocusedWidget(responseList);
    }
}
Esempio n. 6
0
std::unique_ptr<CBaseAlien> CBaseAlien::Create(
    const ObjectCreateParams& params,
    Gfx::COldModelManager* modelManager,
    Gfx::CEngine* engine)
{
    auto obj = MakeUnique<CBaseAlien>(params.id, params.type);

    obj->SetTeam(params.team);

    std::unique_ptr<CPhysics> physics = MakeUnique<CPhysics>(obj.get());

    std::unique_ptr<CMotion> motion;
    if ( params.type == OBJECT_MOTHER )
    {
        motion = MakeUnique<CMotionQueen>(obj.get());
    }
    if ( params.type == OBJECT_ANT )
    {
        motion = MakeUnique<CMotionAnt>(obj.get());
    }
    if ( params.type == OBJECT_SPIDER )
    {
        motion = MakeUnique<CMotionSpider>(obj.get());
    }
    if ( params.type == OBJECT_BEE )
    {
        motion = MakeUnique<CMotionBee>(obj.get());
    }
    if ( params.type == OBJECT_WORM )
    {
        motion = MakeUnique<CMotionWorm>(obj.get());
    }
    assert(motion != nullptr);

    physics->SetMotion(motion.get());
    motion->SetPhysics(physics.get());

    motion->Create(params.pos, params.angle, params.type, 0.0f, modelManager);

    obj->SetProgrammable();
    obj->SetMovable(std::move(motion), std::move(physics));

    return std::move(obj);
}
Esempio n. 7
0
Tab::Tab(Context *) : 
    lWindow()
{
    buttonTitle = new ButtonToggled(gContext);
    SetMovable(false);
}
Esempio n. 8
0
void CExchangeItem::SetLock( BOOL bLock )
{
	cIcon::SetLock( bLock );
	SetMovable( !bLock );
}
Esempio n. 9
0
void cMsgBox::MsgBox(LONG lId, eMBType nMBType, LPCTSTR strMsg, cbFUNC cbMBFunc)
{
	if( !strMsg ) return ;

	m_nMBType = nMBType;
	SHORT_RECT rect = {0};
	WORD value = 0;
	g_pExecutive->GetRenderer()->GetClientRect(
		&rect,
		&value,
		&value);
	
	const SIZE buttonSize = {64, 23};
	const POINT textPoint = {15, 42};
	int nMsgBoxWidth = GetWidth();
	int nMsgBoxHeight = GetHeight();
	int nBtn1_Y	= 78;
	int nBtn2_Y	= 78;
	int nTextLine = 0;

	SCRIPTMGR->GetImage( 30, &m_DlgImg ) ;										// 기본 배경. AUTOSIZE 타입의 메세지 박스 출력 후에 항상 필요하기 때문에 여기서

	//--------------------------------------------------------------------------
	// Setting Text area.
	m_pMsg = new cTextArea ;													// 텍스트 라인 수를 구하기 위해 텍스트 먼저 처리

	int  nTextWidth	= nMsgBoxWidth - textPoint.x ;
	RECT rtText		= { 0, 0, 196 - textPoint.x * 2, 200 } ;

	m_pMsg->SetFontIdx( 0 ) ;
	m_pMsg->SetFontColor( RGB(96, 98, 1) );
	m_pMsg->Init(
		textPoint.x,
		textPoint.y,
		WORD(nTextWidth),
		200,
		0);
	m_pMsg->InitTextArea(
		&rtText,
		256);
	m_pMsg->SetAlpha((BYTE)m_alpha) ;
	m_pMsg->SetScriptText( strMsg ) ;
	m_pMsg->SetActive(m_bActive) ;	

	nTextLine = m_pMsg->GetIMEex()->GetTotalLine() ;

	//--------------------------------------------------------------------------
	// Setting Dialog info.
	cImageRect* pRect = NULL ;

	cImage middleBg ;

	WORD wWidth	 = 0 ;
	WORD wHeight = 0 ;

	//--------------------------------------------------------------------------
	// ..상단 이미지
	SCRIPTMGR->GetImage( 119, &m_DlgImg ) ;
	pRect = m_DlgImg.GetImageRect() ;

	nMsgBoxHeight = (int)(pRect->bottom - pRect->top) ;

	//--------------------------------------------------------------------------
	// ..중간 이미지 - 상단 이미지, 중간 이미지, 텍스트 출력 y 좌표가 서로 딱 맞아 떨어지지가 않기 때문에 줄 수에 정확히 맞추기 위해서 따로 추가..
   	cStatic* pMiddle01Bg = new cStatic ;

	SCRIPTMGR->GetImage( 120, &middleBg ) ;
	pRect = middleBg.GetImageRect() ;

	wWidth  = (WORD)(pRect->right-pRect->left) ;
	wHeight = (WORD)(pRect->bottom-pRect->top) ;

	pMiddle01Bg->Init( 0, nMsgBoxHeight, wWidth, wHeight, &middleBg, -1 ) ;
	cImageScale scale0 = {1.0f, 3.0f} ;
 	pMiddle01Bg->SetScale(&scale0) ;
 	Add( pMiddle01Bg ) ;

	nMsgBoxHeight += (int)((pRect->bottom-pRect->top-1)*scale0.y) ;

	//--------------------------------------------------------------------------
	// ..중간 이미지 - 텍스트 공간 만큼의 크기로 설정
   	cStatic* pMiddle02Bg = new cStatic ;

	SCRIPTMGR->GetImage( 120, &middleBg ) ;
	pRect = middleBg.GetImageRect() ;

	wWidth  = (WORD)(pRect->right-pRect->left) ;
	wHeight = (WORD)(pRect->bottom-pRect->top) ;

	pMiddle02Bg->Init( 0, nMsgBoxHeight, wWidth, wHeight, &middleBg, -1 ) ;
	cImageScale scale = {1.0f, 4.0f} ;
	scale.y *= nTextLine ;
 	pMiddle02Bg->SetScale(&scale) ;
 	Add( pMiddle02Bg ) ;

	nMsgBoxHeight += (int)((pRect->bottom-pRect->top-1)*scale.y) ;

	nBtn1_Y = nMsgBoxHeight-7 ;
	nBtn2_Y = nMsgBoxHeight-7 ;

	//--------------------------------------------------------------------------
	// ..하단 이미지
	cStatic* pBottomBg = new cStatic ;

	SCRIPTMGR->GetImage( 121, &middleBg) ;
	pRect = middleBg.GetImageRect() ;

	wWidth  = (WORD)(pRect->right-pRect->left) ;
	wHeight = (WORD)(pRect->bottom-pRect->top) ;

	pBottomBg->Init( 0, nMsgBoxHeight, wWidth, wHeight, &middleBg, -1 );
	Add( pBottomBg ) ;

	nMsgBoxHeight += (int)(pRect->bottom-pRect->top) ;

	switch(nMBType)
	{
	case MBT_OK:
	case MBT_OK_EXIT_PROGRAM:
		{
			m_pButton[0] = new cButton;
			m_pButton[0]->Init(
				(nMsgBoxWidth - buttonSize.cx) / 2,
				nBtn1_Y,
				WORD(buttonSize.cx),
				WORD(buttonSize.cy),
				&m_BtnImgBasic,
				&m_BtnImgOver,
				&m_BtnImgPress,
				0,
				MBI_OK);
			m_pButton[0]->SetText( m_BtnText[MB_BTN_OK], m_dwColor[0], m_dwColor[1], m_dwColor[2] );
			m_pButton[0]->SetTextXY(0, 6) ;
			m_pButton[0]->SetAlign( TXT_CENTER );
			m_pButton[0]->SetActive( m_bActive );
			m_pButton[0]->SetAlpha( (BYTE)m_alpha );
			Add( m_pButton[0] );

			SetOpenSound(
				1256);
			SetCloseSound(
				1257);
		}
		break;

	case MBT_YESNO:
	case MBT_YESNO_EXIT_PROGRAM:
		{
			m_pButton[0] = new cButton;
			m_pButton[0]->Init(
				24,
				nBtn2_Y,
				WORD(buttonSize.cx),
				WORD(buttonSize.cy),
				&m_BtnImgBasic,
				&m_BtnImgOver,
				&m_BtnImgPress,
				0,
				MBI_YES);
			m_pButton[0]->SetText( m_BtnText[MB_BTN_YES], m_dwColor[0], m_dwColor[1], m_dwColor[2] );
			m_pButton[0]->SetTextXY(0, 6) ;
			m_pButton[0]->SetAlign( TXT_CENTER );
			m_pButton[0]->SetActive( m_bActive );
			m_pButton[0]->SetAlpha( (BYTE)m_alpha );
			Add( m_pButton[0] );

			m_pButton[1] = new cButton;
			m_pButton[1]->Init(
				111,
				nBtn1_Y,
				WORD(buttonSize.cx),
				WORD(buttonSize.cy),
				&m_BtnImgBasic,
				&m_BtnImgOver,
				&m_BtnImgPress,
				0,
				MBI_NO);
			m_pButton[1]->SetText( m_BtnText[MB_BTN_NO], m_dwColor[0], m_dwColor[1], m_dwColor[2] );
			m_pButton[1]->SetTextXY(0, 6) ;
			m_pButton[1]->SetAlign( TXT_CENTER );
			m_pButton[1]->SetActive( m_bActive );
			m_pButton[1]->SetAlpha( (BYTE)m_alpha );
			Add( m_pButton[1] );

			SetOpenSound(
				1256);
			SetCloseSound(
				1257);
		}
		break;

	case MBT_CANCEL:
	case MBT_CANCEL_EXIT_PROGRAM:
		{
			m_pButton[0] = new cButton;
			m_pButton[0]->Init(
				(nMsgBoxWidth - buttonSize.cx) / 2,
				nBtn1_Y,
				WORD(buttonSize.cx),
				WORD(buttonSize.cy),
				&m_BtnImgBasic,
				&m_BtnImgOver,
				&m_BtnImgPress,
				0,
				MBI_CANCEL);
			m_pButton[0]->SetText( m_BtnText[MB_BTN_CANCEL], m_dwColor[0], m_dwColor[1], m_dwColor[2] );
			m_pButton[0]->SetTextXY(0, 6) ;
			m_pButton[0]->SetAlign( TXT_CENTER );
			m_pButton[0]->SetActive( m_bActive );
			m_pButton[0]->SetAlpha( (BYTE)m_alpha );
			Add( m_pButton[0] );

			SetOpenSound(
				1256);
			SetCloseSound(
				1257);
		}
		break;
	}

	// ..배경을 먼저 출력해야 하기 때문에 텍스트 추가는 여기서
	Add( m_pMsg );
	cDialog::Init(
		0,
		0,
		GetWidth(),
		GetHeight(),
		&m_DlgImg,
		lId);
	// 100302 LUJ, 위치를 원하는대로 배치하려면 SetAbsXY()를 사용해야한다
	SetAbsXY(
		(rect.right - GetWidth()) / 2,
		(rect.bottom - GetHeight()) / 2);
	SetMovable(TRUE);
	RECT rtCaption = { 0, 0, GetWidth(), 20 };
	SetCaptionRect(&rtCaption);

	m_cbMBFunc = cbMBFunc;
	
	cStatic* pStatic = new cStatic;
	pStatic->Init( 15, 16, 0, 0, NULL, -1 );
	pStatic->SetStaticText( RESRCMGR->GetMsg( 261 ) );
	pStatic->SetShadow( TRUE );
	pStatic->SetFontIdx( 0 );
	pStatic->SetAlign( TXT_LEFT );
	Add( pStatic );

	mCounterStatic = new cStatic;
	mCounterStatic->Init(
		GetWidth() - 30,
		16,
		0,
		0,
		0,
		-1);
	mCounterStatic->SetShadow(TRUE);
	mCounterStatic->SetFontIdx(0);
	mCounterStatic->SetAlign(TXT_RIGHT);
	mCounterStatic->SetActive(FALSE);
	Add(mCounterStatic);
	m_bActive = FALSE;
}