本文整理汇总了C++中MenuItem::SetDisplayText方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuItem::SetDisplayText方法的具体用法?C++ MenuItem::SetDisplayText怎么用?C++ MenuItem::SetDisplayText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::SetDisplayText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopulateMenuPage
bool RestrictWeaponPage::PopulateMenuPage(player_t *player_ptr)
{
this->SetEscLink("%s", Translate(player_ptr, 530));
this->SetTitle("%s", Translate(player_ptr, 531));
// Setup weapon list
for( int i = 0; i < MAX_WEAPONS_USED; i++ )
{
if ( !gpManiWeaponMgr->weapons[i] ) continue;
if (gpManiWeaponMgr->weapons[i]->GetDisplayID() == 0) continue;
MenuItem *ptr = new RestrictWeaponItem();
if (!gpManiWeaponMgr->weapons[i]->IsRestricted())
{
ptr->SetDisplayText("%s", Translate(player_ptr, gpManiWeaponMgr->weapons[i]->GetDisplayID()));
}
else
{
ptr->SetDisplayText("* %s <%i>",
Translate(player_ptr, gpManiWeaponMgr->weapons[i]->GetDisplayID()),
gpManiWeaponMgr->weapons[i]->GetTeamLimit());
}
ptr->SetHiddenText("%s", Translate(player_ptr, gpManiWeaponMgr->weapons[i]->GetDisplayID()));
ptr->params.AddParam("index", i);
this->AddItem(ptr);
}
this->SortHidden();
return true;
}
示例2: PopulateMenuPage
bool ObservePlayerPage::PopulateMenuPage(player_t *player_ptr)
{
this->SetEscLink("%s", Translate(player_ptr, 3110));
this->SetTitle("%s", Translate(player_ptr, 3111));
MenuItem *ptr = NULL;
if (gpManiObserverTrack->observer_id[player_ptr->index - 1] != -1)
{
ptr = new ObservePlayerItem;
ptr->SetDisplayText("%s", Translate(player_ptr, 3114));
ptr->params.AddParamVar("user_id", "%i", -1);
ptr->SetHiddenText(" ");
this->AddItem(ptr);
}
for( int i = 1; i <= max_players; i++ )
{
player_t player;
player.index = i;
if (!FindPlayerByIndex(&player)) continue;
if (player.player_info->IsFakeClient())
{
continue;
}
ptr = new ObservePlayerItem;
if (gpManiObserverTrack->observer_id[player_ptr->index - 1] == player.index)
{
ptr->SetDisplayText("%s [%s] %i",
Translate(player_ptr, 3112),
player.name,
player.user_id);
}
else
{
ptr->SetDisplayText("[%s] %i",
player.name,
player.user_id);
}
ptr->SetHiddenText("%s", player.name);
ptr->params.AddParamVar("user_id", "%i", player.user_id);
this->AddItem(ptr);
}
this->SortHidden();
return true;
}
示例3: PopulateMenuPage
bool SetSkinPage::PopulateMenuPage(player_t *player_ptr)
{
this->SetEscLink("%s", Translate(player_ptr, 780));
this->SetTitle("%s", Translate(player_ptr, 781));
for( int i = 1; i <= max_players; i++ )
{
player_t player;
player.index = i;
if (!FindPlayerByIndex(&player)) continue;
if (player.is_dead) continue;
if (player_ptr->index != player.index &&
gpManiClient->HasAccess(player.index, IMMUNITY, IMMUNITY_SETSKIN))
{
continue;
}
MenuItem *ptr = new SetSkinItem();
ptr->SetDisplayText("[%s] %i", player.name, player.user_id);
ptr->SetHiddenText("%s", player.name);
ptr->params.AddParam("user_id", player.user_id);
this->AddItem(ptr);
}
this->SortHidden();
return true;
}
示例4: PopulateMenuPage
bool FavouritesPage::PopulateMenuPage(player_t *player_ptr)
{
this->SetEscLink("%s", Translate(player_ptr, 770));
this->SetTitle("%s", Translate(player_ptr, 771));
for (int i = 0; i < web_shortcut_list_size; i++)
{
MenuItem *ptr = new FavouritesItem;
ptr->params.AddParam("index", i);
ptr->SetDisplayText("%s", web_shortcut_list[i].shortcut);
this->AddItem(ptr);
}
return true;
}
示例5: PopulateMenuPage
bool PlaySoundPage::PopulateMenuPage(player_t *player_ptr)
{
this->SetEscLink("%s", Translate(player_ptr, 540));
this->SetTitle("%s", Translate(player_ptr, 541));
// Setup sound list
for( int i = 0; i < sound_list_size; i++ )
{
MenuItem *ptr = new PlaySoundItem();
ptr->SetDisplayText("%s", sound_list[i].alias);
ptr->params.AddParam("index", i);
this->AddItem(ptr);
}
return true;
}
示例6: PopulateMenuPage
bool TKPlayerPage::PopulateMenuPage(player_t *player_ptr)
{
bool is_bot;
char *name;
this->params.GetParam("is_bot", &is_bot);
this->params.GetParam("name", &name);
this->SetEscLink("%s", Translate(player_ptr, 620));
this->SetTitle("%s", Translate(player_ptr, 631,"%s", name));
// Some people don't want the forgive option
if (IsMenuOptionAllowed(MANI_TK_FORGIVE, is_bot))
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 632, AddParam("punish", MANI_TK_FORGIVE));
}
// Some people don't want the slay option
if (IsMenuOptionAllowed(MANI_TK_SLAY, is_bot))
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 633, AddParam("punish", MANI_TK_SLAY));
}
// Some people don't want the slap option
if (IsMenuOptionAllowed(MANI_TK_SLAP, is_bot) && gpManiGameType->IsSlapAllowed())
{
MenuItem *ptr = new TKPlayerItem;
ptr->SetDisplayText("%s", Translate(player_ptr, 634, "%i", mani_tk_slap_to_damage.GetInt()));
ptr->params.AddParam("punish", MANI_TK_SLAP);
this->AddItem(ptr);
}
// Some people don't want the beacon option
if (IsMenuOptionAllowed(MANI_TK_BEACON, is_bot) && gpManiGameType->GetAdvancedEffectsAllowed())
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 643, AddParam("punish", MANI_TK_BEACON));
}
// Some people don't want the time bomb option
if (IsMenuOptionAllowed(MANI_TK_TIME_BOMB, is_bot))
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 640, AddParam("punish", MANI_TK_TIME_BOMB));
}
// Some people don't want the fire bomb option
if (IsMenuOptionAllowed(MANI_TK_FIRE_BOMB, is_bot) && gpManiGameType->IsFireAllowed())
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 641, AddParam("punish", MANI_TK_FIRE_BOMB));
}
// Some people don't want the freeze bomb option
if (IsMenuOptionAllowed(MANI_TK_FREEZE_BOMB, is_bot))
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 642, AddParam("punish", MANI_TK_FREEZE_BOMB));
}
// Some people don't want the freeze option
if (IsMenuOptionAllowed(MANI_TK_FREEZE, is_bot))
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 636, AddParam("punish", MANI_TK_FREEZE));
}
// Some people don't want the burn option
if (IsMenuOptionAllowed(MANI_TK_BURN, is_bot) && gpManiGameType->IsFireAllowed())
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 639, AddParam("punish", MANI_TK_BURN));
}
// Some people don't want the cash option
if (IsMenuOptionAllowed(MANI_TK_CASH, is_bot) && gpManiGameType->CanUseProp(MANI_PROP_ACCOUNT))
{
MenuItem *ptr = new TKPlayerItem;
ptr->SetDisplayText("%s", Translate(player_ptr, 637, "%i", mani_tk_cash_percent.GetInt()));
ptr->params.AddParam("punish", MANI_TK_CASH);
this->AddItem(ptr);
}
// Some people don't want the drug option
if (IsMenuOptionAllowed(MANI_TK_DRUG, is_bot) && gpManiGameType->IsDrugAllowed())
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 638, AddParam("punish", MANI_TK_DRUG));
}
// Some people don't want the blind option
if (IsMenuOptionAllowed(MANI_TK_BLIND, is_bot))
{
MENUOPTION_CREATE_PARAM(TKPlayerItem, 635, AddParam("punish", MANI_TK_BLIND));
}
return true;
}