From e6a6707c36824a87ac8d66cebcb4218a3e9c3aa7 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 8 Jan 2025 21:38:35 -0600 Subject: [PATCH] skip intro dialog and special node when cli launches a scenario --- src/game/boe.main.cpp | 2 +- src/game/boe.party.cpp | 22 ++++++++++++---------- src/game/boe.party.hpp | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index f679c843a..60c62ad8b 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -365,7 +365,7 @@ static void handle_scenario_args() { } } if(!univ.party.is_in_scenario()){ - put_party_in_scen(path.filename().string()); + put_party_in_scen(path.filename().string(), scen_arg_town || scen_arg_out_x); } }else{ std::cerr << "Failed to load scenario: " << *scen_arg_path << std::endl; diff --git a/src/game/boe.party.cpp b/src/game/boe.party.cpp index 900c01d8f..1889e8f45 100644 --- a/src/game/boe.party.cpp +++ b/src/game/boe.party.cpp @@ -102,7 +102,7 @@ short store_pc_graphic; // When the party is placed into a scen from the starting screen, this is called to put the game into game // mode and load in the scen and init the party info // party record already contains scen name -void put_party_in_scen(std::string scen_name) { +void put_party_in_scen(std::string scen_name, bool force) { bool item_took = false; // Drop debug mode @@ -186,15 +186,17 @@ void put_party_in_scen(std::string scen_name) { adjust_spell_menus(); adjust_monst_menu(); - // Throw up intro dialog - for(short j = 0; j < univ.scenario.intro_strs.size(); j++) - if(!univ.scenario.intro_strs[j].empty()) { - std::array buttons = {0,-1,-1}; - custom_choice_dialog(univ.scenario.intro_strs, univ.scenario.intro_mess_pic, PIC_SCEN, buttons); - j = 6; - } - run_special(eSpecCtx::STARTUP, eSpecCtxType::SCEN, univ.scenario.init_spec, loc(0,0)); - give_help(1,2); + if(!force){ + // Throw up intro dialog + for(short j = 0; j < univ.scenario.intro_strs.size(); j++) + if(!univ.scenario.intro_strs[j].empty()) { + std::array buttons = {0,-1,-1}; + custom_choice_dialog(univ.scenario.intro_strs, univ.scenario.intro_mess_pic, PIC_SCEN, buttons); + j = 6; + } + run_special(eSpecCtx::STARTUP, eSpecCtxType::SCEN, univ.scenario.init_spec, loc(0,0)); + give_help(1,2); + } // Compatibility flags if(univ.scenario.format.prog_make_ver[0] < 2){ diff --git a/src/game/boe.party.hpp b/src/game/boe.party.hpp index 220108492..7d787a512 100644 --- a/src/game/boe.party.hpp +++ b/src/game/boe.party.hpp @@ -46,7 +46,7 @@ short trait_present(eTrait which_trait); short race_present(eRace which_race); short wilderness_lore_present(ter_num_t ter); void print_spell_cast(eSpell spell,eSkill which); -void put_party_in_scen(std::string scen_name); +void put_party_in_scen(std::string scen_name, bool force = false); short party_size(bool only_living); bool all_items_identified();