npctrade.otui

main 290 lines · 6.3 KB Raw
Alex Alex Commit Client Upload Part 2 19/10/2026 00:06
1NPCOfferLabel < Label
2 anchors.left: prev.right
3 anchors.top: prev.top
4 margin-left: 5
5 text-auto-resize: true
6
7NPCItemBox < UICheckBox
8 border-width: 1
9 border-color: #000000
10 color: #aaaaaa
11 text-align: center
12 text-offset: 0 30
13 @onCheckChange: modules.game_npctrade.onItemBoxChecked(self)
14
15 Item
16 id: item
17 phantom: true
18 anchors.top: parent.top
19 anchors.horizontalCenter: parent.horizontalCenter
20 image-color: #ffffffff
21 margin-top: 3
22
23 $checked on:
24 border-color: #ffffff
25
26 $!checked:
27 border-color: #000000
28
29 $!on:
30 image-color: #ffffff88
31 color: #aaaaaa88
32
33MainWindow
34 id: npcWindow
35 !text: tr('NPC Trade')
36 size: 550 340
37 @onEscape: modules.game_npctrade.closeNpcTrade()
38
39 TabButton
40 id: buyTab
41 !tooltip: tr("List of items that you're able to buy")
42 !text: tr('Buy')
43 checked: true
44 on: true
45 anchors.left: parent.left
46 anchors.right: parent.horizontalCenter
47 anchors.top: parent.top
48 margin-top: 0
49
50 TabButton
51 id: sellTab
52 !tooltip: tr("List of items that you're able to sell")
53 !text: tr('Sell')
54 anchors.left: parent.horizontalCenter
55 anchors.right: parent.right
56 anchors.top: parent.top
57
58 FlatPanel
59 height: 150
60 anchors.left: parent.left
61 anchors.right: parent.right
62 anchors.top: prev.bottom
63 margin-top: 5
64
65 VerticalScrollBar
66 id: itemsPanelListScrollBar
67 anchors.top: parent.top
68 anchors.bottom: parent.bottom
69 anchors.right: parent.right
70 step: 24
71 pixels-scroll: true
72
73 ScrollablePanel
74 id: itemsPanel
75 height: 200
76 anchors.left: parent.left
77 anchors.right: prev.left
78 anchors.top: parent.top
79 anchors.bottom: parent.bottom
80 vertical-scrollbar: itemsPanelListScrollBar
81 margin-left: 5
82 margin-right: 5
83 layout:
84 type: grid
85 cell-size: 160 90
86 flow: true
87 auto-spacing: true
88
89 FlatPanel
90 id: setupPanel
91 height: 105
92 enabled: false
93 anchors.left: parent.left
94 anchors.right: parent.horizontalCenter
95 anchors.top: prev.bottom
96 margin-top: 5
97 margin-right: 5
98 image-color: #ffffff88
99
100 Label
101 !text: tr('Name') .. ':'
102 anchors.left: parent.left
103 anchors.top: parent.top
104 margin-top: 5
105 margin-left: 5
106 width: 85
107
108 NPCOfferLabel
109 id: name
110
111 Label
112 !text: tr('Id') .. ':'
113 anchors.left: parent.left
114 anchors.top: parent.top
115 margin-top: 5
116 margin-left: 5
117 margin-left: 195
118 width: 15
119
120 NPCOfferLabel
121 id: id
122
123 Label
124 !text: tr('Price') .. ':'
125 anchors.left: parent.left
126 anchors.top: prev.bottom
127 margin-top: 3
128 margin-left: 5
129 width: 85
130
131 NPCOfferLabel
132 id: price
133
134 Label
135 !text: tr('Your Money') .. ':'
136 anchors.left: parent.left
137 anchors.top: prev.bottom
138 margin-top: 3
139 margin-left: 5
140 width: 85
141
142 NPCOfferLabel
143 id: money
144
145 Label
146 id: weightDesc
147 !text: tr('Weight') .. ':'
148 anchors.left: parent.left
149 anchors.top: prev.bottom
150 margin-top: 3
151 margin-left: 5
152 width: 85
153
154 NPCOfferLabel
155 id: weight
156
157 Label
158 id: capacityDesc
159 !text: tr('Your Capacity') .. ':'
160 anchors.left: parent.left
161 anchors.top: prev.bottom
162 margin-top: 3
163 margin-left: 5
164 width: 85
165
166 NPCOfferLabel
167 id: capacity
168
169 HorizontalScrollBar
170 id: quantityScroll
171 anchors.left: parent.left
172 anchors.right: parent.right
173 anchors.top: prev.bottom
174 margin-top: 3
175 margin-left: 5
176 margin-right: 5
177 show-value: true
178 minimum: 1
179 maximum: 100
180 step: 1
181 @onValueChange: modules.game_npctrade.onQuantityValueChange(self:getValue())
182
183 FlatPanel
184 id: buyOptions
185 height: 80
186 anchors.top: prev.top
187 anchors.left: parent.horizontalCenter
188 anchors.right: parent.right
189 margin-left: 5
190 image-color: #ffffff88
191
192 Label
193 id: searchLabel
194 !text: tr('Search') .. ':'
195 anchors.left: parent.left
196 anchors.top: parent.top
197 text-auto-resize: true
198 margin-top: 7
199 margin-left: 5
200
201 TextEdit
202 id: searchText
203 anchors.left: prev.right
204 anchors.top: prev.top
205 anchors.right: parent.right
206 margin-top: -2
207 margin-left: 5
208 margin-right: 5
209 @onTextChange: modules.game_npctrade.onSearchTextChange()
210
211 CheckBox
212 id: buyWithBackpack
213 !text: tr('Buy with backpack')
214 anchors.top: searchText.bottom
215 anchors.left: parent.left
216 anchors.right: parent.right
217 margin-left: 5
218 margin-top: 3
219 @onCheckChange: modules.game_npctrade.onBuyWithBackpackChange()
220
221 CheckBox
222 id: ignoreCapacity
223 !text: tr('Ignore capacity')
224 anchors.top: prev.bottom
225 anchors.left: parent.left
226 anchors.right: parent.right
227 margin-left: 5
228 margin-top: 3
229 @onCheckChange: modules.game_npctrade.onIgnoreCapacityChange()
230
231 CheckBox
232 id: ignoreEquipped
233 !text: tr('Ignore equipped')
234 anchors.top: searchText.bottom
235 anchors.left: parent.left
236 anchors.right: parent.right
237 margin-left: 5
238 margin-top: 3
239 visible: false
240 checked: true
241 @onCheckChange: modules.game_npctrade.onIgnoreEquippedChange()
242
243 CheckBox
244 id: showAllItems
245 !text: tr('Show all items')
246 anchors.top: prev.bottom
247 anchors.left: parent.left
248 anchors.right: parent.right
249 margin-left: 5
250 margin-top: 3
251 visible: false
252 checked: true
253 @onCheckChange: modules.game_npctrade.onShowAllItemsChange()
254
255 Button
256 id: sellAllWithDelayButton
257 !text: tr('Sell all with delay')
258 width: 128
259 anchors.right: next.left
260 anchors.bottom: parent.bottom
261 margin-right: 10
262 visible: false
263 @onClick: modules.game_npctrade.sellAll(true)
264
265 Button
266 id: sellAllButton
267 !text: tr('Sell all')
268 width: 64
269 anchors.right: next.left
270 anchors.bottom: parent.bottom
271 margin-right: 10
272 visible: false
273 @onClick: modules.game_npctrade.sellAll()
274
275 Button
276 id: tradeButton
277 !text: tr('Buy')
278 width: 64
279 anchors.right: next.left
280 anchors.bottom: parent.bottom
281 margin-right: 10
282 @onClick: modules.game_npctrade.onTradeClick()
283
284 Button
285 !text: tr('Close')
286 width: 64
287 anchors.right: parent.right
288 anchors.bottom: parent.bottom
289 @onClick: modules.game_npctrade.closeNpcTrade()
290
Top