Skip to content

Commit 8b45d89

Browse files
committed
remove ClearQuantityHint
1 parent 992f5cb commit 8b45d89

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

osrs/interfaces/chat/make.simba

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ begin
306306
Result := StrToInt(current.UpText);
307307
end;
308308

309+
309310
(*
310311
## Make.HasHint
311312
```pascal
@@ -362,7 +363,8 @@ var
362363
tpa: TPointArray;
363364
begin
364365
tpa := Target.FindColor($A0FFFF, 0, Chat.Bounds);
365-
if tpa <> [] then Result := tpa.Bounds();
366+
if tpa <> [] then
367+
Result := tpa.Bounds();
366368
end;
367369

368370
(*
@@ -399,6 +401,9 @@ var
399401
tpa: TPointArray;
400402
b: TBox;
401403
begin
404+
if not Self.HasHint() then
405+
Exit(True);
406+
402407
tpa := TPointArray.CreateFromBox(Chat.Bounds, True);
403408
for b in Self.GetItemBoxes() do
404409
tpa := tpa.ExcludeBox(b.Expand(1));
@@ -408,33 +413,6 @@ begin
408413
Result := SleepUntil(not Self.HasHint(), RandomMode(100, 50, 1500), 600);
409414
end;
410415

411-
(*
412-
## Make.ClearQuantityHint
413-
```pascal
414-
function TRSMake.ClearQuantityHint(): Boolean;
415-
```
416-
Checks if a hint tooltip is covering the quantity buttons and closes it if so.
417-
Returns True if the quantity buttons are accessible (no hint, or hint was closed).
418-
Example:
419-
```pascal
420-
if not Make.ClearQuantityHint() then
421-
WriteLn('Failed to clear hint covering quantity buttons');
422-
```
423-
*)
424-
function TRSMake.ClearQuantityHint(): Boolean;
425-
var
426-
hintPt: TPoint;
427-
begin
428-
if not Self.HasHint() then
429-
Exit(True);
430-
431-
hintPt := Self.GetHintBox().TopRight;
432-
if (hintPt.Y > Self.QuantityButtonBoxes[5].Y2) or (hintPt.X < Self.QuantityButtonBoxes[5].X1) then
433-
Exit(True);
434-
435-
Result := Self.CloseHint();
436-
end;
437-
438416
(*
439417
## Make.QuantityButtons
440418
The quantity buttons are dynamic there can be anywhere from 1 to 6 available.
@@ -485,8 +463,8 @@ var
485463
quantity: ERSItemQuantity;
486464
quantitybtns: array of TRSMakeQuantityButton;
487465
begin
488-
if not Self.ClearQuantityHint() then
489-
raise GetDebugLn('Make', 'Failed to close the tooltip which is covering the quantity buttons');
466+
if not Self.CloseHint() then
467+
raise GetDebugLn('Make', 'Failed to close the tooltip which could be covering the quantity buttons');
490468

491469
quantitybtns := Self.FindQuantityButtons();
492470
quantity := ERSItemQuantity.Integer2Quantity(amount);

0 commit comments

Comments
 (0)