Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8711f8a
Updated draft
Boombaastical Feb 20, 2026
f581b9c
Updated draft for adding saved paths on the go
Boombaastical Feb 21, 2026
6f35536
Merge remote-tracking branch 'upstream' into MaxLair/AddedSaveOnTheGoo
Boombaastical Feb 23, 2026
fc7c2aa
Updated draft
Boombaastical Feb 23, 2026
5054e92
Added more draft changes
Boombaastical Feb 24, 2026
d12f770
Updated draft, now working logic but needs UI
Boombaastical Feb 24, 2026
846247e
Finalizing the save-on-the-go feature for MaxLair, missing the screen…
Boombaastical Feb 24, 2026
4bbfe56
Draft: updated some other fixes
Boombaastical Feb 24, 2026
401a3fe
Tweaked things a bit
Boombaastical Feb 25, 2026
19b9e3a
Saved other changes
Boombaastical Feb 26, 2026
10e5b1d
Fixed logic
Boombaastical Feb 26, 2026
8dc8317
Merge remote-tracking branch 'upstream' into MaxLair/AddedSaveOnTheGo
Boombaastical Feb 27, 2026
12aa9f5
Finalized logic, testing
Boombaastical Feb 27, 2026
8f2e4fd
Finalized implementation of the save-on-the-go option
Boombaastical Feb 27, 2026
d49935a
Merge remote-tracking branch 'upstream' into MaxLair/AddedSaveOnTheGo
Boombaastical Feb 27, 2026
22d051e
Reverted non-necessary additions
Boombaastical Feb 28, 2026
3641b06
Reverted unnecessary additions 2
Boombaastical Feb 28, 2026
1e57d55
Reverted unnecessary additions 3
Boombaastical Feb 28, 2026
d5da4be
Fixed formatting issues
Boombaastical Mar 1, 2026
4d3a748
Merge remote-tracking branch 'upstream' into MaxLair/AddedSaveOnTheGo
Boombaastical Mar 1, 2026
b2d7bc2
Merge remote-tracking branch 'upstream' into MaxLair/AddedSaveOnTheGo
Boombaastical Mar 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class EndBattleDecider{
const PathStats& path_stats,
bool any_shiny, bool boss_is_shiny
) const = 0;

// For BossFinder: whether the boss is in the "save on the go" list.
virtual bool is_in_save_list(const std::string& boss_slug) const { return false; }

// For Standard/StrongBoss: whether to keep a followed path when prompted.
//virtual bool should_keep_followed_path() const { return false; }
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
*
*/

#include <vector>
#include <memory>
//#include "Common/Compiler.h"
//#include "Common/Cpp/Json/JsonValue.h"
//#include "Common/Cpp/Json/JsonArray.h"
//#include "Common/Cpp/Json/JsonObject.h"
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
#include "Common/Cpp/Options/ConfigOption.h"
//#include "CommonFramework/Globals.h"
#include "Pokemon/Pokemon_Strings.h"
#include "Pokemon/Resources/Pokemon_PokemonNames.h"
Expand All @@ -16,6 +20,7 @@
#include "PokemonSwSh/Resources/PokemonSwSh_MaxLairDatabase.h"
#include "PokemonSwSh_MaxLair_Options_BossAction.h"


//#include <iostream>
//using std::cout;
//using std::endl;
Expand Down Expand Up @@ -49,30 +54,101 @@ BossActionRow::BossActionRow(std::string slug, const std::string& name_slug, con
BossAction::CATCH_AND_STOP_IF_SHINY
)
, ball(LockMode::UNLOCK_WHILE_RUNNING, "poke-ball")
, save_on_the_go(LockMode::UNLOCK_WHILE_RUNNING, false)
{
PA_ADD_STATIC(pokemon);
add_option(action, "Action");
add_option(ball, "Ball");
add_option(save_on_the_go, "Save Path");

save_on_the_go.set_visibility(
action == BossAction::CATCH_AND_STOP_IF_SHINY ? ConfigOptionState::ENABLED : ConfigOptionState::DISABLED
);

action.add_listener(*this);
}

void BossActionRow::on_config_value_changed(void* object) {
if (action != BossAction::CATCH_AND_STOP_IF_SHINY) {
save_on_the_go = false;
}
}


