-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.js
More file actions
103 lines (92 loc) · 3.22 KB
/
settings.js
File metadata and controls
103 lines (92 loc) · 3.22 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import {
@ButtonProperty,
@CheckboxProperty,
Color,
@ColorProperty,
@PercentSliderProperty,
@SelectorProperty,
@SwitchProperty,
@TextProperty,
@Vigilant,
} from 'Vigilance';
// The only parameter that is required is the first, which should be the Module name.
// The other 2 parameters are optional.
// The 2nd parameter is the title of the settings window, seen in the top left above the
// category list.
// The 3rd parameter is an object that determines the sorting order of the categories.
@Vigilant('DungeonBreakerExtras', 'Advanced Settings', {
getCategoryComparator: () => (a, b) => {
const categories = ['Visuals', 'Nuker', "Extras"];
return categories.indexOf(a.name) - categories.indexOf(b.name);
},
getSubcategoryComparator: () => (a, b) => {
const subcategories = ["Render", "Nuker", "Dungeonbreaker"];
return subcategories.indexOf(a.getValue()[0].attributesExt.subcategory) - subcategories.indexOf(b.getValue()[0].attributesExt.subcategory);
},
getPropertyComparator: () => (a, b) => {
const names = ["Enable Visuals", "Color Picker", "Enable Nuker", "Pingless", "Auto swap", "Auto swap back", "Global Pingless"];
return names.indexOf(a.attributesExt.name) - names.indexOf(b.attributesExt.name);
}
})
class Settings {
@SwitchProperty({
name: 'Enable Visuals',
description: 'Renders filled box on config blocks',
category: 'Visuals',
subcategory: 'Render',
placeholder: 'Activate',
})
enabledVisuals = true;
@ColorProperty({
name: 'Color Picker',
description: 'Pick a color for config blocks',
category: 'Visuals',
subcategory: 'Render',
})
color = Color.BLUE;
@SwitchProperty({
name: 'Enable Nuker',
description: 'Automatically breaks config blocks',
category: 'Nuker',
subcategory: 'Nuker',
placeholder: 'Activate',
})
enabledNuker = true;
@SwitchProperty({
name: 'Pingless',
description: 'Instantly removes config blocks clientside',
category: 'Nuker',
subcategory: 'Nuker',
placeholder: 'Activate',
})
pingless = true;
@SwitchProperty({
name: 'Auto swap',
description: 'Swaps to dungeonbreaker when blocks can be nuked.',
category: 'Nuker',
subcategory: 'Nuker',
placeholder: 'Activate',
})
autoSwap = true;
@SwitchProperty({
name: 'Auto swap back',
description: 'Returns to the item you were holding once nuking stops.',
category: 'Nuker',
subcategory: 'Nuker',
placeholder: 'Activate',
})
autoSwapBack = false;
@SwitchProperty({
name: 'Global Pingless',
description: 'Instantly removes all blocks mined with dungeonbreaker clientside. (for blocks that can not be instamined eg. wood/obsidian)',
category: 'Extras',
subcategory: 'Dungeonbreaker',
placeholder: 'Activate',
})
globalPingless = false;
constructor() {
this.initialize(this);
this.setCategoryDescription('Nuker', 'All available nuker settings should be watchdog safe unless specified.');
}
}
export default new Settings();