Skip to content

Commit

Permalink
Update interface.simba
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Sep 2, 2021
1 parent a8fda65 commit a7218f6
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions osr/interface/interface.simba
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ begin
end;

function TRSInterface.FindDropDown(Dimensions: TRSButtonDimensions): TRSDropDownArray;
function FindArrow(Bounds: TBox; Color: TCTS0Color; Dimensions: TRSButtonDimensions): TRSButtonArray; overload;
function FindArrow(B: TBox; Color: TCTS0Color; Dimensions: TRSButtonDimensions): Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
I, W, H: Int32;
B: TBox;
Color: TCTS1Color;
Boxes: TBoxArray;
begin
B := Bounds;

if SRL.FindColors(TPA, Color, B) > 0 then
ATPA += TPA;

Expand All @@ -92,28 +88,14 @@ function TRSInterface.FindDropDown(Dimensions: TRSButtonDimensions): TRSDropDown
begin
if ((W = Dimensions[I].Width) or (Dimensions[I].Width = 0)) and
((H = Dimensions[I].Height) or (Dimensions[I].Height = 0)) and
(TPA.Frameness > 57) then
(TPA.Frameness > 100) then
Boxes += B;
end;

{$IFDEF SRL_DEBUG_FINDBUTTONS}
Writeln(W, ', ', H);
{$ENDIF}
end;

Boxes.SortByXY(10);

SetLength(Result, Length(Boxes));
for I := 0 to High(Boxes) do
begin
Result[I].Index := I;
Result[I].Bounds := Boxes[I];
Result[I].Middle := Boxes[I].Middle;
Result[I].EnabledColors := Self.ButtonEnabledColors;
end;
Result := Length(Boxes) = 1;
end;


var
TPA: TPointArray;
ATPA: T2DPointArray;
Expand All @@ -140,13 +122,9 @@ begin
begin
if ((W = Dimensions[I].Width) or (Dimensions[I].Width = 0)) and
((H = Dimensions[I].Height) or (Dimensions[I].Height = 0)) and
(TPA.Frameness > 100) and (Length(FindArrow(B, CTS0(65536, 1), [16, 16])) = 1) then
(TPA.Frameness > 100) and FindArrow(B, CTS0(65536, 1), [[16, 16]]) then
Boxes += B;
end;

{$IFDEF SRL_DEBUG_FINDBUTTONS}
Writeln(W, ', ', H);
{$ENDIF}
end;

Boxes.SortByXY(10);
Expand Down

0 comments on commit a7218f6

Please sign in to comment.