Fix Windows scenario editor menus
This commit is contained in:
@@ -105,9 +105,9 @@ BEGIN
|
|||||||
MENUITEM " &Delete Last Town", IDM_SCEN_ADV_DELETE_TOWN
|
MENUITEM " &Delete Last Town", IDM_SCEN_ADV_DELETE_TOWN
|
||||||
MENUITEM " Write D&ata To Text File", IDM_SCEN_ADV_DATA_DUMP
|
MENUITEM " Write D&ata To Text File", IDM_SCEN_ADV_DATA_DUMP
|
||||||
MENUITEM " Do &Full Text Dump", IDM_SCEN_ADV_TEXT_DUMP
|
MENUITEM " Do &Full Text Dump", IDM_SCEN_ADV_TEXT_DUMP
|
||||||
MENUITEM " Scenario Shoppin&g Text Dump", IDM_SCEN_ADV_DATA_DUMP
|
MENUITEM " Scenario Shoppin&g Text Dump", IDM_SCEN_PASSWORD
|
||||||
MENUITEM " Scenario &Monster Dump", IDM_SCEN_ADV_TEXT_DUMP
|
MENUITEM " Scenario &Monster Dump", IDM_SCEN_PASSWORD
|
||||||
MENUITEM " Scenario Specials D&ump", IDM_SCEN_INTRO
|
MENUITEM " Scenario Specials D&ump", IDM_SCEN_PASSWORD
|
||||||
MENUITEM " Scenario Ob&ject Data Dump", IDM_SCEN_PASSWORD
|
MENUITEM " Scenario Ob&ject Data Dump", IDM_SCEN_PASSWORD
|
||||||
END
|
END
|
||||||
POPUP "&Town"
|
POPUP "&Town"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
// Include this last because some #defines in the Windows headers cause compile errors in my headers.
|
// Include this last because some #defines in the Windows headers cause compile errors in my headers.
|
||||||
// Fortunately they're on symbols not used in this file, so this should work.
|
// Fortunately they're on symbols not used in this file, so this should work.
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#undef HELP_INDEX // Except this one.
|
||||||
|
|
||||||
// This is the index of each menu on the menubar
|
// This is the index of each menu on the menubar
|
||||||
enum {
|
enum {
|
||||||
@@ -34,8 +35,8 @@ void setMenuCommand(HMENU& menu, int i, eMenu cmd) {
|
|||||||
MENUITEMINFOA item;
|
MENUITEMINFOA item;
|
||||||
item.cbSize = sizeof(MENUITEMINFOA);
|
item.cbSize = sizeof(MENUITEMINFOA);
|
||||||
item.fMask = MIIM_ID | MIIM_FTYPE;
|
item.fMask = MIIM_ID | MIIM_FTYPE;
|
||||||
GetMenuItemInfoA(file_menu, i++, true, &item);
|
GetMenuItemInfoA(menu, i++, true, &item);
|
||||||
if(info.fType == MFT_SEPARATOR) return;
|
if(item.fType == MFT_SEPARATOR) return;
|
||||||
menuChoices[item.wID] = cmd;
|
menuChoices[item.wID] = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,6 +208,7 @@ void shut_down_menus(short mode) {
|
|||||||
EnableMenuItem(out_menu, i, MF_GRAYED | MF_BYPOSITION);
|
EnableMenuItem(out_menu, i, MF_GRAYED | MF_BYPOSITION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DrawMenuBar(mainPtr.getSystemHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_file_menu(int item_hit);
|
void handle_file_menu(int item_hit);
|
||||||
@@ -227,7 +229,7 @@ LRESULT CALLBACK menuProc(HWND handle, UINT message, WPARAM wParam, LPARAM lPara
|
|||||||
handle_item_menu(cmd - 10000);
|
handle_item_menu(cmd - 10000);
|
||||||
} else if(cmd >= 20000 && cmd < 30000) { // Monster menus
|
} else if(cmd >= 20000 && cmd < 30000) { // Monster menus
|
||||||
handle_monst_menu(cmd - 20000);
|
handle_monst_menu(cmd - 20000);
|
||||||
} else handle_menu_choice(menuChoices[message]);
|
} 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.
|
||||||
|
|||||||
Reference in New Issue
Block a user