tgui-core 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProgressBar.module-BkAFfFy0.js +29 -0
- package/dist/Section.module-CLVHJ4yA.js +15 -0
- package/dist/assets/BlockQuote.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/ColorBox.css +1 -0
- package/dist/assets/Dialog.css +1 -0
- package/dist/assets/Dimmer.css +1 -0
- package/dist/assets/Divider.css +1 -0
- package/dist/assets/Flex.css +1 -0
- package/dist/assets/Icon.css +6 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Knob.css +1 -0
- package/dist/assets/LabeledList.css +1 -0
- package/dist/assets/MenuBar.css +1 -0
- package/dist/assets/Modal.css +1 -0
- package/dist/assets/NoticeBox.css +1 -0
- package/dist/assets/NumberInput.css +1 -0
- package/dist/assets/ProgressBar.css +1 -0
- package/dist/assets/RoundGauge.css +1 -0
- package/dist/assets/Section.css +1 -0
- package/dist/assets/Slider.css +1 -0
- package/dist/assets/Stack.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -0
- package/dist/assets/TextArea.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/common/assets.d.ts +4 -0
- package/dist/common/assets.js +25 -0
- package/dist/common/collections.d.ts +10 -0
- package/dist/common/collections.js +15 -0
- package/dist/common/color.d.ts +25 -0
- package/dist/common/color.js +69 -0
- package/dist/common/constants.d.ts +102 -0
- package/dist/common/constants.js +312 -0
- package/dist/common/events.d.ts +33 -0
- package/dist/common/events.js +147 -0
- package/{lib/common/exhaustive.ts → dist/common/exhaustive.d.ts} +1 -3
- package/dist/common/exhaustive.js +6 -0
- package/dist/common/format.d.ts +11 -0
- package/dist/common/format.js +114 -0
- package/{lib/common/fp.ts → dist/common/fp.d.ts} +2 -16
- package/dist/common/fp.js +9 -0
- package/dist/common/hotkeys.d.ts +25 -0
- package/dist/common/hotkeys.js +112 -0
- package/dist/common/http.d.ts +4 -0
- package/dist/common/http.js +10 -0
- package/dist/common/keycodes.d.ts +85 -0
- package/dist/common/keycodes.js +88 -0
- package/{lib/common/keys.ts → dist/common/keys.d.ts} +21 -24
- package/dist/common/keys.js +8 -0
- package/dist/common/math.d.ts +39 -0
- package/dist/common/math.js +41 -0
- package/dist/common/perf.d.ts +24 -0
- package/dist/common/perf.js +33 -0
- package/dist/common/random.d.ts +16 -0
- package/dist/common/random.js +18 -0
- package/dist/common/react.d.ts +23 -0
- package/dist/common/react.js +30 -0
- package/dist/common/redux.d.ts +64 -0
- package/dist/common/redux.js +72 -0
- package/dist/common/storage.d.ts +24 -0
- package/dist/common/storage.js +133 -0
- package/dist/common/string.d.ts +65 -0
- package/dist/common/string.js +83 -0
- package/dist/common/timer.d.ts +18 -0
- package/dist/common/timer.js +28 -0
- package/dist/common/type-utils.d.ts +9 -0
- package/dist/common/type-utils.js +25 -0
- package/dist/common/uuid.d.ts +9 -0
- package/dist/common/uuid.js +10 -0
- package/dist/components/AnimatedNumber.d.ts +60 -0
- package/dist/components/AnimatedNumber.js +76 -0
- package/dist/components/Autofocus.d.ts +4 -0
- package/dist/components/Autofocus.js +17 -0
- package/dist/components/Blink.d.ts +26 -0
- package/dist/components/Blink.js +56 -0
- package/dist/components/BlockQuote.d.ts +3 -0
- package/dist/components/BlockQuote.js +13 -0
- package/dist/components/BodyZoneSelector.d.ts +28 -0
- package/dist/components/BodyZoneSelector.js +115 -0
- package/dist/components/Box.d.ts +91 -0
- package/dist/components/Box.js +133 -0
- package/dist/components/Button.d.ts +93 -0
- package/dist/components/Button.js +298 -0
- package/dist/components/ByondUi.js +73 -0
- package/dist/components/Chart.d.ts +28 -0
- package/dist/components/Chart.js +95 -0
- package/dist/components/Collapsible.d.ts +15 -0
- package/dist/components/Collapsible.js +27 -0
- package/dist/components/ColorBox.d.ts +8 -0
- package/dist/components/ColorBox.js +24 -0
- package/dist/components/Dialog.d.ts +24 -0
- package/dist/components/Dialog.js +67 -0
- package/dist/components/Dimmer.d.ts +3 -0
- package/dist/components/Dimmer.js +13 -0
- package/dist/components/Divider.d.ts +6 -0
- package/dist/components/Divider.js +22 -0
- package/dist/components/DmIcon.d.ts +33 -0
- package/dist/components/DmIcon.js +29 -0
- package/dist/components/DraggableControl.js +176 -0
- package/dist/components/Dropdown.d.ts +48 -0
- package/dist/components/Dropdown.js +152 -0
- package/dist/components/FakeTerminal.js +38 -0
- package/dist/components/FitText.d.ts +22 -0
- package/dist/components/FitText.js +63 -0
- package/dist/components/Flex.d.ts +93 -0
- package/dist/components/Flex.js +72 -0
- package/dist/components/Icon.d.ts +30 -0
- package/dist/components/Icon.js +51 -0
- package/dist/components/Image.d.ts +14 -0
- package/dist/components/Image.js +35 -0
- package/dist/components/InfinitePlane.js +139 -0
- package/dist/components/Input.d.ts +61 -0
- package/dist/components/Input.js +89 -0
- package/dist/components/KeyListener.d.ts +15 -0
- package/dist/components/KeyListener.js +23 -0
- package/dist/components/Knob.d.ts +49 -0
- package/dist/components/Knob.js +162 -0
- package/dist/components/LabeledControls.d.ts +11 -0
- package/dist/components/LabeledControls.js +39 -0
- package/dist/components/LabeledList.d.ts +57 -0
- package/dist/components/LabeledList.js +94 -0
- package/dist/components/MenuBar.d.ts +28 -0
- package/dist/components/MenuBar.js +174 -0
- package/dist/components/Modal.d.ts +3 -0
- package/dist/components/Modal.js +25 -0
- package/dist/components/NoticeBox.d.ts +20 -0
- package/dist/components/NoticeBox.js +49 -0
- package/dist/components/NumberInput.d.ts +45 -0
- package/dist/components/NumberInput.js +221 -0
- package/dist/components/Popper.d.ts +27 -0
- package/dist/components/Popper.js +177 -0
- package/dist/components/ProgressBar.d.ts +46 -0
- package/dist/components/ProgressBar.js +37 -0
- package/dist/components/RestrictedInput.js +155 -0
- package/dist/components/RoundGauge.d.ts +53 -0
- package/dist/components/RoundGauge.js +147 -0
- package/dist/components/Section.d.ts +63 -0
- package/dist/components/Section.js +62 -0
- package/dist/components/Slider.d.ts +46 -0
- package/dist/components/Slider.js +124 -0
- package/dist/components/Stack.d.ts +27 -0
- package/dist/components/Stack.js +67 -0
- package/dist/components/StyleableSection.d.ts +11 -0
- package/dist/components/StyleableSection.js +16 -0
- package/dist/components/Table.d.ts +29 -0
- package/dist/components/Table.js +67 -0
- package/dist/components/Tabs.d.ts +23 -0
- package/dist/components/Tabs.js +89 -0
- package/dist/components/TextArea.d.ts +39 -0
- package/dist/components/TextArea.js +118 -0
- package/dist/components/TimeDisplay.js +34 -0
- package/dist/components/Tooltip.d.ts +29 -0
- package/dist/components/Tooltip.js +83 -0
- package/dist/components/TrackOutsideClicks.d.ts +13 -0
- package/dist/components/TrackOutsideClicks.js +24 -0
- package/dist/components/VirtualList.d.ts +8 -0
- package/dist/components/VirtualList.js +34 -0
- package/dist/components/index.js +92 -0
- package/dist/popper-CiqSDJTE.js +906 -0
- package/package.json +8 -10
- package/lib/common/assets.ts +0 -38
- package/lib/common/collections.ts +0 -27
- package/lib/common/color.ts +0 -88
- package/lib/common/constants.ts +0 -349
- package/lib/common/events.ts +0 -262
- package/lib/common/format.ts +0 -167
- package/lib/common/hotkeys.ts +0 -207
- package/lib/common/http.ts +0 -16
- package/lib/common/keycodes.ts +0 -86
- package/lib/common/math.ts +0 -76
- package/lib/common/perf.ts +0 -72
- package/lib/common/random.ts +0 -32
- package/lib/common/react.ts +0 -59
- package/lib/common/redux.ts +0 -187
- package/lib/common/storage.ts +0 -207
- package/lib/common/string.ts +0 -169
- package/lib/common/timer.ts +0 -63
- package/lib/common/type-utils.ts +0 -41
- package/lib/common/types.d.ts +0 -12
- package/lib/common/uuid.ts +0 -18
- package/lib/components/AnimatedNumber.tsx +0 -180
- package/lib/components/Autofocus.tsx +0 -23
- package/lib/components/Blink.tsx +0 -91
- package/lib/components/BlockQuote.tsx +0 -9
- package/lib/components/BodyZoneSelector.tsx +0 -149
- package/lib/components/Box.tsx +0 -252
- package/lib/components/Button.tsx +0 -425
- package/lib/components/ByondUi.jsx +0 -110
- package/lib/components/Chart.tsx +0 -155
- package/lib/components/Collapsible.tsx +0 -43
- package/lib/components/ColorBox.tsx +0 -29
- package/lib/components/Dialog.tsx +0 -81
- package/lib/components/Dimmer.tsx +0 -13
- package/lib/components/Divider.tsx +0 -20
- package/lib/components/DmIcon.tsx +0 -86
- package/lib/components/DraggableControl.jsx +0 -276
- package/lib/components/Dropdown.tsx +0 -246
- package/lib/components/FakeTerminal.jsx +0 -52
- package/lib/components/FitText.tsx +0 -99
- package/lib/components/Flex.tsx +0 -159
- package/lib/components/Icon.tsx +0 -95
- package/lib/components/Image.tsx +0 -54
- package/lib/components/InfinitePlane.jsx +0 -192
- package/lib/components/Input.tsx +0 -176
- package/lib/components/KeyListener.tsx +0 -40
- package/lib/components/Knob.tsx +0 -178
- package/lib/components/LabeledControls.tsx +0 -44
- package/lib/components/LabeledList.tsx +0 -154
- package/lib/components/MenuBar.tsx +0 -228
- package/lib/components/Modal.tsx +0 -23
- package/lib/components/NoticeBox.tsx +0 -45
- package/lib/components/NumberInput.tsx +0 -328
- package/lib/components/Popper.tsx +0 -100
- package/lib/components/ProgressBar.tsx +0 -105
- package/lib/components/RestrictedInput.jsx +0 -301
- package/lib/components/RoundGauge.tsx +0 -180
- package/lib/components/Section.tsx +0 -120
- package/lib/components/Slider.tsx +0 -169
- package/lib/components/Stack.tsx +0 -96
- package/lib/components/StyleableSection.tsx +0 -33
- package/lib/components/Table.tsx +0 -84
- package/lib/components/Tabs.tsx +0 -89
- package/lib/components/TextArea.tsx +0 -182
- package/lib/components/TimeDisplay.jsx +0 -64
- package/lib/components/Tooltip.tsx +0 -152
- package/lib/components/TrackOutsideClicks.tsx +0 -35
- package/lib/components/VirtualList.tsx +0 -69
- package/lib/styles/atomic/candystripe.scss +0 -8
- package/lib/styles/atomic/centered-image.scss +0 -7
- package/lib/styles/atomic/color.scss +0 -21
- package/lib/styles/atomic/debug-layout.scss +0 -17
- package/lib/styles/atomic/fit-text.scss +0 -14
- package/lib/styles/atomic/links.scss +0 -12
- package/lib/styles/atomic/outline.scss +0 -47
- package/lib/styles/atomic/text.scss +0 -44
- package/lib/styles/base.scss +0 -32
- package/lib/styles/colors.scss +0 -92
- package/lib/styles/components/BlockQuote.module.scss +0 -20
- package/lib/styles/components/BlockQuote.module.scss.d.ts +0 -4
- package/lib/styles/components/Button.module.scss +0 -157
- package/lib/styles/components/Button.module.scss.d.ts +0 -46
- package/lib/styles/components/ColorBox.module.scss +0 -12
- package/lib/styles/components/ColorBox.module.scss.d.ts +0 -4
- package/lib/styles/components/Dialog.module.scss +0 -60
- package/lib/styles/components/Dialog.module.scss.d.ts +0 -10
- package/lib/styles/components/Dimmer.module.scss +0 -22
- package/lib/styles/components/Dimmer.module.scss.d.ts +0 -4
- package/lib/styles/components/Divider.module.scss +0 -27
- package/lib/styles/components/Divider.module.scss.d.ts +0 -6
- package/lib/styles/components/Dropdown.scss +0 -72
- package/lib/styles/components/Flex.module.scss +0 -13
- package/lib/styles/components/Flex.module.scss.d.ts +0 -5
- package/lib/styles/components/Icon.module.scss +0 -25
- package/lib/styles/components/Icon.module.scss.d.ts +0 -5
- package/lib/styles/components/Input.module.scss +0 -64
- package/lib/styles/components/Input.module.scss.d.ts +0 -8
- package/lib/styles/components/Knob.module.scss +0 -131
- package/lib/styles/components/Knob.module.scss.d.ts +0 -33
- package/lib/styles/components/LabeledList.module.scss +0 -49
- package/lib/styles/components/LabeledList.module.scss.d.ts +0 -8
- package/lib/styles/components/MenuBar.module.scss +0 -75
- package/lib/styles/components/MenuBar.module.scss.d.ts +0 -14
- package/lib/styles/components/Modal.module.scss +0 -14
- package/lib/styles/components/Modal.module.scss.d.ts +0 -4
- package/lib/styles/components/NoticeBox.module.scss +0 -65
- package/lib/styles/components/NoticeBox.module.scss.d.ts +0 -27
- package/lib/styles/components/NumberInput.module.scss +0 -71
- package/lib/styles/components/NumberInput.module.scss.d.ts +0 -9
- package/lib/styles/components/ProgressBar.module.scss +0 -63
- package/lib/styles/components/ProgressBar.module.scss.d.ts +0 -27
- package/lib/styles/components/RoundGauge.module.scss +0 -85
- package/lib/styles/components/RoundGauge.module.scss.d.ts +0 -49
- package/lib/styles/components/Section.module.scss +0 -130
- package/lib/styles/components/Section.module.scss.d.ts +0 -13
- package/lib/styles/components/Slider.module.scss +0 -54
- package/lib/styles/components/Slider.module.scss.d.ts +0 -8
- package/lib/styles/components/Stack.module.scss +0 -60
- package/lib/styles/components/Stack.module.scss.d.ts +0 -12
- package/lib/styles/components/Table.module.scss +0 -44
- package/lib/styles/components/Table.module.scss.d.ts +0 -10
- package/lib/styles/components/Tabs.module.scss +0 -144
- package/lib/styles/components/Tabs.module.scss.d.ts +0 -35
- package/lib/styles/components/TextArea.module.scss +0 -86
- package/lib/styles/components/TextArea.module.scss.d.ts +0 -11
- package/lib/styles/components/Tooltip.module.scss +0 -24
- package/lib/styles/components/Tooltip.module.scss.d.ts +0 -4
- package/lib/styles/functions.scss +0 -79
- package/lib/styles/input.scss +0 -9
- package/lib/styles/main.scss +0 -20
- package/lib/styles/reset.scss +0 -68
- /package/{lib/components/index.ts → dist/components/index.d.ts} +0 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
const t = 2, n = 1, i = 0, m = -1, c = {
|
|
2
|
+
// Department colors
|
|
3
|
+
department: {
|
|
4
|
+
captain: "#c06616",
|
|
5
|
+
security: "#e74c3c",
|
|
6
|
+
medbay: "#3498db",
|
|
7
|
+
science: "#9b59b6",
|
|
8
|
+
engineering: "#f1c40f",
|
|
9
|
+
cargo: "#f39c12",
|
|
10
|
+
service: "#7cc46a",
|
|
11
|
+
centcom: "#00c100",
|
|
12
|
+
other: "#c38312"
|
|
13
|
+
},
|
|
14
|
+
// Damage type colors
|
|
15
|
+
damageType: {
|
|
16
|
+
oxy: "#3498db",
|
|
17
|
+
toxin: "#2ecc71",
|
|
18
|
+
burn: "#e67e22",
|
|
19
|
+
brute: "#e74c3c"
|
|
20
|
+
},
|
|
21
|
+
// reagent / chemistry related colours
|
|
22
|
+
reagent: {
|
|
23
|
+
acidicbuffer: "#fbc314",
|
|
24
|
+
basicbuffer: "#3853a4"
|
|
25
|
+
}
|
|
26
|
+
}, u = [
|
|
27
|
+
"average",
|
|
28
|
+
"bad",
|
|
29
|
+
"black",
|
|
30
|
+
"blue",
|
|
31
|
+
"brown",
|
|
32
|
+
"good",
|
|
33
|
+
"green",
|
|
34
|
+
"grey",
|
|
35
|
+
"label",
|
|
36
|
+
"olive",
|
|
37
|
+
"orange",
|
|
38
|
+
"pink",
|
|
39
|
+
"purple",
|
|
40
|
+
"red",
|
|
41
|
+
"teal",
|
|
42
|
+
"transparent",
|
|
43
|
+
"violet",
|
|
44
|
+
"white",
|
|
45
|
+
"yellow"
|
|
46
|
+
], d = [
|
|
47
|
+
{
|
|
48
|
+
name: "Syndicate",
|
|
49
|
+
freq: 1213,
|
|
50
|
+
color: "#8f4a4b"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "Red Team",
|
|
54
|
+
freq: 1215,
|
|
55
|
+
color: "#ff4444"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "Blue Team",
|
|
59
|
+
freq: 1217,
|
|
60
|
+
color: "#3434fd"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "Green Team",
|
|
64
|
+
freq: 1219,
|
|
65
|
+
color: "#34fd34"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "Yellow Team",
|
|
69
|
+
freq: 1221,
|
|
70
|
+
color: "#fdfd34"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "CentCom",
|
|
74
|
+
freq: 1337,
|
|
75
|
+
color: "#2681a5"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "Supply",
|
|
79
|
+
freq: 1347,
|
|
80
|
+
color: "#b88646"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Service",
|
|
84
|
+
freq: 1349,
|
|
85
|
+
color: "#6ca729"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "Science",
|
|
89
|
+
freq: 1351,
|
|
90
|
+
color: "#c68cfa"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "Command",
|
|
94
|
+
freq: 1353,
|
|
95
|
+
color: "#fcdf03"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "Medical",
|
|
99
|
+
freq: 1355,
|
|
100
|
+
color: "#57b8f0"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "Engineering",
|
|
104
|
+
freq: 1357,
|
|
105
|
+
color: "#f37746"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "Security",
|
|
109
|
+
freq: 1359,
|
|
110
|
+
color: "#dd3535"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "AI Private",
|
|
114
|
+
freq: 1447,
|
|
115
|
+
color: "#d65d95"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Common",
|
|
119
|
+
freq: 1459,
|
|
120
|
+
color: "#1ecc43"
|
|
121
|
+
}
|
|
122
|
+
], e = [
|
|
123
|
+
{
|
|
124
|
+
id: "o2",
|
|
125
|
+
path: "/datum/gas/oxygen",
|
|
126
|
+
name: "Oxygen",
|
|
127
|
+
label: "O₂",
|
|
128
|
+
color: "blue"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "n2",
|
|
132
|
+
path: "/datum/gas/nitrogen",
|
|
133
|
+
name: "Nitrogen",
|
|
134
|
+
label: "N₂",
|
|
135
|
+
color: "yellow"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "co2",
|
|
139
|
+
path: "/datum/gas/carbon_dioxide",
|
|
140
|
+
name: "Carbon Dioxide",
|
|
141
|
+
label: "CO₂",
|
|
142
|
+
color: "grey"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "plasma",
|
|
146
|
+
path: "/datum/gas/plasma",
|
|
147
|
+
name: "Plasma",
|
|
148
|
+
label: "Plasma",
|
|
149
|
+
color: "pink"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "water_vapor",
|
|
153
|
+
path: "/datum/gas/water_vapor",
|
|
154
|
+
name: "Water Vapor",
|
|
155
|
+
label: "H₂O",
|
|
156
|
+
color: "lightsteelblue"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: "hypernoblium",
|
|
160
|
+
path: "/datum/gas/hypernoblium",
|
|
161
|
+
name: "Hyper-noblium",
|
|
162
|
+
label: "Hyper-nob",
|
|
163
|
+
color: "teal"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: "n2o",
|
|
167
|
+
path: "/datum/gas/nitrous_oxide",
|
|
168
|
+
name: "Nitrous Oxide",
|
|
169
|
+
label: "N₂O",
|
|
170
|
+
color: "bisque"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "no2",
|
|
174
|
+
path: "/datum/gas/nitrium",
|
|
175
|
+
name: "Nitrium",
|
|
176
|
+
label: "Nitrium",
|
|
177
|
+
color: "brown"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: "tritium",
|
|
181
|
+
path: "/datum/gas/tritium",
|
|
182
|
+
name: "Tritium",
|
|
183
|
+
label: "Tritium",
|
|
184
|
+
color: "limegreen"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: "bz",
|
|
188
|
+
path: "/datum/gas/bz",
|
|
189
|
+
name: "BZ",
|
|
190
|
+
label: "BZ",
|
|
191
|
+
color: "mediumpurple"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "pluoxium",
|
|
195
|
+
path: "/datum/gas/pluoxium",
|
|
196
|
+
name: "Pluoxium",
|
|
197
|
+
label: "Pluoxium",
|
|
198
|
+
color: "mediumslateblue"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "miasma",
|
|
202
|
+
path: "/datum/gas/miasma",
|
|
203
|
+
name: "Miasma",
|
|
204
|
+
label: "Miasma",
|
|
205
|
+
color: "olive"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: "freon",
|
|
209
|
+
path: "/datum/gas/freon",
|
|
210
|
+
name: "Freon",
|
|
211
|
+
label: "Freon",
|
|
212
|
+
color: "paleturquoise"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: "hydrogen",
|
|
216
|
+
path: "/datum/gas/hydrogen",
|
|
217
|
+
name: "Hydrogen",
|
|
218
|
+
label: "H₂",
|
|
219
|
+
color: "white"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: "healium",
|
|
223
|
+
path: "/datum/gas/healium",
|
|
224
|
+
name: "Healium",
|
|
225
|
+
label: "Healium",
|
|
226
|
+
color: "salmon"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "proto_nitrate",
|
|
230
|
+
path: "/datum/gas/proto_nitrate",
|
|
231
|
+
name: "Proto Nitrate",
|
|
232
|
+
label: "Proto-Nitrate",
|
|
233
|
+
color: "greenyellow"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "zauker",
|
|
237
|
+
path: "/datum/gas/zauker",
|
|
238
|
+
name: "Zauker",
|
|
239
|
+
label: "Zauker",
|
|
240
|
+
color: "darkgreen"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: "halon",
|
|
244
|
+
path: "/datum/gas/halon",
|
|
245
|
+
name: "Halon",
|
|
246
|
+
label: "Halon",
|
|
247
|
+
color: "purple"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "helium",
|
|
251
|
+
path: "/datum/gas/helium",
|
|
252
|
+
name: "Helium",
|
|
253
|
+
label: "He",
|
|
254
|
+
color: "aliceblue"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: "antinoblium",
|
|
258
|
+
path: "/datum/gas/antinoblium",
|
|
259
|
+
name: "Antinoblium",
|
|
260
|
+
label: "Anti-Noblium",
|
|
261
|
+
color: "maroon"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: "nitrium",
|
|
265
|
+
path: "/datum/gas/nitrium",
|
|
266
|
+
name: "Nitrium",
|
|
267
|
+
label: "Nitrium",
|
|
268
|
+
color: "brown"
|
|
269
|
+
}
|
|
270
|
+
];
|
|
271
|
+
function b(a, o) {
|
|
272
|
+
if (!a) return o || "None";
|
|
273
|
+
const r = a.toLowerCase();
|
|
274
|
+
for (let l = 0; l < e.length; l++)
|
|
275
|
+
if (e[l].id === r)
|
|
276
|
+
return e[l].label;
|
|
277
|
+
return o || "None";
|
|
278
|
+
}
|
|
279
|
+
function s(a) {
|
|
280
|
+
if (!a) return "black";
|
|
281
|
+
const o = a.toLowerCase();
|
|
282
|
+
for (let r = 0; r < e.length; r++)
|
|
283
|
+
if (e[r].id === o)
|
|
284
|
+
return e[r].color;
|
|
285
|
+
return "black";
|
|
286
|
+
}
|
|
287
|
+
const g = (a) => {
|
|
288
|
+
if (!a) return;
|
|
289
|
+
const o = a.toLowerCase();
|
|
290
|
+
for (let r = 0; r < e.length; r++)
|
|
291
|
+
if (e[r].id === o)
|
|
292
|
+
return e[r];
|
|
293
|
+
}, p = (a) => {
|
|
294
|
+
if (a) {
|
|
295
|
+
for (let o = 0; o < e.length; o++)
|
|
296
|
+
if (e[o].path === a)
|
|
297
|
+
return e[o];
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
export {
|
|
301
|
+
c as COLORS,
|
|
302
|
+
u as CSS_COLORS,
|
|
303
|
+
d as RADIO_CHANNELS,
|
|
304
|
+
m as UI_CLOSE,
|
|
305
|
+
i as UI_DISABLED,
|
|
306
|
+
t as UI_INTERACTIVE,
|
|
307
|
+
n as UI_UPDATE,
|
|
308
|
+
s as getGasColor,
|
|
309
|
+
g as getGasFromId,
|
|
310
|
+
p as getGasFromPath,
|
|
311
|
+
b as getGasLabel
|
|
312
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type Fn = (...args: any[]) => void;
|
|
2
|
+
export declare class EventEmitter {
|
|
3
|
+
private listeners;
|
|
4
|
+
constructor();
|
|
5
|
+
on(name: string, listener: Fn): void;
|
|
6
|
+
off(name: string, listener: Fn): void;
|
|
7
|
+
emit(name: string, ...params: any[]): void;
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare const globalEvents: EventEmitter;
|
|
11
|
+
export declare const setupGlobalEvents: (options?: {
|
|
12
|
+
ignoreWindowFocus?: boolean;
|
|
13
|
+
}) => void;
|
|
14
|
+
export declare function canStealFocus(node: HTMLElement): boolean;
|
|
15
|
+
export declare function addScrollableNode(node: HTMLElement): void;
|
|
16
|
+
export declare function removeScrollableNode(node: HTMLElement): void;
|
|
17
|
+
export declare class KeyEvent {
|
|
18
|
+
event: KeyboardEvent;
|
|
19
|
+
type: 'keydown' | 'keyup';
|
|
20
|
+
code: number;
|
|
21
|
+
ctrl: boolean;
|
|
22
|
+
shift: boolean;
|
|
23
|
+
alt: boolean;
|
|
24
|
+
repeat: boolean;
|
|
25
|
+
_str?: string;
|
|
26
|
+
constructor(e: KeyboardEvent, type: 'keydown' | 'keyup', repeat?: boolean);
|
|
27
|
+
hasModifierKeys(): boolean;
|
|
28
|
+
isModifierKey(): boolean;
|
|
29
|
+
isDown(): boolean;
|
|
30
|
+
isUp(): boolean;
|
|
31
|
+
toString(): string;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var v = (t, e, s) => e in t ? _(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var i = (t, e, s) => v(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { KEY_CTRL as F, KEY_SHIFT as L, KEY_ALT as b, KEY_F1 as K, KEY_F12 as S } from "./keycodes.js";
|
|
5
|
+
class C {
|
|
6
|
+
constructor() {
|
|
7
|
+
i(this, "listeners");
|
|
8
|
+
this.listeners = {};
|
|
9
|
+
}
|
|
10
|
+
on(e, s) {
|
|
11
|
+
this.listeners[e] = this.listeners[e] || [], this.listeners[e].push(s);
|
|
12
|
+
}
|
|
13
|
+
off(e, s) {
|
|
14
|
+
const n = this.listeners[e];
|
|
15
|
+
if (!n)
|
|
16
|
+
throw new Error(`There is no listeners for "${e}"`);
|
|
17
|
+
this.listeners[e] = n.filter((l) => l !== s);
|
|
18
|
+
}
|
|
19
|
+
emit(e, ...s) {
|
|
20
|
+
const n = this.listeners[e];
|
|
21
|
+
if (n)
|
|
22
|
+
for (let l = 0, k = n.length; l < k; l += 1) {
|
|
23
|
+
const g = n[l];
|
|
24
|
+
g(...s);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
clear() {
|
|
28
|
+
this.listeners = {};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const o = new C();
|
|
32
|
+
let m = !1;
|
|
33
|
+
const W = (t = {}) => {
|
|
34
|
+
m = !!t.ignoreWindowFocus;
|
|
35
|
+
};
|
|
36
|
+
let d, f = !0;
|
|
37
|
+
function u(t, e) {
|
|
38
|
+
if (m) {
|
|
39
|
+
f = !0;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (d && (clearTimeout(d), d = null), e) {
|
|
43
|
+
d = setTimeout(() => u(t));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
f !== t && (f = t, o.emit(t ? "window-focus" : "window-blur"), o.emit("window-focus-change", t));
|
|
47
|
+
}
|
|
48
|
+
let r = null;
|
|
49
|
+
function E(t) {
|
|
50
|
+
const e = String(t.tagName).toLowerCase();
|
|
51
|
+
return e === "input" || e === "textarea";
|
|
52
|
+
}
|
|
53
|
+
function T(t) {
|
|
54
|
+
a(), r = t, r.addEventListener("blur", a);
|
|
55
|
+
}
|
|
56
|
+
function a() {
|
|
57
|
+
r && (r.removeEventListener("blur", a), r = null);
|
|
58
|
+
}
|
|
59
|
+
let w = null, c = null;
|
|
60
|
+
const h = [];
|
|
61
|
+
function A(t) {
|
|
62
|
+
h.push(t);
|
|
63
|
+
}
|
|
64
|
+
function B(t) {
|
|
65
|
+
const e = h.indexOf(t);
|
|
66
|
+
e >= 0 && h.splice(e, 1);
|
|
67
|
+
}
|
|
68
|
+
function N(t) {
|
|
69
|
+
if (r || !f)
|
|
70
|
+
return;
|
|
71
|
+
const e = document.body;
|
|
72
|
+
for (; t && t !== e; ) {
|
|
73
|
+
if (h.includes(t)) {
|
|
74
|
+
if (t.contains(w))
|
|
75
|
+
return;
|
|
76
|
+
w = t, t.focus();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
t = t.parentElement;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
window.addEventListener("mousemove", (t) => {
|
|
83
|
+
const e = t.target;
|
|
84
|
+
e !== c && (c = e, N(e));
|
|
85
|
+
});
|
|
86
|
+
window.addEventListener("focusin", (t) => {
|
|
87
|
+
c = null, w = t.target, u(!0), E(t.target) && T(t.target);
|
|
88
|
+
});
|
|
89
|
+
window.addEventListener("focusout", () => {
|
|
90
|
+
c = null, u(!1, !0);
|
|
91
|
+
});
|
|
92
|
+
window.addEventListener("blur", () => {
|
|
93
|
+
c = null, u(!1, !0);
|
|
94
|
+
});
|
|
95
|
+
window.addEventListener("beforeunload", () => {
|
|
96
|
+
u(!1);
|
|
97
|
+
});
|
|
98
|
+
const y = {};
|
|
99
|
+
class p {
|
|
100
|
+
constructor(e, s, n) {
|
|
101
|
+
i(this, "event");
|
|
102
|
+
i(this, "type");
|
|
103
|
+
i(this, "code");
|
|
104
|
+
i(this, "ctrl");
|
|
105
|
+
i(this, "shift");
|
|
106
|
+
i(this, "alt");
|
|
107
|
+
i(this, "repeat");
|
|
108
|
+
i(this, "_str");
|
|
109
|
+
this.event = e, this.type = s, this.code = e.keyCode, this.ctrl = e.ctrlKey, this.shift = e.shiftKey, this.alt = e.altKey, this.repeat = !!n;
|
|
110
|
+
}
|
|
111
|
+
hasModifierKeys() {
|
|
112
|
+
return this.ctrl || this.alt || this.shift;
|
|
113
|
+
}
|
|
114
|
+
isModifierKey() {
|
|
115
|
+
return this.code === F || this.code === L || this.code === b;
|
|
116
|
+
}
|
|
117
|
+
isDown() {
|
|
118
|
+
return this.type === "keydown";
|
|
119
|
+
}
|
|
120
|
+
isUp() {
|
|
121
|
+
return this.type === "keyup";
|
|
122
|
+
}
|
|
123
|
+
toString() {
|
|
124
|
+
return this._str ? this._str : (this._str = "", this.ctrl && (this._str += "Ctrl+"), this.alt && (this._str += "Alt+"), this.shift && (this._str += "Shift+"), this.code >= 48 && this.code <= 90 ? this._str += String.fromCharCode(this.code) : this.code >= K && this.code <= S ? this._str += "F" + (this.code - 111) : this._str += "[" + this.code + "]", this._str);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
document.addEventListener("keydown", (t) => {
|
|
128
|
+
if (E(t.target))
|
|
129
|
+
return;
|
|
130
|
+
const e = t.keyCode, s = new p(t, "keydown", y[e]);
|
|
131
|
+
o.emit("keydown", s), o.emit("key", s), y[e] = !0;
|
|
132
|
+
});
|
|
133
|
+
document.addEventListener("keyup", (t) => {
|
|
134
|
+
if (E(t.target))
|
|
135
|
+
return;
|
|
136
|
+
const e = t.keyCode, s = new p(t, "keyup");
|
|
137
|
+
o.emit("keyup", s), o.emit("key", s), y[e] = !1;
|
|
138
|
+
});
|
|
139
|
+
export {
|
|
140
|
+
C as EventEmitter,
|
|
141
|
+
p as KeyEvent,
|
|
142
|
+
A as addScrollableNode,
|
|
143
|
+
E as canStealFocus,
|
|
144
|
+
o as globalEvents,
|
|
145
|
+
B as removeScrollableNode,
|
|
146
|
+
W as setupGlobalEvents
|
|
147
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const formatSiUnit: (value: number, minBase1000?: number, unit?: string) => string;
|
|
2
|
+
export declare function formatPower(value: number, minBase1000?: number): string;
|
|
3
|
+
export declare function formatEnergy(value: number, minBase1000?: number): string;
|
|
4
|
+
export declare function formatMoney(value: number, precision?: number): string;
|
|
5
|
+
export declare function formatDb(value: number): string;
|
|
6
|
+
export declare const formatSiBaseTenUnit: (value: number, minBase1000?: number, unit?: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Formats decisecond count into HH:MM:SS display by default
|
|
9
|
+
* "short" format does not pad and adds hms suffixes
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatTime: (val: number, formatType?: "short" | "default") => string;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
const d = [
|
|
2
|
+
"f",
|
|
3
|
+
// femto
|
|
4
|
+
"p",
|
|
5
|
+
// pico
|
|
6
|
+
"n",
|
|
7
|
+
// nano
|
|
8
|
+
"μ",
|
|
9
|
+
// micro
|
|
10
|
+
"m",
|
|
11
|
+
// milli
|
|
12
|
+
// NOTE: This is a space for a reason. When we right align si numbers,
|
|
13
|
+
// in monospace mode, we want to units and numbers stay in their respective
|
|
14
|
+
// columns. If rendering in HTML mode, this space will collapse into
|
|
15
|
+
// a single space anyway.
|
|
16
|
+
" ",
|
|
17
|
+
// base
|
|
18
|
+
"k",
|
|
19
|
+
// kilo
|
|
20
|
+
"M",
|
|
21
|
+
// mega
|
|
22
|
+
"G",
|
|
23
|
+
// giga
|
|
24
|
+
"T",
|
|
25
|
+
// tera
|
|
26
|
+
"P",
|
|
27
|
+
// peta
|
|
28
|
+
"E",
|
|
29
|
+
// exa
|
|
30
|
+
"Z",
|
|
31
|
+
// zetta
|
|
32
|
+
"Y",
|
|
33
|
+
// yotta
|
|
34
|
+
"R",
|
|
35
|
+
// ronna
|
|
36
|
+
"Q",
|
|
37
|
+
// quecca
|
|
38
|
+
"F",
|
|
39
|
+
"N",
|
|
40
|
+
"H"
|
|
41
|
+
], l = d.indexOf(" "), m = (t, n = -l, s = "") => {
|
|
42
|
+
if (!isFinite(t))
|
|
43
|
+
return t.toString();
|
|
44
|
+
const o = Math.floor(Math.log10(Math.abs(t))), r = Math.max(n * 3, o), e = Math.floor(r / 3), i = d[Math.min(e + l, d.length - 1)];
|
|
45
|
+
let a = (t / Math.pow(1e3, e)).toFixed(2);
|
|
46
|
+
return a.endsWith(".00") ? a = a.slice(0, -3) : a.endsWith(".0") && (a = a.slice(0, -2)), `${a} ${i.trim()}${s}`.trim();
|
|
47
|
+
};
|
|
48
|
+
function S(t, n = 0) {
|
|
49
|
+
return m(t, n, "W");
|
|
50
|
+
}
|
|
51
|
+
function $(t, n = 0) {
|
|
52
|
+
return m(t, n, "J");
|
|
53
|
+
}
|
|
54
|
+
function b(t, n = 0) {
|
|
55
|
+
if (!Number.isFinite(t))
|
|
56
|
+
return String(t);
|
|
57
|
+
const s = Number(t.toFixed(n)), o = s < 0, e = Math.abs(s).toString().split(".");
|
|
58
|
+
e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
59
|
+
const i = e.join(".");
|
|
60
|
+
return o ? `-${i}` : i;
|
|
61
|
+
}
|
|
62
|
+
function g(t) {
|
|
63
|
+
const n = 20 * Math.log10(t), s = n >= 0 ? "+" : "-";
|
|
64
|
+
let o = Math.abs(n);
|
|
65
|
+
return o === 1 / 0 ? o = "Inf" : o = o.toFixed(2), `${s}${o} dB`;
|
|
66
|
+
}
|
|
67
|
+
const M = [
|
|
68
|
+
"",
|
|
69
|
+
"· 10³",
|
|
70
|
+
// kilo
|
|
71
|
+
"· 10⁶",
|
|
72
|
+
// mega
|
|
73
|
+
"· 10⁹",
|
|
74
|
+
// giga
|
|
75
|
+
"· 10¹²",
|
|
76
|
+
// tera
|
|
77
|
+
"· 10¹⁵",
|
|
78
|
+
// peta
|
|
79
|
+
"· 10¹⁸",
|
|
80
|
+
// exa
|
|
81
|
+
"· 10²¹",
|
|
82
|
+
// zetta
|
|
83
|
+
"· 10²⁴",
|
|
84
|
+
// yotta
|
|
85
|
+
"· 10²⁷",
|
|
86
|
+
// ronna
|
|
87
|
+
"· 10³⁰",
|
|
88
|
+
// quecca
|
|
89
|
+
"· 10³³",
|
|
90
|
+
"· 10³⁶",
|
|
91
|
+
"· 10³⁹"
|
|
92
|
+
], p = (t, n = 0, s = "") => {
|
|
93
|
+
if (!isFinite(t))
|
|
94
|
+
return "NaN";
|
|
95
|
+
const o = Math.floor(Math.log10(t)), r = Math.max(n * 3, o), e = Math.floor(r / 3), i = M[e], c = t / Math.pow(1e3, e), a = Math.max(0, 2 - r % 3);
|
|
96
|
+
return `${c.toFixed(a)} ${i} ${s}`.trim();
|
|
97
|
+
}, F = (t, n = "default") => {
|
|
98
|
+
const s = Math.floor(t / 10), o = Math.floor(s / 3600), r = Math.floor(s % 3600 / 60), e = s % 60;
|
|
99
|
+
if (n === "short") {
|
|
100
|
+
const f = o > 0 ? `${o}h` : "", u = r > 0 ? `${r}m` : "", h = e > 0 ? `${e}s` : "";
|
|
101
|
+
return `${f}${u}${h}`;
|
|
102
|
+
}
|
|
103
|
+
const i = String(o).padStart(2, "0"), c = String(r).padStart(2, "0"), a = String(e).padStart(2, "0");
|
|
104
|
+
return `${i}:${c}:${a}`;
|
|
105
|
+
};
|
|
106
|
+
export {
|
|
107
|
+
g as formatDb,
|
|
108
|
+
$ as formatEnergy,
|
|
109
|
+
b as formatMoney,
|
|
110
|
+
S as formatPower,
|
|
111
|
+
p as formatSiBaseTenUnit,
|
|
112
|
+
m as formatSiUnit,
|
|
113
|
+
F as formatTime
|
|
114
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
type Func = (...args: any[]) => any;
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Creates a function that returns the result of invoking the given
|
|
5
4
|
* functions, where each successive invocation is supplied the return
|
|
@@ -15,18 +14,5 @@ type Func = (...args: any[]) => any;
|
|
|
15
14
|
* const composedFunction2 = flow([add2, multiplyBy3], subtract5); // ((4 + 2) * 3) - 5 = 13
|
|
16
15
|
*
|
|
17
16
|
*/
|
|
18
|
-
export const flow
|
|
19
|
-
|
|
20
|
-
(input: any, ...rest: any[]): any => {
|
|
21
|
-
let output = input;
|
|
22
|
-
|
|
23
|
-
for (const func of funcs) {
|
|
24
|
-
// Recurse into the array of functions
|
|
25
|
-
if (Array.isArray(func)) {
|
|
26
|
-
output = flow(...func)(output, ...rest);
|
|
27
|
-
} else if (func) {
|
|
28
|
-
output = func(output, ...rest);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return output;
|
|
32
|
-
};
|
|
17
|
+
export declare const flow: (...funcs: Array<Func | Func[]>) => (input: any, ...rest: any[]) => any;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { KeyEvent } from './events';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Acquires a lock on the hotkey, which prevents it from being
|
|
5
|
+
* passed through to BYOND.
|
|
6
|
+
*/
|
|
7
|
+
export declare function acquireHotKey(keyCode: number): void;
|
|
8
|
+
/**
|
|
9
|
+
* Makes the hotkey available to BYOND again.
|
|
10
|
+
*/
|
|
11
|
+
export declare function releaseHotKey(keyCode: number): void;
|
|
12
|
+
export declare function releaseHeldKeys(): void;
|
|
13
|
+
export declare function setupHotKeys(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Registers for any key events, such as key down or key up.
|
|
16
|
+
* This should be preferred over directly connecting to keydown/keyup
|
|
17
|
+
* as it lets tgui prevent the key from reaching BYOND.
|
|
18
|
+
*
|
|
19
|
+
* If using in a component, prefer KeyListener, which automatically handles
|
|
20
|
+
* stopping listening when unmounting.
|
|
21
|
+
*
|
|
22
|
+
* @param callback The function to call whenever a key event occurs
|
|
23
|
+
* @returns A callback to stop listening
|
|
24
|
+
*/
|
|
25
|
+
export declare function listenForKeyEvents(callback: (key: KeyEvent) => void): () => void;
|