Skip to content

Commit 804625a

Browse files
committed
Allow 2 sliders to count as Switch 2 international. News page can be black at the bottom.
1 parent a3ed2b7 commit 804625a

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
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 = 55;
29-
const int PROGRAM_VERSION_PATCH = 2;
29+
const int PROGRAM_VERSION_PATCH = 3;
3030

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

SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141
#include "NintendoSwitch/Inference/NintendoSwitch_SelectedSettingDetector.h"
142142
#include "PokemonSV/Inference/Boxes/PokemonSV_BoxShinyDetector.h"
143143
#include "PokemonSwSh/Inference/PokemonSwSh_DialogBoxDetector.h"
144+
#include "CommonTools/Images/SolidColorTest.h"
145+
144146

145147
#include <QPixmap>
146148
#include <QVideoFrame>
@@ -262,10 +264,17 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope&
262264

263265
auto screenshot = feed.snapshot();
264266

267+
#if 0
268+
NewsDetector detector;
269+
detector.make_overlays(overlays);
270+
cout << detector.detect(screenshot) << endl;
271+
#endif
272+
273+
#if 0
265274
PokemonSwSh::BlackDialogBoxDetector detector(true);
266275
detector.make_overlays(overlays);
267276
cout << detector.process_frame(screenshot, current_time()) << endl;
268-
277+
#endif
269278

270279

271280
// PokemonSV::BoxShinyDetector detector;

SerialPrograms/Source/NintendoSwitch/Programs/DateSpam/NintendoSwitch2_HomeToDateTime.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ ConsoleType settings_detect_console_type(
5050
size_t sliders = detector.detect(snapshot).size();
5151
switch (sliders){
5252
case 1:
53+
case 2:
5354
console.state().set_console_type(console, ConsoleType::Switch2_FW20_International);
5455
break;
5556
case 3:

SerialPrograms/Source/PokemonSV/Programs/PokemonSV_ConnectToInternet.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ class NewsDetector : public StaticScreenDetector{
3434

3535
private:
3636
Color m_color;
37-
ImageFloatBox m_bottom_white;
37+
ImageFloatBox m_bottom_solid;
3838
ImageFloatBox m_bottom_buttons;
3939
};
4040
NewsDetector::NewsDetector(Color color)
4141
: m_color(color)
42-
, m_bottom_white(0.15, 0.92, 0.20, 0.06)
42+
, m_bottom_solid(0.15, 0.92, 0.20, 0.06)
4343
, m_bottom_buttons(0.40, 0.92, 0.58, 0.06)
4444
{}
4545
void NewsDetector::make_overlays(VideoOverlaySet& items) const{
46-
items.add(m_color, m_bottom_white);
46+
items.add(m_color, m_bottom_solid);
4747
items.add(m_color, m_bottom_buttons);
4848
}
4949
bool NewsDetector::detect(const ImageViewRGB32& screen){
50-
ImageStats bottom_white = image_stats(extract_box_reference(screen, m_bottom_white));
51-
if (!is_white(bottom_white)){
50+
ImageStats bottom_solid = image_stats(extract_box_reference(screen, m_bottom_solid));
51+
if (!is_white(bottom_solid) && !is_black(bottom_solid)){
5252
return false;
5353
}
5454

@@ -161,7 +161,14 @@ void connect_to_internet_from_overworld(const ProgramInfo& info, VideoStream& st
161161
int ret = wait_until(
162162
stream, context,
163163
std::chrono::seconds(60),
164-
{overworld, main_menu, dialog, prompt, news, battle_menu}
164+
{
165+
overworld,
166+
main_menu,
167+
dialog,
168+
prompt,
169+
news,
170+
battle_menu,
171+
}
165172
);
166173
context.wait_for(std::chrono::milliseconds(100));
167174
switch (ret){

0 commit comments

Comments
 (0)