diff --git a/Spawner.vcxproj b/Spawner.vcxproj index a8e92b7f..dbf89618 100644 --- a/Spawner.vcxproj +++ b/Spawner.vcxproj @@ -46,6 +46,7 @@ + diff --git a/src/Spawner/QuickMatch.cpp b/src/Spawner/QuickMatch.cpp new file mode 100644 index 00000000..07ecfacd --- /dev/null +++ b/src/Spawner/QuickMatch.cpp @@ -0,0 +1,45 @@ +#include "Spawner.h" +#include + +namespace QuickMatch +{ + const wchar_t* PlayerString = L"Player"; +} + +DEFINE_HOOK(0x643AA5, ProgressScreenClass_643720_HideName, 0x8) +{ + if ((Spawner::Enabled && Spawner::GetConfig()->QuickMatch) == false) + return 0; + + REF_STACK(wchar_t*, pPlayerName, STACK_OFFSET(0x5C, 8)); + pPlayerName = const_cast(QuickMatch::PlayerString); + + return 0; +} + +DEFINE_HOOK(0x65837A, RadarClass_658330_HideName, 0x6) +{ + if ((Spawner::Enabled && Spawner::GetConfig()->QuickMatch) == false) + return 0; + + R->ECX(QuickMatch::PlayerString); + return 0x65837A + 0x6; +} + +DEFINE_HOOK(0x64B156, ModeLessDialog_64AE50_HideName, 0x9) +{ + if ((Spawner::Enabled && Spawner::GetConfig()->QuickMatch) == false) + return 0; + + R->EDX(QuickMatch::PlayerString); + return 0x64B156 + 0x9; +} + +DEFINE_HOOK(0x648EA8, WaitForPlayers_HideName, 0x6) +{ + if ((Spawner::Enabled && Spawner::GetConfig()->QuickMatch) == false) + return 0; + + R->EAX(QuickMatch::PlayerString); + return 0x648EB3; +} diff --git a/src/Spawner/Spawner.Config.cpp b/src/Spawner/Spawner.Config.cpp index e4761557..295469e0 100644 --- a/src/Spawner/Spawner.Config.cpp +++ b/src/Spawner/Spawner.Config.cpp @@ -99,15 +99,13 @@ void SpawnerConfig::LoadFromINIFile(CCINIClass* pINI) // Extended Options Ra2Mode = pINI->ReadBool(pSettingsSection, "Ra2Mode", Ra2Mode); + QuickMatch = pINI->ReadBool(pSettingsSection, "QuickMatch", QuickMatch); SkipScoreScreen = pINI->ReadBool(pSettingsSection, "SkipScoreScreen", SkipScoreScreen); WriteStatistics = pINI->ReadBool(pSettingsSection, "WriteStatistics", WriteStatistics); AINamesByDifficulty = pINI->ReadBool(pSettingsSection, "AINamesByDifficulty", AINamesByDifficulty); ContinueWithoutHumans = pINI->ReadBool(pSettingsSection, "ContinueWithoutHumans", ContinueWithoutHumans); DefeatedBecomesObserver = pINI->ReadBool(pSettingsSection, "DefeatedBecomesObserver", DefeatedBecomesObserver); Observer_ShowAIOnSidebar = pINI->ReadBool(pSettingsSection, "Observer.ShowAIOnSidebar", Observer_ShowAIOnSidebar); - // TODO: - // QuickMatch = pINI->ReadBool(pSettingsSection, "QuickMatch", QuickMatch); - // RunAutoSS = pINI->ReadBool(pSettingsSection, "RunAutoSS", RunAutoSS); } constexpr char* PlayerSectionArray[8] = { diff --git a/src/Spawner/Spawner.Config.h b/src/Spawner/Spawner.Config.h index 8fe10332..c4c0491b 100644 --- a/src/Spawner/Spawner.Config.h +++ b/src/Spawner/Spawner.Config.h @@ -127,15 +127,13 @@ class SpawnerConfig // Extended Options bool Ra2Mode; + bool QuickMatch; bool SkipScoreScreen; bool WriteStatistics; bool AINamesByDifficulty; bool ContinueWithoutHumans; bool DefeatedBecomesObserver; bool Observer_ShowAIOnSidebar; - // TODO: - // bool QuickMatch; - // bool RunAutoSS; SpawnerConfig() // default values // Game Mode Options @@ -215,15 +213,13 @@ class SpawnerConfig // Extended Options , Ra2Mode { false } + , QuickMatch { false } , SkipScoreScreen { Main::GetConfig()->SkipScoreScreen } , WriteStatistics { false } , AINamesByDifficulty { false } , ContinueWithoutHumans { false } , DefeatedBecomesObserver { false } , Observer_ShowAIOnSidebar { false } - // TODO: - // , QuickMatch { false } - // , RunAutoSS { false } { } void LoadFromINIFile(CCINIClass* pINI);