@@ -77,6 +77,7 @@ UpdatePopupDetector_Switch1::UpdatePopupDetector_Switch1(Color color)
7777 , m_left(0.08 , 0.25 , 0.10 , 0.38 )
7878 , m_bottom_solid(0.10 , 0.84 , 0.80 , 0.04 )
7979 , m_bottom_buttons(0.70 , 0.92 , 0.28 , 0.05 )
80+ , m_option_divider(0.49 , 0.66 , 0.02 , 0.01 )
8081{}
8182void UpdatePopupDetector_Switch1::make_overlays (VideoOverlaySet& items) const {
8283 items.add (m_color, m_box_top);
@@ -85,8 +86,14 @@ void UpdatePopupDetector_Switch1::make_overlays(VideoOverlaySet& items) const{
8586 items.add (m_color, m_left);
8687 items.add (m_color, m_bottom_solid);
8788 items.add (m_color, m_bottom_buttons);
89+ items.add (m_color, m_option_divider);
8890}
8991bool UpdatePopupDetector_Switch1::detect (const ImageViewRGB32& screen){
92+ ImageStats option_divider = image_stats (extract_box_reference (screen, m_option_divider));
93+ if (option_divider.stddev .sum () < 10 ){
94+ return false ;
95+ }
96+
9097 ImageStats stats_box_top = image_stats (extract_box_reference (screen, m_box_top));
9198// cout << stats_box_top.average << stats_box_top.stddev << endl;
9299 bool white;
@@ -161,6 +168,7 @@ UpdatePopupDetector_Switch2::UpdatePopupDetector_Switch2(Color color)
161168 , m_left(0.08 , 0.25 , 0.10 , 0.38 )
162169 , m_bottom_solid(0.10 , 0.86 , 0.80 , 0.04 )
163170 , m_bottom_buttons(0.70 , 0.92 , 0.28 , 0.05 )
171+ , m_option_divider(0.49 , 0.60 , 0.02 , 0.01 )
164172{}
165173
166174void UpdatePopupDetector_Switch2::make_overlays (VideoOverlaySet& items) const {
@@ -170,8 +178,14 @@ void UpdatePopupDetector_Switch2::make_overlays(VideoOverlaySet& items) const{
170178 items.add (m_color, m_left);
171179 items.add (m_color, m_bottom_solid);
172180 items.add (m_color, m_bottom_buttons);
181+ items.add (m_color, m_option_divider);
173182}
174183bool UpdatePopupDetector_Switch2::detect (const ImageViewRGB32& screen){
184+ ImageStats option_divider = image_stats (extract_box_reference (screen, m_option_divider));
185+ if (option_divider.stddev .sum () < 10 ){
186+ return false ;
187+ }
188+
175189 ImageStats stats_box_top = image_stats (extract_box_reference (screen, m_box_top));
176190// cout << stats_box_top.average << stats_box_top.stddev << endl;
177191 bool white;
0 commit comments