diff --git a/src/cheat.c b/src/cheat.c index 25b164ad8..9ffa3d677 100644 --- a/src/cheat.c +++ b/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()) diff --git a/src/display3d.c b/src/display3d.c index 245701a67..5086cc369 100644 --- a/src/display3d.c +++ b/src/display3d.c @@ -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 ); } diff --git a/src/display3d.h b/src/display3d.h index 1430a2d6b..70391cf6d 100644 --- a/src/display3d.h +++ b/src/display3d.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); diff --git a/src/keybind.c b/src/keybind.c index 8e472d0ef..cdcab68cd 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -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 ) { diff --git a/src/keybind.h b/src/keybind.h index fbea434e3..9c5267b7d 100644 --- a/src/keybind.h +++ b/src/keybind.h @@ -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 );