# Options Methods to interact with the options gametab. ```{figure} ../../images/options.png ``` - - - (EOptionsTab)= ## EOptionsTab enum ```pascal EOptionsTab = enum(CONTROLS, AUDIO, DISPLAY); ``` Enum representing each of the options tabs. - - - (EOptionsSlider)= ## EOptionsSlider enum ```pascal 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)= ## EOptionsDropDown enum ```pascal EOptionsDropDown = enum(PLAYER_ATTACK, NPC_ATTACK, CLIENT_MODE); ``` Enum representing each of the options gametab dropdowns. - - - (EOptionsButton)= ## EOptionsButton enum ```pascal EOptionsButton = enum(AID, RUN, HOUSE, BOND, ALL_SETTINGS); ``` Enum representing each of the options gametab buttons. - - - (TOptions)= ## TOptions type Main record responsible with interacting with the {ref}`Options` gametab. - - - ## Options.SetupGameTab ```pascal procedure TOptions.SetupGameTab(); ``` Internal method used to setup the {ref}`TOptions` coordinates. This is automatically called for you on the {ref}`Options variable`. - - - ## TOptions.Buttons ```pascal Buttons: array [EOptionsButton] of TButton; ``` `TButton` 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}`EHouseOptionsButton`. Example: ```pascal ShowOnTarget(Options.Buttons[EOptionsButton.HOUSE]); ``` ```{figure} ../../images/options_button.png ``` - - - ## Options.IsOpen ```pascal function TOptions.IsOpen(): Boolean; ``` Returns true/false if the options gametab is open or not. Example: ```pascal WriteLn Options.IsOpen(); ``` - - - ## Options.Open ```pascal function TOptions.Open(): Boolean; ``` Attempts to open the options gametab. Example: ```pascal WriteLn Options.Open(); ``` - - - ## Options.GetTab ```pascal function TOptions.GetTab(): EOptionsTab; ``` Returns the currently active {ref}`EOptionsTab`. Example: ```pascal WriteLn Options.GetTab(); ``` - - - ## Options.OpenTab ```pascal function TOptions.OpenTab(tab: EOptionsTab): Boolean; ``` Attempts to open the specified `tab` {ref}`EOptionsTab`. Example: ```pascal WriteLn Options.OpenTab(EOptionsTab.DISPLAY); ``` - - - ## Options._GetZoomLevel ```pascal function TOptions._GetZoomLevel(): Integer; ``` Retrieves the current zoom level assuming the display tab is currently open. Example: ```pascal WriteLn Options._GetZoomLevel(); ``` - - - ## Options.GetZoomLevel ```pascal 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: ```pascal WriteLn Options.GetZoomLevel(); ``` - - - ## Options.SetZoomLevel ```pascal 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: ```pascal Options.SetZoomLevel(30); ``` - - - ## Options.SetPlayerAttack ```pascal function TOptions.SetPlayerAttack(index: Integer): Boolean; function TOptions.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 TOptions.SetNPCAttack(index: Integer): Boolean; function TOptions.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 TOptions.SetClientMode(mode: EMode): Boolean; ``` Attempts to set the specified `mode` client mode. Example: ```pascal WriteLn Options.SetClientMode('Fixed'); ``` - - - ## Options.RenderSelf ```pascal TOptions.RenderSelf(); ``` Writes "::renderself" on the chat and presses enter. This toggles your character being rendered. Example: ```pascal Options.RenderSelf(); ``` - - - ## Options.GetRoofsState ```pascal function TOptions.GetRoofsState(): Boolean; ``` Returns the roofs state. Example: ```pascal Options.GetRoofsState(); ``` - - - ## Options.HideRoofs ```pascal function TOptions.HideRoofs(): Boolean; ``` Attempts to hide roofs. Example: ```pascal Options.HideRoofs(); ``` - - - ## Options.ShowRoofs ```pascal function TOptions.ShowRoofs(): Boolean; ``` Attempts to show roofs. Example: ```pascal Options.ShowRoofs(); ``` - - - ## Options.GetBrightness ```pascal function TOptions.GetBrightness(): Integer; ``` Returns the current brightness level. By default it uses {ref}`CacheParser` for this so it doesn't need to open the options tab. Example: ```pascal WriteLn Options.GetBrightness(); ``` - - - ## Options.SetMaxBrightness ```pascal function TOptions.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}`TOptions` variable.