aboutsummaryrefslogtreecommitdiff
path: root/src/features/settings/settingThings/button.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/settings/settingThings/button.js')
-rw-r--r--src/features/settings/settingThings/button.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/features/settings/settingThings/button.js b/src/features/settings/settingThings/button.js
new file mode 100644
index 0000000..77ba4b8
--- /dev/null
+++ b/src/features/settings/settingThings/button.js
@@ -0,0 +1,18 @@
+import SoopyMouseClickEvent from "../../../../guimanager/EventListener/SoopyMouseClickEvent";
+import ButtonWithArrow from "../../../../guimanager/GuiElement/ButtonWithArrow";
+import SettingBase from "./settingBase";
+
+class ButtonSetting extends SettingBase {
+ constructor(name, description, settingId, module, buttonText, buttonFunction, defaultValue=null){
+ super(name, description, defaultValue, settingId, module)
+
+ this.buttonObject = new ButtonWithArrow().setLocation(0, 0.3, 0.8, 0.4).setText("ยง0"+buttonText)
+ this.settingObject.addChild(this.buttonObject)
+
+ this.buttonObject.addEvent(new SoopyMouseClickEvent().setHandler(()=>{
+ buttonFunction.call(this)
+ }))
+ }
+}
+
+export default ButtonSetting \ No newline at end of file