add 'showlevelname' command to toggle on/off the levelname displayed on the screen. Default is on (to help people know what level they are on).
Also don't make 'showfps' or 'showlevelname' require user to enter "cheat" mode to use. 2.3: r10366 git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10369 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
799e10f17a
commit
c0d626d790
13
src/cheat.c
13
src/cheat.c
|
@ -70,6 +70,7 @@ static CHEAT_ENTRY cheatCodes[] =
|
|||
{"showfps", kf_ToggleFPS}, //displays your average FPS
|
||||
{"showsamples", kf_ToggleSamples}, //displays the # of Sound samples in Queue & List
|
||||
{"showorders", kf_ToggleOrders}, //displays unit order/action state.
|
||||
{"showlevelname", kf_ToggleLevelName}, // shows the current level name on screen
|
||||
{"logical", kf_ToggleLogical}, //logical game updates separated from graphics updates.
|
||||
{"pause", kf_TogglePauseMode}, // Pause the game.
|
||||
{"sync me", kf_ForceSync},
|
||||
|
@ -81,6 +82,18 @@ BOOL attemptCheatCode(const char* cheat_name)
|
|||
const CHEAT_ENTRY * curCheat;
|
||||
static const CHEAT_ENTRY * const EndCheat = &cheatCodes[ARRAY_SIZE(cheatCodes)];
|
||||
|
||||
// there is no reason to make people enter "cheat mode" to enter following commands
|
||||
if (!strcasecmp("showfps", cheat_name))
|
||||
{
|
||||
kf_ToggleFPS();
|
||||
return true;
|
||||
}
|
||||
else if (!strcasecmp("showlevelname", cheat_name))
|
||||
{
|
||||
kf_ToggleLevelName();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strcmp(cheat_name, "cheat on") == 0 || strcmp(cheat_name, "debug") == 0)
|
||||
{
|
||||
if (!getDebugMappingStatus())
|
||||
|
|
|
@ -220,6 +220,10 @@ bool showSAMPLES = false;
|
|||
* default OFF, turn ON via console command 'showorders'
|
||||
*/
|
||||
bool showORDERS = false;
|
||||
/** Show the current level name on the screen, toggle via the 'showlevelname'
|
||||
* console command
|
||||
*/
|
||||
bool showLevelName = true;
|
||||
/** When we have a connection issue, we will flash a message on screen
|
||||
* 0 = no issue, 1= player leaving nicely, 2= player got disconnected
|
||||
*/
|
||||
|
@ -600,7 +604,10 @@ void draw3DScene( void )
|
|||
if (getWidgetsStatus() && !gamePaused())
|
||||
{
|
||||
char buildInfo[255];
|
||||
iV_DrawText( getLevelName(), RET_X + 134, 420 + E_H );
|
||||
if (showLevelName)
|
||||
{
|
||||
iV_DrawText( getLevelName(), RET_X + 134, 420 + E_H );
|
||||
}
|
||||
getAsciiTime(buildInfo,gameTime);
|
||||
iV_DrawText( buildInfo, RET_X + 134, 434 + E_H );
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ typedef enum
|
|||
extern bool showFPS;
|
||||
extern bool showSAMPLES;
|
||||
extern bool showORDERS;
|
||||
extern bool showLevelName;
|
||||
|
||||
extern void setViewAngle(SDWORD angle);
|
||||
extern UDWORD getViewDistance(void);
|
||||
|
|
|
@ -519,7 +519,10 @@ void kf_ToggleOrders(void) // Displays orders & action of currently selected uni
|
|||
showORDERS = !showORDERS;
|
||||
CONPRINTF(ConsoleString, (ConsoleString, "Unit Order/Action displayed is %s", showORDERS ? "Enabled" : "Disabled"));
|
||||
}
|
||||
|
||||
void kf_ToggleLevelName(void) // toggles level name
|
||||
{
|
||||
showLevelName = !showLevelName;
|
||||
}
|
||||
/* Writes out the frame rate */
|
||||
void kf_FrameRate( void )
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ extern void kf_BuildInfo( void );
|
|||
extern void kf_ToggleFPS(void); //FPS counter NOT same as kf_Framerate! -Q
|
||||
extern void kf_ToggleSamples(void); // Displays # of sound samples in Queue/list.
|
||||
extern void kf_ToggleOrders(void); //displays unit's Order/action state.
|
||||
extern void kf_ToggleLevelName(void);
|
||||
extern void kf_FrameRate( void );
|
||||
extern void kf_ShowNumObjects( void );
|
||||
extern void kf_ToggleRadar( void );
|
||||
|
|
Loading…
Reference in New Issue