vehicle cheats and debug cheat string display

This commit is contained in:
Xinerki 2020-05-21 17:28:03 +03:00
parent 6692f5b2aa
commit 1c00e3cf2c
4 changed files with 1047 additions and 988 deletions

File diff suppressed because it is too large Load diff

View file

@ -176,7 +176,7 @@ public:
static CKeyboardState OldKeyState; static CKeyboardState OldKeyState;
static CKeyboardState NewKeyState; static CKeyboardState NewKeyState;
static CKeyboardState TempKeyState; static CKeyboardState TempKeyState;
static char KeyBoardCheatString[20]; static char KeyBoardCheatString[30];
static CMouseControllerState OldMouseControllerState; static CMouseControllerState OldMouseControllerState;
static CMouseControllerState NewMouseControllerState; static CMouseControllerState NewMouseControllerState;
static CMouseControllerState PCTempMouseControllerState; static CMouseControllerState PCTempMouseControllerState;

View file

@ -689,11 +689,13 @@ DisplayGameDebugText()
{ {
static bool bDisplayPosn = false; static bool bDisplayPosn = false;
static bool bDisplayRate = false; static bool bDisplayRate = false;
static bool bDisplayCheatStr = false;
{ {
SETTWEAKPATH("GameDebugText"); SETTWEAKPATH("GameDebugText");
TWEAKBOOL(bDisplayPosn); TWEAKBOOL(bDisplayPosn);
TWEAKBOOL(bDisplayRate); TWEAKBOOL(bDisplayRate);
TWEAKBOOL(bDisplayCheatStr);
} }
@ -781,6 +783,26 @@ DisplayGameDebugText()
CFont::SetColor(CRGBA(255, 108, 0, 255)); CFont::SetColor(CRGBA(255, 108, 0, 255));
CFont::PrintString(40.0f, 40.0f, ustr); CFont::PrintString(40.0f, 40.0f, ustr);
} }
if (bDisplayCheatStr)
{
sprintf(str, "%s", CPad::KeyBoardCheatString);
AsciiToUnicode(str, ustr);
CFont::SetPropOff();
CFont::SetBackgroundOff();
CFont::SetScale(0.7f, 1.5f);
CFont::SetCentreOn();
CFont::SetBackGroundOnlyTextOff();
CFont::SetWrapx(640.0f);
CFont::SetFontStyle(FONT_HEADING);
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.5f)+2.f, SCREEN_SCALE_FROM_BOTTOM(20.0f)+2.f, ustr);
CFont::SetColor(CRGBA(255, 150, 225, 255));
CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.5f), SCREEN_SCALE_FROM_BOTTOM(20.0f), ustr);
}
} }
#endif #endif

View file

@ -69,7 +69,7 @@ mysrand(unsigned int seed)
#ifdef DEBUGMENU #ifdef DEBUGMENU
void WeaponCheat(); void WeaponCheat();
void HealthCheat(); void HealthCheat();
void TankCheat(); void VehicleCheat(bool something, int model);
void BlowUpCarsCheat(); void BlowUpCarsCheat();
void ChangePlayerCheat(); void ChangePlayerCheat();
void MayhemCheat(); void MayhemCheat();
@ -293,7 +293,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Health", HealthCheat); DebugMenuAddCmd("Cheats", "Health", HealthCheat);
DebugMenuAddCmd("Cheats", "Wanted level up", WantedLevelUpCheat); DebugMenuAddCmd("Cheats", "Wanted level up", WantedLevelUpCheat);
DebugMenuAddCmd("Cheats", "Wanted level down", WantedLevelDownCheat); DebugMenuAddCmd("Cheats", "Wanted level down", WantedLevelDownCheat);
DebugMenuAddCmd("Cheats", "Tank", TankCheat); DebugMenuAddCmd("Cheats", "Tank", []() { VehicleCheat(true, MI_TAXI); });
DebugMenuAddCmd("Cheats", "Blow up cars", BlowUpCarsCheat); DebugMenuAddCmd("Cheats", "Blow up cars", BlowUpCarsCheat);
DebugMenuAddCmd("Cheats", "Change player", ChangePlayerCheat); DebugMenuAddCmd("Cheats", "Change player", ChangePlayerCheat);
DebugMenuAddCmd("Cheats", "Mayhem", MayhemCheat); DebugMenuAddCmd("Cheats", "Mayhem", MayhemCheat);