Options¶
Methods to interact with the options gametab.
EOptionsTab enum¶
EOptionsTab = enum(CONTROLS, AUDIO, DISPLAY);
Enum representing each of the options tabs.
EOptionsSlider enum¶
EOptionsSlider = enum(BRIGHTNESS, ZOOM);
Enum representing the 2 important sliders the options gametab has available. Could be expanded in the future to include the sound sliders but for now only has this 2.
EOptionsDropDown enum¶
EOptionsDropDown = enum(PLAYER_ATTACK, NPC_ATTACK, CLIENT_MODE);
Enum representing each of the options gametab dropdowns.
TOptions type¶
Main record responsible with interacting with the Options gametab.
Options.SetupGameTab¶
procedure TOptions.SetupGameTab();
Internal method used to setup the TOptions type coordinates.
This is automatically called for you on the Options variable.
Options.IsOpen¶
function TOptions.IsOpen(): Boolean;
Returns true/false if the options gametab is open or not.
Example:
WriteLn Options.IsOpen();
Options.Open¶
function TOptions.Open(): Boolean;
Attempts to open the options gametab.
Example:
WriteLn Options.Open();
Options.GetTab¶
function TOptions.GetTab(): EOptionsTab;
Returns the currently active EOptionsTab enum.
Example:
WriteLn Options.GetTab();
Options.OpenTab¶
function TOptions.OpenTab(tab: EOptionsTab): Boolean;
Attempts to open the specified tab EOptionsTab enum.
Example:
WriteLn Options.OpenTab(EOptionsTab.DISPLAY);
Options._GetZoomLevel¶
function TOptions._GetZoomLevel(): Integer;
Retrieves the current zoom level assuming the display tab is currently open.
Example:
WriteLn Options._GetZoomLevel();
Options.GetZoomLevel¶
function TOptions.GetZoomLevel(useCache: Boolean = True): Integer;
Retrieves the current zoom level.
By default it uses the value cached in TOptions.ZoomLevel if it is already set.
If it’s not set or if you decide to use this with useCache set to False,
TOptions.ZoomLevel will be updated with the value this returns.
Example:
WriteLn Options.GetZoomLevel();
Options.SetZoomLevel¶
function TOptions.SetZoomLevel(level: Integer): Boolean;
Sets a new zoom level through the options gametab.
If we successfully update the zoom level we update the cached
TOptions.ZoomLevel, if we don’t, we reset it to -1.
Example:
Options.SetZoomLevel(30);
Options.SetPlayerAttack¶
function TOptions.SetPlayerAttack(index: Integer): Boolean;
function TOptions.SetPlayerAttack(option: String): Boolean; overload;
Attempts to set the specified attack option for players.
Example:
WriteLn Options.SetPlayerAttack('Depends on combat levels');
WriteLn Options.SetPlayerAttack(2);
Options.SetNPCAttack¶
function TOptions.SetNPCAttack(index: Integer): Boolean;
function TOptions.SetNPCAttack(option: String): Boolean; overload;
Attempts to set the specified attack option for NPCs.
Example:
WriteLn Options.SetNPCAttack('Depends on combat levels');
WriteLn Options.SetNPCAttack(2);
Options.SetClientMode¶
function TOptions.SetClientMode(mode: EMode): Boolean;
Attempts to set the specified mode client mode.
Example:
WriteLn Options.SetClientMode('Fixed');
Options.RenderSelf¶
TOptions.RenderSelf();
Writes “::renderself” on the chat and presses enter.
This toggles your character being rendered.
Example:
Options.RenderSelf();
Options.GetRoofsState¶
function TOptions.GetRoofsState(): Boolean;
Returns the roofs state.
Example:
Options.GetRoofsState();
Options.HideRoofs¶
function TOptions.HideRoofs(): Boolean;
Attempts to hide roofs.
Example:
Options.HideRoofs();
Options.ShowRoofs¶
function TOptions.ShowRoofs(): Boolean;
Attempts to show roofs.
Example:
Options.ShowRoofs();
Options.GetBrightness¶
function TOptions.GetBrightness(): Integer;
Returns the current brightness level. By default it uses CacheParser for this so it doesn’t need to open the options tab.
Example:
WriteLn Options.GetBrightness();
Options.SetMaxBrightness¶
function TOptions.SetMaxBrightness(): Boolean;
Attempts to set your brightness to 100, which is the only value supported by WaspLib.
Example:
WriteLn Options.SetMaxBrightness();
Options variable¶
Global TOptions type variable.