bool OnPlayerShopResetGoods(const CEGUI::EventArgs& e) { CEGUI::Window* wnd = WEArgs(e).window; if(!wnd) return false; CGoods* goods = static_cast<CGoods*>(wnd->getUserData()); if (!goods) return false; CPlayer *pPlayer = GetGame()->GetMainPlayer(); CMainPlayerHand* pHand = GetGame()->GetMainPlayerHand(); if (!pPlayer || !pHand) return false; int shopState = GetPlayerShop().GetCurShopState(); if (shopState==PlayerShop::SET_SHOP) { GetPlayerShop().ReMoveShopGoods(goods->GetIndex(),goods->GetExID()); wnd->setUserData(NULL); int index = GetPlayerShop().GetCurGoodsNum(); GetPlayerShop().OnOrderPageOpen(goods, index); FireUIEvent("PlayerShop","ClearGoodsInfo"); FireUIEvent("PlayerShop","UpdateMoneyInfo"); return true; } return false; }
bool OnShopCityContentSelChanged(const CEGUI::EventArgs& e) { CEGUI::TabControl* tbs = WTabControl(WEArgs(e).window); if(tbs) { CEGUI::Window* tbcontent = tbs->getTabContentsAtIndex(tbs->getSelectedTabIndex()); if(tbcontent) { tbcontent->addChildWindow(GetWindow(SHOPCITY_CHILD_PAGE_NAME));//把唯一ShopCityChild加到当前选中tbcontent上 //更新ItemSet的显示 FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE); //更新最近购买 FireUIEvent(SHOPCITY_LATESTBUY_NAME,SHOPCITY_PAGE_EVENT_UPDATE_LATESTBUY); //更新推荐 FireUIEvent(SHOPCITY_TWITTER_NAME,SHOPCITY_TWITTER_EVENT_NAME); //更新左搜索(导购)菜单 FireUIEvent(SHOPCITY_SEARCH_LEFTWND_NAME,SHOPCITY_SEARCHLEFT_EVENT_MENUUPDATE_NAME); //更新右搜索(筛选)菜单 FireUIEvent(SHOPCITY_SEARCH_RIGHTWND_NAME,SHOPCITY_SEARCHRIGHT_EVENT_MENUUPDATE_NAME); //设置更新源类型 ShopCityMsgMgr& msgMgr = GetInst(ShopCityMsgMgr); msgMgr.SetStateUpdateUIByType(0);//由选中的商城商店类型来更新 } } return true; }
bool OnPlayerShopPageOpen(const CEGUI::EventArgs& e) { CEGUI::Window* wnd = WEArgs(e).window; if(!wnd) return false; PlayerShop& playerShop = GetPlayerShop(); // 打开个人商店前关闭其他界面(卡片镶嵌、制作、TalkBox、NPC商店、交易、仓库、装备、魔化等) // 打开背包 playerShop.SetIsOpenShop(true); // 打开留言板界面 FireUIEvent("PlayerShopMessageBoard", "Opened"); // 更新操作界面按钮状态 FireUIEvent("PlayerShop", "UpdateOperBtn"); // 更新货币统计信息 FireUIEvent("PlayerShop", "UpdateMoneyInfo"); playerShop.UpdataPlayerShopGoodsList(); return true; }
void FactionOper::RecvUpdatePlayerFacInfoMsg(CMessage* pMsg) { // 玩家 GUID CGUID guidPlayer; pMsg->GetGUID( guidPlayer ); // 所在家族 GUID CGUID guidFaction; pMsg->GetGUID( guidFaction ); // 玩家家族称号 TCHAR szFacTitle[ MAX_MEMBER_NAME_SIZE ]; pMsg->GetStr( szFacTitle, MAX_MEMBER_NAME_SIZE ); // 遍历处理场景内所有的玩家 for( std::list<CBaseObject*>::iterator p = GetGame()->GetRegion()->GetObjectList()->begin(); p != GetGame()->GetRegion()->GetObjectList()->end(); p++ ) { if( (*p)->GetType() == TYPE_PLAYER ) { CPlayer* pPlayer = dynamic_cast<CPlayer*>(*p); // 处理更新的玩家 if( pPlayer->GetExID() == guidPlayer ) { pPlayer->SetFactionID( guidFaction ); pPlayer->SetFactionTitle( std::string( szFacTitle ) ); pPlayer->SetFactionName( std::string( m_pFactionManager->GetFaction( guidFaction )->GetName() ) ); } } } // 刷新界面 FireUIEvent("FactionPage","UpdateMem"); }
bool OnSaleWeimianBtnClicked(const CEGUI::EventArgs& e) { //点击出售按钮,打开出售界面 OpenSaleUI(); FireUIEvent("Auction/BuyWnd","CloseClicked");//关闭购买界面 return true; }
bool OnBuyWeimianBtnClicked(const CEGUI::EventArgs& e) { //点击购买按钮,打开购买界面 OpenBuyUI(); FireUIEvent("Auction/SaleWnd","CloseClicked");//关闭出售界面 return true; }
///////////////////////////////////////////////// // zhaohang 2010/7/21 // 消息接收部分 //////////////////////////////////////////////// void ShopCityMsgMgr::Receive_AfficheResponse(CMessage* pMsg) { long length = pMsg->GetLong(); char* str = new char[length]; pMsg->GetEx((void*)str,length); Affiche = str; SAFEDELETE(str); FireUIEvent(SHOPCITY_PAGE_NAME,SHOPCITY_PAGE_EVENT_AFFICHERESPONSE); }
bool HandleEnterSelectLS(const CEGUI::EventArgs& e) { FireUIEvent("SelectLS",EVENT_OPEN); ///////////////////////////////////////////////// // zhaohang 2010/7/21 // 商城页面UI显示测试,使得不用登录即可看界面 //FireUIEvent(SHOPCITY_PAGE_NAME,EVENT_OPEN); //////////////////////////////////////////////// return true; }
bool OnSearchRightccboxItemChange(const CEGUI::EventArgs& e) { // ShopCityMsgMgr& msgMgr = GetInst(ShopCityMsgMgr); //设为根据筛选数据更新显示项目 msgMgr.SetStateUpdateUIByType(1); //根据筛选数据更新Itemset的显示 FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE_BY_FILTER); return true; }
void FactionOper::RecvSetChairmanNotifyMsg(CMessage* pMsg) { TCHAR szPrompt[ 256 ]; // 老族长 名字 TCHAR nameOldMaster[ MAX_MEMBER_NAME_SIZE ]; pMsg->GetStr( nameOldMaster, MAX_MEMBER_NAME_SIZE ); // 新族长 名字 TCHAR nameNewMaster[ MAX_MEMBER_NAME_SIZE ]; pMsg->GetStr( nameNewMaster, MAX_MEMBER_NAME_SIZE ); // 如果我是老族长 if( ! lstrcmp( GetGame()->GetMainPlayer()->GetName(), nameOldMaster ) ) { // "您已经将族长职位转让给 %s!" wsprintf( szPrompt, AppFrame::GetText("FA_104") , nameNewMaster ); GetInst(MsgEventManager).PushEvent(Msg_Ok,szPrompt); // 修改官阶 m_pFactionManager->SetMyJob( 0 ); } // 如果我是新族长 else if( ! lstrcmp( GetGame()->GetMainPlayer()->GetName(), nameNewMaster ) ) { // "%s 任命您为 %s 的新族长!" wsprintf( szPrompt, AppFrame::GetText("FA_302") , nameOldMaster, m_pFactionManager->GetMyFaction()->GetName() ); GetInst(MsgEventManager).PushEvent(Msg_Ok,szPrompt); // 设置作为族长的相关数据 m_pFactionManager->SetMyJob( Exceptive_JobLvl ); } // 如果是我的会友 else if( m_pFactionManager->GetMyFaction() ) { // "%s 任命 %s 为 %s 的新族长!" wsprintf( szPrompt, AppFrame::GetText("FA_303") , nameOldMaster, m_pFactionManager->GetMyFaction()->GetName() ); GetInst(ChatListPage).AddChatWords(szPrompt,0xffffffff,0,0xff000000,"",CHAT_SYSTEM); } // 更新 Member 数据 if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( nameOldMaster ) ) { pMember->SetJob( 0 ); } if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( nameNewMaster ) ) { pMember->SetJob( Exceptive_JobLvl ); } // 刷新界面 FireUIEvent("FactionPage","UpdateMem"); }
void FactionOper::RecvQuitNotifyMsg(CMessage* pMsg) { // 退出族员的家族 GUID CGUID guidFaction; pMsg->GetGUID( guidFaction ); // 退出族员的 GUID CGUID guidMember; pMsg->GetGUID( guidMember ); // 退出的族员 名字 TCHAR nameMember[ MAX_MEMBER_NAME_SIZE ]; pMsg->GetStr( nameMember, MAX_MEMBER_NAME_SIZE ); // 自己家族的GUID CGUID guidMyFaction = GetGame()->GetMainPlayer()->GetFactionID(); // 遍历处理场景内所有的玩家 std::list<CBaseObject*>::iterator p = GetGame()->GetRegion()->GetObjectList()->begin(); for( ; p != GetGame()->GetRegion()->GetObjectList()->end(); p++ ) { if( (*p)->GetType() == TYPE_PLAYER ) { CPlayer* pPlayer = dynamic_cast<CPlayer*>(*p); // 将退出族员的家族信息清除 if( pPlayer->GetExID() == guidMember ) { // 清空自己的家族标志信息 pPlayer->SetFactionID( NULL_GUID ); pPlayer->SetUnionID( NULL_GUID ); pPlayer->SetFactionName( std::string() ); pPlayer->SetFactionTitle( std::string() ); break; } } } // 如果不是自己家族的,则返回 if( guidMyFaction != guidFaction ) return; // 处理自己 if( GetGame()->GetMainPlayer()->GetExID() == guidMember ) { FireUIEvent("FactionPage","Closed"); // "您已经退出家族!" //GetGame()->GetAudioList()->Play2DSound("SOUNDS\\interfaces\\i-31.wav"); // "您的家族申请已提交!请等待审批。。。" GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("FA_307")); //您已经退出帮会! } }
void MsgEventManager::ProcesEvent() { if( m_IsRuning ) return ; std::list<MsgEvent>::iterator it = m_MsgBoxList.begin(); if( it != m_MsgBoxList.end() ) { m_IsRuning = true; GetInst(CMsgBox).Set(*it); FireUIEvent("MessageBox",EVENT_OPEN); m_MsgBoxList.erase( it ); } }
bool OnShopCitySearch(const CEGUI::EventArgs& e) { //获取导购文本 CEGUI::Combobox* guide = WComboBox(GetWindow(SHOPCITY_SEARCH_LEFTWND_NAME)); if(guide && guide->getEditbox()->getText()=="") { return true;//文本为空直接返回 } ShopCityMsgMgr& msgMgr = GetInst(ShopCityMsgMgr); msgMgr.SetStateUpdateUIByType(2);//设为更新源为导购 //根据导购数据更新显示项目 FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE_BY_GUIDE); return true; }
//双击推荐列表,打开购买页面 bool OnShopCityTwitterMouseDoubleClicked(const CEGUI::EventArgs& e) { CEGUI::Listbox* twitterList = WListBox(WEArgs(e).window); CEGUI::ListboxItem* lbi = twitterList->getFirstSelectedItem(); if(lbi) { uint index = lbi->getID();//获取索引,索引关联物品索引 CEGUI::Window* buyPage = GetWindow(SHOPCITY_BUY_PAGE_NAME); buyPage->setID(index);//购买界面ID与物品索引关联 //打开购买界面 FireUIEvent(SHOPCITY_BUY_PAGE_NAME,EVENT_OPEN); } return true; }
void FactionOper::CreateFactionUi() { // "您尚未加入家族!" if( !m_pFactionManager->AmIJoinedFaction() ) { FireUIEvent("CreateFaction","Opened"); return ; } else { } }
void FactionOper::RecvSetChairmanMsg(CMessage* pMsg) { // 检测 成功失败 if( PLAYER_OPT_SUCCEED == pMsg->GetLong() ) { m_pFactionManager->SetMyJob( 0 ); FireUIEvent("FactionPage","UpdateMem"); } else { // 处理错误 m_pFactionManager->HandleErrorMsg( pMsg ); } }
void ShopCityMsgMgr::Receive_PageOpen(CMessage *pMsg) { if(GetGame()->GetMainPlayer() && GetGame()->GetGameControl()) { GetGame()->GetGameControl()->AutoAttactStop();//停止自动攻击 GetGame()->GetGameControl()->AutoMoveStop();//停止自动移动 GetGame()->GetGameControl()->StopMove();//停止移动 } BYTE bFlag = pMsg->GetByte();//服务器返回是否打开成功 if(bFlag == 1) { IsPageOpen = true; if(dt)//不为空,进行数据解码 dt->DecodeFromDataBlock(pMsg); //解码完成通知打开界面 FireUIEvent(SHOPCITY_PAGE_NAME,EVENT_OPEN); SetPageState(true); } else { FireUIEvent(SHOPCITY_PAGE_NAME,EVENT_OPEN); SetPageState(true); } }
void FactionOper::RecvMemberOnlineNotifyMsg(CMessage* pMsg) { // 族员GUID CGUID guidMember; pMsg->GetGUID( guidMember ); bool bIsOnline = pMsg->GetLong() != 0; // 保存设置 if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( guidMember ) ) { pMember->SetOnline( bIsOnline ); } FireUIEvent("FactionPage","UpdateMem"); }
bool OnHideShowPlayerShop(const CEGUI::EventArgs& e) { CEGUI::Window* wnd = WEArgs(e).window; if(!wnd) return false; int curShopState = GetPlayerShop().GetCurShopState(); if (curShopState==PlayerShop::SET_SHOP) { } else if (curShopState==PlayerShop::SHOPPING_SHOP) { // 确定要交易的物品 if (!GetPlayerShop().GetbSetTrue()) { if(!GetPlayerShop().IsTradeItemReady()) return false; GetPlayerShop().CalcTradeGolds(); FireUIEvent("PlayerShop", "UpdateMoneyInfo"); GetPlayerShop().SetbSetTrue(true); FireUIEvent("PlayerShop", "UpdateOperBtn"); //GetGame()->GetAudioList()->Play2DSound("SOUNDS\\interfaces\\i-03.wav"); } // 取消要交易的物品 else if (GetPlayerShop().GetbSetTrue()) { GetPlayerShop().CancelAllTrade(); FireUIEvent("PlayerShop", "UpdateMoneyInfo"); GetPlayerShop().SetbSetTrue(false); FireUIEvent("PlayerShop", "UpdateOperBtn"); //GetGame()->GetAudioList()->Play2DSound("SOUNDS\\interfaces\\i-03.wav"); } } return true; }
void FactionOper::RecvMemberLevelNotifyMsg(CMessage* pMsg) { // 被设置官阶的族员GUID CGUID guidMember; pMsg->GetGUID( guidMember ); long lLevel = pMsg->GetLong(); // 保存设置 if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( guidMember ) ) { pMember->SetLevel( lLevel ); } FireUIEvent("FactionPage","UpdateMem"); }
bool OnBeginStopPlayerShop(const CEGUI::EventArgs& e) { CEGUI::Window* wnd = WEArgs(e).window; if(!wnd) return false; CPlayer* pPlayer = GetGame()->GetMainPlayer(); if (!pPlayer) return false; int curShopState = GetPlayerShop().GetCurShopState(); // 开始摆摊 if (curShopState==PlayerShop::SET_SHOP) { /// 判断玩家周围5*5的范围内是否有别的玩家已经在开店了,如果有则不容许开店 if (pPlayer->CheckIsAnyBodyShopOpenedOnRange(2)) { GetChatListPage().AddChatWords(AppFrame::GetText("Shop_16") //已经有玩家在您周围开店,请您重新选择开店地址 , 0xffffffff, 0, 0xff000000,"", eNOTIFYPOS_CENTER); FireUIEvent("PlayerShop", "Closed"); return false; } // 发送摆摊消息 //GetGame()->GetAudioList()->Play2DSound("SOUNDS\\interfaces\\i-03.wav"); if (!pPlayer->IsRecruitingTeam()) { GetPlayerShop().SetbSetTrue(true); GetPlayerShop().SendOpenShopMes(); }else GetChatListPage().AddChatWords(AppFrame::GetText("Shop_12") //招募状态下不能开店 , 0xffffffff, 0, 0xff000000,"", eNOTIFYPOS_CENTER); } // 取消摆摊 else if (curShopState==PlayerShop::OPEN_SHOP) { GetPlayerShop().SendCloseShopMes(); } // 购买 else if (curShopState==PlayerShop::SHOPPING_SHOP) { // 发送交易消息 GetPlayerShop().SendBuyGoodsMes(); //GetGame()->GetAudioList()->Play2DSound("SOUNDS\\interfaces\\i-03.wav"); } return true; }
void FactionOper::RecvMemberMapNotifyeMsg(CMessage *pMsg) { // 被设置官阶的族员GUID CGUID guidMember; pMsg->GetGUID( guidMember ); // 地图 TCHAR szRegion[ MAX_MEMBER_NAME_SIZE ]; pMsg->GetStr( szRegion, MAX_MEMBER_NAME_SIZE ); // 保存设置 if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( guidMember ) ) { pMember->SetRegion( szRegion ); } FireUIEvent("FactionPage","UpdateMem"); }
void FactionOper::RecvMemberOccuNotifyMsg(CMessage* pMsg) { // 被设置官阶的族员GUID CGUID guidMember; pMsg->GetGUID( guidMember ); long lOccu = pMsg->GetLong(); // 保存设置 if( CFacMember* pMember = m_pFactionManager->GetMyConfrere( guidMember ) ) { pMember->SetOccupation( lOccu ); } // 刷新 FireUIEvent("FactionPage","UpdateMem"); }
void FactionOper::Switch() { CPlayer* player = GetGame()->GetMainPlayer(); if ( !player) return ; // "您尚未加入家族!" if( !m_pFactionManager->AmIJoinedFaction() ) { GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("FA_301")); //您尚未加入行会! return ; } m_IsOpen = !m_IsOpen; FireUIEvent("FactionPage",EVENT_SWITCH); if ( m_IsOpen ) { m_pFactionManager->SendBaseInfoRequestMsg(); } }
bool OnShopCityUpdate(const CEGUI::EventArgs& e) { //更新Itemset FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE); //更新推荐 FireUIEvent(SHOPCITY_TWITTER_NAME,SHOPCITY_TWITTER_EVENT_NAME); //更新最近购买 FireUIEvent(SHOPCITY_LATESTBUY_NAME,SHOPCITY_PAGE_EVENT_UPDATE_LATESTBUY); //更新右搜索(筛选)菜单 FireUIEvent(SHOPCITY_SEARCH_RIGHTWND_NAME,SHOPCITY_SEARCHRIGHT_EVENT_MENUUPDATE_NAME); //更新左搜索(导购)菜单 FireUIEvent(SHOPCITY_SEARCH_LEFTWND_NAME,SHOPCITY_SEARCHLEFT_EVENT_MENUUPDATE_NAME); //清空付费券的UI FireUIEvent(SHOPCITY_PAGE_NAME,SHOPCITY_PAGE_EVENT_CLEARMONEYEDBOXES); //然后更新付费券的UI FireUIEvent(SHOPCITY_PAGE_NAME,SHOPCITY_PAGE_EVENT_UPDATEMONEYEDBOXES); return true; }
void FactionOper::RecvDisbandNotifyMsg(CMessage* pMsg) { // 解散的家族 GUID CGUID guidFaction; pMsg->GetGUID( guidFaction ); // 处理自己 if( m_pFactionManager->AmIJoinedFaction( guidFaction ) ) { // 关闭界面 FireUIEvent("FactionPage","Closed"); // "您所在的家族已经解散!" const char* pStr =AppFrame::GetText("FA_309") ; GetInst(ChatListPage).AddChatWords(pStr,0xffffffff,0,0xff000000,"",CHAT_SYSTEM); } // 清除该家族的信息 m_pFactionManager->DelFaction( guidFaction ); }
void FactionOper::RecvDisbandMsg(CMessage* pMsg) { // 检测 成功失败 if( PLAYER_OPT_SUCCEED == pMsg->GetLong() ) { // 关闭界面 FireUIEvent("FactionPage","Closed"); // "您所在家族已经解散!" const char* pStr =AppFrame::GetText("FA_309") ; GetInst(ChatListPage).AddChatWords(pStr,0xffffffff,0,0xff000000,"",CHAT_SYSTEM); // 清除该家族的信息 m_pFactionManager->DelFaction( GetGame()->GetMainPlayer()->GetFactionID() ); } else { // 处理错误 m_pFactionManager->HandleErrorMsg( pMsg ); } }
void FactionOper::RecvJoindNotifyMsg(CMessage* pMsg) { // 族员结构 tagFacMemInfo stFacMemInfo; pMsg->GetEx( &stFacMemInfo, sizeof(stFacMemInfo) ); CGUID FactionGuid; pMsg->GetGUID( FactionGuid ); // 添加一个族员 CFacMember::SMemberInfo stMemberInfo; stMemberInfo.guidFac = FactionGuid; stMemberInfo.guidMember = stFacMemInfo.MemberGuid; stMemberInfo.strName = stFacMemInfo.szName; stMemberInfo.strTitle = stFacMemInfo.szTitle; stMemberInfo.lLevel = stFacMemInfo.lLvl; stMemberInfo.lJob = stFacMemInfo.lJobLvl; stMemberInfo.lOccupation = stFacMemInfo.lOccu; stMemberInfo.lContribute = stFacMemInfo.lContribute; stMemberInfo.bOnline = stFacMemInfo.bIsOnline != 0; stMemberInfo.strRegion = stFacMemInfo.szRegion; m_pFactionManager->AddMyConfrere( &stMemberInfo ); // 是否是自己 if( GetGame()->GetMainPlayer()->GetExID() == stFacMemInfo.MemberGuid ) { GetGame()->GetMainPlayer()->SetFactionID(FactionGuid); m_pFactionManager->SetMyJob( stFacMemInfo.lJobLvl ); // "您已经加入家族: %s" TCHAR szPrompt[ 1024 ]; wsprintf( szPrompt, AppFrame::GetText("FA_308"), GetGame()->GetMainPlayer()->GetFactionName().c_str() ); GetInst(MsgEventManager).PushEvent(Msg_Ok,szPrompt); } FireUIEvent("FactionPage","UpdateFacAppList"); }
void FactionOper::RecvCheckRequisitionMsgNotify(CMessage* pMsg) { // 家族GUID CGUID guidFaction; pMsg->GetGUID( guidFaction ); // true添加,false删除 long bAdd = pMsg->GetLong(); if( CFaction* pMyFaction = m_pFactionManager->GetMyFaction() ) { if( bAdd ) { //申请者结构 tagFacApplyPerson stFacApplyPerson; pMsg->GetEx( &stFacApplyPerson, sizeof(stFacApplyPerson) ); // 进行添加 CFacMember::SMemberInfo stMemberInfo; stMemberInfo.guidFac = GetGame()->GetMainPlayer()->GetFactionID(); stMemberInfo.guidMember = stFacApplyPerson.PlayerGuid; stMemberInfo.strName = stFacApplyPerson.szName; stMemberInfo.lLevel = stFacApplyPerson.lLvl; stMemberInfo.lOccupation = stFacApplyPerson.lOccu; pMyFaction->AddApply( &stMemberInfo ); } else { // 申请者GUID CGUID guidRequisition; pMsg->GetGUID( guidRequisition ); // 删除 pMyFaction->DelApply( guidRequisition ); } } FireUIEvent("FactionPage","UpdateFacAppList"); }
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)); }