From 6236a12ca9faff214ec7cf46295888769fad433e Mon Sep 17 00:00:00 2001 From: Vanic Date: Mon, 5 Jan 2026 15:18:12 +0300 Subject: [PATCH] Item: add `titleColor` & `descriptionColor` params --- mods/CORE/Item/src/Item.lua | 11 +++++++---- mods/CORE/Item/src/Item/Settings.lua | 12 ++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/mods/CORE/Item/src/Item.lua b/mods/CORE/Item/src/Item.lua index 6c20390..9040c4c 100644 --- a/mods/CORE/Item/src/Item.lua +++ b/mods/CORE/Item/src/Item.lua @@ -11,9 +11,11 @@ local ItemFactory = Mod.getInfo('smc__core__item_factory').require('ItemFactory' local Item = { defaultDef = { settings = { - name = "", - title = "", - description = "", + name = '', + title = '', + description = '', + titleColor = '#FFFFFF', + descriptionColor = '#C0C0C0' }, callbacks = {} } @@ -55,7 +57,8 @@ local function itemDefToLuantiDef(itemDef, addModName) description = string.match(s.name, '%S:(%S+)')..'-desc' 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 diff --git a/mods/CORE/Item/src/Item/Settings.lua b/mods/CORE/Item/src/Item/Settings.lua index b435721..9650212 100644 --- a/mods/CORE/Item/src/Item/Settings.lua +++ b/mods/CORE/Item/src/Item/Settings.lua @@ -13,6 +13,18 @@ Settings.title = nil ---@type string? 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 ---'item_2d'| ---'item_3d'