# Login World Switcher The login world switcher is the world selecting interface you get when you click the world button on the {ref}`Login` screen: ```{figure} ../../images/login_worldswitcher.png ``` - - - ## TRSLoginWorldSwitcher Reponsible for handling the login screen world switcher. This record holds information about the several buttons it has like you can see in this image: ```{figure} ../../images/login_worldswitcher_debug.png ``` - - - ## TRSLoginWorldSwitcher.Setup ```pascal procedure TRSLoginWorldSwitcher.Setup(); ``` Internal method used to setup the {ref}`TRSLoginWorldSwitcher` coordinates. This is automatically called for you on the {ref}`LoginWorldSwitcher variable`. - - - ## LoginWorldSwitcher.IsOpen ```pascal function TRSLoginWorldSwitcher.IsOpen(): Boolean; ``` Returns True/False if the login screen world switcher is currently open. Example: ```pascal WriteLn LoginWorldSwitcher.IsOpen(); ``` - - - ## LoginWorldSwitcher.WaitOpen ```pascal function TRSLoginWorldSwitcher.WaitOpen(time: Integer = 600; interval: Integer = -1): Boolean; ``` Returns True/False if the login screen world switcher opens within `time` milliseconds. Example: ```pascal WriteLn LoginWorldSwitcher.WaitOpen(); ``` - - - ## LoginWorldSwitcher.Close ```pascal function TRSLoginWorldSwitcher.Close(): Boolean; ``` Attempts to close the login screen world switcher. Example: ```pascal if LoginWorldSwitcher.IsOpen() then LoginWorldSwitcher.Close(); ``` - - - ## LoginWorldSwitcher.Open ```pascal function TRSLoginWorldSwitcher.Open(): Boolean; ``` Attempts to open the login screen world switcher. Example: ```pascal if not LoginWorldSwitcher.IsOpen() then LoginWorldSwitcher.Open(); ``` - - - ## LoginWorldSwitcher.Read ```pascal function TRSLoginWorldSwitcher.Read(index: Integer): Integer; ``` Returns the number of the world box at the `index` you specify. Example: ```pascal if LoginWorldSwitcher.IsOpen() then WriteLn LoginWorldSwitcher.Read(0); ``` - - - ## LoginWorldSwitcher Pagination ```pascal function TRSLoginWorldSwitcher.PreviousPage(): Boolean; function TRSLoginWorldSwitcher.NextPage(): Boolean; ``` Attempts to switch the current login screen world switcher page using the `LoginWorldSwitcher.LeftButton` and `LoginWorldSwitcher.RightButton`. Returns True if we successfully changed page. Example: ```pascal if LoginWorldSwitcher.IsOpen() then LoginWorldSwitcher.NextPage(); ``` - - - ## LoginWorldSwitcher GetCurrent ```pascal function TRSLoginWorldSwitcher.GetCurrent(): Integer; ``` Attempts to get our currently selected world. For this, if the login screen world switcher is open, we close it first, as the current world can only be read from the login screen. Example: ```pascal WriteLn LoginWorldSwitcher.GetCurrent(); ``` - - - ## LoginWorldSwitcher.Find ```pascal function TRSLoginWorldSwitcher.Find(world: Integer; out index: Integer): Boolean; ``` Attempts to find the specified `world`. For this, {ref}`LoginWorldSwitcher Pagination` will be used if required. If the world we specified is found, the function returns `True` and the index of of the button is returned through `index`. Example: ```pascal WriteLn LoginWorldSwitcher.Find(303, idx); ``` - - - ## LoginWorldSwitcher.Switch ```pascal function TRSLoginWorldSwitcher.Switch(world: Integer): Boolean; ``` Attempts to switch to the specified `world`. For this, {ref}`LoginWorldSwitcher Pagination` will be used if required. If the world we specified is found and we successfully switch to it the function returns `True`. Example: ```pascal WriteLn LoginWorldSwitcher.Switch(303); ``` - - - ## LoginWorldSwitcher variable Global {ref}`TRSLoginWorldSwitcher` variable.