From 0f19b2a10e7fe30483db93efe1ec3813b926428d Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 2 Sep 2024 13:38:14 -0700 Subject: [PATCH] Rename Item Printer RNG table fields (#470) --- .../ItemPrinter/PokemonSV_ItemPrinterRNG.cpp | 22 +++++++++---------- .../ItemPrinter/PokemonSV_ItemPrinterRNG.h | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.cpp b/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.cpp index 2d66c4ced..e08937abb 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.cpp @@ -92,7 +92,7 @@ std::unique_ptr ItemPrinterRNG_Descriptor::make_stats() const{ ItemPrinterRNG::~ItemPrinterRNG(){ MATERIAL_FARMER_OPTIONS.remove_listener(*this); MATERIAL_FARMER_TRIGGER.remove_listener(*this); - TABLE0.remove_listener(*this); + DATE_SEED_TABLE.remove_listener(*this); // AUTO_MATERIAL_FARMING.remove_listener(*this); } @@ -124,14 +124,14 @@ ItemPrinterRNG::ItemPrinterRNG() LockMode::LOCK_WHILE_RUNNING, ItemPrinterMode::AUTO_MODE ) - , TABLE1( + , DESIRED_ITEM_TABLE( "Item Table:
" "Input your desired item and desired quantity to the table.
" "Ensure you have enough BP and are maxed out on the following sandwich ingredients: Chorizo, Bananas, Mayonnaise, Whipped Cream. " "Also, ensure you have a strong lead pokemon for auto-battling, for farming materials.
" "If there are duplicate items in the table, only the higher quantity will be considered." ) - , TABLE0( + , DATE_SEED_TABLE( "Rounds Table:
Run the following prints in order and repeat. " "Changes to this table take effect the next time the table starts from the beginning." ) @@ -203,10 +203,10 @@ ItemPrinterRNG::ItemPrinterRNG() if (PreloadSettings::instance().DEVELOPER_MODE){ PA_ADD_OPTION(MODE); - PA_ADD_OPTION(TABLE1); + PA_ADD_OPTION(DESIRED_ITEM_TABLE); } PA_ADD_OPTION(NUM_ITEM_PRINTER_ROUNDS); - PA_ADD_OPTION(TABLE0); + PA_ADD_OPTION(DATE_SEED_TABLE); PA_ADD_OPTION(OVERLAPPING_BONUS_WARNING); PA_ADD_OPTION(DELAY_MILLIS); PA_ADD_OPTION(ADJUST_DELAY); @@ -228,7 +228,7 @@ ItemPrinterRNG::ItemPrinterRNG() ItemPrinterRNG::value_changed(this); // AUTO_MATERIAL_FARMING.add_listener(*this); - TABLE0.add_listener(*this); + DATE_SEED_TABLE.add_listener(*this); MODE.add_listener(*this); MATERIAL_FARMER_OPTIONS.add_listener(*this); MATERIAL_FARMER_TRIGGER.add_listener(*this); @@ -245,11 +245,11 @@ void ItemPrinterRNG::value_changed(void* object){ ? ConfigOptionState::ENABLED : ConfigOptionState::HIDDEN ); - TABLE1.set_visibility( + DESIRED_ITEM_TABLE.set_visibility( MODE == ItemPrinterMode::AUTO_MODE ? ConfigOptionState::ENABLED : ConfigOptionState::HIDDEN ); - TABLE0.set_visibility( + DATE_SEED_TABLE.set_visibility( MODE == ItemPrinterMode::AUTO_MODE ? ConfigOptionState::HIDDEN : ConfigOptionState::ENABLED ); @@ -290,7 +290,7 @@ void ItemPrinterRNG::value_changed(void* object){ bool ItemPrinterRNG::overlapping_bonus(){ // for each row in table. if ball/item bonus, ensure that sum of prints in subsequent rows >=10 before the next bonus, or end of the table. uint16_t total_prints_since_last_bonus = 10; - for (std::shared_ptr& table_row : TABLE0.current_refs()){ + for (std::shared_ptr& table_row : DATE_SEED_TABLE.current_refs()){ ItemPrinterRngRow& row = static_cast(*table_row); if (row.desired_item == ItemPrinter::PrebuiltOptions::BALL_BONUS || row.desired_item == ItemPrinter::PrebuiltOptions::ITEM_BONUS){ if (total_prints_since_last_bonus < 10){ @@ -654,7 +654,7 @@ void ItemPrinterRNG::run_item_printer_rng_automode( bool have_cleared_out_bonus = false; std::map obtained_prizes; - std::vector desired_table = TABLE1.snapshot(); + std::vector desired_table = DESIRED_ITEM_TABLE.snapshot(); for (const ItemPrinterDesiredItemRowSnapshot& desired_row : desired_table){ std::string desired_slug = ItemPrinter::PrebuiltOptions_AutoMode_Database().find(desired_row.item)->slug; int16_t desired_quantity = desired_row.quantity; @@ -831,7 +831,7 @@ void ItemPrinterRNG::run_item_printer_rng( for (uint32_t c = 0; c < NUM_ITEM_PRINTER_ROUNDS; c++){ send_program_status_notification(env, NOTIFICATION_STATUS_UPDATE); - std::vector table = TABLE0.snapshot(); + std::vector table = DATE_SEED_TABLE.snapshot(); for (const ItemPrinterRngRowSnapshot& row : table){ // Cannot run material farmer between chained prints. if (row.chain){ diff --git a/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.h b/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.h index 41e92da5c..43beebea9 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.h +++ b/SerialPrograms/Source/PokemonSV/Programs/ItemPrinter/PokemonSV_ItemPrinterRNG.h @@ -121,8 +121,8 @@ class ItemPrinterRNG : public SingleSwitchProgramInstance, public ConfigOption:: StaticTextOption OVERLAPPING_BONUS_WARNING; EnumDropdownOption MODE; - ItemPrinterDesiredItemTable TABLE1; - ItemPrinterRngTable TABLE0; + ItemPrinterDesiredItemTable DESIRED_ITEM_TABLE; + ItemPrinterRngTable DATE_SEED_TABLE; SimpleIntegerOption DELAY_MILLIS; BooleanCheckBoxOption ADJUST_DELAY;