Windows: Fix check state after menu translate.

The caching in SetIngameMenuItemStates was pointless, and buggy on
language change.
This commit is contained in:
Unknown W. Brackets 2017-04-04 21:01:05 -07:00
parent 47284905a4
commit c3a4f53755
2 changed files with 3 additions and 9 deletions

View File

@ -466,6 +466,9 @@ namespace MainWindow
for (int i = 0; i < GetMenuItemCount(menu); i++) {
SetMenuInfo(GetSubMenu(menu,i), &info);
}
// Always translate first: translating resets the menu.
TranslateMenus(hwndMain, menu);
UpdateMenus();
// Accept dragged files.

View File

@ -53,15 +53,6 @@ namespace MainWindow {
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
void SetIngameMenuItemStates(HMENU menu, const GlobalUIState state) {
static GlobalUIState lastGlobalUIState = UISTATE_PAUSEMENU;
static bool lastUMDPermit = false;
if (lastGlobalUIState == GetUIState() && lastUMDPermit == getUMDReplacePermit())
return;
lastGlobalUIState = GetUIState();
lastUMDPermit = getUMDReplacePermit();
UINT menuEnable = state == UISTATE_INGAME ? MF_ENABLED : MF_GRAYED;
UINT umdSwitchEnable = state == UISTATE_INGAME && getUMDReplacePermit() ? MF_ENABLED : MF_GRAYED;