Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Reordered the setup flow pages to allow updating the tool without hav…
Browse files Browse the repository at this point in the history
…ing Steam open. Closes #291.
  • Loading branch information
PazerOP committed Mar 6, 2021
1 parent cbc5794 commit e3d9151
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion submodules/mh_stuff
4 changes: 2 additions & 2 deletions tf2_bot_detector/SetupFlow/ISetupFlowPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ namespace tf2_bot_detector
Invalid = -1,

PermissionsCheck = 0,
CheckSteamOpen,
BasicSettings,
NetworkSettings,
UpdateCheck,
CheckSteamOpen,
BasicSettings,
AddonManager,
ChatWrappersGenerate,
TF2CommandLine,
Expand Down
2 changes: 1 addition & 1 deletion tf2_bot_detector/SetupFlow/NetworkSettingsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace tf2_bot_detector;
template<typename T>
static bool InternalValidateSettings(const T& settings)
{
if (!settings.m_AllowInternetUsage)
if (!settings.m_AllowInternetUsage.has_value())
return false;
if (!settings.m_ReleaseChannel.has_value())
return false;
Expand Down
10 changes: 9 additions & 1 deletion tf2_bot_detector/SetupFlow/SetupFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Version.h"

#include <imgui.h>
#include <mh/algorithm/algorithm.hpp>
#include <mh/text/string_insertion.hpp>

#include <string_view>
Expand All @@ -30,6 +31,7 @@ namespace tf2_bot_detector

SetupFlow::SetupFlow()
{
// order unimportant, see SetupFlowPage enum
m_Pages.push_back(CreatePermissionsCheckPage());
m_Pages.push_back(CreateCheckSteamOpenPage());
m_Pages.push_back(std::make_unique<BasicSettingsPage>());
Expand All @@ -39,7 +41,13 @@ SetupFlow::SetupFlow()
m_Pages.push_back(std::make_unique<ChatWrappersGeneratorPage>());
m_Pages.push_back(std::make_unique<TF2CommandLinePage>());
m_Pages.push_back(std::make_unique<ChatWrappersVerifyPage>());
//m_Pages.push_back(std::make_unique<RCONConnectionPage>());
// order unimportant, see SetupFlowPage enum

mh::sort(m_Pages, [](const std::unique_ptr<ISetupFlowPage>& lhs, const std::unique_ptr<ISetupFlowPage>& rhs)
{
assert(lhs->GetPage() != rhs->GetPage());
return lhs->GetPage() < rhs->GetPage();
});
}

bool SetupFlow::OnUpdate(const Settings& settings)
Expand Down

0 comments on commit e3d9151

Please sign in to comment.