From fe0295fa2e9cbb830f7b9527f80d754b4591d3b3 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 4 Mar 2021 16:34:22 +0100 Subject: [PATCH] :triangular_flag_on_post: Move barbarian and bard test options to the ini --- Source/diablo.cpp | 10 ++++------ Source/diablo.h | 12 +++++++----- SourceX/DiabloUI/selhero.cpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index dfd9d2a3f..3d9a952ca 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -101,8 +101,6 @@ static void print_help_and_exit() printf(" %-20s %-30s\n", "-f", "Display frames per second"); printf(" %-20s %-30s\n", "-x", "Run in windowed mode"); printf(" %-20s %-30s\n", "--spawn", "Force spawn mode even if diabdat.mpq is found"); - printf(" %-20s %-30s\n", "--bardtest", "Enable the Bard class"); - printf(" %-20s %-30s\n", "--barbariantest", "Enable the Barbarian class"); printf("\nHellfire options:\n"); printf(" %-20s %-30s\n", "--diablo", "Force diablo mode even if hellfire.mpq is found"); printf(" %-20s %-30s\n", "--nestart", "Use alternate nest palette"); @@ -153,10 +151,6 @@ static void diablo_parse_flags(int argc, char **argv) forceDiablo = TRUE; } else if (strcasecmp("--nestart", argv[i]) == 0) { gbNestArt = true; - } else if (strcasecmp("--bardtest", argv[i]) == 0) { - gbBard = true; - } else if (strcasecmp("--barbariantest", argv[i]) == 0) { - gbBarbarian = true; #ifdef _DEBUG } else if (strcasecmp("-^", argv[i]) == 0) { debug_mode_key_inverted_v = TRUE; @@ -427,6 +421,8 @@ static void SaveOptions() setIniInt("Game", "Grab Input", sgOptions.bGrabInput); setIniInt("Game", "Theo Quest", sgOptions.bTheoQuest); setIniInt("Game", "Cow Quest", sgOptions.bCowQuest); + setIniInt("Game", "Test Bard", sgOptions.bTestBard); + setIniInt("Game", "Test Barbarian", sgOptions.bTestBarbarian); setIniValue("Network", "Bind Address", sgOptions.szBindAddress); } @@ -466,6 +462,8 @@ static void LoadOptions() sgOptions.bGrabInput = getIniBool("Game", "Grab Input", false); sgOptions.bTheoQuest = getIniBool("Game", "Theo Quest", false); sgOptions.bCowQuest = getIniBool("Game", "Cow Quest", false); + sgOptions.bTestBard = getIniBool("Game", "Test Bard", false); + sgOptions.bTestBarbarian = getIniBool("Game", "Test Barbarian", false); getIniValue("Network", "Bind Address", sgOptions.szBindAddress, sizeof(sgOptions.szBindAddress), "0.0.0.0"); } diff --git a/Source/diablo.h b/Source/diablo.h index 8553bed85..773dc4b20 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -36,11 +36,13 @@ typedef struct Options { Sint32 nGammaCorrection; // Gamma correction level bool bColorCycling; // Enable color cycling animations - Sint32 nTickRate; // Game play ticks per secound - bool bJogInTown; // Enable double walk speed when in town - bool bGrabInput; // Do not let the mouse leave the application window - bool bTheoQuest; // Enable the Theo quest - bool bCowQuest; // Enable the cow quest + Sint32 nTickRate; // Game play ticks per secound + bool bJogInTown; // Enable double walk speed when in town + bool bGrabInput; // Do not let the mouse leave the application window + bool bTheoQuest; // Enable the Theo quest + bool bCowQuest; // Enable the cow quest + bool bTestBard; // Enable the bard hero class + bool bTestBarbarian; // Enable the babarian hero class char szBindAddress[129]; // Optionally bind to a specific network interface } Options; diff --git a/SourceX/DiabloUI/selhero.cpp b/SourceX/DiabloUI/selhero.cpp index 0ceea9c34..df4630ced 100644 --- a/SourceX/DiabloUI/selhero.cpp +++ b/SourceX/DiabloUI/selhero.cpp @@ -274,10 +274,10 @@ void selhero_List_Select(int value) if (gbIsHellfire) { vecSelHeroDlgItems.push_back(new UiListItem("Monk", PC_MONK)); } - if (gbBard) { + if (gbBard || sgOptions.bTestBard) { vecSelHeroDlgItems.push_back(new UiListItem("Bard", PC_BARD)); } - if (gbBarbarian) { + if (gbBarbarian || sgOptions.bTestBarbarian) { vecSelHeroDlgItems.push_back(new UiListItem("Barbarian", PC_BARBARIAN)); } if (vecSelHeroDlgItems.size() > 4)