# Options Methods to interact with the options gametab. ```{figure} ../../images/options.png ``` - - - ## ERSOptionsTab ```pascal ERSOptionsTab = enum(CONTROLS, AUDIO, DISPLAY); ``` Enum representing each of the options tabs. - - - ## ERSOptionsSlider ```pascal ERSOptionsSlider = 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. - - - ## ERSOptionsDropDown ```pascal ERSOptionsDropDown = enum(PLAYER_ATTACK, NPC_ATTACK, CLIENT_MODE); ``` Enum representing each of the options gametab dropdowns. - - - ## ERSOptionsButton ```pascal ERSOptionsButton = enum(AID, RUN, HOUSE, BOND, ALL_SETTINGS); ``` Enum representing each of the options gametab buttons. - - - ## TRSOptions Main record responsible with interacting with the {ref}`Options` gametab. - - - ## Options.SetupGameTab ```pascal procedure TRSOptions.SetupGameTab(); ``` Internal method used to setup the {ref}`TRSOptions` coordinates. This is automatically called for you on the {ref}`Options variable`. - - - ## TRSOptions.Buttons ```pascal Buttons: array [ERSOptionsButton] of TRSButton; ``` `TRSButton` for each of the {ref}`Options` buttons. Example: ```pascal ShowOnTarget(Options.Buttons); ``` ```{figure} ../../images/options_buttons.png ``` You can also access each button with an index or, more conveniently, with a {ref}`ERSHouseOptionsButton`. Example: ```pascal ShowOnTarget(Options.Buttons[ERSOptionsButton.HOUSE]); ``` ```{figure} ../../images/options_button.png ``` - - - ## Options.IsOpen ```pascal function TRSOptions.IsOpen(): Boolean; ``` Returns true/false if the options gametab is open or not. Example: ```pascal WriteLn Options.IsOpen(); ``` - - - ## Options.Open ```pascal function TRSOptions.Open(): Boolean; ``` Attempts to open the options gametab. Example: ```pascal WriteLn Options.Open(); ``` - - - ## Options.GetTab ```pascal function TRSOptions.GetTab(): ERSOptionsTab; ``` Returns the currently active {ref}`ERSOptionsTab`. Example: ```pascal WriteLn Options.GetTab(); ``` - - - ## Options.OpenTab ```pascal function TRSOptions.OpenTab(tab: ERSOptionsTab): Boolean; ``` Attempts to open the specified `tab` {ref}`ERSOptionsTab`. Example: ```pascal WriteLn Options.OpenTab(ERSOptionsTab.DISPLAY); ``` - - - ## Options.GetZoomLevel ```pascal function TRSOptions.GetZoomLevel(useCache: Boolean = True): Integer; ``` Retrieves the current zoom level. By default it uses the value cached in `TRSOptions.ZoomLevel` if it is already set. If it's not set or if you decide to use this with `useCache` set to `False`, `TRSOptions.ZoomLevel` will be updated with the value this returns. Example: ```pascal WriteLn Options.GetZoomLevel(); ``` - - - ## Options.SetZoomLevel ```pascal function TRSOptions.SetZoomLevel(level: Integer): Boolean; ``` Sets a new zoom level through the options gametab. If we successfully update the zoom level we update the cached `TRSOptions.ZoomLevel`, if we don't, we reset it to `-1`. Example: ```pascal Options.SetZoomLevel(30); ``` - - - ## Options.SetPlayerAttack ```pascal function TRSOptions.SetPlayerAttack(index: Integer): Boolean; function TRSOptions.SetPlayerAttack(option: String): Boolean; overload; ``` Attempts to set the specified attack option for players. Example: ```pascal WriteLn Options.SetPlayerAttack('Depends on combat levels'); WriteLn Options.SetPlayerAttack(2); ``` - - - ## Options.SetNPCAttack ```pascal function TRSOptions.SetNPCAttack(index: Integer): Boolean; function TRSOptions.SetNPCAttack(option: String): Boolean; overload; ``` Attempts to set the specified attack option for NPCs. Example: ```pascal WriteLn Options.SetNPCAttack('Depends on combat levels'); WriteLn Options.SetNPCAttack(2); ``` - - - ## Options.SetClientMode ```pascal function TRSOptions.SetClientMode(mode: ERSMode): Boolean; ``` Attempts to set the specified `mode` client mode. Example: ```pascal WriteLn Options.SetClientMode('Fixed'); ``` - - - ## Options.RenderSelf ```pascal TRSOptions.RenderSelf(); ``` Writes "::renderself" on the chat and presses enter. This toggles your character being rendered. Example: ```pascal Options.RenderSelf(); ``` - - - ## Options.GetRoofsState ```pascal function TRSOptions.GetRoofsState(): Boolean; ``` Returns the roofs state. Example: ```pascal Options.GetRoofsState(); ``` - - - ## Options.HideRoofs ```pascal function TRSOptions.HideRoofs(): Boolean; ``` Attempts to hide roofs. Example: ```pascal Options.HideRoofs(); ``` - - - ## Options.ShowRoofs ```pascal function TRSOptions.ShowRoofs(): Boolean; ``` Attempts to show roofs. Example: ```pascal Options.ShowRoofs(); ``` - - - ## Options.GetBrightness ```pascal function TRSOptions.GetBrightness(): Integer; ``` Returns the current brightness level. By default it uses {ref}`RSCacheParser` for this so it doesn't need to open the options tab. Example: ```pascal WriteLn Options.GetBrightness(); ``` - - - ## Options.SetMaxBrightness ```pascal function TRSOptions.SetMaxBrightness(): Boolean; ``` Attempts to set your brightness to 100, which is the only value supported by WaspLib. Example: ```pascal WriteLn Options.SetMaxBrightness(); ``` - - - ## Options variable Global {ref}`TRSOptions` variable.