forked from Apancore.Studio/simple-makes-complex
Item: add titleColor & descriptionColor params
This commit is contained in:
@@ -11,9 +11,11 @@ local ItemFactory = Mod.getInfo('smc__core__item_factory').require('ItemFactory'
|
|||||||
local Item = {
|
local Item = {
|
||||||
defaultDef = {
|
defaultDef = {
|
||||||
settings = {
|
settings = {
|
||||||
name = "",
|
name = '',
|
||||||
title = "",
|
title = '',
|
||||||
description = "",
|
description = '',
|
||||||
|
titleColor = '#FFFFFF',
|
||||||
|
descriptionColor = '#C0C0C0'
|
||||||
},
|
},
|
||||||
callbacks = {}
|
callbacks = {}
|
||||||
}
|
}
|
||||||
@@ -55,7 +57,8 @@ local function itemDefToLuantiDef(itemDef, addModName)
|
|||||||
description = string.match(s.name, '%S:(%S+)')..'-desc'
|
description = string.match(s.name, '%S:(%S+)')..'-desc'
|
||||||
end
|
end
|
||||||
|
|
||||||
local description = S(title)..'\n'..core.colorize('#C0C0C0', S(description))
|
---@diagnostic disable-next-line: param-type-not-match
|
||||||
|
local description = core.colorize(s.titleColor ,S(title))..'\n'..core.colorize(s.descriptionColor, S(description))
|
||||||
|
|
||||||
s.title, s.description = nil, description
|
s.title, s.description = nil, description
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,18 @@ Settings.title = nil
|
|||||||
---@type string?
|
---@type string?
|
||||||
Settings.description = nil
|
Settings.description = nil
|
||||||
|
|
||||||
|
---Item title color in description.
|
||||||
|
---
|
||||||
|
---Default: `#FFFFFF`
|
||||||
|
---@type ColorString?
|
||||||
|
Settings.titleColor = nil
|
||||||
|
|
||||||
|
---Item description color in description.
|
||||||
|
---
|
||||||
|
---Default: `#C0C0C0`
|
||||||
|
---@type ColorString?
|
||||||
|
Settings.descriptionColor = nil
|
||||||
|
|
||||||
---@alias Item.Visual
|
---@alias Item.Visual
|
||||||
---'item_2d'|
|
---'item_2d'|
|
||||||
---'item_3d'
|
---'item_3d'
|
||||||
|
|||||||
Reference in New Issue
Block a user