Esempio n. 1
0
void cRokko::Editor_Activate(void)
{
    CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();

    // direction
    CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_rokko_direction"));
    Editor_Add(UTF8_("Direction"), UTF8_("Direction it moves into."), combobox, 100, 110);

    combobox->addItem(new CEGUI::ListboxTextItem("left"));
    combobox->addItem(new CEGUI::ListboxTextItem("right"));
    combobox->addItem(new CEGUI::ListboxTextItem("up"));
    combobox->addItem(new CEGUI::ListboxTextItem("down"));

    combobox->setText(Get_Direction_Name(m_start_direction));
    combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cRokko::Editor_Direction_Select, this));

    // speed
    CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_rokko_speed"));
    Editor_Add(UTF8_("Speed"), UTF8_("Speed when activated"), editbox, 120);

    editbox->setValidationString("[+]?[0-9]*\\.?[0-9]*");
    editbox->setText(float_to_string(m_speed, 6, 0));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRokko::Editor_Speed_Text_Changed, this));

    // init
    Editor_Init();
}
Esempio n. 2
0
void cFlyon::Editor_Activate(void)
{
    // get window manager
    CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();

    // direction
    CEGUI::Combobox* combobox = static_cast<CEGUI::Combobox*>(wmgr.createWindow("TaharezLook/Combobox", "editor_flyon_direction"));
    Editor_Add(UTF8_("Direction"), UTF8_("Direction it moves into."), combobox, 100, 110);

    combobox->addItem(new CEGUI::ListboxTextItem("up"));
    combobox->addItem(new CEGUI::ListboxTextItem("down"));
    combobox->addItem(new CEGUI::ListboxTextItem("left"));
    combobox->addItem(new CEGUI::ListboxTextItem("right"));

    combobox->setText(Get_Direction_Name(m_start_direction));
    combobox->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&cFlyon::Editor_Direction_Select, this));

    // image dir
    CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_flyon_image_dir"));
    Editor_Add(UTF8_("Image directory"), UTF8_("Directory containing the images"), editbox, 200);

    editbox->setText(path_to_utf8(m_img_dir).c_str());
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cFlyon::Editor_Image_Dir_Text_Changed, this));

    // max distance
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_flyon_max_distance"));
    Editor_Add(UTF8_("Distance"), _("Movable Distance into its direction"), editbox, 90);

    editbox->setValidationString("^[+]?\\d*$");
    editbox->setText(int_to_string(static_cast<int>(m_max_distance)));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cFlyon::Editor_Max_Distance_Text_Changed, this));

    // speed
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_flyon_speed"));
    Editor_Add(UTF8_("Speed"), UTF8_("Initial speed when jumping out"), editbox, 120);

    editbox->setValidationString("[+]?[0-9]*\\.?[0-9]*");
    editbox->setText(float_to_string(m_speed, 6, 0));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cFlyon::Editor_Speed_Text_Changed, this));

    // init
    Editor_Init();
}
Esempio n. 3
0
void cLayer_Line_Point_Start :: Editor_Activate( void )
{
	// get window manager
	CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();

	// origin
	CEGUI::Editbox *editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "layer_line_origin" ));
	Editor_Add( UTF8_("Waypoint origin"), UTF8_("Waypoint origin"), editbox, 100 );

	editbox->setValidationString( "^[+]?\\d*$" );
	editbox->setText( int_to_string( m_origin ) );
	editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cLayer_Line_Point_Start::Editor_Origin_Text_Changed, this ) );

	// init
	Editor_Init();
}
Esempio n. 4
0
void LoginEvent::OnPageLoad(GamePage *pPage)
{
    pPage->LoadPageWindow();
    
    CEGUI::Window *pLoginWindow = pPage->GetPageWindow();
	/////////////////////////////////////////////////
	// zhaohang  2010/6/4 
	// 添加选服的修改
	//首次打开显示选择登陆服务器界面
    FireUIEvent("SelectLS",EVENT_OPEN);
    //设置密码编辑框掩码
    CEGUI::Editbox *pPwdEdit = static_cast<CEGUI::Editbox*>(pLoginWindow->getChild("LoginPage/PassWord"));
    pPwdEdit->setTextMasked(true);
    pPwdEdit->subscribeEvent(CEGUI::Editbox::EventTextAccepted ,CEGUI::Event::Subscriber(&LoginEvent::HandleLogin, this));
	
    //设置相应事件处理函数
    CEGUI::PushButton *pEnterBtn = static_cast<CEGUI::PushButton*>(pLoginWindow->getChild("LoginPage/Enter"));
    pEnterBtn->setText(ToCEGUIString(AppFrame::GetText("Login_1")));
	//pEnterBtn->setText(ToCEGUIString("[ROLL Speed:1 Dir:Left Text:nihao]"));
    pEnterBtn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&LoginEvent::HandleLogin, this));

    CEGUI::PushButton *pExitBtn = static_cast<CEGUI::PushButton*>(pLoginWindow->getChild("LoginPage/Exit"));
    pExitBtn->setText(ToCEGUIString(AppFrame::GetText("Login_2")));
    pExitBtn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&LoginEvent::HandleExitBtn, this));

    CEGUI::PushButton *pRegistBtn = static_cast<CEGUI::PushButton*>(pLoginWindow->getChild("LoginPage/Register"));
    pRegistBtn->setText(ToCEGUIString(AppFrame::GetText("Login_3")));
    
    CEGUI::PushButton *pForgetPwdBtn = static_cast<CEGUI::PushButton*>(pLoginWindow->getChild("LoginPage/ForgetPwd"));
    pForgetPwdBtn->setText(ToCEGUIString(AppFrame::GetText("Login_4")));

	CEGUI::PushButton* serverInfo = static_cast<CEGUI::PushButton*>(pLoginWindow->getChild("Login/ServerInfo"));
    serverInfo->setText(ToCEGUIString(AppFrame::GetText("Login_5")));
	serverInfo->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(HandleEnterSelectLS));

}
Esempio n. 5
0
void cRandom_Sound::Editor_Activate(void)
{
    CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();

    // filename
    CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_filename"));
    Editor_Add(UTF8_("Filename"), UTF8_("Sound filename"), editbox, 200);

    editbox->setText(m_filename.c_str());
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Filename_Text_Changed, this));

    // continuous
    CEGUI::Checkbox* checkbox = static_cast<CEGUI::Checkbox*>(wmgr.createWindow("TaharezLook/Checkbox", "editor_sound_continuous"));
    Editor_Add(UTF8_("Continuous"), UTF8_("Check if the sound should be played continuously instead of randomly"), checkbox, 50);

    checkbox->setSelected(m_continuous);
    checkbox->subscribeEvent(CEGUI::Checkbox::EventCheckStateChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Continuous_Changed, this));

    // delay min
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_delay_min"));
    Editor_Add(UTF8_("Delay Minimum"), UTF8_("Minimal delay until played again"), editbox, 90);

    editbox->setValidationString("^[+]?\\d*$");
    editbox->setText(int_to_string(m_delay_min));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Delay_Min_Text_Changed, this));

    // delay max
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_delay_max"));
    Editor_Add(UTF8_("Maximum"), UTF8_("Maximal delay until played again"), editbox, 90, 28, 0);

    editbox->setValidationString("^[+]?\\d*$");
    editbox->setText(int_to_string(m_delay_max));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Delay_Max_Text_Changed, this));

    // volume min
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_min"));
    Editor_Add(UTF8_("Volume Minimum"), UTF8_("Minimal random volume for each play"), editbox, 90);

    editbox->setValidationString("^[+]?\\d*$");
    editbox->setText(int_to_string(static_cast<int>(m_volume_min)));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Min_Text_Changed, this));

    // volume max
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_max"));
    Editor_Add(UTF8_("Maximum"), UTF8_("Maximal random volume for each play"), editbox, 90, 28, 0);

    editbox->setValidationString("^[+]?\\d*$");
    editbox->setText(int_to_string(static_cast<int>(m_volume_max)));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Max_Text_Changed, this));

    // volume reduction begin
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_reduction_begin"));
    Editor_Add(UTF8_("Volume Reduction Begin"), UTF8_("Volume reduction begins gradually at this distance"), editbox, 90);

    editbox->setValidationString("^[+]?\\d*$");
    editbox->setText(int_to_string(static_cast<int>(m_volume_reduction_begin)));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Reduction_Begin_Text_Changed, this));

    // volume reduction end
    editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sound_volume_reduction_end"));
    Editor_Add(UTF8_("End"), UTF8_("Volume reduction ends at this distance. Sound is not played beyond this."), editbox, 90, 28, 0);

    editbox->setValidationString("^[+]?\\d*$");
    editbox->setText(int_to_string(static_cast<int>(m_volume_reduction_end)));
    editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cRandom_Sound::Editor_Volume_Reduction_End_Text_Changed, this));

    // init
    Editor_Init();
}
Esempio n. 6
0
void cStaticEnemy :: Editor_Activate( void )
{
	// get window manager
	CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();

	// image
	CEGUI::Editbox *editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_image" ));
	Editor_Add( UTF8_("Image"), UTF8_("Image filename"), editbox, 200 );

	editbox->setText( m_img_filename.c_str() );
	editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Image_Text_Changed, this ) );

	// rotation speed
	editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_rotation_speed" ));
	Editor_Add( UTF8_("Rotation Speed"), UTF8_("Rotation Speed"), editbox, 120 );

	editbox->setValidationString( "[-+]?[0-9]*\\.?[0-9]*" );
	editbox->setText( float_to_string( m_rotation_speed ) );
	editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Rotation_Speed_Text_Changed, this ) );

	// path
	editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_path_identifier" ));
	Editor_Add( UTF8_("Path Identifier"), UTF8_("Name of the Path to move along."), editbox, 120 );

	editbox->setText( m_path_state.m_path_identifier.c_str() );
	editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Path_Identifier_Text_Changed, this ) );

	// speed
	editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_speed" ));
	Editor_Add( UTF8_("Speed"), UTF8_("Maximum speed"), editbox, 120 );

	editbox->setValidationString( "[-+]?[0-9]*\\.?[0-9]*" );
	editbox->setText( float_to_string( m_speed ) );
	editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Speed_Text_Changed, this ) );

	// fire resistant
	CEGUI::Combobox *combobox = static_cast<CEGUI::Combobox *>(wmgr.createWindow( "TaharezLook/Combobox", "editor_static_enemy_fire_resistant" ));
	Editor_Add( UTF8_("Fire Resistant"), UTF8_("If it is resistant against fire"), combobox, 120, 80 );

	combobox->addItem( new CEGUI::ListboxTextItem( UTF8_("Enabled") ) );
	combobox->addItem( new CEGUI::ListboxTextItem( UTF8_("Disabled") ) );

	if( m_fire_resistant )
	{
		combobox->setText( UTF8_("Enabled") );
	}
	else
	{
		combobox->setText( UTF8_("Disabled") );
	}

	combobox->subscribeEvent( CEGUI::Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Fire_Resistant_Select, this ) );

	// ice resistance
	editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_static_enemy_ice_resistance" ));
	Editor_Add( UTF8_("Ice Resistance"), UTF8_("Resistance against Ice (0.0-1.0)"), editbox, 120 );

	editbox->setValidationString( "[+]?[0-9]*\\.?[0-9]*" );
	editbox->setText( float_to_string( m_ice_resistance ) );
	editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cStaticEnemy::Editor_Ice_Resistance_Text_Changed, this ) );
    
	// init
	Editor_Init();
}
Esempio n. 7
0
void SubscriberAHEvent(CEGUI::Window* pageWnd)
{
	pageWnd->subscribeEvent(EVENT_OPEN,CEGUI::Event::Subscriber(OnOpenedUpdate));//绑定打开界面刷新数据事件

	pageWnd->subscribeEvent("UpdatePickUpUI",CEGUI::Event::Subscriber(UpdatePickUPUIDate));//更新提取界面UI

	CEGUI::PushButton* btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/BtnBuyWeimian"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnBuyWeimianBtnClicked));//点击按钮购买位面

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/BtnSalWeimian"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnSaleWeimianBtnClicked));//点击按钮出售位面

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Pickup/BtnGold"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnPickUpGold));//提取金币

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Pickup/BtnWeimian"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnPickUpWeimian));//提取位面

	CEGUI::MultiColumnList* mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/SaleMCL"));
	mcl->subscribeEvent(CEGUI::MultiColumnList::EventSelectionChanged,CEGUI::Event::Subscriber(OnSaleMCLSelChanged));//位面可购买条目选中事件
	mcl->subscribeEvent("UpdateCanBuyMCL",CEGUI::Event::Subscriber(UpdateCanBuyMCLDate));//更新可购买出售列表
	mcl->subscribeEvent(CEGUI::Window::EventMouseDoubleClick,CEGUI::Event::Subscriber(OnBuyWeimianBtnClicked));//双击可购买Item,事件响应

	mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/BuySale/BuyMCL"));
	mcl->subscribeEvent(CEGUI::MultiColumnList::EventSelectionChanged,CEGUI::Event::Subscriber(OnBuyMCLSelChanged));//位面可出售条目选中事件
	mcl->subscribeEvent("UpdateBuyMCL",CEGUI::Event::Subscriber(UpdateCanSaleMCLDate));//更新可出售列表
	mcl->subscribeEvent(CEGUI::Window::EventMouseDoubleClick,CEGUI::Event::Subscriber(OnSaleWeimianBtnClicked));//双击可出售Item,事件响应

	mcl = WMCL(pageWnd->getChildRecursive("Auction/Tab/Query/MCL"));
	mcl->subscribeEvent(CEGUI::MultiColumnList::EventSelectionChanged,CEGUI::Event::Subscriber(OnPerMCLSelChanged));//个人挂单条目选中事件
	mcl->subscribeEvent("UpdatePerMCL",CEGUI::Event::Subscriber(UpdatePerMCLDate));//更新个人挂单列表

	CEGUI::Window* wnd = pageWnd->getChildRecursive("Auction/SaleWnd");
	wnd->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked,CEGUI::Event::Subscriber(OnSaleUIClosed));//出售界面关闭

	btn = WPushButton(wnd->getChildRecursive("Auction/SaleWnd/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnSaleSubmit));//提交出售请求

	wnd = pageWnd->getChildRecursive("Auction/BuyWnd");
	wnd->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked,CEGUI::Event::Subscriber(OnBuyUIClosed));//购买界面关闭

	btn = WPushButton(wnd->getChildRecursive("Auction/Buy/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnBuySubmit));//提交购买请求

	CEGUI::Editbox* edb = WEditBox(pageWnd->getChildRecursive("Auction/Buy/buyNum"));//
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateBuyUIDate));//购买界面UI更新

	edb = WEditBox(pageWnd->getChildRecursive("Auction/SaleWnd/saleNum"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateSaleUIDate));//出售界面UI更新

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnAgentSaleSubmit));//委托出售挂单提交

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/Submit"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnAgentBuySubmit));//委托求购挂单提交

	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditNum"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentSaleUIDate));//委托出售挂单UI更新
	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/sale/EditPrice"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentSaleUIDate));//委托出售挂单UI更新


	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditNum"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentBuyUIDate));//委托求购UI更新
	edb = WEditBox(pageWnd->getChildRecursive("Auction/Tab/Agent/Buy/EditPrice"));
	edb->subscribeEvent(CEGUI::Window::EventTextChanged,CEGUI::Event::Subscriber(UpdateAgentBuyUIDate));//委托求购UI更新

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Query/Cancel"));//个人委托撤销挂单
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnCancelAgentOrder));

	//
	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/Query/Refresh"));//发送请求更新个人挂单列表
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnRefreshPerMCL));

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/RefreshSale"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnRefreshSaleMCL));//发送请求更新出售委托挂单列表

	btn = WPushButton(pageWnd->getChildRecursive("Auction/Tab/BuySale/RefreshBuy"));
	btn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(OnRefreshBuyMCL));//发送请求更新求购委托挂单列表


}