mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
add console on_open 'mode' argument
This commit is contained in:
parent
e80b10dbda
commit
78ea12aa26
4 changed files with 25 additions and 8 deletions
|
|
@ -194,7 +194,7 @@ function set_mode(mode)
|
|||
console_mode = mode
|
||||
end
|
||||
|
||||
function on_open()
|
||||
function on_open(mode)
|
||||
if modes == nil then
|
||||
modes = RadioGroup({
|
||||
chat=document.s_chat,
|
||||
|
|
@ -204,4 +204,7 @@ function on_open()
|
|||
set_mode(mode)
|
||||
end, "console")
|
||||
end
|
||||
if mode then
|
||||
modes:set(mode)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@ end
|
|||
|
||||
local _RadioGroup = {}
|
||||
function _RadioGroup.set(self, key)
|
||||
if type(self) ~= 'table' then
|
||||
error("called as non-OOP via '.', use radiogroup:set")
|
||||
end
|
||||
if self.current then
|
||||
self.elements[self.current].enabled = true
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue