mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 18:59:03 -06:00
Fix a major bug. Also fix copy. yw milla
This commit is contained in:
parent
d38954dd69
commit
dddcd0c7a7
@ -3,7 +3,13 @@ function copy(t)
|
|||||||
if type(t) ~= "table" then return t end
|
if type(t) ~= "table" then return t end
|
||||||
local meta = getmetatable(t)
|
local meta = getmetatable(t)
|
||||||
local target = {}
|
local target = {}
|
||||||
for k, v in pairs(t) do target[k] = v end
|
for k, v in pairs(t) do
|
||||||
|
if type(v) == "table" then
|
||||||
|
target[k] = copy(v)
|
||||||
|
else
|
||||||
|
target[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
setmetatable(target, meta)
|
setmetatable(target, meta)
|
||||||
return target
|
return target
|
||||||
end
|
end
|
||||||
|
@ -12,6 +12,8 @@ function GamemodeConfigScene:new(gamemode)
|
|||||||
mode_config = gamemode:provideSettings() or {}
|
mode_config = gamemode:provideSettings() or {}
|
||||||
optioncount = #mode_config
|
optioncount = #mode_config
|
||||||
|
|
||||||
|
print(selected_mode.hash)
|
||||||
|
|
||||||
self.highlight = 1
|
self.highlight = 1
|
||||||
|
|
||||||
for i, j in pairs(mode_config) do
|
for i, j in pairs(mode_config) do
|
||||||
@ -25,7 +27,7 @@ function GamemodeConfigScene:new(gamemode)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GamemodeConfigScene:save()
|
function GamemodeConfigScene:save()
|
||||||
config.gamemodesettings[selected_mode.hash] = new_config
|
config.gamemodesettings[selected_mode.hash] = copy(new_config)
|
||||||
end
|
end
|
||||||
|
|
||||||
function GamemodeConfigScene:render()
|
function GamemodeConfigScene:render()
|
||||||
|
Loading…
Reference in New Issue
Block a user