mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 15:01:49 +00:00
feat: 'res:project' as default project
This commit is contained in:
parent
ca066f46a6
commit
57fa6393c2
4 changed files with 8 additions and 1 deletions
8
res/project/project.toml
Normal file
8
res/project/project.toml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# default project
|
||||
name = "default"
|
||||
base_packs = ["base"]
|
||||
permissions = [
|
||||
"network",
|
||||
"record-audio",
|
||||
"sub-instances",
|
||||
]
|
||||
32
res/project/project_client.lua
Normal file
32
res/project/project_client.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
local menubg
|
||||
|
||||
function on_menu_clear()
|
||||
if menubg then
|
||||
menubg:destruct()
|
||||
menubg = nil
|
||||
end
|
||||
end
|
||||
|
||||
local function setup_backround()
|
||||
local controller = {}
|
||||
function controller.resize_menu_bg()
|
||||
local w, h = unpack(gui.get_viewport())
|
||||
if menubg then
|
||||
menubg.region = {0, math.floor(h / 48), math.floor(w / 48), 0}
|
||||
menubg.pos = {0, 0}
|
||||
end
|
||||
return w, h
|
||||
end
|
||||
local bgid = random.uuid()
|
||||
gui.root.root:add(string.format(
|
||||
"<image id='%s' src='gui/menubg' size-func='DATA.resize_menu_bg' "..
|
||||
"z-index='-1' interactive='true'/>", bgid), controller)
|
||||
menubg = gui.root[bgid]
|
||||
controller.resize_menu_bg()
|
||||
end
|
||||
|
||||
function on_menu_setup()
|
||||
setup_backround()
|
||||
menu.page = "main"
|
||||
menu.visible = true
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue