Skip to content

Commit

Permalink
fix: removed the global hint removal
Browse files Browse the repository at this point in the history
- removed hints in every line they were needed instead of the a global remover
- deprecation warnings should be visible again
  • Loading branch information
Torwent committed Jul 23, 2024
1 parent 3841812 commit 840f644
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 31 deletions.
5 changes: 0 additions & 5 deletions osr.simba
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{$IFNDEF SRL_OSR} {$I SRL-T/osr.simba}{$ENDIF}
{$DEFINE WL_OSR}

{$IFNDEF WL_HINTS}
{$IFDEF HINTS}{$DEFINE WL_HINTS}{$ENDIF}
{$HINTS OFF}
{$ENDIF}

{$IFNDEF WL_UTILS} {$I utils.simba} {$ENDIF}
{$SCOPEDENUMS ON}

Expand Down
8 changes: 4 additions & 4 deletions osr/antiban/antiban.simba
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{$I WaspLib/osr.simba}
{$ENDIF}

procedure OnStartAntibanTask(Task: PAntibanTask);
procedure TAntiban.OnStartAntibanTask({$H-}task: PAntibanTask);{$H+}
var
str: String;
begin
Expand All @@ -26,7 +26,7 @@ begin
{$ENDIF}
end;

procedure OnBreakingTask(Task: PBreakTask; var countdown: TCountdown);
procedure TAntiban.OnBreakingTask({$H-}task: PBreakTask;{$H+} var countdown: TCountdown);
var
str: String;
begin
Expand All @@ -49,7 +49,7 @@ begin
{$ENDIF}
end;

procedure OnSleepingTask(Task: PSleepTask; var Countdown: TCountdown);
procedure TAntiban.OnSleepingTask({$H-}task: PSleepTask;{$H+} var countdown: TCountdown);
var
str: String;
begin
Expand Down Expand Up @@ -722,7 +722,7 @@ begin
end;
end;

procedure TAntiban.WalkingTasks(walker: PRSWalker; position: TPoint; destination: TPoint); overload;
procedure TAntiban.WalkingTasks({$H-}walker: PRSWalker; position: TPoint; destination: TPoint);{$H+} overload;
begin
Self.WalkingTasks();
end;
Expand Down
5 changes: 4 additions & 1 deletion osr/deprecated.simba
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end;
type
TStatsPayload = type TSRLBaseRecord;

procedure TStatsPayload.Setup(id: String; user: String = ''); deprecated 'This is not needed anymore';
procedure TStatsPayload.Setup({$H-}id: String; user: String = '');{$H+} deprecated 'This is not needed anymore';
begin

end;
Expand All @@ -39,8 +39,11 @@ begin
APIClient.SetUsername(user);
end;


{$H-}
var
StatsPayload: TStatsPayload;
{$H+}

function TBaseBankScript.Withdraw(item: TRSBankWithdrawItem): Boolean; overload; deprecated 'Use the TRSBankItem version instead!';
var
Expand Down
3 changes: 3 additions & 0 deletions osr/interfaces/mainscreen/collectbox.simba
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,11 @@ begin
Result := WaitUntil(CollectBox.IsOpen(), SRL.TruncatedGauss(50, 1500), 3000);
end;


{$H-}
var
CollectBoxes: TRSCollectBoxes;
{$H+}

procedure TRSClient.ClientModeChanged(); override;
begin
Expand Down
2 changes: 1 addition & 1 deletion osr/mm2ms.simba
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ begin
Result := Self.GetCuboidMSEx(loc, shape, offset, angle);
end;

function TRSMinimap.GetCuboidArrayMSEx(locArray: TPointArray; shapeArray: TRSMainScreenShapeArray; startHeights: TDoubleArray; offset: Vector3 = [0, 0, 0]; angle: Single = $FFFF): TCuboidExArray; overload;
function TRSMinimap.GetCuboidArrayMSEx(locArray: TPointArray; shapeArray: TRSMainScreenShapeArray; offset: Vector3 = [0, 0, 0]; angle: Single = $FFFF): TCuboidExArray; overload;
var
i: Int32;
begin
Expand Down
2 changes: 0 additions & 2 deletions utils.simba
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,3 @@ var
{$ELSE}{$ENDIF}
{$ELSE}{$ENDIF}
{$ELSE}{$ENDIF}

