Designing a UIScript (*.uis) in FreeSO

Discussion in 'Contribute' started by xXJDrocks450Xx, Jan 3, 2020.

  1. xXJDrocks450Xx

    xXJDrocks450Xx Well-Known Member

    Want to get started making a UIScript for FreeSO? Maybe not now, but eventually you might need this!
    Let's setup the file:
    #Appended UI properties for House Page control (freeso)
    We first need to setup the script with a Comment tag (#), and show where to Begin and End the script.
    Put all of your code in between these tags!

    Let's define an image to use in our new control:
    # Images ---------------------------------------------------------------------------------------------------
    <DefineImage "NAME" assetID="ID"> # optional image filepath comment goes here
    <DefineImage "HouseCategoryBackgroundImage" assetID="0x00000B5B00000001"> # example: This is a category background image
    <DefineImage "Background" assetID="neighp/neighp_bg.png"> # example: This is a dialog background image
    Remember the name you gave it! "assetID" is a little tricky as it can be a Hexadecimal number or a file path (courtesy of FreeSO)
    Let's define a String to use in our new control:
    # Strings ---------------------------------------------------------------------------------------------------
    <Begin><SetSharedProperties stringDir = "UIText" stringTable = TABLE_INDEX>
         <DefineString "NAME" stringIndex=INDEX> # template: fill in your own values!
         <DefineString "DefaultNeighborhoodButtonCaption" stringIndex = 35> # example: This string reads: "Neighborhood"
    The content of these strings is defined in a string table (*.cst file). The stringDir directive dictates which folder to look for this string table in, however for our uses, this should be left as "UIText". stringTable is an index referring to the unique string table to refer to that contains our strings to use. Which string this definition represents is dictated by the stringIndex property. If multiple tables are required, use multiple Begin, SetSharedProperties and End tags.

    Scripting the Control Using Parameters
    Below are functions that use parameter lists to define properties of controls in the script
    The parameters that can be used in these tags are:
    <SetControlProperties "NAME" [params]> # template: fill in your own values!
    <SetControlProperties "CategoryButtonPosition_Money" position=(74,167)>
    This sets properties of a control referenced by FreeSO internally. The properties can be applied programmatically using C# through the UIScript class.
    AddText, AddTextEdit, AddSlider, AddListBox, AddFormatedText, AddProgressBar
    Each of these adds the advertised control to the parent control (the one being scripted right now).
    <FUNCTION "NAME" [params]> # template: fill in your own values!
    <AddButton "HouseLinkButton" id = 100 image = "HouseLinkButtonImage" position=(32,41)> #example: creates a button with the name, id, image, and position defined.
    [params] can be filled in with properties that you wish to set values for. Refer to the parameter list above in case you do not know the name of the parameter you wish to set. Some controls have properties that others do not!
    Last edited: Jan 3, 2020
    Tirea, Andrew AOG, dotequals and 2 others like this.

Share This Page