☂️
API v2.0
☂️
API v2.0
  • Getting Started
    • 👉Starting Guide
  • Cheat's Types and Callbacks
    • 🔄Callbacks
    • 📊Enums
    • 📔Classes
      • 🎨Color
      • 📋Menu
        • CTabSection
        • CFirstTab
        • CSecondTab
        • CThirdTab
        • CMenuGroup
      • 🧩Widgets
        • CMenuSwitch
        • CMenuSliderFloat
        • CMenuSliderInt
        • CMenuButton
        • CMenuColorPicker
        • CMenuColorPickerAttachment
        • CMenuComboBox
        • CMenuGearAttachment
        • CMenuInputBox
        • CMenuMultiComboBox
        • CMenuMultiSelect
        • CMenuBind
      • 🔢Math
        • 🌐Vector
        • 🔄Angle
        • 🔢Vec2
        • 🔀Vertex
  • Game Components
    • 📃Lists
      • 🔮Abilities
      • 🚚Couriers
      • 🛠️CustomEntities
      • 👾Entities
      • 🦸Heroes
      • 🎭NPCs
      • 🐉Camps
      • 👥Players
      • 🔮Runes
      • 🌳TempTrees
      • 🏰Towers
      • 🌲Trees
      • 🎁Physical Items
      • ✨Modifiers
      • 🚀LinearProjectiles
    • 📃Core
      • 👤Player
      • ✨Modifier
      • 👾Entity
      • 🎭NPC
      • 🦸Hero
      • 🌟Ability
      • 🔑Item
      • 🔮Rune
      • 🏰Tower
      • 🌳Tree
      • 🔱Vambrace
      • 🐉Camp
      • 🍾Bottle
      • 🚚Courier
      • 🍻DrunkenBrawler
      • 📦PhysicalItem
      • 👟PowerTreads
      • 🪙TierToken
    • 🛠️Game Engine
      • 🔧Engine
      • 🎉Event
      • 📜GameRules
      • 🌍GlobalVars
      • 🧭GridNav
      • 🎮Input
      • 🌍World
      • 🌫️FogOfWar
      • ⚙️ConVar
    • 🌐Networking & APIs
      • 💬Chat
      • 🌐HTTP
      • 🚂Steam
      • 📡NetChannel
      • 🌐Game Coordinator
    • 🎨Rendering & Visuals
      • ✨Particle
      • 🖌️Renderer
      • 🎨Render
      • 🗺️MiniMap
      • 🖼️Panorama
        • 🖼️Panorama
        • 🖼️UIPanel
    • 📁Configuration & Utilities
      • ⚒️Config
      • 🤖Humanizer
      • 📓Log
      • 🗣️Localizer
      • 📝GameLocalizer
Powered by GitBook
On this page
  • Name
  • Parent
  • Type
  • Open
  • ForceLocalization
  • ToolTip
  • ToolTip
  • Visible
  • Visible
  • Disabled
  • Disabled
  • Unsafe
  • Unsafe
  • Get
  • Set
  • Image
  • ImageHandle
  • Icon
  • SetCallback
  • UnsetCallback
  • ColorPicker
  • Gear
  1. Cheat's Types and Callbacks
  2. Classes
  3. Widgets

CMenuSwitch

PreviousWidgetsNextCMenuSliderFloat

Last updated 26 days ago

CMenuSwitch metatable.

Name

:Name(): string

Returns widget's name.

Parent

:Parent(): |

Returns widget's parent.

Type

:Type():

Returns widget type.

Open

:Open(): nil

Opens parent tabs.

ForceLocalization

Not recommended for use due to its complexity

:ForceLocalization(newText): nil

Name
Type
Description

newText

string

Changes text in the widget. The path to the widget is not affected. May be used for dynamic text customization or recolor.

ToolTip

:ToolTip(newText): string

Name
Type
Description

newText

string

Gets or sets tooltip. Tooltip is displayed when mouse cursor is over the widget. Depends on the argument.

ToolTip

:ToolTip(): string

Visible

:Visible(value): nil

Name
Type
Description

value

boolean

Gets or sets visible state. Depends on argument.

Example

-- setter
switch:Visible(false)

Visible

:Visible(): boolean

Example

-- getter
local isVisible = switch:Visible()

Disabled

:Disabled(value): nil

Name
Type
Description

value

boolean

Gets or sets disabled state. Depends on argument.

Example

-- setter
switch:Disabled( false )

Disabled

:Disabled(): boolean

Example

-- getter
local isDisabled = switch:Disabled()

Unsafe

:Unsafe(value): nil

Name
Type
Description

value

boolean

Gets or sets unsafe state. Unsafe widgets have warning sign. Depends on argument.

Unsafe

:Unsafe(): boolean

Get

:Get(): boolean

Returns widget's value.

Set

:Set(value): nil

Name
Type
Description

value

boolean

Sets widget's value.

Image

:Image(imagePath, [offset]): nil

Name
Type
Description

imagePath

string

Path to the image.

offset [?]

Optional image offset. (default: {0.0, 0.0})

Sets widget's image.

ImageHandle

:ImageHandle(imageHandle, [offset]): nil

Name
Type
Description

imageHandle

integer

offset [?]

Optional image offset. (default: {0.0, 0.0})

Sets tab's image by already created handle.

Icon

:Icon(icon, [offset]): nil

Name
Type
Description

icon

string

icon unicode.

offset [?]

Optional icon offset. (default: {0.0, 0.0})

Example

--https://fontawesome.com/icons/user?f=classic&s=solid
switch:Icon("\f{007}")

SetCallback

Multiple callbacks could be set.

`:SetCallback(callback, [forceCall]):` **`nil`**

Name
Type
Description

callback

fun(this: CMenuSwitch):nil

function to be called on widget change.

forceCall [?]

boolean

true if you want to call callback on widget creation. (default: false)

Sets widget's on change callback.

UnsetCallback

:UnsetCallback(callback): nil

Name
Type
Description

callback

fun(this: CMenuSwitch):nil

function to be removed from widget's callbacks.

Removes widget's on change callback.

ColorPicker

Name
Type
Description

name

string

Name of the attachment.

color

Default color.

Creates CMenuColorPickerAttachment and attaches it to the widget.

Gear

Name
Type
Description

name

string

Name of the attachment.

gearIcon [?]

string

Gear FontAwesome icon. (default: "\uf013")

useSmallFont [?]

boolean

Use small font for gear icon. (default: true)

Creates CMenuGearAttachment and attaches it to the widget.

Sets widget's icon.

:ColorPicker(name, color):

:Gear(name, [gearIcon], [useSmallFont]):

📔
🧩
Icons list
CMenuColorPickerAttachment
CMenuGearAttachment
Vec2
Vec2
Vec2
Color
CMenuGroup
CMenuGearAttachment
Enum.WidgetType