diff --git a/rsrc/dialogs/need-party.xml b/rsrc/dialogs/need-party.xml index b4067f1e..eac47da3 100644 --- a/rsrc/dialogs/need-party.xml +++ b/rsrc/dialogs/need-party.xml @@ -7,5 +7,6 @@ You can't start a scenario until you have a party loaded. Click the Load Game or Make New Party button to get a group of adventurers. + Or, hold the Alt key to use a preset party. \ No newline at end of file diff --git a/src/boe.actions.cpp b/src/boe.actions.cpp index d5502cc0..f0bacf7f 100644 --- a/src/boe.actions.cpp +++ b/src/boe.actions.cpp @@ -2670,12 +2670,13 @@ void handle_death() { } -void start_new_game() { +void start_new_game(bool force) { short i; std::string choice; using kb = sf::Keyboard; - choice = cChoiceDlog("new-party",{"okay","cancel"}).show(); + if(!force) + choice = cChoiceDlog("new-party",{"okay","cancel"}).show(); if(choice == "cancel") return; @@ -2711,7 +2712,8 @@ void start_new_game() { // It was probably a relic of Exile III. // (It also refreshed stores... with uninitialized items.) - edit_party(); + if(!force) + edit_party(); // if no PCs left, forget it for(i = 0 ; i < 6; i++) @@ -2727,9 +2729,10 @@ void start_new_game() { univ.party[i].finish_create(); } } + party_in_memory = true; + if(force) return; fs::path file = nav_put_party(); if(!file.empty()) save_party(file, univ); - party_in_memory = true; } location get_cur_direction(location the_point) { diff --git a/src/boe.actions.hpp b/src/boe.actions.hpp index 0feffdfe..6e3ad468 100644 --- a/src/boe.actions.hpp +++ b/src/boe.actions.hpp @@ -23,7 +23,7 @@ void handle_hunting(); void switch_pc(short which); void drop_pc(short which); void handle_death(); -void start_new_game(); +void start_new_game(bool force = false); location get_cur_direction(location the_point); bool outd_move_party(location destination,bool forced); bool town_move_party(location destination,short forced); diff --git a/src/boe.startup.cpp b/src/boe.startup.cpp index cc5cc8ef..fe025d2b 100644 --- a/src/boe.startup.cpp +++ b/src/boe.startup.cpp @@ -34,8 +34,10 @@ rectangle startup_button[6]; // TODO: Always returns false, so make it void bool handle_startup_press(location the_point) { + using kb = sf::Keyboard; std::string scen_name; short i,scen; + bool force_party = false; the_point.x -= ul.x; the_point.y -= ul.y; @@ -68,12 +70,20 @@ bool handle_startup_press(location the_point) { case STARTBTN_JOIN: // regular scen if(!party_in_memory) { - cChoiceDlog("need-party").show(); - break; + if(kb::isKeyPressed(kb::LAlt) || kb::isKeyPressed(kb::RAlt)) { + force_party = true; + start_new_game(true); + } else { + cChoiceDlog("need-party").show(); + break; + } } scen = pick_prefab_scen(); - if(scen < 0) + if(scen < 0) { + if(force_party) + party_in_memory = false; break; + } switch(scen) { case 0: scen_name = "valleydy.exs"; break; @@ -83,22 +93,37 @@ bool handle_startup_press(location the_point) { //case 3: sprintf(univ.party.scen_name,"busywork.exs"); break; } put_party_in_scen(scen_name); + if(force_party && scen_name != univ.party.scen_name) + party_in_memory = false; break; case STARTBTN_CUSTOM: // custom if(!party_in_memory) { - cChoiceDlog("need-party").show(); - break; + if(kb::isKeyPressed(kb::LAlt) || kb::isKeyPressed(kb::RAlt)) { + force_party = true; + start_new_game(true); + } else { + cChoiceDlog("need-party").show(); + break; + } } scen = pick_a_scen(); - if(scen < 0) break; + if(scen < 0) { + if(force_party) + party_in_memory = false; + break; + } if(scen_headers[scen].prog_make_ver[0] > 2 || scen_headers[scen].prog_make_ver[1] > 0) { + if(force_party) + party_in_memory = false; cChoiceDlog("scen-version-mismatch").show(); break; } scen_name = scen_headers[scen].file; put_party_in_scen(scen_name); + if(force_party && scen_name != univ.party.scen_name) + party_in_memory = false; break; } }