示例#1
0
std::string CActorViewer::NotifyExternalCommand(const std::string& command)
{
	Palleon::CEmbedRemoteCall rpc(command);
	auto method = rpc.GetMethod();
	if(method == "SetGamePath")
	{
		auto gamePath = rpc.GetParam("Path");
		CFileManager::SetGamePath(gamePath);
		return std::string("success");
	}
	if(method == "SetActor")
	{
		try
		{
			auto baseModelId = boost::lexical_cast<uint32>(rpc.GetParam("BaseModelId"));
			auto topModelId = boost::lexical_cast<uint32>(rpc.GetParam("TopModelId"));
			SetActor(baseModelId, topModelId);
			return std::string("success");
		}
		catch(...)
		{
			return std::string("failed");
		}
	}
	return std::string("failed");
}
void BezierControllerActorProxy::CreateActor()
{
   SetActor(*new BezierController());
   static_cast<BezierController*>(GetActor())->RenderProxyNode(true);
   
   std::ostringstream ss;
   ss << "Controller" << mNumControllers++;
   SetName(ss.str());
}
    void StaticMeshActorProxy::CreateActor()
    {
        SetActor(*new dtCore::Object);

        static int actorCount = 0;
        std::ostringstream ss;
        ss << "StaticMesh" << actorCount++;
        SetName(ss.str());
    }
示例#4
0
Actor* CreateExplosion (int index, int x, int y, TLN_Sequence sequence)
{
	Actor* actor = GetActor (index);
	SetActor (index, TYPE_EXPLOSION, x,y, 32,32, ExplosionTasks);
	TLN_ConfigSprite (index, spritesets[SPRITESET_MAIN], 0);
	TLN_SetSpriteAnimation (index, index, sequence, 1);
	//TLN_SetSpriteBlendMode (index, BLEND_ADD);
	return actor;
}
/// Instantiates the actor
void ComponentGameActorProxy::CreateActor() 
{
   ComponentGameActor* actor = new ComponentGameActor(*this);

   // add component to the actor. When done now, the component's properties
   // are accessible in STAGE.
   actor->AddComponent(new TextLabelComponent());

   SetActor(*actor); 
}
示例#6
0
 CCloseCaptionItem(
     C_BaseFlex *actor,
     CSentence *sentence,
     CCloseCaptionPhrase *phrase,
     float curtime,
     int frame,
     double updatetime )
 {
     SetActor( actor );
     m_pPhrase = NULL;
     SetPhrase( phrase );
     SetSentence( sentence );
     SetSentenceTime( curtime );
     SetLastUpdateFrame( frame );
     SetLastUpdateTime( updatetime );
 }
示例#7
0
Window_BattleCommand::Window_BattleCommand(int x, int y, int width, int height) :
	Window_Base(x, y, width, height) {

	SetActor(0);

	disabled.resize(commands.size());
	index = -1;
	top_row = 0;
	cycle = 0;

	SetContents(Bitmap::Create(width - 16, height - 16));

	num_rows = contents->GetHeight() / 16;

	Refresh();
}
void PanGestureProcessor::EmitGestureSignal( Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates )
{
    DALI_ASSERT_DEBUG ( mCurrentPanEvent );

    mCurrentPanEmitters.clear();
    ResetActor();

    actor->ScreenToLocal( GetImplementation(mCurrentRenderTask), actorCoordinates.x, actorCoordinates.y, mCurrentPanEvent->currentPosition.x, mCurrentPanEvent->currentPosition.y );

    EmitPanSignal( actor, gestureDetectors, *mCurrentPanEvent, actorCoordinates, mCurrentPanEvent->state, mCurrentRenderTask );

    if ( actor->OnStage() )
    {
        mCurrentPanEmitters = gestureDetectors;
        SetActor( actor );
    }
}
 void TaskActorGameEventProxy::CreateActor()
 {
    SetActor(*new TaskActorGameEvent(*this));
 }
示例#10
0
void MineActorProxy::CreateActor()
{
   MineActor* pActor = new MineActor(*this);
   SetActor(*pActor);
}
示例#11
0
 void DistanceSensorActorProxy::CreateActor()
 {
    SetActor(*new DistanceSensorActor(*this));
 }
