Skip to content

Commit f0eae10

Browse files
committed
Add deprecation pop-up for deprecated programs.
1 parent 90598b3 commit f0eae10

18 files changed

+62
-17
lines changed

SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_MultiSwitchProgramWidget.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ MultiSwitchProgramWidget2::MultiSwitchProgramWidget2(
6565
);
6666
layout->addWidget(header);
6767

68+
if (descriptor.deprecated()){
69+
QMessageBox box;
70+
box.warning(
71+
nullptr,
72+
"Deprecation Notice",
73+
"This program is deprecated and no longer maintained. Please consider using a newer alternative."
74+
);
75+
}
76+
6877

6978
{
7079
QScrollArea* scroll_outer = new QScrollArea(this);

SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_SingleSwitchProgramWidget.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ SingleSwitchProgramWidget2::SingleSwitchProgramWidget2(
5757
);
5858
layout->addWidget(header);
5959

60+
if (descriptor.deprecated()){
61+
QMessageBox box;
62+
box.warning(
63+
nullptr,
64+
"Deprecation Notice",
65+
"This program is deprecated and no longer maintained. Please consider using a newer alternative."
66+
);
67+
}
68+
6069

6170
{
6271
QScrollArea* scroll_outer = new QScrollArea(this);

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_MultiSwitchProgram.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ MultiSwitchProgramDescriptor::MultiSwitchProgramDescriptor(
115115
FasterIfTickPrecise faster_if_tick_precise,
116116
size_t min_switches,
117117
size_t max_switches,
118-
size_t default_switches
118+
size_t default_switches,
119+
bool deprecated
119120
)
120121
: ProgramDescriptor(
121122
pick_color(required_features, faster_if_tick_precise),
@@ -128,6 +129,7 @@ MultiSwitchProgramDescriptor::MultiSwitchProgramDescriptor(
128129
, m_required_features(std::move(required_features))
129130
, m_faster_if_tick_precise(faster_if_tick_precise)
130131
, m_allow_commands_while_running(allow_commands_while_running == AllowCommandsWhenRunning::ENABLE_COMMANDS)
132+
, m_deprecated(deprecated)
131133
, m_min_switches(min_switches)
132134
, m_max_switches(max_switches)
133135
, m_default_switches(default_switches)

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_MultiSwitchProgram.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ class MultiSwitchProgramDescriptor : public ProgramDescriptor{
8282
FasterIfTickPrecise faster_if_tick_precise,
8383
size_t min_switches,
8484
size_t max_switches,
85-
size_t default_switches
85+
size_t default_switches,
86+
bool deprecated = false
8687
);
8788

8889
FeedbackType feedback() const{ return m_feedback; }
8990
const ControllerFeatures& required_features() const{ return m_required_features; }
9091
FasterIfTickPrecise faster_if_tick_precise() const{ return m_faster_if_tick_precise; }
9192
bool allow_commands_while_running() const{ return m_allow_commands_while_running; }
93+
bool deprecated() const{ return m_deprecated; }
9294

9395
size_t min_switches() const{ return m_min_switches; }
9496
size_t max_switches() const{ return m_max_switches; }
@@ -102,6 +104,7 @@ class MultiSwitchProgramDescriptor : public ProgramDescriptor{
102104
const ControllerFeatures m_required_features;
103105
const FasterIfTickPrecise m_faster_if_tick_precise;
104106
const bool m_allow_commands_while_running;
107+
const bool m_deprecated;
105108

106109
const size_t m_min_switches;
107110
const size_t m_max_switches;

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_SingleSwitchProgram.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ SingleSwitchProgramDescriptor::SingleSwitchProgramDescriptor(
2525
FeedbackType feedback,
2626
AllowCommandsWhenRunning allow_commands_while_running,
2727
ControllerFeatures required_features,
28-
FasterIfTickPrecise faster_if_tick_precise
28+
FasterIfTickPrecise faster_if_tick_precise,
29+
bool deprecated
2930
)
3031
: ProgramDescriptor(
3132
pick_color(required_features, faster_if_tick_precise),
@@ -38,6 +39,7 @@ SingleSwitchProgramDescriptor::SingleSwitchProgramDescriptor(
3839
, m_required_features(std::move(required_features))
3940
, m_faster_if_tick_precise(faster_if_tick_precise)
4041
, m_allow_commands_while_running(allow_commands_while_running == AllowCommandsWhenRunning::ENABLE_COMMANDS)
42+
, m_deprecated(deprecated)
4143
{}
4244
std::unique_ptr<PanelInstance> SingleSwitchProgramDescriptor::make_panel() const{
4345
return std::make_unique<SingleSwitchProgramOption>(*this);

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_SingleSwitchProgram.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ class SingleSwitchProgramDescriptor : public ProgramDescriptor{
5959
FeedbackType feedback,
6060
AllowCommandsWhenRunning allow_commands_while_running,
6161
ControllerFeatures required_features,
62-
FasterIfTickPrecise faster_if_tick_precise = FasterIfTickPrecise::NOT_FASTER
62+
FasterIfTickPrecise faster_if_tick_precise = FasterIfTickPrecise::NOT_FASTER,
63+
bool deprecated = false
6364
);
6465

6566
FeedbackType feedback() const{ return m_feedback; }
6667
const ControllerFeatures& required_features() const{ return m_required_features; }
6768
FasterIfTickPrecise faster_if_tick_precise() const{ return m_faster_if_tick_precise; }
6869
bool allow_commands_while_running() const{ return m_allow_commands_while_running; }
70+
bool deprecated() const{ return m_deprecated; }
6971

7072
virtual std::unique_ptr<PanelInstance> make_panel() const override;
7173
virtual std::unique_ptr<SingleSwitchProgramInstance> make_instance() const = 0;
@@ -75,6 +77,7 @@ class SingleSwitchProgramDescriptor : public ProgramDescriptor{
7577
const ControllerFeatures m_required_features;
7678
const FasterIfTickPrecise m_faster_if_tick_precise;
7779
const bool m_allow_commands_while_running;
80+
const bool m_deprecated;
7881
};
7982

8083

SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_AutoItemPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ AutoItemPrinter_Descriptor::AutoItemPrinter_Descriptor()
3737
FeedbackType::REQUIRED,
3838
AllowCommandsWhenRunning::DISABLE_COMMANDS,
3939
{ControllerFeature::NintendoSwitch_ProController},
40-
FasterIfTickPrecise::NOT_FASTER
40+
FasterIfTickPrecise::NOT_FASTER,
41+
true
4142
)
4243
{}
4344
struct AutoItemPrinter_Descriptor::Stats : public StatsTracker{

SerialPrograms/Source/PokemonSwSh/PokemonSwSh_Panels.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ std::vector<PanelEntry> PanelListFactory::make_panels() const{
116116
ret.emplace_back(make_single_switch_program<SurpriseTrade_Descriptor, SurpriseTrade>());
117117
ret.emplace_back(make_single_switch_program<TradeBot_Descriptor, TradeBot>());
118118
ret.emplace_back(make_single_switch_program<ClothingBuyer_Descriptor, ClothingBuyer>());
119-
ret.emplace_back(make_single_switch_program<BallThrower_Descriptor, BallThrower>());
120119
ret.emplace_back(make_single_switch_program<AutonomousBallThrower_Descriptor, AutonomousBallThrower>());
121120
ret.emplace_back(make_single_switch_program<DexRecFinder_Descriptor, DexRecFinder>());
122121
ret.emplace_back(make_single_switch_program<BoxReorderNationalDex_Descriptor, BoxReorderNationalDex>());
@@ -191,6 +190,7 @@ std::vector<PanelEntry> PanelListFactory::make_panels() const{
191190
ret.emplace_back(make_multi_switch_program<MaxLairBossFinder_Descriptor, MaxLairBossFinder>());
192191

193192
ret.emplace_back("---- Deprecated Programs ----");
193+
ret.emplace_back(make_single_switch_program<BallThrower_Descriptor, BallThrower>());
194194
ret.emplace_back(make_single_switch_program<BeamReset_Descriptor, BeamReset>());
195195
ret.emplace_back(make_single_switch_program<EggCombined2_Descriptor, EggCombined2>());
196196
ret.emplace_back(make_single_switch_program<EggSuperCombined2_Descriptor, EggSuperCombined2>());

SerialPrograms/Source/PokemonSwSh/Programs/DenHunting/PokemonSwSh_BeamReset.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ BeamReset_Descriptor::BeamReset_Descriptor()
2626
"Reset a beam until you see a purple beam.",
2727
FeedbackType::NONE,
2828
AllowCommandsWhenRunning::DISABLE_COMMANDS,
29-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
29+
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS},
30+
FasterIfTickPrecise::NOT_FASTER,
31+
true
3032
)
3133
{}
3234

SerialPrograms/Source/PokemonSwSh/Programs/EggPrograms/PokemonSwSh_EggCombined2.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ EggCombined2_Descriptor::EggCombined2_Descriptor()
2424
"Fetch and hatch eggs at the same time. (Fastest - 1700 eggs/day for 5120-step)",
2525
FeedbackType::NONE,
2626
AllowCommandsWhenRunning::DISABLE_COMMANDS,
27-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
27+
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS},
28+
FasterIfTickPrecise::NOT_FASTER,
29+
true
2830
)
2931
{}
3032

0 commit comments

Comments
 (0)