mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
WAGE: Implement API to enable/disable menu items
This commit is contained in:
parent
c02c36ce88
commit
7e8c1028d3
@ -707,6 +707,8 @@ Designed *Gui::mouseUp(int x, int y) {
|
||||
(_selectionEndX == _selectionStartX && _selectionEndY == _selectionStartY)) {
|
||||
_selectionStartY = _selectionEndY = -1;
|
||||
_consoleFullRedraw = true;
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,25 +79,6 @@ struct MenuItem {
|
||||
MenuItem(const char *n) : name(n) {}
|
||||
};
|
||||
|
||||
enum {
|
||||
kMenuActionAbout,
|
||||
kMenuActionNew,
|
||||
kMenuActionOpen,
|
||||
kMenuActionClose,
|
||||
kMenuActionSave,
|
||||
kMenuActionSaveAs,
|
||||
kMenuActionRevert,
|
||||
kMenuActionQuit,
|
||||
|
||||
kMenuActionUndo,
|
||||
kMenuActionCut,
|
||||
kMenuActionCopy,
|
||||
kMenuActionPaste,
|
||||
kMenuActionClear,
|
||||
|
||||
kMenuActionCommand
|
||||
};
|
||||
|
||||
struct MenuData {
|
||||
int menunum;
|
||||
const char *title;
|
||||
@ -568,5 +549,10 @@ void Menu::processMenuShortCut(byte flags, uint16 ascii) {
|
||||
}
|
||||
}
|
||||
|
||||
void Menu::enableCommand(int menunum, int action, bool state) {
|
||||
for (int i = 0; i < _items[menunum]->subitems.size(); i++)
|
||||
if (_items[menunum]->subitems[i]->action == action)
|
||||
_items[menunum]->subitems[i]->enabled = state;
|
||||
}
|
||||
|
||||
} // End of namespace Wage
|
||||
|
@ -63,6 +63,25 @@ enum {
|
||||
kFontStyleExtended = 64
|
||||
};
|
||||
|
||||
enum {
|
||||
kMenuActionAbout,
|
||||
kMenuActionNew,
|
||||
kMenuActionOpen,
|
||||
kMenuActionClose,
|
||||
kMenuActionSave,
|
||||
kMenuActionSaveAs,
|
||||
kMenuActionRevert,
|
||||
kMenuActionQuit,
|
||||
|
||||
kMenuActionUndo,
|
||||
kMenuActionCut,
|
||||
kMenuActionCopy,
|
||||
kMenuActionPaste,
|
||||
kMenuActionClear,
|
||||
|
||||
kMenuActionCommand
|
||||
};
|
||||
|
||||
class Menu {
|
||||
public:
|
||||
Menu(Gui *gui);
|
||||
@ -76,6 +95,7 @@ public:
|
||||
void regenCommandsMenu();
|
||||
void regenWeaponsMenu();
|
||||
void processMenuShortCut(byte flags, uint16 ascii);
|
||||
void enableCommand(int menunum, int action, bool state);
|
||||
|
||||
bool _menuActivated;
|
||||
Common::Rect _bbox;
|
||||
|
Loading…
x
Reference in New Issue
Block a user