本文整理汇总了C++中cegui::Window::enable方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::enable方法的具体用法?C++ Window::enable怎么用?C++ Window::enable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::enable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPlayerShopOperBtnUpdate
// 更新界面操作按钮状态
bool OnPlayerShopOperBtnUpdate(const CEGUI::EventArgs& e)
{
CEGUI::Window* mainPage = WEArgs(e).window;
if(!mainPage) return false;
CEGUI::Window* messageBoardBtn = mainPage->getChildRecursive("PlayerShop/backgrond/Messageboard");
CEGUI::Window* HideShowBtn = mainPage->getChildRecursive("PlayerShop/backgrond/HideShowBtn");
CEGUI::Window* beginStopBtn = mainPage->getChildRecursive("PlayerShop/backgrond/BeginStopBtn");
CEGUI::Window* closeBtn = mainPage->getChildRecursive("PlayerShop/backgrond/CloseBtn");
if (!messageBoardBtn || !HideShowBtn || !beginStopBtn || !closeBtn) return false;
PlayerShop& playerShop = GetPlayerShop();
int shopState = playerShop.GetCurShopState();
bool shopSetSure = playerShop.GetbSetTrue();
if(shopState < 0 || shopState >= PlayerShop::SHOP_STATE)
return false;
vector<PlayerShop::tagGoodsItem>& myShopGoods = playerShop.GetMyShopGoods();
// 设置商店
if(shopState == PlayerShop::SET_SHOP)
{
if (!myShopGoods.empty())
{
// 如果商店中有物品就把开始摆摊显示出来
beginStopBtn->setVisible(true);
beginStopBtn->enable();
beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("开始贩卖")));
}else
{
// 如果商店中有物品就让开始摆摊不显示出来
beginStopBtn->setVisible(false);
}
HideShowBtn->setVisible(false);
}
// 打开商店
else if(shopState == PlayerShop::OPEN_SHOP)
{
// 停止摆摊 & 隐藏商店显示出来
beginStopBtn->setVisible(true);
beginStopBtn->enable();
beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("停止贩卖")));
HideShowBtn->setVisible(true);
HideShowBtn->enable();
HideShowBtn->setText(ToCEGUIString(AppFrame::GetText("隐藏商店")));
}
// 购买状态
else if(shopState == PlayerShop::SHOPPING_SHOP)
{
if (shopSetSure)
{
// 重设 & 购买显示出来
beginStopBtn->setVisible(true);
beginStopBtn->enable();
beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("购买")));
HideShowBtn->setVisible(true);
HideShowBtn->enable();
HideShowBtn->setText(ToCEGUIString(AppFrame::GetText("重设")));
}
else
{
// 确定 & 购买显示出来
beginStopBtn->setVisible(true);
beginStopBtn->disable();
beginStopBtn->setText(ToCEGUIString(AppFrame::GetText("购买")));
HideShowBtn->setVisible(true);
HideShowBtn->enable();
HideShowBtn->setText(ToCEGUIString(AppFrame::GetText("确定")));
}
}
return true;
}