aboutsummaryrefslogtreecommitdiff
path: root/features/improvements/index.js
blob: fa573af94b18bd94042224c82f46aefa583d71e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/// <reference types="../../../CTAutocomplete" />
/// <reference lib="es2015" />
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()){
                if(color.length > 6) return
                cancel(event)
                ChatLib.chat(color + "&m" + ChatLib.getChatBreak(" ") + "&r");
            }
        }).trigger.triggerIfCanceled(false)
        this.registerCommand("dung", (...args)=>{
            ChatLib.command("warp dungeon_hub")
        })
    }

    initVariables(){
        this.betterLineBreaks = undefined
    }

    onDisable(){
        this.initVariables()
    }
}

module.exports = {
    class: new Improvements()
}