Now you can hold Alt while starting a scenario to skip party creation
(Only if party not loaded)
This commit is contained in:
@@ -7,5 +7,6 @@
|
|||||||
<text top='6' left='49' width='273' height='43'>
|
<text top='6' left='49' width='273' height='43'>
|
||||||
You can't start a scenario until you have a party loaded.
|
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.
|
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.
|
||||||
</text>
|
</text>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -2670,12 +2670,13 @@ void handle_death() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void start_new_game() {
|
void start_new_game(bool force) {
|
||||||
short i;
|
short i;
|
||||||
std::string choice;
|
std::string choice;
|
||||||
using kb = sf::Keyboard;
|
using kb = sf::Keyboard;
|
||||||
|
|
||||||
choice = cChoiceDlog("new-party",{"okay","cancel"}).show();
|
if(!force)
|
||||||
|
choice = cChoiceDlog("new-party",{"okay","cancel"}).show();
|
||||||
if(choice == "cancel")
|
if(choice == "cancel")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -2711,7 +2712,8 @@ void start_new_game() {
|
|||||||
// It was probably a relic of Exile III.
|
// It was probably a relic of Exile III.
|
||||||
// (It also refreshed stores... with uninitialized items.)
|
// (It also refreshed stores... with uninitialized items.)
|
||||||
|
|
||||||
edit_party();
|
if(!force)
|
||||||
|
edit_party();
|
||||||
|
|
||||||
// if no PCs left, forget it
|
// if no PCs left, forget it
|
||||||
for(i = 0 ; i < 6; i++)
|
for(i = 0 ; i < 6; i++)
|
||||||
@@ -2727,9 +2729,10 @@ void start_new_game() {
|
|||||||
univ.party[i].finish_create();
|
univ.party[i].finish_create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
party_in_memory = true;
|
||||||
|
if(force) return;
|
||||||
fs::path file = nav_put_party();
|
fs::path file = nav_put_party();
|
||||||
if(!file.empty()) save_party(file, univ);
|
if(!file.empty()) save_party(file, univ);
|
||||||
party_in_memory = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location get_cur_direction(location the_point) {
|
location get_cur_direction(location the_point) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ void handle_hunting();
|
|||||||
void switch_pc(short which);
|
void switch_pc(short which);
|
||||||
void drop_pc(short which);
|
void drop_pc(short which);
|
||||||
void handle_death();
|
void handle_death();
|
||||||
void start_new_game();
|
void start_new_game(bool force = false);
|
||||||
location get_cur_direction(location the_point);
|
location get_cur_direction(location the_point);
|
||||||
bool outd_move_party(location destination,bool forced);
|
bool outd_move_party(location destination,bool forced);
|
||||||
bool town_move_party(location destination,short forced);
|
bool town_move_party(location destination,short forced);
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ rectangle startup_button[6];
|
|||||||
|
|
||||||
// TODO: Always returns false, so make it void
|
// TODO: Always returns false, so make it void
|
||||||
bool handle_startup_press(location the_point) {
|
bool handle_startup_press(location the_point) {
|
||||||
|
using kb = sf::Keyboard;
|
||||||
std::string scen_name;
|
std::string scen_name;
|
||||||
short i,scen;
|
short i,scen;
|
||||||
|
bool force_party = false;
|
||||||
|
|
||||||
the_point.x -= ul.x;
|
the_point.x -= ul.x;
|
||||||
the_point.y -= ul.y;
|
the_point.y -= ul.y;
|
||||||
@@ -68,12 +70,20 @@ bool handle_startup_press(location the_point) {
|
|||||||
|
|
||||||
case STARTBTN_JOIN: // regular scen
|
case STARTBTN_JOIN: // regular scen
|
||||||
if(!party_in_memory) {
|
if(!party_in_memory) {
|
||||||
cChoiceDlog("need-party").show();
|
if(kb::isKeyPressed(kb::LAlt) || kb::isKeyPressed(kb::RAlt)) {
|
||||||
break;
|
force_party = true;
|
||||||
|
start_new_game(true);
|
||||||
|
} else {
|
||||||
|
cChoiceDlog("need-party").show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
scen = pick_prefab_scen();
|
scen = pick_prefab_scen();
|
||||||
if(scen < 0)
|
if(scen < 0) {
|
||||||
|
if(force_party)
|
||||||
|
party_in_memory = false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch(scen) {
|
switch(scen) {
|
||||||
case 0: scen_name = "valleydy.exs"; break;
|
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;
|
//case 3: sprintf(univ.party.scen_name,"busywork.exs"); break;
|
||||||
}
|
}
|
||||||
put_party_in_scen(scen_name);
|
put_party_in_scen(scen_name);
|
||||||
|
if(force_party && scen_name != univ.party.scen_name)
|
||||||
|
party_in_memory = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STARTBTN_CUSTOM: // custom
|
case STARTBTN_CUSTOM: // custom
|
||||||
if(!party_in_memory) {
|
if(!party_in_memory) {
|
||||||
cChoiceDlog("need-party").show();
|
if(kb::isKeyPressed(kb::LAlt) || kb::isKeyPressed(kb::RAlt)) {
|
||||||
break;
|
force_party = true;
|
||||||
|
start_new_game(true);
|
||||||
|
} else {
|
||||||
|
cChoiceDlog("need-party").show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scen = pick_a_scen();
|
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(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();
|
cChoiceDlog("scen-version-mismatch").show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
scen_name = scen_headers[scen].file;
|
scen_name = scen_headers[scen].file;
|
||||||
put_party_in_scen(scen_name);
|
put_party_in_scen(scen_name);
|
||||||
|
if(force_party && scen_name != univ.party.scen_name)
|
||||||
|
party_in_memory = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user