Advertisement
matekaOSF2

Untitled

Nov 28th, 2021
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. class Window [
  2. Table flags -> default location for values
  3.  
  4. Method Section(name)
  5. @name -> text for the Section
  6.  
  7. Method Toggle(name, options, callback)
  8. @name -> text for toggle
  9. @options -> array
  10. location (table) -> alternate table to put value in (default = window.flags)
  11. flag (string) -> index for value (e.g location.farming)
  12. @callback -> function to call when toggle is changed
  13.  
  14. return -> [
  15. Method Set(number) -> sets toggle value
  16. ]
  17.  
  18. Method Slider(name, options, callback)
  19. @name -> text for slider
  20. @options -> array
  21. location (table) -> alternate table to put value in (default = window.flags)
  22. flag (string) -> index for value (e.g location.farming)
  23. precise (boolean) -> wether to show full number or not -- e.g 0, 1 vs 0, 0.1, 0.2, ...
  24. default (number) -> default slider value
  25. min, max (number) -> self explanatory
  26. @callback(value) -> function to call when slider is changed
  27.  
  28. return -> [
  29. Method Set(number) -> sets slider value
  30. ]
  31.  
  32. Method Dropdown(name, options, callback)
  33. @name -> text for dropdown
  34. @options -> array
  35. location (table) -> alternate table to put value in (default = window.flags)
  36. flag (string) -> index for value (e.g location.farming)
  37. list -> list of objects to display
  38. @callback(new) -> function to call when dropdown is changed
  39.  
  40. return -> [
  41. Method Refresh(array) -> resets dropdown.list and sets value to first value in array
  42. ]
  43.  
  44. Method Button(name, callback)
  45. @name -> text for button
  46. @callback -> function to call when button is clicked
  47.  
  48. return -> [
  49. Method Fire(<void>) -> calls callback
  50. ]
  51.  
  52. Method Bind(name, options, callback)
  53. @name -> text for keybind
  54. @options -> array
  55. location (table) -> alternate table to put value in (default = window.flags)
  56. flag (string) -> index for value (e.g location.farming)
  57. kbonly (bool) -> keyboard keys only (no mouse)
  58. default (bool) -> default key for bind;
  59.  
  60. @callback(key) -> function to call when bind is changed
  61.  
  62. Method Box(name, options, callback)
  63. @name -> text for box
  64. @options -> array
  65. location (table) -> alternate table to put value in (default = window.flags)
  66. flag (string) -> index for value (e.g location.farming)
  67. min, max (number) -> self explanatory
  68. type (string) -> if type is "number", box will only accept numbers
  69.  
  70. @callback(box, new, old, enter) -> function to call when box is changed
  71. box -> box object;
  72. new -> new value;
  73. old -> old value;
  74. enter -> wether enter was pressed
  75.  
  76. returns -> box object (Instance)
  77.  
  78. Method SearchBox(name, options, callback)
  79. @name -> text for searchbox
  80. @options -> array
  81. location (table) -> alternate table to put value in (default = window.flags)
  82. flag (string) -> index for value (e.g location.farming)
  83. list -> list of objects to search for
  84. @callback(new) -> function to call when dropdown is changed
  85.  
  86. return -> [
  87. Method Refresh(array) -> resets dropdown.list and sets value to first value in array
  88. ]
  89. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement