hotkeys_manager.otui

main 269 lines · 6.1 KB Raw
Alex Alex Commit Client Upload Part 2 19/10/2026 00:06
1HotkeyListLabel < UILabel
2 font: verdana-11px-monochrome
3 background-color: alpha
4 text-offset: 2 0
5 focusable: true
6 phantom: false
7
8 $focus:
9 background-color: #ffffff22
10
11MainWindow
12 id: hotkeysWindow
13 !text: tr('Hotkeys')
14 size: 370 475
15
16 @onEnter: modules.game_hotkeys.ok()
17 @onEscape: modules.game_hotkeys.cancel()
18
19 ComboBox
20 id: configSelector
21 anchors.left: parent.left
22 anchors.right: parent.right
23 anchors.top: parent.top
24 menu-scroll: true
25 menu-height: 125
26 menu-scroll-step: 25
27 text-offset: 5 2
28 @onOptionChange: modules.game_hotkeys.onConfigChange()
29 @onSetup: |
30 self:addOption(tr("Hotkeys config #1"))
31 self:addOption(tr("Hotkeys config #2"))
32 self:addOption(tr("Hotkeys config #3"))
33 self:addOption(tr("Hotkeys config #4"))
34 self:addOption(tr("Hotkeys config #5"))
35
36
37 VerticalScrollBar
38 id: currentHotkeysScrollBar
39 height: 150
40 anchors.top: prev.bottom
41 anchors.right: parent.right
42 margin-top: 5
43 step: 14
44 pixels-scroll: true
45
46 TextList
47 id: currentHotkeys
48 vertical-scrollbar: currentHotkeysScrollBar
49 anchors.left: parent.left
50 anchors.right: prev.left
51 anchors.top: prev.top
52 anchors.bottom: prev.bottom
53 focusable: false
54
55 Button
56 id: resetButton
57 width: 96
58 !text: tr('Reset All')
59 anchors.left: parent.left
60 anchors.top: next.top
61 @onClick: modules.game_hotkeys.reset()
62 margin-right: 10
63
64 Button
65 id: addHotkeyButton
66 !text: tr('Add')
67 width: 64
68 anchors.right: next.left
69 anchors.top: next.top
70 margin-right: 5
71 @onClick: modules.game_hotkeys.addHotkey()
72
73 Button
74 id: removeHotkeyButton
75 !text: tr('Remove')
76 width: 64
77 enabled: false
78 anchors.right: parent.right
79 anchors.top: currentHotkeys.bottom
80 margin-top: 8
81 @onClick: modules.game_hotkeys.removeHotkey()
82
83 HorizontalSeparator
84 anchors.left: parent.left
85 anchors.right: parent.right
86 anchors.top: prev.bottom
87 margin-top: 5
88
89 Label
90 anchors.left: parent.left
91 anchors.top: prev.bottom
92 margin-top: 10
93 !text: tr('Extra action:')
94
95 ComboBox
96 id: action
97 anchors.left: prev.right
98 anchors.right: parent.right
99 anchors.top: prev.top
100 margin-left: 5
101 margin-top: -4
102 enabled: false
103 @onOptionChange: modules.game_hotkeys.updateHotkeyAction()
104
105 HorizontalSeparator
106 anchors.left: parent.left
107 anchors.right: parent.right
108 anchors.top: prev.bottom
109 margin-top: 5
110
111 Label
112 id: hotKeyTextLabel
113 !text: tr('Edit hotkey text:')
114 enable: false
115 anchors.left: parent.left
116 anchors.right: parent.right
117 anchors.top: prev.bottom
118 margin-top: 6
119
120 TextEdit
121 id: hotkeyText
122 enabled: false
123 anchors.left: parent.left
124 anchors.right: parent.right
125 anchors.top: prev.bottom
126 margin-top: 2
127 @onTextChange: modules.game_hotkeys.onHotkeyTextChange(self:getText())
128
129 CheckBox
130 id: sendAutomatically
131 !text: tr('Send automatically')
132 anchors.left: parent.left
133 anchors.right: parent.right
134 anchors.top: prev.bottom
135 enabled:false
136 margin-top: 5
137 @onCheckChange: modules.game_hotkeys.onSendAutomaticallyChange(self:isChecked())
138
139 Item
140 id: itemPreview
141 anchors.left: parent.left
142 anchors.top: prev.bottom
143 margin-top: 10
144 virtual: true
145
146 Button
147 id: selectObjectButton
148 !text: tr('Select object')
149 width: 128
150 enabled: false
151 anchors.left: prev.right
152 anchors.top: prev.top
153 margin-left: 10
154 @onClick: modules.game_hotkeys.startChooseItem()
155
156 Button
157 id: clearObjectButton
158 !text: tr('Clear object')
159 width: 128
160 enabled: false
161 anchors.left: prev.left
162 anchors.right: prev.right
163 anchors.top: prev.bottom
164 margin-top: 2
165 @onClick: modules.game_hotkeys.clearObject()
166
167 ButtonBox
168 id: useOnSelf
169 !text: tr('Use on yourself')
170 width: 128
171 enabled: false
172 anchors.left: selectObjectButton.right
173 anchors.right: parent.right
174 anchors.top: selectObjectButton.top
175 checked: false
176 margin-left: 10
177
178 ButtonBox
179 id: useOnTarget
180 !text: tr('Use on target')
181 width: 128
182 enabled: false
183 anchors.left: prev.left
184 anchors.right: parent.right
185 anchors.top: prev.bottom
186 checked: false
187 margin-top: 2
188
189 ButtonBox
190 id: useWith
191 !text: tr('With crosshair')
192 width: 128
193 enabled: false
194 anchors.left: prev.left
195 anchors.right: parent.right
196 anchors.top: prev.bottom
197 checked: false
198 margin-top: 2
199
200 HorizontalSeparator
201 id: separator
202 anchors.left: parent.left
203 anchors.right: parent.right
204 anchors.bottom: next.top
205 margin-bottom: 5
206
207 Button
208 id: okButton
209 !text: tr('Ok')
210 width: 64
211 anchors.right: next.left
212 anchors.bottom: parent.bottom
213 @onClick: modules.game_hotkeys.ok()
214 margin-right: 10
215
216 Button
217 id: cancelButton
218 !text: tr('Cancel')
219 width: 64
220 anchors.right: parent.right
221 anchors.bottom: parent.bottom
222 @onClick: modules.game_hotkeys.cancel()
223
224HotkeyAssignWindow < MainWindow
225 id: assignWindow
226 !text: tr('Button Assign')
227 size: 360 150
228 @onEscape: self:destroy()
229
230 Label
231 !text: tr('Please, press the key you wish to add onto your hotkeys manager')
232 anchors.left: parent.left
233 anchors.right: parent.right
234 anchors.top: parent.top
235 text-auto-resize: true
236 text-align: left
237
238 Label
239 id: comboPreview
240 !text: tr('Current hotkey to add: %s', 'none')
241 anchors.horizontalCenter: parent.horizontalCenter
242 anchors.top: prev.bottom
243 margin-top: 10
244 text-auto-resize: true
245
246 HorizontalSeparator
247 id: separator
248 anchors.left: parent.left
249 anchors.right: parent.right
250 anchors.bottom: next.top
251 margin-bottom: 10
252
253 Button
254 id: addButton
255 !text: tr('Add')
256 width: 64
257 anchors.right: next.left
258 anchors.bottom: parent.bottom
259 margin-right: 10
260 @onClick: modules.game_hotkeys.hotkeyCaptureOk(self:getParent(), self:getParent():getChildById('comboPreview').keyCombo)
261
262 Button
263 id: cancelButton
264 !text: tr('Cancel')
265 width: 64
266 anchors.right: parent.right
267 anchors.bottom: parent.bottom
268 @onClick: self:getParent():destroy()
269
Top