Permalink
Browse files

Rename function

  • Loading branch information...
Silverfeelin committed Aug 18, 2017
1 parent d2c0cdd commit c6cf2dd834ab3d0ef7a215405459e16613cd7d2c
Showing with 6 additions and 11 deletions.
  1. +0 −2 interface/wedit/settings.lua
  2. +6 −9 scripts/wedit/controller.lua
@@ -21,8 +21,6 @@ local brushShapes = {
}
function init()
if not status.statusProperty("wedit") then status.setStatusProperty("wedit", {}) end
widget.setText(widgets.noclipBind, weditInterface.getConfigData("noclipBind") or "g")
widget.setText(widgets.noclipSpeed, weditInterface.getConfigData("noclipSpeed") or 0.75)
widget.setText(widgets.delay, weditInterface.getConfigData("delay") or 15)
@@ -22,24 +22,21 @@ require "/scripts/wedit/actions.lua"
--- Sets a value under the "wedit" status property.
-- @param key wedit table key.
-- @param value Property value.
-- @see controller.getConfigData
function controller.setConfigData(key, value)
-- @see controller.getUserConfig
function controller.setUserConfig(key, value)
local cfg = status.statusProperty("wedit") or {}
cfg[key] = value
status.setStatusProperty("wedit", cfg)
end
--- Gets a value under the "wedit" status property.
-- @param key wedit table key.
-- @see controller.setConfigData
function controller.getConfigData(key)
-- @see controller.setUserConfig
function controller.getUserConfig(key)
local cfg = status.statusProperty("wedit") or {}
return key == nil and cfg or cfg[key]
end
-- Failsafe: If the WEdit property wasn't set, set it.
if not status.statusProperty("wedit") then status.setStatusProperty("wedit", {}) end
-- Failsafe: If the interface was somehow marked open on init, this ensure it's marked closed.
status.setStatusProperty("wedit.compact.open", nil)
status.setStatusProperty("wedit.dyePicker.open", nil)
@@ -184,7 +181,7 @@ end
-- @see wedit.user
function controller.updateUserConfig()
-- Load config data
local cfg = controller.getConfigData()
local cfg = controller.getUserConfig()
for k in pairs(wedit.user) do
wedit.user[k] = nil
end
@@ -194,7 +191,7 @@ function controller.updateUserConfig()
if wedit.getUserConfigData("clearSchematics") then
storage.weditSchematics = {}
controller.setConfigData("clearSchematics", false)
controller.setUserConfig("clearSchematics", false)
wedit.user.clearSchematics = false
end
end

0 comments on commit c6cf2dd

Please sign in to comment.