Some character editor changes:

- Move Own Boats/Horses to Scenario menu
- Disable Scenario menu if not in a scenario
- Don't bother converting notes from legacy saves if not in a scenario (affects game too)
This commit is contained in:
2015-06-27 02:08:15 -04:00
parent 2397c540ab
commit dafe6c2790
7 changed files with 40 additions and 50 deletions

View File

@@ -257,13 +257,10 @@ void handle_menu_choice(eMenu item_hit) {
break;
case eMenu::LEAVE_SCENARIO:
if(!party_in_scen) {
display_strings(25,15);
break;
}
if(cChoiceDlog("leave-scenario",{"okay","cancel"}).show() != "okay")
break;
remove_party_from_scen();
menu_activate();
break;
case eMenu::EDIT_ALCHEMY:
display_alchemy(true);
@@ -279,10 +276,6 @@ void handle_menu_choice(eMenu item_hit) {
edit_day();
break;
case eMenu::ADD_OUT_MAPS:
if(!party_in_scen) {
display_strings(25,15);
break;
}
display_strings(13,15);
for(i = 0; i < 100; i++)
for(j = 0; j < 6; j++)
@@ -290,10 +283,6 @@ void handle_menu_choice(eMenu item_hit) {
univ.out_maps[i][j][k] = 255;
break;
case eMenu::ADD_TOWN_MAPS:
if(!party_in_scen) {
display_strings(25,15);
break;
}
display_strings(14,15);
for(i = 0; i < 200; i++)
for(j = 0; j < 8; j++)

View File

@@ -19,7 +19,7 @@ using MenuHandle = NSMenu*;
extern cUniverse univ;
extern fs::path file_in_mem;
extern bool scen_items_loaded;
extern bool scen_items_loaded, party_in_scen;
MenuHandle menu_bar_handle;
MenuHandle apple_menu, file_menu, reg_menu, extra_menu, items_menu[4];
@@ -65,10 +65,10 @@ void init_menubar() {
eMenu::EDIT_GOLD, eMenu::EDIT_FOOD, eMenu::EDIT_ALCHEMY, eMenu::NONE,
eMenu::HEAL_DAMAGE, eMenu::RESTORE_MANA, eMenu::RAISE_DEAD, eMenu::CURE_CONDITIONS, eMenu::NONE,
eMenu::EDIT_MAGE, eMenu::EDIT_PRIEST, eMenu::EDIT_TRAITS, eMenu::EDIT_SKILLS, eMenu::EDIT_XP, eMenu::NONE,
eMenu::REUNITE_PARTY, eMenu::OWN_VEHICLES,
eMenu::REUNITE_PARTY,
};
static const eMenu scen_choices[] = {
eMenu::EDIT_DAY, eMenu::NONE, eMenu::LEAVE_TOWN, eMenu::RESET_TOWNS, eMenu::ADD_OUT_MAPS, eMenu::ADD_TOWN_MAPS,
eMenu::EDIT_DAY, eMenu::NONE, eMenu::LEAVE_TOWN, eMenu::RESET_TOWNS, eMenu::ADD_OUT_MAPS, eMenu::ADD_TOWN_MAPS, eMenu::OWN_VEHICLES,
eMenu::NONE, eMenu::LEAVE_SCENARIO, eMenu::SET_SDF,
};
@@ -101,7 +101,7 @@ void menu_activate() {
for(int i = 3; i < [file_menu numberOfItems]; i++)
[[file_menu itemAtIndex: i] setEnabled: YES];
[[menu_bar_handle itemWithTitle: @"Edit Party"] setEnabled: YES];
[[menu_bar_handle itemWithTitle: @"Scenario Edit"] setEnabled: YES];
[[menu_bar_handle itemWithTitle: @"Scenario Edit"] setEnabled: party_in_scen];
}
}

View File

@@ -22,7 +22,7 @@ enum {
extern sf::RenderWindow mainPtr;
extern cUniverse univ;
extern bool scen_items_loaded;
extern bool scen_items_loaded, party_in_scen;
extern fs::path file_in_mem;
LONG_PTR mainProc;
HMENU menuHandle = NULL;
@@ -79,10 +79,10 @@ void init_menubar() {
eMenu::EDIT_GOLD, eMenu::EDIT_FOOD, eMenu::EDIT_ALCHEMY, eMenu::NONE,
eMenu::HEAL_DAMAGE, eMenu::RESTORE_MANA, eMenu::RAISE_DEAD, eMenu::CURE_CONDITIONS, eMenu::NONE,
eMenu::EDIT_MAGE, eMenu::EDIT_PRIEST, eMenu::EDIT_TRAITS, eMenu::EDIT_SKILLS, eMenu::EDIT_XP, eMenu::NONE,
eMenu::REUNITE_PARTY, eMenu::OWN_VEHICLES,
eMenu::REUNITE_PARTY,
};
static const eMenu scen_choices[] = {
eMenu::EDIT_DAY, eMenu::NONE, eMenu::LEAVE_TOWN, eMenu::RESET_TOWNS, eMenu::ADD_OUT_MAPS, eMenu::ADD_TOWN_MAPS,
eMenu::EDIT_DAY, eMenu::NONE, eMenu::LEAVE_TOWN, eMenu::RESET_TOWNS, eMenu::ADD_OUT_MAPS, eMenu::ADD_TOWN_MAPS, eMenu::OWN_VEHICLES,
eMenu::NONE, eMenu::LEAVE_SCENARIO, eMenu::SET_SDF,
};
static const eMenu help_choices[] = {
@@ -142,7 +142,7 @@ void menu_activate() {
EnableMenuItem(file_menu, i, MF_BYPOSITION | MF_GRAYED);
} else {
EnableMenuItem(menuHandle, PARTY_MENU_POS, MF_BYPOSITION | MF_ENABLED);
EnableMenuItem(menuHandle, SCEN_MENU_POS, MF_BYPOSITION | MF_ENABLED);
EnableMenuItem(menuHandle, SCEN_MENU_POS, MF_BYPOSITION | (party_in_scen ? MF_ENABLED : MF_GRAYED));
for(int i = 1; i < GetMenuItemCount(file_menu) - 1; i++)
EnableMenuItem(file_menu, i, MF_BYPOSITION | MF_ENABLED);
}