Skip to content

Commit 9ee084c

Browse files
committed
Update
1 parent b6a7df5 commit 9ee084c

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

druid/color.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---@alias color vector4|vector3|string
2+
13
local PALETTE_DATA = {}
24
local COLOR_WHITE = vmath.vector4(1, 1, 1, 1)
35
local COLOR_X = hash("color.x")

druid/druid.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function M.get_widget(widget_class, gui_url, params)
147147
for index = 1, #registered_druids do
148148
local druid = registered_druids[index]
149149
if druid.fragment == gui_url.fragment and druid.path == gui_url.path then
150-
return druid.new_widget:trigger(widget_class, nil, nil, params)
150+
return druid.new_widget(widget_class, nil, nil, params)
151151
end
152152
end
153153

druid/editor_scripts/assign_layers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--- Module for assigning layers to GUI nodes based on textures and fonts
22

33
local defold_parser = require("druid.editor_scripts.defold_parser.defold_parser")
4-
local system = require("druid.editor_scripts.defold_parser.system.system")
4+
local system = require("druid.editor_scripts.defold_parser.system.parser_internal")
55

66
local M = {}
77

druid/editor_scripts/create_druid_gui_script.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ end
6565
---@param widget_resource_path string The path to the GUI script to link
6666
function M.link_gui_script(selection, widget_resource_path)
6767
local defold_parser = require("druid.editor_scripts.defold_parser.defold_parser")
68-
local system = require("druid.editor_scripts.defold_parser.system.system")
68+
local system = require("druid.editor_scripts.defold_parser.system.parser_internal")
6969

7070
local gui_filepath = editor.get(selection, "path")
7171
print("Linking GUI script to", gui_filepath)

druid/editor_scripts/defold_parser/defold_parser.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--- Defold Text Proto format encoder/decoder to lua table
22

33
local config = require("druid.editor_scripts.defold_parser.system.config")
4-
local system = require("druid.editor_scripts.defold_parser.system.system")
4+
local parser_internal = require("druid.editor_scripts.defold_parser.system.parser_internal")
55

66
local M = {}
77

@@ -17,7 +17,7 @@ function M.decode_defold_object(text)
1717

1818
-- For each line in the text, we go through the following steps:
1919
for raw_line in text:gmatch("[^\r\n]+") do
20-
system.parse_line(raw_line, stack)
20+
parser_internal.parse_line(raw_line, stack)
2121
end
2222

2323
return root
@@ -39,8 +39,8 @@ function M.encode_defold_object(obj, spaces, data_level, extension)
3939
end
4040

4141
table.sort(keys, function(a, b)
42-
local index_a = system.contains(key_order, a) or 0
43-
local index_b = system.contains(key_order, b) or 0
42+
local index_a = parser_internal.contains(key_order, a) or 0
43+
local index_b = parser_internal.contains(key_order, b) or 0
4444
return index_a < index_b
4545
end)
4646

@@ -63,7 +63,7 @@ function M.encode_defold_object(obj, spaces, data_level, extension)
6363
result = result .. tabString .. key .. ': "' .. encodedChild .. '"\n'
6464
elseif item_type == "number" or item_type == "boolean" then
6565
local is_contains_dot = string.find(key, "%.")
66-
if item_type == "number" and (system.contains(config.with_dot_params, key) and not is_contains_dot) then
66+
if item_type == "number" and (parser_internal.contains(config.with_dot_params, key) and not is_contains_dot) then
6767
result = result .. tabString .. key .. ': ' .. string.format("%.1f", array_item) .. '\n'
6868
else
6969
result = result .. tabString .. key .. ': ' .. tostring(array_item) .. '\n'
@@ -94,7 +94,7 @@ function M.encode_defold_object(obj, spaces, data_level, extension)
9494
-- Handle scalar values (string, number, boolean)
9595
if value_type == "number" or value_type == "boolean" then
9696
local is_contains_dot = string.find(key, "%.")
97-
if value_type == "number" and (system.contains(config.with_dot_params, key) and not is_contains_dot) then
97+
if value_type == "number" and (parser_internal.contains(config.with_dot_params, key) and not is_contains_dot) then
9898
result = result .. tabString .. key .. ': ' .. string.format("%.1f", value) .. '\n'
9999
else
100100
result = result .. tabString .. key .. ': ' .. tostring(value) .. '\n'
@@ -125,7 +125,7 @@ end
125125
---@param file_path string
126126
---@return table|nil, string|nil
127127
function M.load_from_file(file_path)
128-
local content, reason = system.read_file(file_path)
128+
local content, reason = parser_internal.read_file(file_path)
129129
if not content then
130130
return nil, reason
131131
end
@@ -146,7 +146,7 @@ function M.save_to_file(file_path, lua_table)
146146

147147
local encoded_object = M.encode_defold_object(lua_table, nil, nil, defold_format_name)
148148

149-
return system.write_file(file_path, encoded_object)
149+
return parser_internal.write_file(file_path, encoded_object)
150150
end
151151

152152

druid/editor_scripts/defold_parser/system/system.lua renamed to druid/editor_scripts/defold_parser/system/parser_internal.lua

File renamed without changes.

0 commit comments

Comments
 (0)