add gui.get_active_frame, set_active_frame & update cursor lock behavior

This commit is contained in:
MihailRis 2026-02-06 14:16:30 +03:00
parent 463098aa1e
commit 8468ab184d
11 changed files with 123 additions and 50 deletions

View file

@ -127,11 +127,11 @@ function on_hud_open()
hud.default_hand_controller = update_hand
local name = "gui/no_icon"
gui.create_frame(name, {16, 16})
local name = "misc/moon"
gui.create_frame(name, name, {128, 128})
local document = Document.new(name)
document.root:add("<label>Hello</label>")
document.root:add("<button>Hello, World</button>")
document.root.color = {255, 0, 0, 255}
end

View file

@ -232,6 +232,7 @@ _GUI_ROOT = Document.new("core:root")
_MENU = _GUI_ROOT.menu
menu = _MENU
gui.root = _GUI_ROOT
gui.main_frame_id = "core:main"
do
local status, err = pcall(function()
@ -435,6 +436,7 @@ function __vc_on_hud_open()
if menu.page ~= "" then
if not menu:back() then
menu:reset()
gui.set_active_frame("")
end
elseif hud.is_inventory_open() then
hud.close_inventory()