XR Script GUI
From Newerth: Savage Wiki
create <widgettype> -Creates a widget
hide <panel>:<object> -Hides a widget show <panel>:<object> -shows a hidden widget move <panel>:<object> x y -moves widget (must put in the new values, not just the diffrence you want to make) select <panel>:<object> -select a widget for variable manipulation fadein <object> [time] -fades widget in (like the minipmap toggler) fadeout <object> [time] -fades widget out focus <panel>:<object> -brings widget to focus aka, top of screen on <event> cmd - at the event exec command <event> can be one of the following: mousedown, mouseover, mouseup, mouseout, show, hide, move resize <panel>:<object> w h -resizes a widget (must put in the new values, not just the diffrence you want to make) hideall -Hides all widgets staticdepth <0|1> -States weither the widgets can change layer positions in the gui. destroy <widget> -destroys a widget reloadgui - clears gui buffer files, and reloads gui by executing ui_main ui_game files.
MODIFIER COMMANDS:
menu <commmand> <args> commands: list --lists all menu widgets currently loaded add <panel:object> <name> <command> --add an item to the menu (each item in a menu can be linked to a command) remove <panel:object> <name> --remove an item from the list select <panelname:object> <name> --select an item ffrom the list (imitates clicking it) clear <panel:object> --enmpty the menu list param <param> <value> --allows you to alter the params of the selected widget itemizefiles <panel:object> <path> <wildcard> <command> --create a list baed on the files in a folder (wildcards:a wild card of '.cfg' would parse all fils with that string in the file name) itemizedirs <panel:object> <path> <command> --create a menu based on the dirs in a folder floater <command> <args> commands: list - lists all menu widgets currently loaded param <param> <value> - allows you to alter the params of the selected widget swatch <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget variables <panel:object> <r g b a> - lets you set what color the swatch is? keygrab <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget activate <panel:object> - activates a keygrab (causes it to take focus and start reading input) deactivate <panel:object> - deactivates keygrab (causes it to lose focus and stop reading) abort <panel:object> - same as deactivate commit <panel:object> - commits a keygrab (causes it to lose focus, stop reading and executes the exec_cmd) togglebutton <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget toggle <panel:object> - Toggles the current value up <panel:object> - executes the up_command param down <panel:object> - executes the command param o_scrollbuffer <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget print <panel:object> <string> - adds the string to the buffer list scroll <panel:object> <value> - the ammount to scroll up or down the list (used for scroll bars) scrollbuffer <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget print <panel:object> <string> - adds the string to the buffer list scroll <panel:object> <value> - the ammount to scroll up or down the list (used for scroll bars) map <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget playermap <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget textbuffer <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget print <panel:object> <string> - adds the string to the buffer list userlist <command> <args> commands: list - lists all menu widgets currently loaded chatbox <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget say <panel:object> <name> <string> - will print the string in the chatbox in the chatbox textbox <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget activate <panel:object> - activates a textbox (causes it to take focus and start reading input) deactivate <panel:object> - deactivates textbox (causes it to lose focus and stop reading) abort <panel:object> - same as deactivate commit <panel:object> - commits a textbox (causes it to lose focus, stop reading and executes the exec_cmd) graphic <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget label <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget slider <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget variable <variable> - variable which is represented in the slider range <min> <max> - max and min range of the slider direction <horizontal/vertical> -direction of the slider button <command> <args> commands: list - lists all menu widgets currently loaded param <panel:object> <param> <value> - allows you to alter the params of the selected widget panel <command> <args> commands: list - lists all menu widgets currently loaded param <panel> <param> <value> - allows you to alter the params of the selected widget end <panel> - nothing i could figure out move <panel> <x> <y> - moves panel to new ordered pair show <panel> - unhides panel focus <panel> - brings panel into active front state hide <panel> - hides panel remove <panel> - destroys panel link <panel1> <panel2> <top/bottom/left/right> - will snap 2 panels togeather.
CREATION COMMANDS:
create thumbnailgrid name x y columns thumbnail_displaysize cvar_t cmd --creats the thumbnail grid for commanders?
floater name x y w h --Creates a "handle" that allows you to dynamicly move widgets with your mouse
graphic param <panel:object> <value> valid parameters: image <image> - changes the image char_height <size> - changes the text size textcolor <r> <g> <b> - changes the text color color <r> <g> <b> - changes the color of the image text <text> - sets the text color animate <startframe> <endframe> <numloops> <freezeframe> - sets the animation parameters fps <float> - sets the fps of the animation
create menu name x y w -- Creates a pull down menu
menu param <panel:object> <var> <value> valid parameters: bg_color <r> <g> <b> - sets the background color text_color <r> <g> <b> - sets the text color highlight_color <r> <g> <b> - sets the highlighted text color char_height <height> - sets the font width, in pixels visible_items <items> -sets maximum numbers of items in the menu visible at any one time
create swatch name x y w h --creates the color slider things . . like in the editor
swatch param <panel:object> <var> <value> valid parameters: variables <var1> <var2> <var3> <var4>
create keygrab name x y width height [var] -- creates a text box that grabs a key - for binding keys
keygrab param <panel:object> <param> <args> params: commit_cmd - command to exec if they hit enter (success) abort_cmd - command to exec if they hit esc (abort) char_height - height of the text border - size of the border to draw around the widget type - float, int, string
create togglebutton name x y w h --Creats a toggle check box - options menu
togglebutton param <panel:object> <var> <value> valid parameters: command <command> - the command to execute when a button is pressed up_command <command> - the command to execute when a button is released down_image <image> - the image file to use when the button is down (pressed) down_hover_image <image> - the image file to use when the button is down and the mouse is over it (mouseover) up_image <image> - the image file to use when the button is up (normal) up_hover_image <image> - the image file to use when the button is up and the mouse is over it (mouseover) text <text> - the text to overlay on top of the button variable <varname> - use a cvar to control the toggle/untoggle
create o_scrollbuffer name x y width height --ordered buffer to hold a list of strings - like the server list
o_scrollbuffer param <panel:object> <param> <value> Available params: thickness - (line thickness of chat box) delay_secs - (# seconds delay before text fades) char_height - (height of character [aka font size]) icon_height - (height of icons) textcolor r g b - the color to draw the text selected_textcolor r g b - the color to draw the selected text selected_bgcolor r g b - the color to draw the background of selected text dropshadow - set to 1 to draw a dropshadow dropshadowoffset - set the offset of the dropshadow dropshadowcolor r g b - set the color of the dropshadow rows - (number of rows in o_scrollbuffer) linewrap - turn on/off linewrapping variable - the variable to set the value to scrollvariable - the variable to determine the scrolling amount rclick_cmd - the command to run when someone right-clicks sort_column - the column to sort on colpos <pos> - the pixel position to start column number <i> url - the url to grab data from to put in the o_scrollbuffer
scrollbuffer name x y width height -- scroll buffer to hold a list of strings
scrollbuffer param <panel:object> <param> <value> Available params: thickness - (line thickness of chat box) delay_secs - (# seconds delay before text fades) char_height - (height of character [aka font size]) icon_height - (height of icons) textcolor r g b - the color to draw the text selected_textcolor r g b - the color to draw the selected text selected_bgcolor r g b - the color to draw the background of selected text dropshadow - set to 1 to draw a dropshadow dropshadowoffset - set the offset of the dropshadow dropshadowcolor r g b - set the color of the dropshadow rows - (number of rows in scrollbuffer) linewrap - turn on/off linewrapping variable - the variable to set the value to scrollvariable - the variable to determine the scrolling amount rclick_cmd - the command to run when someone right-clicks url - the url to grab data from to put in the scrollbuffer
create map name x y w h --creates minimap
map param <panel:object> <var> <value> valid parameters: friend_image <image> - sets the icon to use for friendly objects friend_player_image <image> - sets the icon to use for friendly objects friend_officer_image <image> - sets the icon to use for friendly objects friend_seige_image <image> - sets the icon to use for friendly objects enemy_image <image> - sets the icon to use for enemy objects enemy_seige_image <image> - sets the icon to use for enemy objects other_image <image> - sets the icon to use for neutral objects bg_cvar <cvar_name> - sets the name of the cvar that specifies the background image
create playermap name x y w h --creates spawn map playermap param <panel:object> <var> <value> valid parameters:
friend_image <image> - sets the icon to use for friendly objects friend_player_image <image> - sets the icon to use for friendly players friend_seige_image <image> - sets the icon to use for friendly seige weapons friend_officer_image <image> - sets the icon to use for friendly officers enemy_image <image> - sets the icon to use for enemy objects enemy_seige_image <image> - sets the icon to use for enemy seige weapons enemy_officer_image <image> - sets the icon to use for enemy officers other_image <image> - sets the icon to use for neutral objects spawnpoint_image <image> - sets the icon to use for a spawnpoint commandcenter_image <image> - sets the icon to use for the command center waypoint_image <image> - sets the icon to use for a waypoint player_image <image> - sets the icon to use for the player underattack_image <image> - sets the icon to use for a building under attack buildingcomplete_image <image> - sets the icon to use for a building construction complete image bg_cvar <cvar_name> - sets the name of the cvar that specifies the background image spawnselect <1|0> -
create textbuffer name x y width rows --shows text buffer - Was B before patch
togglebutton param <panel:object> <var> <value> valid parameters: team <number> - the team to display users from (-1 will display users from all teams) type <name|ping|score|deaths> - change whether this draws the names, pings, scores, or deaths textcolor <r> <g> <b> - change the text color selected_textcolor <r> <g> <b> - change the selected text color gap <number> - change the gap between vertical lines of the text interactive - changes it so you can select players from the widget
create userlist name x y width height --userlist Pressing Tab does this
togglebutton param <panel:object> <var> <value> valid parameters: team <number> - the team to display users from (-1 will display users from all teams) type <name|ping|score|deaths> - change whether this draws the names, pings, scores, or deaths textcolor <r> <g> <b> - change the text color selected_textcolor <r> <g> <b> - change the selected text color gap <number> - change the gap between vertical lines of the text interactive - changes it so you can select players from the widget
create chatbox name x y rows cols [thickness] [char_height] --The chatbox currently in the game.
chatbox param <panel:object> <param> <value> Available params: thickness - (line thickness of chat box) delay_secs - (# seconds delay before text fades) char_height - (height of character [aka font size]) rows - (number of rows in chatbox) width - (width of the chatbox) type
create textbox name x y width size var [max_length textheight] -- box to allow text input - chatting
textbox param <panel:object> <param> <args> params: commit_cmd - command to exec if they hit enter (success) abort_cmd - command to exec if they hit esc (abort) char_height - height of the text border - size of the border to draw around the widget dropshadow - set to 1 to draw a dropshadow dropshadowoffset dropshadowcolor r g b type - float, int, string hidden - set to 1 to hide the contents
create slider name x y width height --creates a slider that can or cant be controled by user (hp bar and options slider)
slider param <panel:object> <var> <value> valid parameters: variable <name> - sets the variable to store the value in value <float> - sets the value of the slider range <lo> <high> - sets the range of the slider (floats) slider_color <r> <g> <b> - sets the slider color bgshader <image> - sets the slider background shader fillshader <image> - sets the slider fill shader handleshader <image> - sets the slider handle shader showvalue <false|true> - turns off/on the value getting drawn handlesize <int> - slider handle size
create button name x y w h --creates a button
button param <panel:object> <var> <value> valid parameters: command <command> - the command to execute when a but ton is pressed mouseover_command <command> - the command to execute when the mouse enters the widget mouseaway_command <command> - the command to execute when the mouse exits the widget down_image <image> - the image file to use when the button is down (pressed) up_image <image> - the image file to use when the button is up (normal) up_hover_image <image> - the image file to use when the button is up and the mouse is over it (mouseover) disable_image <image> - the image file to use when the button is disabled reset - clear all params enable <true|false> - set the button to be enabled or disabled (unclickable) text <text> - the text to overlay on top of the button text_color <r> <g> <b> - the text color for text that is overlaid on top of the button alt <text> - the alt text to overlay when they hover on the button
create label name x y w h --creates a lable - text
label param <panel:object> <var> <value> valid parameters: char_height <height> - size of the font, vertically text <text> - the text to use as the label cvar <cvarname> - the cvar to use as the label textcolor <r> <g> <b> - change the text color align <left|center|right> - the alignment to use for the text
create panel name x y [pivot_x] [pivot_y] -creates a panel - theses hold widgets to forma complete object?
label param <panel:object> <var> <value> valid parameters: char_height <height> - size of the font, vertically text <text> - the text to use as the label cvar <cvarname> - the cvar to use as the label textcolor <r> <g> <b> - change the text color align <left|center|right> - the alignment to use for the text
create graphic name x y w h --creates a graphic (can be an image (tga, png or jpg) or a movie (blink or theora support) [note:jpg isnt in atm but will be soon]
graphic param <panel:object> <var> <value> valid parameters: image <image> - changes the image char_height <size> - changes the text size textcolor <r> <g> <b> - changes the text color color <r> <g> <b> - changes the color of the image text <text> - sets the text color animate <startframe> <endframe> <numloops> <freezeframe> - sets the animation parameters fps <float> - sets the fps of the animation
ui_frame.cfg: The XR widget frame system; cvars you have to define BEFORE calling "exec ui_frame.cfg"
MANDATORY cvars: _x and _y; _height and _width: Top and left corners and the total size of the frame. The placement is relative to the panel or widget being framed. The frames are NOT a distinct panel, they're "graphic" type under the current panel. _border: Sets the frames border width. Anything below and including 4, will get corners the same size as the bars, if above, the corners will be slightly larger, so they look like beams being "shoved" inside some corners holding them. _image: Points to various image sets to be used for the frame elements human: the game will automatically use the default HUD designed frame images for humans AND the CODE switches the source for the images from "/human/frameleft.s2g" etc to /beast/frameleft.s2g when the player has joined T2 (beasts). standard: (the old metallic looking frame with large corners - the Savage 1 alpha overused frames) neutral: This is the keyword that forces the game to keep the "human" looking frames, even if they're not one of the special kinds. This is useful for windows displayed up to the point you join a team. (menus and stuff) old: the crappy, old, orange-ish frames, with crappy, old, semi-transparent corners. oldthin: the old and ugly 1px white streched borders. thin: forces the frame to have the corners' width and height match those of the bars.
SPECIAL cvars: _frame_alpha can be used so that the frames are set to show a degree of transparency _variation 1: this cvar determines that the frame is part of the frames which change aspect according to the HUD interface the user has selected (hi-res, minimal, smoke, old), so that they get the specific graphics once the HUD is loaded. You would see the new hi-res frames in Hi-Res HUD, or the black ones in Minimal and so forth. It's reset to 0 after each frame is drawn.