MapGen: add load fixColor to mapgen async
This commit is contained in:
@@ -37,6 +37,8 @@ dofile(core.get_modpath('smc__system__table')..'/init.lua')
|
||||
-- TODO: пока что закоментировано, поскольку вызывает ошибку из-за global_step
|
||||
-- Smc lib loader
|
||||
-- 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
|
||||
local mapGenerator = dofile(core.get_modpath('smc__core__map_generator')..'/src/mapGenerator.lua')
|
||||
|
||||
@@ -3,23 +3,5 @@ Smc = {}
|
||||
local modInfo = Mod.getInfo('smc__system__helper_lib')
|
||||
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.color')
|
||||
|
||||
18
mods/SYSTEM/HelperLib/src/Lib/color.lua
Normal file
18
mods/SYSTEM/HelperLib/src/Lib/color.lua
Normal 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
|
||||
Reference in New Issue
Block a user