From 48653ec89538f1650106a5e77463412cad4684c2 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sun, 31 Oct 2021 09:49:42 +0800 Subject: first commit --- features/improvements/index.js | 36 ++++++++++++++++++++++++++++++++++++ features/improvements/metadata.json | 8 ++++++++ 2 files changed, 44 insertions(+) create mode 100644 features/improvements/index.js create mode 100644 features/improvements/metadata.json (limited to 'features/improvements') diff --git a/features/improvements/index.js b/features/improvements/index.js new file mode 100644 index 0000000..4d003f3 --- /dev/null +++ b/features/improvements/index.js @@ -0,0 +1,36 @@ +/// +/// +import Feature from "../../featureClass/class"; +import ToggleSetting from "../settings/settingThings/toggle"; + +class Improvements extends Feature { + constructor() { + super() + } + + onEnable(){ + this.initVariables() + + this.betterLineBreaks = new ToggleSetting("Better line breaks", "Changes all dashed lines (-------) in chat into solid lines", true, "better_line_breaks", this) + + this.registerChat("${color}-----------------------------------------------------&r", (color, event)=>{ + if(this.betterLineBreaks.getValue()){ + cancel(event) + ChatLib.chat(color + "&m" + ChatLib.getChatBreak(" ") + "&r"); + } + }).trigger.triggerIfCanceled(false) + } + + + initVariables(){ + this.betterLineBreaks = undefined + } + + onDisable(){ + this.initVariables() + } +} + +module.exports = { + class: new Improvements() +} \ No newline at end of file diff --git a/features/improvements/metadata.json b/features/improvements/metadata.json new file mode 100644 index 0000000..4e147f6 --- /dev/null +++ b/features/improvements/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "Improvements", + "description": "A bunch of random features that improve aspects of the game", + "isHidden": false, + "isTogglable": true, + "defaultEnabled": true, + "sortA": 1 +} \ No newline at end of file -- cgit