本文整理汇总了C++中UIManager::getUILayout方法的典型用法代码示例。如果您正苦于以下问题:C++ UIManager::getUILayout方法的具体用法?C++ UIManager::getUILayout怎么用?C++ UIManager::getUILayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIManager
的用法示例。
在下文中一共展示了UIManager::getUILayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refreshPvAILayer
void PvAIManager::refreshPvAILayer()
{
UIManager *manager = UIManager::sharedManager();
pvaiLayout = manager->getUILayout("PvAILayout");
if (pvaiLayout)
{
//玩家昵称
UILabel *heroNameLabel = pvaiLayout->FindChildObjectByName<UILabel>("pvaiMcName");
if (heroNameLabel)
{
string heroName = UserData::getUserName();
heroNameLabel->setString(heroName.c_str());
}
//玩家排名
UILabel *heroRankLabel = pvaiLayout->FindChildObjectByName<UILabel>("pvaiMcRank");
if (heroRankLabel)
{
stringstream heroRankStream;
heroRankStream << heroRank;
string heroRankStr = heroRankStream.str();
string heroRankText = Localizatioin::getLocalization("M_PVAI_RANK");
heroRankText += heroRankStr;
heroRankLabel->setString(heroRankText.c_str());
}
//玩家声望
UILabel *heroReputationLabel = pvaiLayout->FindChildObjectByName<UILabel>("pvaiMcReputation");
if (heroReputationLabel)
{
int heroReputation = UserData::GetUserInfo().m_reputation;
stringstream heroReputationStream;
heroReputationStream << heroReputation;
string heroReputationStr = heroReputationStream.str();
string heroReputationText = Localizatioin::getLocalization("M_PVAI_REPUTATION");
heroReputationText += heroReputationStr;
heroReputationLabel->setString(heroReputationText.c_str());
}
////剩余挑战次数
//UILabel *lastTimeLabel = pvaiLayout->FindChildObjectByName<UILabel>("pvaiTodayLastTime");
//if (lastTimeLabel)
//{
// stringstream herolastTimeStream;
// herolastTimeStream << basicInfo.remainCount;
// string herolastTimeStr = herolastTimeStream.str();
// lastTimeLabel->setString(herolastTimeStr.c_str());
//}
////奖励金币数
//UILabel *rewardCoinLabel = pvaiLayout->FindChildObjectByName<UILabel>("pvaiRewardCoin");
//if (rewardCoinLabel)
//{
// stringstream herolastTimeStream;
// herolastTimeStream << basicInfo.rewardCoin;
// string herolastTimeStr = herolastTimeStream.str();
// rewardCoinLabel->setString(herolastTimeStr.c_str());
//}
////奖励声望
//UILabel *rewardReputationLabel = pvaiLayout->FindChildObjectByName<UILabel>("pvaiRewardReputation");
//if (rewardReputationLabel)
//{
// stringstream herolastTimeStream;
// herolastTimeStream << basicInfo.rewardReputation;
// string herolastTimeStr = herolastTimeStream.str();
// rewardReputationLabel->setString(herolastTimeStr.c_str());
//}
////奖励领取时间
//TimeManager::Get()->renewTimer(TIMER_PVAI_REWARD, TimeManager::Get()->getCurServerTime() + basicInfo.rewardGetTime);
////冷却时间
//TimeManager::Get()->renewTimer(TIMER_PVAI_COOLDOWN, TimeManager::Get()->getCurServerTime() + basicInfo.coolDownTime);
//挑战玩家列表
int playerCount = aiPlayerVec.size();
int minPlayerCount = min(playerCount, 5);
for (int i = minPlayerCount; i < 5; i++)
{
stringstream iconOtherStream;
iconOtherStream << "iconOther" << i+1;
string iconOtherStr = iconOtherStream.str();
UIPicture *iconOtherPic= pvaiLayout->FindChildObjectByName<UIPicture>(iconOtherStr);
iconOtherPic->setVisible(false);
iconOtherStream.str("");
iconOtherStream << "gridOther" << i+1;
iconOtherStr = iconOtherStream.str();
iconOtherPic= pvaiLayout->FindChildObjectByName<UIPicture>(iconOtherStr);
iconOtherPic->setVisible(false);
iconOtherStream.str("");
iconOtherStream << "pvaiOtherPlayerName" << i+1;
iconOtherStr = iconOtherStream.str();
UILabel * iconOtherLabel= pvaiLayout->FindChildObjectByName<UILabel>(iconOtherStr);
//.........这里部分代码省略.........