-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gearhandler): better logic so loading from client is slightly faster
- Loading branch information
Showing
3 changed files
with
104 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{$DEFINE SCRIPT_GUI} | ||
{$I SRL-T/osr.simba} | ||
{$I WaspLib/optional.simba} | ||
|
||
var | ||
gear1, gear2, gear3, gear4, gear5: TRSGear; | ||
|
||
type | ||
TMyScriptForm = record(TScriptForm) | ||
GearSelector1, GearSelector2, GearSelector3, GearSelector4, GearSelector5: TLabeledComboBox; | ||
end; | ||
|
||
procedure TMyScriptForm.StartScript(sender: TObject); override; | ||
begin | ||
inherited; | ||
|
||
//Read your script options. | ||
gear1 := GearHandler.Get(Self.GearSelector1.GetItemIndex()); | ||
gear2 := GearHandler.Get(Self.GearSelector2.GetItemIndex()); | ||
gear3 := GearHandler.Get(Self.GearSelector3.GetItemIndex()); | ||
gear4 := GearHandler.Get(Self.GearSelector4.GetItemIndex()); | ||
gear5 := GearHandler.Get(Self.GearSelector5.GetItemIndex()); | ||
end; | ||
|
||
procedure TMyScriptForm.Run(); override; | ||
var | ||
tab: TTabSheet; | ||
begin | ||
Self.Setup('HELLO WORLD SCRIPT'); | ||
Self.Start.setOnClick(@Self.StartScript); | ||
|
||
Self.AddTab('Script Settings'); | ||
tab := Self.Tabs[High(Self.Tabs)]; | ||
|
||
Self.GearSelector1.Create(tab); | ||
Self.GearSelector1.SetStyle(TComboBoxStyle.csDropDownList); | ||
Self.GearSelector1.SetCaption('Melee gear:'); | ||
Self.GearSelector1.SetLeft(TControl.AdjustToDPI(20)); | ||
Self.GearSelector1.SetTop(TControl.AdjustToDPI(170)); | ||
GearHandler.AddTo(Self.GearSelector1.ComboBox); | ||
|
||
Self.GearSelector2.Create(tab); | ||
Self.GearSelector2.SetStyle(TComboBoxStyle.csDropDownList); | ||
Self.GearSelector2.SetCaption('Ranged gear:'); | ||
Self.GearSelector2.SetLeft(TControl.AdjustToDPI(20)); | ||
Self.GearSelector2.SetTop(TControl.AdjustToDPI(210)); | ||
GearHandler.AddTo(Self.GearSelector2.ComboBox); | ||
|
||
Self.GearSelector3.Create(tab); | ||
Self.GearSelector3.SetStyle(TComboBoxStyle.csDropDownList); | ||
Self.GearSelector3.SetCaption('Magic gear:'); | ||
Self.GearSelector3.SetLeft(TControl.AdjustToDPI(20)); | ||
Self.GearSelector3.SetTop(TControl.AdjustToDPI(250)); | ||
GearHandler.AddTo(Self.GearSelector3.ComboBox); | ||
|
||
Self.GearSelector4.Create(tab); | ||
Self.GearSelector4.SetStyle(TComboBoxStyle.csDropDownList); | ||
Self.GearSelector4.SetCaption('Dragons gear:'); | ||
Self.GearSelector4.SetLeft(TControl.AdjustToDPI(20)); | ||
Self.GearSelector4.SetTop(TControl.AdjustToDPI(290)); | ||
GearHandler.AddTo(Self.GearSelector4.ComboBox); | ||
|
||
Self.GearSelector5.Create(tab); | ||
Self.GearSelector5.SetStyle(TComboBoxStyle.csDropDownList); | ||
Self.GearSelector5.SetCaption('Demons gear:'); | ||
Self.GearSelector5.SetLeft(TControl.AdjustToDPI(20)); | ||
Self.GearSelector5.SetTop(TControl.AdjustToDPI(330)); | ||
GearHandler.AddTo(Self.GearSelector5.ComboBox); | ||
|
||
Self.CreateAccountManager(tab); | ||
Self.CreateEquipmentManager(); | ||
Self.CreateAntibanManager(); | ||
Self.CreateWaspLibSettings(); | ||
Self.CreateAPISettings(); | ||
|
||
inherited; | ||
end; | ||
|
||
var | ||
MyScriptForm: TMyScriptForm; | ||
|
||
begin | ||
MyScriptForm.Run(); | ||
|
||
WriteLn(gear1.Items); | ||
WriteLn(gear2.Items); | ||
WriteLn(gear3.Items); | ||
WriteLn(gear4.Items); | ||
WriteLn(gear5.Items); | ||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters