Skip to content

Commit 1809a76

Browse files
committed
Fix DateReader being broken in German on Switch 2.
1 parent 56c4e39 commit 1809a76

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

SerialPrograms/Source/NintendoSwitch/Inference/NintendoSwitch_DateChangeDetector.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#include "CommonFramework/VideoPipeline/VideoOverlayScopes.h"
99
#include "NintendoSwitch_DateChangeDetector.h"
1010

11+
//#include <iostream>
12+
//using std::cout;
13+
//using std::endl;
14+
1115
namespace PokemonAutomation{
1216
namespace NintendoSwitch{
1317

@@ -95,7 +99,7 @@ DateChangeDetector_Switch2::DateChangeDetector_Switch2(Color color)
9599
, m_window_bottom(0.50, 0.80, 0.45, 0.07)
96100
, m_window_text(0.05, 0.02, 0.10, 0.08)
97101
, m_jp_year(0.139, 0.436, 0.088, 0.095)
98-
, m_us_hour(0.473, 0.61, 0.06, 0.09)
102+
, m_us_hour(0.466856, 0.567340, 0.049242, 0.063973)
99103
, m_jp_month_arrow(0.291705, 0.331675, 0.054986, 0.069652)
100104
{}
101105
void DateChangeDetector_Switch2::make_overlays(VideoOverlaySet& items) const{
@@ -150,6 +154,8 @@ DateFormat DateChangeDetector_Switch2::detect_date_format(const ImageViewRGB32&
150154
ImageViewRGB32 us_hours = extract_box_reference(screen, m_us_hour);
151155
ImageStats stats_us_hours = image_stats(us_hours);
152156

157+
// cout << stats_us_hours.stddev.sum() << endl;
158+
153159
if (stats_us_hours.stddev.sum() > 30){
154160
return DateFormat::US;
155161
}

SerialPrograms/Source/NintendoSwitch/Programs/DateManip/NintendoSwitch_DateManip.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ DateReader::DateReader(ConsoleHandle& console)
3939
: m_console(console)
4040
, m_switch1(COLOR_RED)
4141
, m_switch2(COLOR_MAGENTA)
42-
, m_background_top(0.50, 0.02, 0.45, 0.08)
43-
, m_window_top(0.50, 0.36, 0.45, 0.07)
44-
, m_window_text(0.05, 0.36, 0.10, 0.07)
45-
, m_us_hour(0.473, 0.61, 0.06, 0.09)
46-
, m_jp_year(0.136, 0.61, 0.11, 0.09)
47-
, m_jp_month_arrow(0.30, 0.50, 0.05, 0.06)
4842
, m_switch1_US(COLOR_YELLOW)
4943
, m_switch1_EU(COLOR_CYAN)
5044
, m_switch1_JP(COLOR_PURPLE)
@@ -53,12 +47,9 @@ DateReader::DateReader(ConsoleHandle& console)
5347
, m_switch2_JP(COLOR_PURPLE)
5448
{}
5549
void DateReader::make_overlays(VideoOverlaySet& items) const{
56-
items.add(COLOR_RED, m_background_top);
57-
items.add(COLOR_RED, m_window_top);
58-
items.add(COLOR_RED, m_window_text);
59-
items.add(COLOR_RED, m_us_hour);
60-
items.add(COLOR_RED, m_jp_year);
61-
items.add(COLOR_RED, m_jp_month_arrow);
50+
m_switch1.make_overlays(items);
51+
m_switch2.make_overlays(items);
52+
6253
m_switch1_US.make_overlays(items);
6354
m_switch1_EU.make_overlays(items);
6455
m_switch1_JP.make_overlays(items);

SerialPrograms/Source/NintendoSwitch/Programs/DateManip/NintendoSwitch_DateManip.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ class DateReader : public StaticScreenDetector{
4646
DateChangeDetector_Switch1 m_switch1;
4747
DateChangeDetector_Switch2 m_switch2;
4848

49-
ImageFloatBox m_background_top;
50-
ImageFloatBox m_window_top;
51-
ImageFloatBox m_window_text;
52-
53-
ImageFloatBox m_us_hour;
54-
ImageFloatBox m_jp_year;
55-
ImageFloatBox m_jp_month_arrow;
56-
5749
DateReader_Switch1_US m_switch1_US;
5850
DateReader_Switch1_EU m_switch1_EU;
5951
DateReader_Switch1_JP m_switch1_JP;

0 commit comments

Comments
 (0)