Skip to content

Commit 3c24b16

Browse files
committed
Add option to trust user console type selection.
1 parent bbf07a5 commit 3c24b16

File tree

7 files changed

+30
-5
lines changed

7 files changed

+30
-5
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace PokemonAutomation{
2626
const bool IS_BETA_VERSION = true;
2727
const int PROGRAM_VERSION_MAJOR = 0;
2828
const int PROGRAM_VERSION_MINOR = 54;
29-
const int PROGRAM_VERSION_PATCH = 6;
29+
const int PROGRAM_VERSION_PATCH = 7;
3030

3131
const std::string PROGRAM_VERSION_BASE =
3232
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/CommonFramework/Startup/NewVersionCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void show_update_box(
144144
){
145145
QMessageBox box;
146146
QPushButton* ok = box.addButton(QMessageBox::Ok);
147-
QPushButton* skip = box.addButton("Skip this version.", QMessageBox::NoRole);
147+
QPushButton* skip = box.addButton("Skip this Version", QMessageBox::NoRole);
148148

149149
box.setTextFormat(Qt::RichText);
150150
std::string text = header + "<br>";

SerialPrograms/Source/NintendoSwitch/Framework/NintendoSwitch_MultiSwitchProgramSession.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "CommonFramework/Notifications/ProgramNotifications.h"
1414
#include "CommonFramework/Options/Environment/SleepSuppressOption.h"
1515
#include "CommonFramework/Options/Environment/PerformanceOptions.h"
16+
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1617
#include "NintendoSwitch/Controllers/NintendoSwitch_ProController.h"
1718
#include "NintendoSwitch_MultiSwitchProgramOption.h"
1819
#include "NintendoSwitch_MultiSwitchProgramSession.h"
@@ -174,7 +175,13 @@ void MultiSwitchProgramSession::internal_run_program(){
174175
session.audio(),
175176
session.stream_history()
176177
);
177-
handles.back().state().set_console_type_user(session.console_type());
178+
179+
ConsoleState& state = handles.back().state();
180+
if (ConsoleSettings::instance().TRUST_USER_CONSOLE_SELECTION){
181+
state.set_console_type(handles.back().logger(), session.console_type());
182+
}else{
183+
state.set_console_type_user(session.console_type());
184+
}
178185
}
179186

180187

SerialPrograms/Source/NintendoSwitch/Framework/NintendoSwitch_SingleSwitchProgramSession.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "CommonFramework/Options/Environment/PerformanceOptions.h"
1313
#include "CommonFramework/Notifications/ProgramInfo.h"
1414
#include "CommonFramework/Notifications/ProgramNotifications.h"
15+
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1516
#include "NintendoSwitch_SingleSwitchProgramOption.h"
1617
#include "NintendoSwitch_SingleSwitchProgramSession.h"
1718

@@ -143,7 +144,13 @@ void SingleSwitchProgramSession::internal_run_program(){
143144
m_system.audio(),
144145
m_system.stream_history()
145146
);
146-
env.console.state().set_console_type_user(m_system.console_type());
147+
148+
if (ConsoleSettings::instance().TRUST_USER_CONSOLE_SELECTION){
149+
env.console.state().set_console_type(m_system.logger(), m_system.console_type());
150+
}else{
151+
env.console.state().set_console_type_user(m_system.console_type());
152+
}
153+
147154

148155
try{
149156
logger().log("<b>Starting Program: " + identifier() + "</b>");

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_ConsoleState.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ const std::string& ConsoleType_strings(ConsoleType type){
4343
logger,
4444
std::string("Conflicting Console Types:") +
4545
"\n User Selected: " + ConsoleType_strings(user_type) +
46-
"\n Detected Type: " + ConsoleType_strings(detected_type)
46+
"\n Detected Type: " + ConsoleType_strings(detected_type) +
47+
"\n\nIf you think this is a bug, please report it to either our Github or our Discord server!"
4748
);
4849
}
4950

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ ConsoleSettings& ConsoleSettings::instance(){
6565
}
6666
ConsoleSettings::ConsoleSettings()
6767
: BatchOption(LockMode::LOCK_WHILE_RUNNING)
68+
, TRUST_USER_CONSOLE_SELECTION(
69+
"<b>Trust User Console Selection:</b><br>"
70+
"Trust that the user's selection for the console type (Switch 1 vs. Switch 2) is correct.<br>"
71+
"Do not cross-check it. Do not stop the program if it disagrees with the user selection.<br>"
72+
"Don't enable this option unless you are encountering issues.",
73+
LockMode::LOCK_WHILE_RUNNING,
74+
false
75+
)
6876
, SETTINGS_TO_HOME_DELAY0(
6977
"<b>Settings to Home Delay:</b><br>Delay from pressing home anywhere in the settings to return to the home menu.",
7078
LockMode::LOCK_WHILE_RUNNING,
@@ -103,6 +111,7 @@ ConsoleSettings::ConsoleSettings()
103111
, KEYBOARD_SECTION("<font size=4><b>Keyboard to Controller Mappings:</b></font>")
104112
{
105113
PA_ADD_OPTION(CONTROLLER_SETTINGS);
114+
PA_ADD_OPTION(TRUST_USER_CONSOLE_SELECTION);
106115
PA_ADD_OPTION(SETTINGS_TO_HOME_DELAY0);
107116
PA_ADD_OPTION(START_GAME_REQUIRES_INTERNET);
108117
PA_ADD_OPTION(START_GAME_INTERNET_CHECK_DELAY0);

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class ConsoleSettings : public BatchOption{
4242

4343
ControllerSettingsTable CONTROLLER_SETTINGS;
4444

45+
BooleanCheckBoxOption TRUST_USER_CONSOLE_SELECTION;
4546
MillisecondsOption SETTINGS_TO_HOME_DELAY0;
4647
BooleanCheckBoxOption START_GAME_REQUIRES_INTERNET;
4748
MillisecondsOption START_GAME_INTERNET_CHECK_DELAY0;

0 commit comments

Comments
 (0)