BossActionTable::BossActionTable()
: StaticTableOption("<b>Boss Actions:</b>", LockMode::UNLOCK_WHILE_RUNNING)
, m_reverting(false)
{
for (const auto& item : all_bosses_by_dex()){
// cout << item.second << endl;
const MaxLairSlugs& slugs = get_maxlair_slugs(item.second);
const std::string& sprite_slug = *slugs.sprite_slugs.begin();
const std::string& name_slug = slugs.name_slug;
add_row(std::make_unique<BossActionRow>(item.second, name_slug, sprite_slug));

auto row = std::make_unique<BossActionRow>(item.second, name_slug, sprite_slug);
m_rows.push_back(row.get());
add_row(std::move(row));
}
finish_construction();

for (auto* row : m_rows) {
row->save_on_the_go.add_listener(*this);
row->action.add_listener(*this);
}

update_checkbox_states();
}

BossActionTable::~BossActionTable(){
for (auto* row : m_rows) {
row->save_on_the_go.remove_listener(*this);
row->action.remove_listener(*this);
}
}

void BossActionTable::update_checkbox_states() {
size_t checked = 0;
for (auto* row : m_rows) {
if (row->save_on_the_go) checked++;
}
for (auto* row : m_rows) {
bool action_ok = (row->action == BossAction::CATCH_AND_STOP_IF_SHINY);
bool disable_by_max = (checked >= 3 && !row->save_on_the_go);
ConfigOptionState state = (action_ok && !disable_by_max) ? ConfigOptionState::ENABLED : ConfigOptionState::DISABLED;
row->save_on_the_go.set_visibility(state);
}
}

void BossActionTable::on_config_value_changed(void* object) {
if (m_reverting) return;

// Counting how many checkboxes are currently checked
size_t checked = 0;
for (auto* row : m_rows) {
if (row->save_on_the_go) checked++;
}

// If we exceed the 3 boxes ticked, we revert the change for the last box ticked
if (checked > 3) {
for (auto* row : m_rows) {
if (object == &row->save_on_the_go && row->save_on_the_go) {
m_reverting = true;
row->save_on_the_go = false;
m_reverting = false;

return;
}
}
}
update_checkbox_states();
}

std::vector<std::string> BossActionTable::make_header() const{
std::vector<std::string> ret{
STRING_POKEMON,
"Action",
STRING_POKEBALL
STRING_POKEBALL,
"Save Path (Max 3)"
};
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#include "Common/Cpp/Options/StaticTableOption.h"
#include "CommonFramework/Options/LabelCellOption.h"
#include "PokemonSwSh/Options/PokemonSwSh_BallSelectOption.h"
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
#include "Common/Cpp/Options/ConfigOption.h"
#include <vector>
#include <memory>

namespace PokemonAutomation{
namespace NintendoSwitch{
Expand All @@ -23,20 +27,36 @@ enum class BossAction{
CATCH_AND_STOP_IF_SHINY,
};

const EnumDropdownDatabase<BossAction>& BossAction_Database();

class BossActionRow : public StaticTableRow{
class BossActionRow : public StaticTableRow,
private ConfigOption::Listener
{
public:
BossActionRow(std::string slug, const std::string& name_slug, const std::string& sprite_slug);
virtual void on_config_value_changed(void* object) override;


LabelCellOption pokemon;
EnumDropdownCell<BossAction> action;
PokemonBallSelectCell ball;
BooleanCheckBoxCell save_on_the_go;
};

class BossActionTable : public StaticTableOption{
class BossActionTable : public StaticTableOption,
private ConfigOption::Listener
{
public:
BossActionTable();
virtual std::vector<std::string> make_header() const;
~BossActionTable();

virtual void on_config_value_changed(void* object) override;
virtual std::vector<std::string> make_header() const override;

private:
std::vector<BossActionRow*> m_rows;
bool m_reverting;
void update_checkbox_states();
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ class EndBattleDecider_BossFinder : public EndBattleDecider{
}
throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "Invalid enum.");
}
virtual bool is_in_save_list(const std::string& boss_slug) const override {
return get_filter(boss_slug).save_on_the_go;
}


private:
Expand Down
Loading