Skip to content

Commit b9e39f5

Browse files
authored
Merge pull request #119 from jacz24/patch-5
Refactor shop interface to use _IsOpenHelper
2 parents ffe27fb + f9212cd commit b9e39f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

osrs/interfaces/mainscreen/shop.simba

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Main record to interact with the {ref}`Shop` interface.
2626
Slots: TRSSlotInterface;
2727
Items: TRSItemInterface;
2828

29-
Bounds, SlotsArea, InfoBox: TBox;
30-
SlotBoxes, InventorySlotBoxes: TBoxArray;
29+
Bounds, SlotsArea, _IsOpenHelper: TBox;
30+
SlotBoxes: TBoxArray;
3131

3232
QuantityButtons: array [ERSShopQuantity] of TRSButton;
3333
ValueButton: TRSButton;
@@ -111,7 +111,7 @@ begin
111111

112112
with Self.Bounds do
113113
begin
114-
Self.InfoBox := TBox.Create(X1 + 30, Y2 - 35, X1 + 100, Y2 - 12);
114+
Self._IsOpenHelper := TBox.Create(X1 + 30, Y2 - 35, X1 + 100, Y2 - 12);
115115
Self.ValueButton.Bounds := TBox.Create(X1 + 110, Y2 - 37, X1 + 139, Y2 - 8);
116116
end;
117117
Self.ValueButton.EnabledColors := [[$0F1043, 0], [$23269F, 0.227]];
@@ -151,7 +151,7 @@ WriteLn Shop.IsOpen();
151151
*)
152152
function TRSShop.IsOpen(): Boolean;
153153
begin
154-
Result := OCR.Recognize(Self.InfoBox, RSFonts.PLAIN_12, [RSFonts.ORANGE], 0).ContainsAny(['Value','check'], True);
154+
Result := OCR.Recognize(Self._IsOpenHelper, RSFonts.PLAIN_12, [RSFonts.ORANGE], 0).ContainsAny(['Value','check'], True);
155155
end;
156156

157157
(*
@@ -406,7 +406,7 @@ begin
406406

407407
img.DrawColor := $0000FF;
408408
img.DrawBox(Self.SlotsArea);
409-
img.DrawBox(Self.InfoBox);
409+
img.DrawBox(Self._IsOpenHelper);
410410

411411
img.DrawColor := Colors.AQUA;
412412
img.DrawBox(Self.ValueButton.Bounds);

0 commit comments

Comments
 (0)