Skip to content

Commit

Permalink
fix: compatibility with latest SRL-T
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Jun 19, 2024
1 parent 4a63dec commit 5ec0e9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions osr/interfaces/xpbar.simba
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ Extensions to SRL's {ref}`XPBar`
{$I WaspLib/osr.simba}
{$ENDIF}

function TRSXPBar.Read(): Int32; override;
function TRSXPBar.Read(): Int64; override;
var
i: Int32;
xpStr: String;
begin
if not Self.IsSetup then
Self._Setup();

if not Self.IsSetup or not Self.Enable() then
Exit;

Result := OCR.RecognizeNumber(Self.Bounds(), TOCRColorFilter.Create([$FFFFFF]), Self.Font);
xpStr := OCR.Recognize(Self.Bounds(), TOCRColorFilter.Create([$FFFFFF]), Self.Font);
Result := xpStr.ExtractInteger(0);

Self.Tracker.IsSetup := (Result > 0) and (Result >= Self.Tracker.Current);

Expand Down

0 comments on commit 5ec0e9e

Please sign in to comment.