Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions osrs/interfaces/mainscreen/goldscreen.simba
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,23 @@ function TRSGoldScreen.CanCraftItem(Item: ERSGoldItem): Boolean;
```
Returns `True` if the given item icon is available for crafting.
*)
function TRSGoldScreen.CanCraftItem(i: ERSGoldItem): Boolean;
function TRSGoldScreen.CanCraftItem(i: ERSGoldItem): Boolean;
const
GOLD_COLOR: TColor := 2806763;
GOLD_COLOR : TColor := 2806763;
AMULET_COLOR : TColorTolerance := [$24BCBD, 0.829, EColorSpace.HSV, [2.402, 0.499, 0.100]];
NECKLACE_COLOR : TColorTolerance := [$20ACC0, 0.663, EColorSpace.HSV, [1.544, 1.355, 0.103]];
begin
if not Self.IsOpen() then
Exit;

Result := Target.FindColor(GOLD_COLOR, 1, Self.ItemBoxes[i]).Length > 0;
end;

if not Result then
Result := Target.HasColor(AMULET_COLOR, 10 ,Self.ItemBoxes[i]);

if not Result then
Result := Target.HasColor(NECKLACE_COLOR, 10 ,Self.ItemBoxes[i]);
end;

(*
## GoldScreen.IsItemHighlighted
Expand All @@ -256,18 +264,26 @@ function TRSGoldScreen.IsItemHighlighted(Item: ERSGoldItem): Boolean;
```
Returns `True` if the given item is currently highlighted.
*)
function TRSGoldScreen.IsItemHighlighted(i: ERSGoldItem): Boolean;
function TRSGoldScreen.IsItemHighlighted(i: ERSGoldItem): Boolean;
var
highlight: TColorTolerance := [4807018,2];
highlight : TColorTolerance := [$49596A, 2, EColorSpace.RGB, [1.000, 1.000, 1.000]];
amuletColor : TColorTolerance := [$24BCBD, 0.829, EColorSpace.HSV, [2.402, 0.499, 0.100]];
necklaceColor : TColorTolerance := [$20ACC0, 0.663, EColorSpace.HSV, [1.544, 1.355, 0.103]];
begin
if not Self.IsOpen() then
Exit;

if not Self.CanCraftItem(i) then
Exit;

Result := Target.FindColor(highlight, Self.ItemBoxes[i]).Length > 0;
end;
Result := Target.HasColor(highlight, 80 ,Self.ItemBoxes[i]);

if not Result then
Result := Target.HasColor(amuletColor, 10 ,Self.ItemBoxes[i]);

if not Result then
Result := Target.HasColor(necklaceColor, 10 ,Self.ItemBoxes[i]);
end;

(*
## GoldScreen.CraftItem
Expand Down
Loading