mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
update session library
This commit is contained in:
parent
c9f9838747
commit
3cb295fd58
4 changed files with 10 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
console_mode = "console"
|
console_mode = "console"
|
||||||
|
|
||||||
history = session.get_entry("commands_history")
|
history = session.get("commands_history")
|
||||||
history_pointer = #history
|
history_pointer = #history
|
||||||
|
|
||||||
events.on("core:open_traceback", function()
|
events.on("core:open_traceback", function()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
settings = session.get_entry('new_world')
|
settings = session.get('new_world')
|
||||||
|
|
||||||
function on_open()
|
function on_open()
|
||||||
local names = generation.get_generators()
|
local names = generation.get_generators()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
settings = session.get_entry('new_world')
|
settings = session.get('new_world')
|
||||||
|
|
||||||
function world_name_validator(name)
|
function world_name_validator(name)
|
||||||
return name:match("^[%w-\\.\\ ]+$") ~= nil and not world.exists(name)
|
return name:match("^[%w-\\.\\ ]+$") ~= nil and not world.exists(name)
|
||||||
|
|
@ -20,7 +20,7 @@ function create_world()
|
||||||
local name = document.name_box.text
|
local name = document.name_box.text
|
||||||
local seed = document.seed_box.text
|
local seed = document.seed_box.text
|
||||||
local generator = settings.generator
|
local generator = settings.generator
|
||||||
session.reset_entry('new_world')
|
session.reset('new_world')
|
||||||
app.new_world(name, seed, generator)
|
app.new_world(name, seed, generator)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
local entries = {}
|
local entries = {}
|
||||||
local this = {}
|
local this = {}
|
||||||
|
|
||||||
function this.get_entry(name)
|
function this.get(name)
|
||||||
local entry = entries[name]
|
local entry = entries[name]
|
||||||
if entry == nil then
|
if entry == nil then
|
||||||
entry = {}
|
entry = {}
|
||||||
|
|
@ -10,7 +10,11 @@ function this.get_entry(name)
|
||||||
return entry
|
return entry
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.reset_entry(name)
|
function this.has(name)
|
||||||
|
return entries[name] ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.reset(name)
|
||||||
entries[name] = nil
|
entries[name] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue