mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add gui.get_active_frame, set_active_frame & update cursor lock behavior
This commit is contained in:
parent
463098aa1e
commit
8468ab184d
11 changed files with 123 additions and 50 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue