@@ -12,12 +12,25 @@ compiler directive:
1212
1313{$IFDEF WL_DEBUG_INTERFACES}
1414
15- procedure TRSInterface.Draw(img: TImage);
15+ (*
16+ ## Button.Draw
17+ ```pascal
18+ procedure TRSButton.Draw(img: TImage; color: Integer = $00FFFF);
19+ ```
20+ Draws the current {ref}`TRSButton` on the `img` passed in.
21+
22+ Example:
23+ ```pascal
24+ {$I WaspLib/osrs.simba}
25+ var
26+ img: TImage;
1627begin
17- img.DrawColor := $00FFFF;
18- img.DrawBox(Self.Bounds);
28+ img := Target.GetImage();
29+ Bank.Buttons[ERSBankButtons.MENU].Draw(img);
30+ img.Show();
1931end;
20-
32+ ```
33+ *)
2134procedure TRSButton.Draw(img: TImage; color: Integer = $00FFFF);
2235var
2336 oldColor: Integer;
2841 img.DrawColor := oldColor;
2942end;
3043
44+ (*
45+ ## ButtonArray.Draw
46+ ```pascal
47+ procedure TRSButtonArray.Draw(img: TImage; color: Integer = $00FFFF);
48+ ```
49+ Draws the current {ref}`TRSButtonArray` on the `img` passed in.
50+
51+ Example:
52+ ```pascal
53+ {$I WaspLib/osrs.simba}
54+ var
55+ img: TImage;
56+ begin
57+ img := Target.GetImage();
58+ Bank.Buttons.Draw(img);
59+ img.Show();
60+ end;
61+ ```
62+ *)
3163procedure TRSButtonArray.Draw(img: TImage; color: Integer = $00FFFF);
3264var
3365 oldColor: Integer;
4274 img.DrawColor := oldColor;
4375end;
4476
77+ (*
78+ ## ScrollBar.Draw
79+ ```pascal
80+ procedure TRSScrollBar.Draw(img: TImage);
81+ ```
82+ Draws the current {ref}`TRSScrollBar` on the `img` passed in.
83+
84+ Example:
85+ ```pascal
86+ {$I WaspLib/osrs.simba}
87+ var
88+ img: TImage;
89+ begin
90+ img := Target.GetImage();
91+ Bank.Scroll.Draw(img);
92+ img.Show();
93+ end;
94+ ```
95+ *)
4596procedure TRSScrollBar.Draw(img: TImage);
4697var
4798 bounds: TBox;
@@ -66,6 +117,25 @@ begin
66117 img.DrawBoxArray([Self.Up, Self.Down], False);
67118end;
68119
120+ (*
121+ ## DropDown.Draw
122+ ```pascal
123+ procedure TRSDropDown.Draw(img: TImage);
124+ ```
125+ Draws the current {ref}`TRSDropDown` on the `img` passed in.
126+
127+ Example:
128+ ```pascal
129+ {$I WaspLib/osrs.simba}
130+ var
131+ img: TImage;
132+ begin
133+ img := Target.GetImage();
134+ Options.DropDowns[ERSOptionsDropDown.CLIENT_MODE].Draw(img);
135+ img.Show();
136+ end;
137+ ```
138+ *)
69139procedure TRSDropDown.Draw(img: TImage);
70140var
71141 i: Integer;
@@ -85,6 +155,47 @@ begin
85155end;
86156
87157
158+ (*
159+ ## Interface.Draw
160+ ```pascal
161+ procedure TRSInterface.Draw(img: TImage);
162+ procedure TRSGameTabs.Draw(img: TImage);
163+ procedure TRSChat.Draw(img: TImage);
164+ procedure TRSMake.Draw(img: TImage);
165+ procedure TRSBank.Draw(img: TImage);
166+ procedure TRSBankPin.Draw(img: TImage);
167+ procedure TRSCollectionBox.Draw(img: TImage);
168+ procedure TRSDepositBox.Draw(img: TImage);
169+ procedure TRSShop.Draw(img: TImage);
170+ procedure TRSGoldScreen.Draw(img: TImage);
171+ procedure TRSSilverScreen.Draw(img: TImage);
172+ ```
173+ Draws several parts of the interface on a {ref}`TImage`
174+
175+ Example:
176+ ```pascal
177+ {$I WaspLib/osrs.simba}
178+ var
179+ img: TImage;
180+ begin
181+ img := Target.GetImage();
182+ GoldScreen.Draw(img);
183+ img.Show();
184+ end;
185+ ```
186+ *)
187+ procedure TRSInterface.Draw(img: TImage);
188+ begin
189+ img.DrawColor := $00FFFF;
190+ img.DrawBox(Self.Bounds);
191+ end;
192+
193+ procedure TRSGameTabs.Draw(img: TImage);
194+ begin
195+ img.DrawBox(Self.Bounds);
196+ img.DrawBoxArray(Self.Tabs, False);
197+ end;
198+
88199procedure TRSChat.Draw(img: TImage);
89200var
90201 tab: TRSChatTab;
@@ -105,6 +216,22 @@ begin
105216 tab.Button.Draw(img);
106217end;
107218
219+ procedure TRSMake.Draw(img: TImage);
220+ begin
221+ if not Self.IsOpen() then Exit;
222+
223+ img.DrawColor := $00FFFF;
224+ img.DrawBox(Chat.Bounds);
225+ img.DrawColor := $FFFFFF;
226+ img.DrawBoxArray(Self.QuantityButtonBoxes, False);
227+ img.DrawColor := $0000FF;
228+ img.DrawBoxArray(Self.GetQuantityBoxes(), False);
229+ img.DrawColor := $00FF00;
230+ img.DrawBoxArray(Self.GetItemBoxes(), False);
231+ img.DrawColor := $FF0000;
232+ img.DrawBox(Self.GetHintBox());
233+ end;
234+
108235procedure TRSBank.Draw(img: TImage);
109236var
110237 i: Integer;
@@ -133,6 +260,17 @@ begin
133260 Self.DynamicButtons[i].Draw(img);
134261end;
135262
263+ procedure TRSBankPin.Draw(img: TImage);
264+ begin
265+ if not Self.IsOpen() then Exit;
266+
267+ img.DrawColor := $00FFFF;
268+ img.DrawBox(Self.Bounds);
269+
270+ img.DrawColor := $FFFFFF;
271+ img.DrawBoxArray(Self.Buttons, False);
272+ end;
273+
136274procedure TRSCollectionBox.Draw(img: TImage);
137275var
138276 i: Integer;
@@ -192,12 +330,6 @@ begin
192330 end;
193331end;
194332
195- procedure TRSGameTabs.Draw(img: TImage);
196- begin
197- img.DrawBox(Self.Bounds);
198- img.DrawBoxArray(Self.Tabs, False);
199- end;
200-
201333procedure TRSShop.Draw(img: TImage);
202334var
203335 i: Integer;
@@ -224,67 +356,19 @@ begin
224356 Self.QuantityButtons[i].Draw(img);
225357end;
226358
227- procedure TRSBankPin .Draw(img: TImage);
359+ procedure TRSGoldScreen .Draw(img: TImage);
228360begin
229- if not Self.IsOpen() then Exit;
230-
231- img.DrawColor := $00FFFF;
232361 img.DrawBox(Self.Bounds);
233-
234- img.DrawColor := $FFFFFF;
235- img.DrawBoxArray(Self.Buttons, False);
362+ img.DrawBoxArray(Self.ItemBoxes, False);
363+ Self.GetButtons().Draw(img);
236364end;
237365
238- (*
239- ## GoldScreen.Draw
240- ```pascal
241- procedure TRSGoldScreen.Draw(Bmp: TMufasaBitmap);
242- ```
243- Debug‑draws bounds, item slots, and quantity buttons on `Bmp`.
244- *)
245- procedure TRSGoldScreen.Draw();
246- var
247- btn: TRSButton;
248- allBoxes: TBoxArray;
249- begin
250- allBoxes += Self.Bounds;
251- allBoxes += Self.ItemBoxes;
252-
253- for btn in Self.GetButtons() do
254- allBoxes += btn.Bounds;
255-
256- ShowOnTarget(allBoxes);
257- end;
258-
259- procedure TRSSilverScreen.Draw();
260- var
261- btn : TRSButton;
262- allBoxes : TBoxArray;
366+ procedure TRSSilverScreen.Draw(img: TImage);
263367begin
264- allBoxes += Self.Bounds;
265- allBoxes += Self.SlotBoxes;
266- allBoxes += Self.ClickBoxes;
267-
268- for btn in Self.GetButtons do
269- allBoxes += btn.Bounds;
270-
271- ShowOnTarget(allBoxes);
272- end;
273-
274- procedure TRSMake.Draw(img: TImage);
275- begin
276- if not Self.IsOpen() then Exit;
277-
278- img.DrawColor := $00FFFF;
279- img.DrawBox(Chat.Bounds);
280- img.DrawColor := $FFFFFF;
281- img.DrawBoxArray(Self.QuantityButtonBoxes, False);
282- img.DrawColor := $0000FF;
283- img.DrawBoxArray(Self.GetQuantityBoxes(), False);
284- img.DrawColor := $00FF00;
285- img.DrawBoxArray(Self.GetItemBoxes(), False);
286- img.DrawColor := $FF0000;
287- img.DrawBox(Self.GetHintBox());
368+ img.DrawBox(Self.Bounds);
369+ img.DrawBoxArray(Self.SlotBoxes, False);
370+ img.DrawBoxArray(Self.ClickBoxes, False);
371+ Self.GetButtons().Draw(img);
288372end;
289373
290374
@@ -325,7 +409,6 @@ begin
325409 img.Show();
326410end;
327411
328-
329412procedure ShowOnTarget(chat: TRSChat); overload;
330413var
331414 img: TImage;
0 commit comments