Skip to content

Creating UI Config File

AnkhHeart edited this page Apr 11, 2018 · 3 revisions

Example File

{
  "output_file": "settings.json",
  "cd_response": {
    "type": "textbox",
    "value": "{0} the command is still on cooldown for {1} seconds!",
    "label": "Cooldown Response",
    "tooltip": "The message that the bot will display.",
    "group": "Responses"
  },
  "use_cd": {
    "type": "checkbox",
    "value": false,
    "label": "Use Cooldown Message",
    "tooltip": "To display CoolDown Message?",
    "group": "Checkboxes"
  },
  "cd": {
    "type": "numberbox",
    "label": "COOLDOWN (seconds)",
    "value": 10,
    "tooltip": "Cooldown in seconds.",
    "group": "Numbers"
  },
  "choice": {
    "type": "dropdown",
    "label": "Mode",
    "value": "Mode 1",
    "tooltip": "This will determine the mode.",
    "items": [
      "Mode 1",
      "Mode 2",
      "Mode 3"
    ],
    "group": "Dropdowns"
  },
  "headcolor": {
    "type": "colorpicker",
    "label": "Header Color",
    "value": "rgba(255,0,0,1.0)",
    "tooltip": "",
    "group": "Color Pickers"
  },
  "interval": {
    "type": "slider",
    "label": "Interval",
    "value": 1,
    "min": 0,
    "max": 10,
    "ticks": 0.1,
    "tooltip": "",
    "group": "Sliders"
  },
  "btnStart": {
    "type": "button",
    "label": "Start Timer",
    "tooltip": "Starts the Timer!",
    "function": "StartTimer",
    "wsevent": "EVENT_START_TIMER",
    "group": "buttons"
  }
}

Output File

Each UI_Config file has to start off with the first element being "output_file" this will tell the bot where the file should be saved to and how it should be called. This file has to always be of type .json.

"output_file": "settings.json"

TextBox

In order to create a Textbox you need to follow this format. The group label will be used to sort all your UI elements in nice Expander boxes so everything looks clean.

{
  "cd_response": {
    "type": "textbox",
    "value": "{0} the command is still on cooldown for {1} seconds!",
    "label": "Cooldown Response",
    "tooltip": "The message that the bot will display.",
    "group": "Responses"
  }
}

CheckBox

In order to create a Checkbox you need to follow this format.

{
  "use_cd": {
    "type": "checkbox",
    "value": false,
    "label": "Use Cooldown Message",
    "tooltip": "To display CoolDown Message?",
    "group": "Checkboxes"
  }
}

NumberBox

In order to create a Numberbox which is a Textbox that only allows Numbers to be typed you would need to follow this format.

{
  "cd": {
    "type": "numberbox",
    "label": "COOLDOWN (seconds)",
    "value": 10,
    "tooltip": "Cooldown in seconds.",
    "group": "Numbers"
  }
}

Dropdown

In order to create a Dropdown you will need to follow this format.

{
  "choice": {
    "type": "dropdown",
    "label": "Mode",
    "value": "Mode 1",
    "tooltip": "This will determine the mode.",
    "items": [
      "Mode 1",
      "Mode 2",
      "Mode 3"
    ],
    "group": "Dropdowns"
  }
}

ColorPicker

In order to create a Colorpicker you will need to follow this format.

{
  "headcolor": {
    "type": "colorpicker",
    "label": "Header Color",
    "value": "rgba(255,0,0,255)",
    "tooltip": "",
    "group": "Color Pickers"
  }
}

Slider

In order to create a Slider you will need to follow this format.

{
  "interval": {
    "type": "slider",
    "label": "Interval",
    "value": 1,
    "min": 0,
    "max": 10,
    "ticks": 0.1,
    "tooltip": "Determines the polling interval.",
    "group": "Sliders"
  }
}

Button

In order to create a Button you will need to follow this format. The function refers to the Python Script function that should be called. The wsevent refers to the Websocket Event that should be sent when clicking the button.

{
  "btnStart": {
    "type": "button",
    "label": "Start Timer",
    "tooltip": "Starts the Timer!",
    "function": "StartTimer",
    "wsevent": "EVENT_START_TIMER",
    "group": "buttons"
  }
}

Clone this wiki locally