示例#12
0
void PanGestureProcessor::Process( const Integration::PanGestureEvent& panEvent )
{
    switch( panEvent.state )
    {
    case Gesture::Possible:
    {
        mCurrentPanEmitters.clear();
        ResetActor();

        HitTestAlgorithm::Results hitTestResults;
        if( HitTest( mStage, panEvent.currentPosition, hitTestResults ) )
        {
            SetActor( &GetImplementation( hitTestResults.actor ) );
            mPossiblePanPosition = panEvent.currentPosition;
        }

        break;
    }

    case Gesture::Started:
    {
        if ( GetCurrentGesturedActor() )
        {
            // The pan gesture should only be sent to the gesture detector which first received it so that
            // it can be told when the gesture ends as well.

            HitTestAlgorithm::Results hitTestResults;
            HitTest( mStage, mPossiblePanPosition, hitTestResults ); // Hit test original possible position...

            if ( hitTestResults.actor && ( GetCurrentGesturedActor() == &GetImplementation( hitTestResults.actor ) ) )
            {
                // Record the current render-task for Screen->Actor coordinate conversions
                mCurrentRenderTask = hitTestResults.renderTask;

                // Set mCurrentPanEvent to use inside overridden methods called in ProcessAndEmit()
                mCurrentPanEvent = &panEvent;
                ProcessAndEmit( hitTestResults );
                mCurrentPanEvent = NULL;
            }
            else
            {
                ResetActor();
                mCurrentPanEmitters.clear();
            }
        }
        break;
    }

    case Gesture::Continuing:
    case Gesture::Finished:
    case Gesture::Cancelled:
    {
        // Only send subsequent pan gesture signals if we processed the pan gesture when it started.
        // Check if actor is still touchable.

        Actor* currentGesturedActor = GetCurrentGesturedActor();
        if ( currentGesturedActor )
        {
            if ( currentGesturedActor->IsHittable() && !mCurrentPanEmitters.empty() && mCurrentRenderTask )
            {
                GestureDetectorContainer outsideTouchesRangeEmitters;

                // Removes emitters that no longer have the actor attached
                // Also remove emitters whose touches are outside the range of the current pan event and add them to outsideTouchesRangeEmitters
                GestureDetectorContainer::iterator endIter = std::remove_if( mCurrentPanEmitters.begin(), mCurrentPanEmitters.end(),
                        IsNotAttachedAndOutsideTouchesRangeFunctor(currentGesturedActor, panEvent.numberOfTouches, outsideTouchesRangeEmitters) );
                mCurrentPanEmitters.erase( endIter, mCurrentPanEmitters.end() );

                Vector2 actorCoords;

                if ( !outsideTouchesRangeEmitters.empty() || !mCurrentPanEmitters.empty() )
                {
                    currentGesturedActor->ScreenToLocal( GetImplementation( mCurrentRenderTask ), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y );

                    // EmitPanSignal checks whether we have a valid actor and whether the container we are passing in has emitters before it emits the pan.
                    EmitPanSignal( currentGesturedActor, outsideTouchesRangeEmitters, panEvent, actorCoords, Gesture::Finished, mCurrentRenderTask);
                    EmitPanSignal( currentGesturedActor, mCurrentPanEmitters, panEvent, actorCoords, panEvent.state, mCurrentRenderTask);
                }

                if ( mCurrentPanEmitters.empty() )
                {
                    // If we have no emitters attached then clear pan actor as well.
                    ResetActor();
                }

                // Clear current gesture detectors if pan gesture has ended or been cancelled.
                if ( ( panEvent.state == Gesture::Finished ) || ( panEvent.state == Gesture::Cancelled ) )
                {
                    mCurrentPanEmitters.clear();
                    ResetActor();
                }
            }
            else
            {
                mCurrentPanEmitters.clear();
                ResetActor();
            }
        }
        break;
    }

    case Gesture::Clear:
        DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Clear\n" );
        break;
    }
}
void CUIActorMenu::Construct()
{
	CUIXml								uiXml;
	uiXml.Load							(CONFIG_PATH, UI_PATH, "actor_menu.xml");

	CUIXmlInit							xml_init;

	xml_init.InitWindow					(uiXml, "main", 0, this);
	m_hint_wnd = UIHelper::CreateHint	(uiXml, "hint_wnd");

	m_LeftBackground					= new CUIStatic();
	m_LeftBackground->SetAutoDelete		(true);
	AttachChild							(m_LeftBackground);
	xml_init.InitStatic					(uiXml, "left_background", 0, m_LeftBackground);

	m_pUpgradeWnd						= new CUIInventoryUpgradeWnd(); 
	AttachChild							(m_pUpgradeWnd);
	m_pUpgradeWnd->SetAutoDelete		(true);
	m_pUpgradeWnd->Init					();

	m_ActorCharacterInfo = new CUICharacterInfo();
	m_ActorCharacterInfo->SetAutoDelete( true );
	AttachChild( m_ActorCharacterInfo );
	m_ActorCharacterInfo->InitCharacterInfo( &uiXml, "actor_ch_info" );

	m_PartnerCharacterInfo = new CUICharacterInfo();
	m_PartnerCharacterInfo->SetAutoDelete( true );
	AttachChild( m_PartnerCharacterInfo );
	m_PartnerCharacterInfo->InitCharacterInfo( &uiXml, "partner_ch_info" );
	
	m_RightDelimiter		= UIHelper::CreateStatic(uiXml, "right_delimiter", this);
	m_ActorTradeCaption		= UIHelper::CreateStatic(uiXml, "right_delimiter:trade_caption", m_RightDelimiter);
	m_ActorTradePrice		= UIHelper::CreateStatic(uiXml, "right_delimiter:trade_price", m_RightDelimiter);
	m_ActorTradeWeightMax	= UIHelper::CreateStatic(uiXml, "right_delimiter:trade_weight_max", m_RightDelimiter);
	m_ActorTradeCaption->AdjustWidthToText();
	
	m_LeftDelimiter			= UIHelper::CreateStatic(uiXml, "left_delimiter", this);
	m_PartnerTradeCaption	= UIHelper::CreateStatic(uiXml, "left_delimiter:trade_caption", m_LeftDelimiter);
	m_PartnerTradePrice		= UIHelper::CreateStatic(uiXml, "left_delimiter:trade_price", m_LeftDelimiter);
	m_PartnerTradeWeightMax	= UIHelper::CreateStatic(uiXml, "left_delimiter:trade_weight_max", m_LeftDelimiter);
	m_PartnerTradeCaption->AdjustWidthToText();

	m_ActorBottomInfo	= UIHelper::CreateStatic(uiXml, "actor_weight_caption", this);
	m_ActorWeight		= UIHelper::CreateStatic(uiXml, "actor_weight", this);
	m_ActorWeightMax	= UIHelper::CreateStatic(uiXml, "actor_weight_max", this);
	m_ActorBottomInfo->AdjustWidthToText();

	m_PartnerBottomInfo	= UIHelper::CreateStatic(uiXml, "partner_weight_caption", this);
	m_PartnerWeight		= UIHelper::CreateStatic(uiXml, "partner_weight", this);
	m_PartnerBottomInfo->AdjustWidthToText();
	m_PartnerWeight_end_x = m_PartnerWeight->GetWndPos().x;

	m_pInventoryBagList			= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_bag", this);
	m_pInventoryBeltList		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_belt", this);
	m_pInventoryOutfitList		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_outfit", this);
	m_pInventoryDetectorList	= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_detector", this);
	m_pInventoryPistolList		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_pistol", this);
	m_pInventoryAutomaticList	= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_automatic", this);
	m_pTradeActorBagList		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_actor_trade_bag", this);
	m_pTradeActorList			= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_actor_trade", this);
	m_pTradePartnerBagList		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_partner_bag", this);
	m_pTradePartnerList			= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_partner_trade", this);

#ifdef INV_KNIFE_SLOT
	m_pInventoryKnifeList		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_knife", this);
#endif

#ifdef INV_TORCH_SLOT
	m_pInventoryTorchList 		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_torch", this);
#endif

#ifdef INV_BINO_SLOT
	m_pInventoryBinoList 		= UIHelper::CreateDragDropListEx(uiXml, "dragdrop_bino", this);
#endif

#ifdef DRAG_DROP_TRASH
	m_pTrashList = UIHelper::CreateDragDropListEx(uiXml, "dragdrop_trash", this);
	m_pTrashList->m_f_item_drop = CUIDragDropListEx::DRAG_DROP_EVENT(this, &CUIActorMenu::OnItemDrop);
	m_pTrashList->m_f_drag_event = CUIDragDropListEx::DRAG_ITEM_EVENT(this, &CUIActorMenu::OnDragItemOnTrash);
#endif

#ifdef EXT_BELT
	e_af_count = uiXml.ReadAttribInt("dragdrop_belt", 0, "rows_num", 5); //+
	clamp(e_af_count, u32(5), u32(16));
	e_af_count_base = e_af_count - 5;// reserv for outfit
	m_belt_list_over.resize(e_af_count);
#endif //EXT_BELT

	m_belt_list_over[0] = UIHelper::CreateStatic(uiXml, "belt_list_over", this);
	Fvector2 pos;
	pos = m_belt_list_over[0]->GetWndPos();
	float dy = uiXml.ReadAttribFlt("belt_list_over", 0, "dy", 10.0f);
	for ( u8 i = 1; i < e_af_count; ++i )
	{
		pos.y += dy;
		m_belt_list_over[i] = UIHelper::CreateStatic(uiXml, "belt_list_over", this);
		m_belt_list_over[i]->SetWndPos( pos );
	}

	m_ActorMoney	= UIHelper::CreateStatic(uiXml, "actor_money_static", this);
	m_PartnerMoney	= UIHelper::CreateStatic(uiXml, "partner_money_static", this);
	
	m_trade_button		= UIHelper::Create3tButtonEx(uiXml, "trade_button", this);
	m_takeall_button	= UIHelper::Create3tButtonEx(uiXml, "takeall_button", this);
	m_exit_button		= UIHelper::Create3tButtonEx(uiXml, "exit_button", this);

	m_clock_value						= UIHelper::CreateStatic(uiXml, "clock_value", this);

	m_pDeadBodyBagList					= new CUIDragDropListEx(); 
	AttachChild							(m_pDeadBodyBagList);
	m_pDeadBodyBagList->SetAutoDelete	(true);
	xml_init.InitDragDropListEx			(uiXml, "dragdrop_deadbody_bag", 0, m_pDeadBodyBagList);

	m_ActorStateInfo					= new ui_actor_state_wnd();
	m_ActorStateInfo->init_from_xml		(uiXml, "actor_state_info");
	m_ActorStateInfo->SetAutoDelete		(true);
	AttachChild							(m_ActorStateInfo); 

	XML_NODE* stored_root				= uiXml.GetLocalRoot	();
	uiXml.SetLocalRoot					(uiXml.NavigateToNode	("action_sounds",0));
	::Sound->create						(sounds[eSndOpen],		uiXml.Read("snd_open",			0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eSndClose],		uiXml.Read("snd_close",			0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eItemToSlot],	uiXml.Read("snd_item_to_slot",	0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eItemToBelt],	uiXml.Read("snd_item_to_belt",	0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eItemToRuck],	uiXml.Read("snd_item_to_ruck",	0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eProperties],	uiXml.Read("snd_properties",	0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eDropItem],		uiXml.Read("snd_drop_item",		0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eAttachAddon],	uiXml.Read("snd_attach_addon",	0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eDetachAddon],	uiXml.Read("snd_detach_addon",	0,	NULL),st_Effect,sg_SourceType);
	::Sound->create						(sounds[eItemUse],		uiXml.Read("snd_item_use",		0,	NULL),st_Effect,sg_SourceType);
	uiXml.SetLocalRoot					(stored_root);

	m_ItemInfo							= new CUIItemInfo();
//-	m_ItemInfo->SetAutoDelete			(true);
//-	AttachChild							(m_ItemInfo);
	m_ItemInfo->InitItemInfo			("actor_menu_item.xml");

	m_upgrade_info						= NULL;
	if ( ai().get_alife() )
	{
		m_upgrade_info						= new UIInvUpgradeInfo();
		m_upgrade_info->SetAutoDelete		(true);
		AttachChild							(m_upgrade_info);
		m_upgrade_info->init_from_xml		("actor_menu_item.xml");
	}

	m_message_box_yes_no				= new CUIMessageBoxEx();	
	m_message_box_yes_no->InitMessageBox( "message_box_yes_no" );
	m_message_box_yes_no->SetAutoDelete	(true);
	m_message_box_yes_no->SetText		( "" );

	m_message_box_ok					= new CUIMessageBoxEx();	
	m_message_box_ok->InitMessageBox	( "message_box_ok" );
	m_message_box_ok->SetAutoDelete		(true);
	m_message_box_ok->SetText			( "" );

	m_UIPropertiesBox					= new CUIPropertiesBox();
	AttachChild							(m_UIPropertiesBox);
	m_UIPropertiesBox->InitPropertiesBox(Fvector2().set(0,0),Fvector2().set(300,300));
	m_UIPropertiesBox->Hide				();
	m_UIPropertiesBox->SetWindowName	( "property_box" );

	InitCallbacks						();

	BindDragDropListEvents				(m_pInventoryBeltList);		
	BindDragDropListEvents				(m_pInventoryPistolList);		
	BindDragDropListEvents				(m_pInventoryAutomaticList);	
	BindDragDropListEvents				(m_pInventoryOutfitList);	
	BindDragDropListEvents				(m_pInventoryDetectorList);	
	BindDragDropListEvents				(m_pInventoryBagList);
	BindDragDropListEvents				(m_pTradeActorBagList);
	BindDragDropListEvents				(m_pTradeActorList);
	BindDragDropListEvents				(m_pTradePartnerBagList);
	BindDragDropListEvents				(m_pTradePartnerList);
	BindDragDropListEvents				(m_pDeadBodyBagList);

#ifdef INV_KNIFE_SLOT
	BindDragDropListEvents				(m_pInventoryKnifeList);
#endif

#ifdef INV_TORCH_SLOT
	BindDragDropListEvents				(m_pInventoryTorchList);
#endif

#ifdef INV_BINO_SLOT
	BindDragDropListEvents				(m_pInventoryBinoList);
#endif

#ifdef DRAG_DROP_TRASH
	m_allowed_drops[iTrashSlot].push_back(iActorBag);
	m_allowed_drops[iTrashSlot].push_back(iActorSlot);
	m_allowed_drops[iTrashSlot].push_back(iActorBelt);
#endif 

	m_allowed_drops[iActorSlot].push_back(iActorBag);
	m_allowed_drops[iActorSlot].push_back(iActorTrade);
	m_allowed_drops[iActorSlot].push_back(iDeadBodyBag);

	m_allowed_drops[iActorBag].push_back(iActorSlot);
	m_allowed_drops[iActorBag].push_back(iActorBelt);
	m_allowed_drops[iActorBag].push_back(iActorTrade);
	m_allowed_drops[iActorBag].push_back(iDeadBodyBag);
	m_allowed_drops[iActorBag].push_back(iActorBag);
	
	m_allowed_drops[iActorBelt].push_back(iActorBag);
	m_allowed_drops[iActorBelt].push_back(iActorTrade);
	m_allowed_drops[iActorBelt].push_back(iDeadBodyBag);
	m_allowed_drops[iActorBelt].push_back(iActorBelt);

	m_allowed_drops[iActorTrade].push_back(iActorSlot);
	m_allowed_drops[iActorTrade].push_back(iActorBag);
	m_allowed_drops[iActorTrade].push_back(iActorBelt);
	m_allowed_drops[iActorTrade].push_back(iActorTrade);

	m_allowed_drops[iPartnerTradeBag].push_back(iPartnerTrade);
	m_allowed_drops[iPartnerTradeBag].push_back(iPartnerTradeBag);
	m_allowed_drops[iPartnerTrade].push_back(iPartnerTradeBag);
	m_allowed_drops[iPartnerTrade].push_back(iPartnerTrade);

	m_allowed_drops[iDeadBodyBag].push_back(iActorSlot);
	m_allowed_drops[iDeadBodyBag].push_back(iActorBag);
	m_allowed_drops[iDeadBodyBag].push_back(iActorBelt);
	m_allowed_drops[iDeadBodyBag].push_back(iDeadBodyBag);

	m_upgrade_selected					= NULL;
	SetCurrentItem						(NULL);
	SetActor							(NULL);
	SetPartner							(NULL);
	SetInvBox							(NULL);

	m_actor_trade						= NULL;
	m_partner_trade						= NULL;
	m_repair_mode						= false;

	DeInitInventoryMode					();
	DeInitTradeMode						();
	DeInitUpgradeMode					();
	DeInitDeadBodySearchMode			();
}
示例#14
0
void KillableTargetActorProxy::CreateActor()
{
   KillableTargetActor* actor = new KillableTargetActor(*this);
   SetActor(*actor);
}
示例#15
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CChoreoChannel::Init( void )
{
	m_szName[ 0 ] = 0;
	SetActor( NULL );
	m_bActive = true;
}