本文整理汇总了C++中GStrings函数的典型用法代码示例。如果您正苦于以下问题:C++ GStrings函数的具体用法?C++ GStrings怎么用?C++ GStrings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GStrings函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GStrings
const char *cht_Morph (player_t *player, PClassPlayerPawn *morphclass, bool quickundo)
{
if (player->mo == NULL)
{
return "";
}
PClassPlayerPawn *oldclass = player->mo->GetClass();
// Set the standard morph style for the current game
int style = MORPH_UNDOBYTOMEOFPOWER;
if (gameinfo.gametype == GAME_Hexen) style |= MORPH_UNDOBYCHAOSDEVICE;
if (player->morphTics)
{
if (P_UndoPlayerMorph (player, player))
{
if (!quickundo && oldclass != morphclass && P_MorphPlayer (player, player, morphclass, 0, style))
{
return GStrings("TXT_STRANGER");
}
return GStrings("TXT_NOTSTRANGE");
}
}
else if (P_MorphPlayer (player, player, morphclass, 0, style))
{
return GStrings("TXT_STRANGE");
}
return "";
}
开发者ID:MajorCooke,项目名称:GZDoom,代码行数:29,代码来源:m_cheat.cpp
示例2: M_ReadSaveStrings
//
// M_ReadSaveStrings
// read the strings from the savegame files
//
void M_ReadSaveStrings(void)
{
FILE *handle;
int count;
int i;
for (i = 0; i < load_end; i++)
{
std::string name;
G_BuildSaveName (name, i);
handle = fopen (name.c_str(), "rb");
if (handle == NULL)
{
strcpy (&savegamestrings[i][0], GStrings(EMPTYSTRING));
LoadMenu[i].status = 0;
}
else
{
count = fread (&savegamestrings[i], SAVESTRINGSIZE, 1, handle);
fclose (handle);
LoadMenu[i].status = 1;
}
}
}
开发者ID:darkranger-red,项目名称:odamex-maemo5,代码行数:30,代码来源:m_menu.cpp
示例3: M_QuickSave
void M_QuickSave(void)
{
if (multiplayer)
{
S_Sound (CHAN_INTERFACE, "player/male/grunt1", 1, ATTN_NONE);
M_ClearMenus ();
return;
}
if (!usergame)
{
S_Sound (CHAN_INTERFACE, "player/male/grunt1", 1, ATTN_NONE);
M_ClearMenus ();
return;
}
if (gamestate != GS_LEVEL)
return;
if (quickSaveSlot < 0)
{
M_StartControlPanel();
M_ReadSaveStrings();
M_SetupNextMenu(&SaveDef);
quickSaveSlot = -2; // means to pick a slot now
return;
}
sprintf (tempstring, GStrings(QSPROMPT), savegamestrings[quickSaveSlot]);
M_StartMessage (tempstring, M_QuickSaveResponse, true);
}
开发者ID:darkranger-red,项目名称:odamex-maemo5,代码行数:30,代码来源:m_menu.cpp
示例4: GetIndent
int FOptionMenuItem::GetIndent()
{
if (mCentered)
{
return 0;
}
const char *label = mLabel;
if (*label == '$') label = GStrings(label+1);
return SmallFont->StringWidth(label);
}
开发者ID:BenJamesbabala,项目名称:ViZDoom,代码行数:10,代码来源:optionmenu.cpp
示例5: M_ChooseSkill
void M_ChooseSkill(int choice)
{
if (choice == nightmare)
{
M_StartMessage(GStrings(NIGHTMARE),M_VerifyNightmare,true);
return;
}
M_StartGame(choice);
}
开发者ID:darkranger-red,项目名称:odamex-maemo5,代码行数:10,代码来源:m_menu.cpp
示例6: PrintMessage
static void PrintMessage (const char *str)
{
if (str != NULL)
{
if (str[0]=='$')
{
str = GStrings(str+1);
}
C_MidPrint (SmallFont, str);
}
}
开发者ID:Accusedbold,项目名称:zdoom,代码行数:11,代码来源:a_keys.cpp
示例7: PrintPickupMessage
static void PrintPickupMessage (const char *str)
{
if (str != NULL)
{
if (str[0]=='$')
{
str=GStrings(str+1);
}
if (str[0] != 0) Printf (PRINT_LOW, "%s\n", str);
}
}
开发者ID:Accusedbold,项目名称:zdoom,代码行数:11,代码来源:a_pickups.cpp
示例8: M_EndGame
void M_EndGame(int choice)
{
choice = 0;
if (!usergame)
{
S_Sound (CHAN_INTERFACE, "player/male/grunt1", 1, ATTN_NONE);
return;
}
M_StartMessage(GStrings(multiplayer ? NETEND : ENDGAME), M_EndGameResponse, true);
}
开发者ID:darkranger-red,项目名称:odamex-maemo5,代码行数:11,代码来源:m_menu.cpp
示例9: C_MidPrint
bool AScanner::Use (bool pickup)
{
if (!(level.flags2 & LEVEL2_ALLMAP))
{
if (Owner->CheckLocalView (consoleplayer))
{
C_MidPrint(SmallFont, GStrings("TXT_NEEDMAP"));
}
return false;
}
return Super::Use (pickup);
}
开发者ID:kevans91,项目名称:zdoom,代码行数:12,代码来源:a_strifeitems.cpp
示例10: P_UpdateSpecials
void P_UpdateSpecials ()
{
// LEVEL TIMER
if (deathmatch && timelimit)
{
if (level.maptime >= (int)(timelimit * TICRATE * 60))
{
Printf ("%s\n", GStrings("TXT_TIMELIMIT"));
G_ExitLevel(0, false);
}
}
}
开发者ID:Blue-Shadow,项目名称:zdoom,代码行数:12,代码来源:p_spec.cpp
示例11: M_Episode
void M_Episode (int choice)
{
if ((gameinfo.flags & GI_SHAREWARE) && choice)
{
M_StartMessage(GStrings(SWSTRING),NULL,false);
//M_SetupNextMenu(&ReadDef1);
M_ClearMenus ();
return;
}
epi = choice;
M_SetupNextMenu(&NewDef);
}
开发者ID:darkranger-red,项目名称:odamex-maemo5,代码行数:13,代码来源:m_menu.cpp
示例12: drawLabel
void FOptionMenuItem::drawLabel(int indent, int y, EColorRange color, bool grayed)
{
const char *label = mLabel;
if (*label == '$') label = GStrings(label+1);
int overlay = grayed? MAKEARGB(96,48,0,0) : 0;
int x;
int w = SmallFont->StringWidth(label) * CleanXfac_1;
if (!mCentered) x = indent - w;
else x = (screen->GetWidth() - w) / 2;
screen->DrawText (SmallFont, color, x, y, label, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay, TAG_DONE);
}
开发者ID:sieg-lu,项目名称:columbine-mod-doom,代码行数:13,代码来源:optionmenu.cpp
示例13: mysnprintf
const char *ACoin::PickupMessage ()
{
if (Amount == 1)
{
return Super::PickupMessage();
}
else
{
static char msg[64];
mysnprintf (msg, countof(msg), GStrings("TXT_XGOLD"), Amount);
return msg;
}
}
开发者ID:BenJamesbabala,项目名称:ViZDoom,代码行数:14,代码来源:a_coin.cpp
示例14: Drawer
void DIntermissionScreenCast::Drawer ()
{
spriteframe_t* sprframe;
FTexture* pic;
Super::Drawer();
const char *name = mName;
if (name != NULL)
{
if (*name == '$') name = GStrings(name+1);
screen->DrawText (SmallFont, CR_UNTRANSLATED,
(SCREENWIDTH - SmallFont->StringWidth (name) * CleanXfac)/2,
(SCREENHEIGHT * 180) / 200,
name,
DTA_CleanNoMove, true, TAG_DONE);
}
// draw the current frame in the middle of the screen
if (caststate != NULL)
{
int castsprite = caststate->sprite;
if (!(mDefaults->flags4 & MF4_NOSKIN) &&
mDefaults->SpawnState != NULL && caststate->sprite == mDefaults->SpawnState->sprite &&
mClass->IsDescendantOf(RUNTIME_CLASS(APlayerPawn)) &&
skins != NULL)
{
// Only use the skin sprite if this class has not been removed from the
// PlayerClasses list.
for (unsigned i = 0; i < PlayerClasses.Size(); ++i)
{
if (PlayerClasses[i].Type == mClass)
{
castsprite = skins[players[consoleplayer].userinfo.GetSkin()].sprite;
}
}
}
sprframe = &SpriteFrames[sprites[castsprite].spriteframes + caststate->GetFrame()];
pic = TexMan(sprframe->Texture[0]);
screen->DrawTexture (pic, 160, 170,
DTA_320x200, true,
DTA_FlipX, sprframe->Flip & 1,
DTA_Translation, casttranslation,
TAG_DONE);
}
}
开发者ID:ChillyDoom,项目名称:zdoom,代码行数:49,代码来源:intermission.cpp
示例15: G_SkillName
const char * G_SkillName()
{
const char *name = AllSkills[gameskill].MenuName;
player_t *player = &players[consoleplayer];
const char *playerclass = player->mo->GetClass()->Meta.GetMetaString(APMETA_DisplayName);
if (playerclass != NULL)
{
FString * pmnm = AllSkills[gameskill].MenuNamesForPlayerClass.CheckKey(playerclass);
if (pmnm != NULL) name = *pmnm;
}
if (*name == '$') name = GStrings(name+1);
return name;
}
开发者ID:BenJamesbabala,项目名称:ViZDoom,代码行数:16,代码来源:g_skill.cpp
示例16: sprintf
END_DEFAULTS
const char *ACoin::PickupMessage ()
{
if (Amount == 1)
{
return Super::PickupMessage();
}
else
{
static char msg[64];
sprintf (msg, GStrings("TXT_XGOLD"), Amount);
return msg;
}
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:16,代码来源:a_coin.cpp
示例17: Init
void DIntermissionScreenText::Init(FIntermissionAction *desc, bool first)
{
Super::Init(desc, first);
mText = static_cast<FIntermissionActionTextscreen*>(desc)->mText;
if (mText[0] == '$') mText = GStrings(&mText[1]);
mTextSpeed = static_cast<FIntermissionActionTextscreen*>(desc)->mTextSpeed;
mTextX = static_cast<FIntermissionActionTextscreen*>(desc)->mTextX;
if (mTextX < 0) mTextX =gameinfo.TextScreenX;
mTextY = static_cast<FIntermissionActionTextscreen*>(desc)->mTextY;
if (mTextY < 0) mTextY =gameinfo.TextScreenY;
mTextLen = (int)strlen(mText);
mTextDelay = static_cast<FIntermissionActionTextscreen*>(desc)->mTextDelay;
mTextColor = static_cast<FIntermissionActionTextscreen*>(desc)->mTextColor;
// For text screens, the duration only counts when the text is complete.
if (mDuration > 0) mDuration += mTextDelay + mTextSpeed * mTextLen;
}
开发者ID:ChillyDoom,项目名称:zdoom,代码行数:16,代码来源:intermission.cpp
示例18: S_Sound
bool APuzzleItem::Use (bool pickup)
{
if (P_UsePuzzleItem (Owner, PuzzleItemNumber))
{
return true;
}
// [RH] Always play the sound if the use fails.
S_Sound (Owner, CHAN_VOICE, "*puzzfail", 1, ATTN_IDLE);
if (Owner != NULL && Owner->CheckLocalView (consoleplayer))
{
const char *message = GetClass()->Meta.GetMetaString (AIMETA_PuzzFailMessage);
if (message != NULL && *message=='$') message = GStrings[message + 1];
if (message == NULL) message = GStrings("TXT_USEPUZZLEFAILED");
C_MidPrintBold (SmallFont, message);
}
return false;
}
开发者ID:AkumaKing,项目名称:Xeu,代码行数:17,代码来源:a_puzzleitems.cpp
示例19: M_QuickLoad
void M_QuickLoad(void)
{
/*if (netgame)
{
M_StartMessage(QLOADNET,NULL,false);
return;
}*/
if (quickSaveSlot < 0)
{
M_StartControlPanel();
M_LoadGame (0);
return;
}
sprintf(tempstring,GStrings(QLPROMPT),savegamestrings[quickSaveSlot]);
M_StartMessage(tempstring,M_QuickLoadResponse,true);
}
开发者ID:darkranger-red,项目名称:odamex-maemo5,代码行数:17,代码来源:m_menu.cpp
示例20: S_Sound
bool APuzzleItem::Use (bool pickup)
{
if (P_UsePuzzleItem (Owner, PuzzleItemNumber))
{
return true;
}
// [RH] Always play the sound if the use fails.
S_Sound (Owner, CHAN_VOICE, "*puzzfail", 1, ATTN_IDLE);
if (Owner != NULL && Owner->CheckLocalView (consoleplayer))
{
FString message = GetClass()->PuzzFailMessage;
if (message.IsNotEmpty() && message[0] == '$') message = GStrings[&message[1]];
if (message.IsEmpty()) message = GStrings("TXT_USEPUZZLEFAILED");
C_MidPrintBold (SmallFont, message);
}
return false;
}
开发者ID:Jayman2000,项目名称:zdoom-pull,代码行数:17,代码来源:a_puzzleitems.cpp
注:本文中的GStrings函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论