本文整理汇总了C++中GStrings函数的典型用法代码示例。如果您正苦于以下问题:C++ GStrings函数的具体用法?C++ GStrings怎么用?C++ GStrings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GStrings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 "";
}
示例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;
}
}
}
示例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);
}
示例4: GetIndent
int FOptionMenuItem::GetIndent()
{
if (mCentered)
{
return 0;
}
const char *label = mLabel;
if (*label == '$') label = GStrings(label+1);
return SmallFont->StringWidth(label);
}
示例5: M_ChooseSkill
void M_ChooseSkill(int choice)
{
if (choice == nightmare)
{
M_StartMessage(GStrings(NIGHTMARE),M_VerifyNightmare,true);
return;
}
M_StartGame(choice);
}
示例6: PrintMessage
static void PrintMessage (const char *str)
{
if (str != NULL)
{
if (str[0]=='$')
{
str = GStrings(str+1);
}
C_MidPrint (SmallFont, str);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
}
示例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;
}