đŸ–Ĩī¸Menu

all menu item names need to be unique

Beware that selection controls can NOT share the same label, given that the widget in question has one.

get_menu_open

Return the menu open state

if(g_menu.get_menu_open()) {
 // ...

get_menu_position

Returns the menu position on the screen

x = g_menu.get_menu_position()[0] // x-axis
y = g_menu.get_menu_position()[1] // y-axis

get_menu_size

returns the menu size

w = g_menu.get_menu_size()[0] // width
h = g_menu.get_menu_size()[1] // height

set_visibility

sets the visibility of a specific menu item.

g_menu.add_config_value_bool("script:test", false) g_menu.add_config_value_bool("script:test2", false)

g_menu.add_checkbox("test", "script:test")
g_menu.add_checkbox("test 2", "script:test2")
 
function on_render() {
     var visible = g_menu.get_config_value("script:test")

     g_menu.set_visibility("test 2", visible)
}

add_checkbox

Adds a bindable checkbox to the menu

g_menu.add_checkbox( "Enable", "script:enabled" )

add_button

Adds a button

function button_test () {
    g_cheat.notify("button 1")
}
g_menu.add_button("Test 1", "button_test")

add_slider

Adds a slider to the menu from value A to B

g_menu.add_slider( "Setting", "script:setting", 0, 100 )

add_combo

Adds a combobox to the menu

g_menu.add_combo(name, config value, options...);
g_menu.add_combo("Combo", "script:combo", "Option1", "Option2");

get_config_value

Returns a config value

var value = g_menu.get_config_value( "script:enabled" )

set_config_value_bool

Set bool config value

g_menu.set_config_value_bool( "script:enabled", false ) // new value

set_config_value_int

Set int config value

g_menu.set_config_value_int( "script:setting", 0 ) // new value

add_config_value_int

Adds a config member as int. May be used for sliders, groupboxes or comboboxes.

g_menu.add_config_value_int( "script:setting", 0 ) // default value

add_config_value_bool

Adds a config member as bool. Used for checkboxes

g_menu.add_config_value_bool( "script:enabled", false ) // default value

add_config_value_color

Adds config member as color. Used for color pickers.

g_menu.add_config_value_color( "script:color", 255, 255, 0, 255) // default value

add_colorpicker

Adds a color picker to menu

g_menu.add_colorpicker("Color", "script:color")

add_multi_combo

g_menu.add_config_value_bool( "script:enabled1", false ) 
g_menu.add_config_value_bool( "script:enabled2", false ) 
g_menu.add_config_value_bool( "script:enabled3", false )

g_menu.add_multi_combobox("U suck", [ [ "Test 1", "script:enabled1"], [ "Test 2", "script:enabled2"], [ "Test 3", "script:enabled3"] ] )

get_active_keybinds

Returns all active keybinds

g_menu.get_active_keybinds()

Last updated