diff --git a/osr/interface/interface.simba b/osr/interface/interface.simba index afe9ce1c..9534d84e 100644 --- a/osr/interface/interface.simba +++ b/osr/interface/interface.simba @@ -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; @@ -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; @@ -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);