changed: functions returned

(and unexposed key_instance class)
This commit is contained in:
VorTechnix 2022-05-23 17:08:42 -07:00
parent 1cef968731
commit 3196a590f5
2 changed files with 37 additions and 28 deletions

View File

@ -31,24 +31,26 @@ else
end
--- Unified Axis Keywords banks
local keywords = {}
-- Direction keywords
keywords.dir = {
["?"] = "front", f = "front",
facing = "front", front = "front",
b = "back", back = "back",
behind = "back", rear = "back",
l = "left", left = "left",
r = "right", right = "right",
u = "up", up = "up",
d = "down", down = "down",
}
-- Mirroring keywords
keywords.mirroring = {
sym = true, symmetrical = true,
mirror = true, mir = true,
rev = true, reverse = true,
["true"] = true
local keywords = {
-- Direction keywords
keywords.dir = {
["?"] = "front", f = "front",
facing = "front", front = "front",
b = "back", back = "back",
behind = "back", rear = "back",
l = "left", left = "left",
r = "right", right = "right",
u = "up", up = "up",
d = "down", down = "down",
},
-- Mirroring keywords
keywords.mirroring = {
sym = true, symmetrical = true,
mirror = true, mir = true,
rev = true, reverse = true,
["true"] = true
},
}
--- Initialize parser function container
@ -201,4 +203,8 @@ function parse.keytable(tbl, facing, sum)
end
return parse
return {
keyword = parse.keyword,
keytable = parse.keytable,
number = parse.num,
}

View File

@ -4,17 +4,20 @@
-- ██ ██ ██ ██ ██ ██ ██
-- ██ ██ ██ ██ ██ ███████ ███████
-- Unified Axes Keyword Parser
local uak_parse = dofile(worldeditadditions.modpath.."/utils/parse/axes_parser.lua")
-- Old axis parsing functions
local axes = dofile(worldeditadditions.modpath.."/utils/parse/axes.lua")
local parse = dofile(worldeditadditions.modpath.."/utils/parse/axes.lua")
local key_instance = dofile(worldeditadditions.modpath.."/utils/parse/key_instance.lua")
worldeditadditions.key_instance = key_instance
worldeditadditions.parse = parse
-- Old parse functions (marked for deprecation).
-- Use parse.keytable or parse.keyword instead
worldeditadditions.parse.axes = axes.parse_axes
worldeditadditions.parse.axis_name = axes.parse_axis_name
worldeditadditions.parse = {
keyword = uak_parse.keyword,
keytable = uak_parse.keytable,
number = uak_parse.num,
-- Old parse functions (marked for deprecation).
-- Use parse.keytable or parse.keyword instead
axes = axes.parse_axes,
axis_name = axes.parse_axis_name,
}
dofile(worldeditadditions.modpath.."/utils/parse/chance.lua")
dofile(worldeditadditions.modpath.."/utils/parse/map.lua")