Added feature to display item names in different ways
This commit is contained in:
1 parent
47fb913db2
commit
25e15a0908
3 files changed
+38
-1
No files matched your search
@@ -14,6 +14,10 @@ EID.DefaultConfig = {
|
|||||||
-- Italian (https://steamcommunity.com/sharedfiles/filedetails/?id=931392691)
|
-- Italian (https://steamcommunity.com/sharedfiles/filedetails/?id=931392691)
|
||||||
-- If you want to make a translation, please contact me :)
|
-- If you want to make a translation, please contact me :)
|
||||||
["Language"] = "en_us",
|
["Language"] = "en_us",
|
||||||
|
-- Toggle if item names should be displayed in your language, english or both
|
||||||
|
-- States: 1 = english , 2 = translated, 3 = both
|
||||||
|
-- Default = 2
|
||||||
|
["TranslateItemName"] = 2,
|
||||||
-- Change font type. Values are [default, borderless, inverted]
|
-- Change font type. Values are [default, borderless, inverted]
|
||||||
-- Default = "default"
|
-- Default = "default"
|
||||||
["FontType"] = "default",
|
["FontType"] = "default",
|
||||||
|
|||||||
@@ -168,8 +168,20 @@ function EID:printDescription(desc)
|
|||||||
end
|
end
|
||||||
--Display Itemname
|
--Display Itemname
|
||||||
if EID.Config["ShowItemName"] then
|
if EID.Config["ShowItemName"] then
|
||||||
|
local curName = desc.Name
|
||||||
|
if EID.Config["TranslateItemName"] ~= 2 then
|
||||||
|
local curLanguage = EID.Config["Language"]
|
||||||
|
EID.Config["Language"] = "en_us"
|
||||||
|
local englishName = EID:getObjectName(desc.ItemType, desc.ItemVariant, desc.ID)
|
||||||
|
EID.Config["Language"] = curLanguage
|
||||||
|
if EID.Config["TranslateItemName"] == 1 then
|
||||||
|
curName = englishName
|
||||||
|
elseif EID.Config["TranslateItemName"] == 3 and curName ~= englishName then
|
||||||
|
curName = curName.." ("..englishName..")"
|
||||||
|
end
|
||||||
|
end
|
||||||
EID:renderString(
|
EID:renderString(
|
||||||
desc.Name,
|
curName,
|
||||||
renderPos + (Vector(offsetX, -4) * EID.Config["Scale"]),
|
renderPos + (Vector(offsetX, -4) * EID.Config["Scale"]),
|
||||||
textScale,
|
textScale,
|
||||||
EID:getNameColor()
|
EID:getNameColor()
|
||||||
|
|||||||
@@ -86,6 +86,27 @@ if MCMLoaded then
|
|||||||
Info = {"Changes the language.","Languages marked with (WIP) are incomplete"}
|
Info = {"Changes the language.","Languages marked with (WIP) are incomplete"}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
-- Item Name Language
|
||||||
|
local translateStates = {"English", "Current Language", "Current + English"}
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"General",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenuOptionType.NUMBER,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return EID.Config["TranslateItemName"]
|
||||||
|
end,
|
||||||
|
Minimum = 1,
|
||||||
|
Maximum = 3,
|
||||||
|
Display = function()
|
||||||
|
return "Name Language: " .. translateStates[EID.Config["TranslateItemName"]]
|
||||||
|
end,
|
||||||
|
OnChange = function(currentNum)
|
||||||
|
EID.Config["TranslateItemName"] = currentNum
|
||||||
|
end,
|
||||||
|
Info = {"If translated names are available,","this changes how item names are displayed."}
|
||||||
|
}
|
||||||
|
)
|
||||||
MCM.AddSpace("EID", "General")
|
MCM.AddSpace("EID", "General")
|
||||||
|
|
||||||
-- Disable on Curse
|
-- Disable on Curse
|
||||||
|
|||||||
Reference in new issue
Block a user