MapGen: add load fixColor to mapgen async

This commit is contained in:
Van
2026-01-14 21:11:17 +03:00
parent 907230e67d
commit c2b0c54236
3 changed files with 21 additions and 19 deletions

View File

@@ -37,6 +37,8 @@ dofile(core.get_modpath('smc__system__table')..'/init.lua')
-- TODO: пока что закоментировано, поскольку вызывает ошибку из-за global_step -- TODO: пока что закоментировано, поскольку вызывает ошибку из-за global_step
-- Smc lib loader -- Smc lib loader
-- dofile(core.get_modpath('smc__system__helper_lib')..'/init.lua') -- dofile(core.get_modpath('smc__system__helper_lib')..'/init.lua')
Smc = {}
dofile(core.get_modpath('smc__system__helper_lib')..'/src/Lib/color.lua')
---@type MapGen ---@type MapGen
local mapGenerator = dofile(core.get_modpath('smc__core__map_generator')..'/src/mapGenerator.lua') local mapGenerator = dofile(core.get_modpath('smc__core__map_generator')..'/src/mapGenerator.lua')

View File

@@ -3,23 +3,5 @@ Smc = {}
local modInfo = Mod.getInfo('smc__system__helper_lib') local modInfo = Mod.getInfo('smc__system__helper_lib')
local require = modInfo.require local require = modInfo.require
---Converts a colorstring into a single representation so that similar colors can match.
---@param color ColorString
---@return ColorString
function Smc.fixColorString(color)
local colorTable = core.colorspec_to_table(color)
if colorTable == nil then
return ''
end
local colorString = core.colorspec_to_colorstring(colorTable)
if colorString == nil then
return ''
end
return colorString
end
require('Lib.globalStep') require('Lib.globalStep')
require('Lib.color')

View File

@@ -0,0 +1,18 @@
---Converts a colorstring into a single representation so that similar colors can match.
---@param color ColorString
---@return ColorString
function Smc.fixColorString(color)
local colorTable = core.colorspec_to_table(color)
if colorTable == nil then
return ''
end
local colorString = core.colorspec_to_colorstring(colorTable)
if colorString == nil then
return ''
end
return colorString
end