diff --git a/Source/debug.cpp b/Source/debug.cpp index b439b16db..a2311842f 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -34,6 +34,7 @@ bool DebugGodMode = false; bool DebugVision = false; bool DebugGrid = false; std::unordered_map DebugCoordsMap; +bool DebugScrollViewEnabled = false; namespace { @@ -621,6 +622,15 @@ std::string DebugCmdShowTileData(const string_view parameter) return "Special powers activated."; } +std::string DebugCmdScrollView(const string_view parameter) +{ + DebugScrollViewEnabled = !DebugScrollViewEnabled; + if (DebugScrollViewEnabled) + return "You can see as far as an eagle."; + InitMultiView(); + return "If you want to see the world, you need to explore it yourself."; +} + std::vector DebugCmdList = { { "help", "Prints help overview or help for a specific command.", "({command})", &DebugCmdHelp }, { "give gold", "Fills the inventory with gold.", "", &DebugCmdGiveGoldCheat }, @@ -646,6 +656,7 @@ std::vector DebugCmdList = { { "seedinfo", "Show seed infos for current level.", "", &DebugCmdLevelSeed }, { "spawn", "Spawns monster {name}.", "({count}) {name}", &DebugCmdSpawnMonster }, { "tiledata", "Toggles showing tile data {name} (leave name empty to see a list).", "{name}", &DebugCmdShowTileData }, + { "scrollview", "Toggles scroll view feature (with shift+mouse).", "", &DebugCmdScrollView }, }; } // namespace diff --git a/Source/debug.h b/Source/debug.h index 73a8d3b0b..113d53ba8 100644 --- a/Source/debug.h +++ b/Source/debug.h @@ -21,6 +21,7 @@ extern bool DebugGodMode; extern bool DebugVision; extern bool DebugGrid; extern std::unordered_map DebugCoordsMap; +extern bool DebugScrollViewEnabled; void FreeDebugGFX(); void LoadDebugGFX(); diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 85955764c..6ad113209 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -101,7 +101,6 @@ std::array quickSpellActionIndexes; bool gbForceWindowed = false; #ifdef _DEBUG -bool debug_mode_key_inverted_v = false; bool debug_mode_key_i = false; std::vector DebugCmdsFromCommandLine; #endif @@ -584,13 +583,11 @@ void PressChar(char vkey) return; case 'T': case 't': - if (debug_mode_key_inverted_v) { - auto &myPlayer = Players[MyPlayerId]; - sprintf(tempstr, "PX = %i PY = %i", myPlayer.position.tile.x, myPlayer.position.tile.y); - NetSendCmdString(1 << MyPlayerId, tempstr); - sprintf(tempstr, "CX = %i CY = %i DP = %i", cursPosition.x, cursPosition.y, dungeon[cursPosition.x][cursPosition.y]); - NetSendCmdString(1 << MyPlayerId, tempstr); - } + auto &myPlayer = Players[MyPlayerId]; + sprintf(tempstr, "PX = %i PY = %i", myPlayer.position.tile.x, myPlayer.position.tile.y); + NetSendCmdString(1 << MyPlayerId, tempstr); + sprintf(tempstr, "CX = %i CY = %i DP = %i", cursPosition.x, cursPosition.y, dungeon[cursPosition.x][cursPosition.y]); + NetSendCmdString(1 << MyPlayerId, tempstr); return; #endif } @@ -812,7 +809,6 @@ void RunGameLoop(interface_mode uMsg) printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--nestart", _("Use alternate nest palette")); #ifdef _DEBUG printInConsole("\nDebug options:\n"); - printInConsole(" %-20s %-30s\n", "-^", "Enable debug tools"); printInConsole(" %-20s %-30s\n", "-i", "Ignore network timeout"); printInConsole(" %-20s %-30s\n", "+", "Pass commands to the engine"); #endif @@ -871,8 +867,6 @@ void DiabloParseFlags(int argc, char **argv) } else if (strcasecmp("--verbose", argv[i]) == 0) { SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE); #ifdef _DEBUG - } else if (strcasecmp("-^", argv[i]) == 0) { - debug_mode_key_inverted_v = true; } else if (strcasecmp("-i", argv[i]) == 0) { debug_mode_key_i = true; } else if (argv[i][0] == '+') { @@ -1201,7 +1195,7 @@ void GameLogic() gGameLogicStep = GameLogicStep::None; #ifdef _DEBUG - if (debug_mode_key_inverted_v && GetAsyncKeyState(DVL_VK_SHIFT)) { + if (DebugScrollViewEnabled && GetAsyncKeyState(DVL_VK_SHIFT)) { ScrollView(); } #endif diff --git a/Source/diablo.h b/Source/diablo.h index 59e010962..a2ec077db 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -106,7 +106,6 @@ void diablo_color_cyc_logic(); extern Keymapper keymapper; extern bool gbForceWindowed; #ifdef _DEBUG -extern bool debug_mode_key_inverted_v; extern bool debug_mode_key_i; #endif diff --git a/Source/player.cpp b/Source/player.cpp index 1d49d076d..fb4ef0fb0 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -2776,12 +2776,6 @@ void InitPlayer(Player &player, bool firstTime) player._pAblSpells = GetSpellBitmask(SPL_BLODBOIL); } -#ifdef _DEBUG - if (debug_mode_key_inverted_v && firstTime) { - player._pMemSpells = SPL_INVALID; - } -#endif - player._pNextExper = ExpLvlsTbl[player._pLevel]; player._pInvincible = false;