Skip to main content

UI

UI namespace

danger

Please be careful when accessing and overriding settings of other scripts!

Properties

rootMenus: Menu[] - std::vector<Menu>

List of all root menus.

Functions

GetLanguage

UI.GetLanguage() number - integer

Returns currently selected language.


Examples

Access Orbwalker Hold Radius settings and temporarily override it.

-- Warning: This is just a PoC to give you an idea how it can be done.
-- We highly advice not to mess around with settings, but if you have to - then please be responsible.
-- If you override some value - make sure to restore it immediately after you executed your logic.

local orbwalkerMenu
for _, v in UI.rootMenus:pairs() do
if v and v.name and v.name == "Orbwalker" then -- Locate Orbwalker Menu
orbwalkerMenu = v
break
end
end
local holdRadius = orbwalkerMenu["Configuration"]["HoldRadius"] -- Access HoldRadius setting
local originalHoldRadius
local function PushHoldRadius(value)
if originalHoldRadius then return end -- Make sure we don't override it twice
originalHoldRadius = holdRadius.value -- Store original value
holdRadius.value = value -- Override value
end
local function PopHoldRadius()
if not originalHoldRadius then return end
holdRadius.value = originalHoldRadius
originalHoldRadius = nil
end

local function MyLogic()
PushHoldRadius(50) -- Override
-- Perform logic
PopHoldRadius() -- Restore
end

Callback.Bind(CallbackType.OnUnload, function()
PopHoldRadius() -- Just in case do it OnUnload
return CallbackResult.Dispose
end)