{$SCOPEDENUMS OFF}
11 changes: 6 additions & 5 deletions utils/forms/formutils.simba
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ procedure TComponent.NumberField(sender: TObject; var key: char);
Callback method to limit user input to numbers only and backspace.
This numbers can be Ints or Doubles.
*)
procedure TComponent.NumberField(sender: TObject; var key: char);
procedure TComponent.NumberField({$H-}sender: TObject;{$H+} var key: char);
begin
if not (key in ['0'..'9', #8, '.']) then
key := #0;
end;

procedure TComponent.MailField(sender: TObject; var key: char);
procedure TComponent.MailField({$H-}sender: TObject;{$H+} var key: char);
begin
if (key in [' ']) then
key := #0;
Expand All @@ -182,7 +182,7 @@ procedure TComponent.TimeField(sender: TObject; var key: char);
```
Callback method to limit user input to numbers only, backspace and a few characters used in time.
*)
procedure TComponent.TimeField(sender: TObject; var key: char);
procedure TComponent.TimeField({$H-}sender: TObject;{$H+} var key: char);
begin
if not (key in ['0'..'9', #8, '.', ':', '-', '_', ',', ' ']) then
key := #0;
Expand All @@ -195,7 +195,7 @@ procedure TComponent.NumberArrayField(sender: TObject; var key: char);
```
Callback method to limit user input to a TIntegerArray.
*)
procedure TComponent.NumberArrayField(sender: TObject; var key: char);
procedure TComponent.NumberArrayField({$H-}sender: TObject;{$H+} var key: char);
begin
if not (key in ['0'..'9', ',', ' ' , #8]) then
key := #0;
Expand Down Expand Up @@ -1819,11 +1819,12 @@ end;
type
TPreferredAppMode = (Default, AllowDark, ForceDark, ForceLight, Max);

{$H-}
var
ShouldAppUseDarkMode: function(): LongBool;
AllowDarkModeForWindow: function(hWnd: TOSWindow; allow: LongBool): LongBool;
AllowDarkModeForApp: function(allow: LongBool): LongBool;
SetPreferredAppMode: function(appMode: TPreferredAppMode): TPreferredAppMode;
FlushMenuThemes: procedure();
RefreshImmersiveColorPolicyState: procedure();

{$H+}
20 changes: 9 additions & 11 deletions utils/forms/scriptform.simba
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ function TScriptForm.CreateAPISettings(): TTabSheet;
parent.SetFocus();
end;

procedure TScriptForm._UpdateUUID(sender: TObject);
procedure TScriptForm._UpdateUUID({$H-}sender: TObject);{$H+}
var
oldUUIDEdit, newUUIDEdit, oldPassEdit, newPassEdit: TEdit;
new: String;
Expand Down Expand Up @@ -486,7 +486,7 @@ function TScriptForm.CreateAPISettings(): TTabSheet;
newPassEdit.Clear();
end;

procedure TScriptForm._UpdatePassword(sender: TObject);
procedure TScriptForm._UpdatePassword({$H-}sender: TObject);{$H+}
var
oldEdit, newEdit: TEdit;
new: String;
Expand Down Expand Up @@ -650,7 +650,7 @@ function TScriptForm.CreateAccountManager(owner: TControl): TPanel;
type TScriptForm = TScriptForm;
//This doesn't have to clutter things outside.

procedure TScriptForm._ClearInputs(sender: TObject);
procedure TScriptForm._ClearInputs({$H-}sender: TObject);{$H+}
var
edit: TCustomEdit;
btn: TButton;
Expand All @@ -673,7 +673,7 @@ function TScriptForm.CreateAccountManager(owner: TControl): TPanel;
btn.setEnabled(False);
end;

procedure TScriptForm._FillInputs(sender: TObject);
procedure TScriptForm._FillInputs({$H-}sender: TObject);{$H+}
var
idx, i: Int32;
worldsStr: String;
Expand Down Expand Up @@ -707,7 +707,7 @@ function TScriptForm.CreateAccountManager(owner: TControl): TPanel;
btn.setEnabled(True);
end;

procedure TScriptForm._ReloadSelector(sender: TObject);
procedure TScriptForm._ReloadSelector({$H-}sender: TObject);{$H+}
var
selector: TComboBox;
hasPlayers: Boolean;
Expand Down Expand Up @@ -1210,7 +1210,6 @@ var
arr: TStringArray;
str: String;
combobox: TComboBox;
json: TJSONObject;
checked: Boolean;
begin
Self.AddTab('Antiban Manager');
Expand Down Expand Up @@ -1642,7 +1641,7 @@ function TScriptForm.CreateLimitSettings(owner: TControl): TPanel;

if str = '' then str := '0';

WLSettings.Put('max_actions', StrToInt64Def(str, 0));
WLSettings.Put('max_actions', StrToIntDef(str, 0));
end;

procedure TScriptForm._TimeLimitOnDone(sender: TObject);
Expand All @@ -1655,7 +1654,7 @@ function TScriptForm.CreateLimitSettings(owner: TControl): TPanel;

if str = '' then str := '0';

WLSettings.Put('max_time', StrToInt64Def(str, 0));
WLSettings.Put('max_time', StrToIntDef(str, 0));
end;

var
Expand Down Expand Up @@ -1804,7 +1803,6 @@ var
arr: TStringArray;
str: String;
tmp: TCheckBox;
json: TJSONObject;
begin
with Result do
begin
Expand Down Expand Up @@ -2084,14 +2082,14 @@ begin
end;
```
*)
procedure TScriptForm.StartScript(sender: TObject);
procedure TScriptForm.StartScript({$H-}sender: TObject);{$H+}
begin
TScriptForm.Form.SetOnClose(nil);
TScriptForm.Form.Close();
end;


procedure TScriptForm.OnClose(sender: TObject; var closeAction: TCloseAction);
procedure TScriptForm.OnClose({$H-}sender: TObject; var closeAction: TCloseAction);{$H+}
begin
TerminateScript();
end;
Expand Down
3 changes: 3 additions & 0 deletions utils/http/http.simba
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,8 @@ begin
end;
end;


{$H-}
var
WaspClient: TWaspClient;
{$H+}
4 changes: 2 additions & 2 deletions utils/settings.simba
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ end;



function TWLSettings.MaxActions(): UInt32;
function TWLSettings.MaxActions(): Integer;
begin
Result := Self.GetInt('max_actions');
end;

function TWLSettings.MaxTime(): UInt64;
function TWLSettings.MaxTime(): Integer;
begin
Result := Self.GetInt('max_time');
end;
Expand Down

0 comments on commit 840f644

Please sign in to comment.