当前位置: 首页>>代码示例>>C++>>正文


C++ GStrings函数代码示例

本文整理汇总了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 "";
}
开发者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


注:本文中的GStrings函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。