slashkeyvalue

fwGui

Aug 2nd, 2021 (edited)
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class fwGuiText
  2. {
  3.     content: string;
  4.  
  5.     font: string;
  6. }
  7.  
  8. class fwGuiMenuItem
  9. {
  10.     text: fwGuiText;
  11.  
  12.     isFocused: boolean;
  13.  
  14.     onHover(): void { };
  15.     onFocus(): void { };
  16. }
  17.  
  18. class fwGuiButton extends fwGuiMenuItem
  19. {
  20.     onSelect(): void { }; // Enter or Mouse
  21. }
  22.  
  23. class fwGuiDropdown extends fwGuiButton
  24. {
  25.  
  26. }
  27.  
  28. class fwGuiMenu
  29. {
  30.     text: fwGuiText;
  31.  
  32.     isActive: boolean;
  33.  
  34.     items: fwGuiMenuItem[];
  35.  
  36.     focusedItem: fwGuiMenuItem;
  37.  
  38.     onOpen(): void { };
  39.     onClose(): void { };
  40. }
  41.  
  42. enum fwGuiWindowConfigFlags
  43. {
  44.     NavEnableKeyboard = 1 << 0,
  45.     NavEnableGamepad = 1 << 1,
  46. }
  47.  
  48. class fwGuiWindow
  49. {
  50.     isOpen: boolean;
  51.  
  52.     configFlags: fwGuiWindowConfigFlags = 0;
  53.  
  54.     menus: fwGuiMenu[];
  55.  
  56.     activeMenu: fwGuiMenu;
  57. }
Add Comment
Please, Sign In to add comment