Skip to content

Commit

Permalink
fix: Make.IsOpen() in the world switcher (#77)
Browse files Browse the repository at this point in the history
The make menu was coming up as true in the world switcher.
Not a big deal but I added some width and height limits to stop it from happening.

I don't know exactly what's the true upper limits because they vary from task to task and I can't try them all so I set it to something that felt reasonable.

Also removed the second loop of the method which wasn't required at all
  • Loading branch information
Torwent committed Jun 12, 2023
1 parent 015a666 commit bd478f5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions osr/make.simba
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ Example
*)
function TRSMake.GetItemButtons(): TRSButtonArray;
var
Button: TRSButton;
button: TRSButton;
i: Int32;
begin
for Button in Self.FindButtons([[0,0]]) do
if (Button.Bounds.Height > 60) and (Button.Bounds.Width > 20) then
Result += Button;

for i := 0 to High(Result) do //Fixes buttons indexes!
Result[i].Index := i;
for button in Self.FindButtons([[0,0]]) do
if InRange(button.Bounds.Height(), 60, 85) and InRange(button.Bounds.Width(), 20, 120) then
begin
button.Index := Length(Result);
Result += button;
end;
end;

(*
Expand Down

0 comments on commit bd478f5

Please sign in to comment.