mainmenu.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include <lib/std.mi>
  2. #include "attribs.m"
  3. System.onScriptLoaded() {
  4. initAttribs();
  5. menubar_main_attrib.onDataChanged();
  6. }
  7. menubar_main_attrib.onDataChanged() {
  8. Group Player = getscriptgroup().findobject("player.content.dummy.group");
  9. Group MenuBar = getscriptgroup().findobject("wasabi.menubar");
  10. if (getData() == "1") {
  11. Player.setXmlParam("y","0");
  12. MenuBar.show();
  13. } else {
  14. Player.setXmlParam("y","-17");
  15. MenuBar.hide();
  16. }
  17. }
  18. System.onAccelerator(String action, String section, String key) {
  19. if (menubar_main_attrib.getData() == "0") return;
  20. Layout l = getScriptGroup().getParentLayout();
  21. if (!l.isActive()) return;
  22. if (action == "MENUHOTKEY_FILE")
  23. {
  24. getScriptGroup().findObject("File.menu").sendAction("open", "", 0, 0, 0, 0);
  25. complete;
  26. }
  27. if (action == "MENUHOTKEY_PLAY")
  28. {
  29. getScriptGroup().findObject("Play.menu").sendAction("open", "", 0, 0, 0, 0);
  30. complete;
  31. }
  32. if (action == "MENUHOTKEY_OPTIONS")
  33. {
  34. getScriptGroup().findObject("Options.menu").sendAction("open", "", 0, 0, 0, 0);
  35. complete;
  36. }
  37. if (action == "MENUHOTKEY_VIEW")
  38. {
  39. getScriptGroup().findObject("View.menu").sendAction("open", "", 0, 0, 0, 0);
  40. complete;
  41. }
  42. if (action == "MENUHOTKEY_HELP")
  43. {
  44. getScriptGroup().findObject("Help.menu").sendAction("open", "", 0, 0, 0, 0);
  45. complete;
  46. }
  47. }