Mac PC Editor: Remove I menus in favour of Party -> Add Item
Also rename the menus to match Mac.
This commit is contained in:
@@ -72,7 +72,7 @@ BEGIN
|
|||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Quit\tCtrl+Q", IDM_FILE_QUIT
|
MENUITEM "&Quit\tCtrl+Q", IDM_FILE_QUIT
|
||||||
END
|
END
|
||||||
POPUP "&Edit Party"
|
POPUP "&Party"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "Edit Gold", IDM_PARTY_GOLD
|
MENUITEM "Edit Gold", IDM_PARTY_GOLD
|
||||||
MENUITEM "Edit Food", IDM_PARTY_FOOD
|
MENUITEM "Edit Food", IDM_PARTY_FOOD
|
||||||
@@ -91,7 +91,7 @@ BEGIN
|
|||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Reunite Party", IDM_PARTY_REUNITE
|
MENUITEM "Reunite Party", IDM_PARTY_REUNITE
|
||||||
END
|
END
|
||||||
POPUP "&Scenario Editing"
|
POPUP "&Scenario"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "Edit Day", IDM_SCEN_DAY
|
MENUITEM "Edit Day", IDM_SCEN_DAY
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
@@ -104,22 +104,6 @@ BEGIN
|
|||||||
MENUITEM "Remove Party From Scenario", IDM_SCEN_LEAVE
|
MENUITEM "Remove Party From Scenario", IDM_SCEN_LEAVE
|
||||||
MENUITEM "Set Stuff Done Flag", IDM_SCEN_SDF
|
MENUITEM "Set Stuff Done Flag", IDM_SCEN_SDF
|
||||||
END
|
END
|
||||||
POPUP "&I1"
|
|
||||||
BEGIN
|
|
||||||
MENUITEM "None", 1000
|
|
||||||
END
|
|
||||||
POPUP "&I2"
|
|
||||||
BEGIN
|
|
||||||
MENUITEM "None", 1001
|
|
||||||
END
|
|
||||||
POPUP "&I3"
|
|
||||||
BEGIN
|
|
||||||
MENUITEM "None", 1002
|
|
||||||
END
|
|
||||||
POPUP "&I4"
|
|
||||||
BEGIN
|
|
||||||
MENUITEM "None", 1003
|
|
||||||
END
|
|
||||||
POPUP "&Help"
|
POPUP "&Help"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "About Blades of Exile Editor", IDM_ABOUT
|
MENUITEM "About Blades of Exile Editor", IDM_ABOUT
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ int main(int argc, char* argv[]) {
|
|||||||
cDialog::init();
|
cDialog::init();
|
||||||
redraw_screen();
|
redraw_screen();
|
||||||
menu_activate();
|
menu_activate();
|
||||||
update_item_menu();
|
|
||||||
|
|
||||||
handle_events();
|
handle_events();
|
||||||
|
|
||||||
@@ -249,7 +248,6 @@ void handle_menu_choice(eMenu item_hit) {
|
|||||||
party_in_scen = !univ.party.scen_name.empty();
|
party_in_scen = !univ.party.scen_name.empty();
|
||||||
if(!party_in_scen) load_base_item_defs();
|
if(!party_in_scen) load_base_item_defs();
|
||||||
scen_items_loaded = true;
|
scen_items_loaded = true;
|
||||||
update_item_menu();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
menu_activate();
|
menu_activate();
|
||||||
@@ -369,8 +367,13 @@ void handle_menu_choice(eMenu item_hit) {
|
|||||||
}
|
}
|
||||||
cStringChoice dlog(strings, "Add which item?");
|
cStringChoice dlog(strings, "Add which item?");
|
||||||
auto choice = dlog.show(all_items.size());
|
auto choice = dlog.show(all_items.size());
|
||||||
if(choice < all_items.size())
|
if(choice < all_items.size()) {
|
||||||
handle_item_menu(all_items[choice]);
|
cItem store_i = all_items[choice];
|
||||||
|
store_i.ident = true;
|
||||||
|
if(!univ.party[current_active_pc].give_item(store_i,GIVE_ALLOW_OVERLOAD))
|
||||||
|
showError("Sorry, that PC has no free inventory slots left! You'll have to either drop something or give it to a different PC.");
|
||||||
|
else redraw_screen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case eMenu::EDIT_TRAITS:
|
case eMenu::EDIT_TRAITS:
|
||||||
@@ -393,14 +396,6 @@ void handle_menu_choice(eMenu item_hit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_item_menu(cItem& item) {
|
|
||||||
cItem store_i = item;
|
|
||||||
store_i.ident = true;
|
|
||||||
if(!univ.party[current_active_pc].give_item(store_i,GIVE_ALLOW_OVERLOAD))
|
|
||||||
showError("Sorry, that PC has no free inventory slots left! You'll have to either drop something or give it to a different PC.");
|
|
||||||
else redraw_screen();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool verify_restore_quit(std::string dlog) {
|
bool verify_restore_quit(std::string dlog) {
|
||||||
std::string choice;
|
std::string choice;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#define BoE_pc_menus_h
|
#define BoE_pc_menus_h
|
||||||
|
|
||||||
void init_menubar();
|
void init_menubar();
|
||||||
void update_item_menu();
|
|
||||||
void menu_activate();
|
void menu_activate();
|
||||||
|
|
||||||
namespace sf { class Event; };
|
namespace sf { class Event; };
|
||||||
@@ -30,7 +29,6 @@ enum class eMenu {
|
|||||||
EDIT_DAY, LEAVE_TOWN, RESET_TOWNS, ADD_OUT_MAPS, ADD_TOWN_MAPS, LEAVE_SCENARIO, SET_SDF,
|
EDIT_DAY, LEAVE_TOWN, RESET_TOWNS, ADD_OUT_MAPS, ADD_TOWN_MAPS, LEAVE_SCENARIO, SET_SDF,
|
||||||
};
|
};
|
||||||
|
|
||||||
void handle_item_menu(class cItem& item);
|
|
||||||
void handle_menu_choice(eMenu item_hit);
|
void handle_menu_choice(eMenu item_hit);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ void init_menubar() {
|
|||||||
menu_ptr.reset(new OpenBoEPCEditMenu(mainPtr));
|
menu_ptr.reset(new OpenBoEPCEditMenu(mainPtr));
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_item_menu() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void menu_activate() {
|
void menu_activate() {
|
||||||
menu_ptr->update_for_editor_state(!file_in_mem.empty(), party_in_scen);
|
menu_ptr->update_for_editor_state(!file_in_mem.empty(), party_in_scen);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,9 +93,6 @@ void menu_activate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_item_menu() {
|
|
||||||
}
|
|
||||||
|
|
||||||
bool menuBarProcessEvent(const sf::Event&) {
|
bool menuBarProcessEvent(const sf::Event&) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ enum {
|
|||||||
FILE_MENU_POS = 0,
|
FILE_MENU_POS = 0,
|
||||||
PARTY_MENU_POS = 1,
|
PARTY_MENU_POS = 1,
|
||||||
SCEN_MENU_POS = 2,
|
SCEN_MENU_POS = 2,
|
||||||
ITEMS_MENU_POS = 3,
|
HELP_MENU_POS = 3,
|
||||||
HELP_MENU_POS = 7,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern sf::RenderWindow mainPtr;
|
extern sf::RenderWindow mainPtr;
|
||||||
@@ -110,27 +109,6 @@ void init_menubar() {
|
|||||||
accel.build();
|
accel.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_item_menu() {
|
|
||||||
if(menuHandle == NULL) return;
|
|
||||||
auto& item_list = univ.scenario.scen_items;
|
|
||||||
int per_menu = 1 + (item_list.size() - 1) / 4;
|
|
||||||
int per_col = 1 + (per_menu - 1) / 4;
|
|
||||||
for(int j = 0; j < 4; j++) {
|
|
||||||
HMENU items_menu = GetSubMenu(menuHandle, ITEMS_MENU_POS + j);
|
|
||||||
while(GetMenuItemCount(items_menu)) RemoveMenu(items_menu, 0, MF_BYPOSITION);
|
|
||||||
if(!scen_items_loaded) {
|
|
||||||
AppendMenuA(items_menu, MF_STRING | MF_GRAYED, 1000, "Items Not Loaded");
|
|
||||||
} else for(int i = 0; i < per_menu && i + j * per_menu < item_list.size(); i++) {
|
|
||||||
cItem& item = item_list[i + j * per_menu];
|
|
||||||
UINT flags = MF_STRING | MF_ENABLED;
|
|
||||||
if(i % per_col == 0) flags |= MF_MENUBARBREAK;
|
|
||||||
AppendMenuA(items_menu, flags, 1000 + j * per_menu + i, item.full_name.c_str());
|
|
||||||
EnableMenuItem(items_menu, i, MF_BYPOSITION | (item.variety != eItemType::NO_ITEM ? MF_ENABLED : MF_GRAYED));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DrawMenuBar(mainPtr.getSystemHandle());
|
|
||||||
}
|
|
||||||
|
|
||||||
void menu_activate() {
|
void menu_activate() {
|
||||||
if(menuHandle == NULL) return;
|
if(menuHandle == NULL) return;
|
||||||
HMENU file_menu = GetSubMenu(menuHandle, FILE_MENU_POS);
|
HMENU file_menu = GetSubMenu(menuHandle, FILE_MENU_POS);
|
||||||
@@ -158,9 +136,7 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara
|
|||||||
}
|
}
|
||||||
if(message == WM_COMMAND) {
|
if(message == WM_COMMAND) {
|
||||||
int cmd = LOWORD(wParam);
|
int cmd = LOWORD(wParam);
|
||||||
if(cmd >= 1000) { // Item menus
|
handle_menu_choice(menuChoices[cmd]);
|
||||||
handle_item_menu(univ.scenario.scen_items[cmd - 1000]);
|
|
||||||
} else handle_menu_choice(menuChoices[cmd]);
|
|
||||||
} else if(message == WM_SETCURSOR) {
|
} else if(message == WM_SETCURSOR) {
|
||||||
// Windows resets the cursor to an arrow whenever the mouse moves, unless we do this.
|
// Windows resets the cursor to an arrow whenever the mouse moves, unless we do this.
|
||||||
// Note: By handling this message, sf::Window::setMouseCursorVisible() will NOT work.
|
// Note: By handling this message, sf::Window::setMouseCursorVisible() will NOT work.
|
||||||
@@ -189,7 +165,6 @@ void set_up_apple_events(int argc, char* argv[]) {
|
|||||||
party_in_scen = !univ.party.scen_name.empty();
|
party_in_scen = !univ.party.scen_name.empty();
|
||||||
if(!party_in_scen) load_base_item_defs();
|
if(!party_in_scen) load_base_item_defs();
|
||||||
scen_items_loaded = true;
|
scen_items_loaded = true;
|
||||||
update_item_menu();
|
|
||||||
menu_activate();
|
menu_activate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user