Added config option for LineHeight and Textbox Width
This commit is contained in:
1 parent
22d50b5fe2
commit
0ec8a0ae60
7 files changed
+66
-14
No files matched your search
@@ -14,7 +14,7 @@ EID.descriptions[languageCode] = {}
|
|||||||
EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions
|
EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions
|
||||||
EID.descriptions[languageCode].languageName = "English"
|
EID.descriptions[languageCode].languageName = "English"
|
||||||
|
|
||||||
EID.descriptions[languageCode].fonts = {"default", "inverted", "borderless"} -- Fonts to be used with this languagepack
|
EID.descriptions[languageCode].fonts = {{name="default", lineHeight=11}, {name="inverted", lineHeight=11}, {name="borderless", lineHeight=11}} -- Fonts to be used with this languagepack
|
||||||
|
|
||||||
EID.descriptions[languageCode].collectibles={
|
EID.descriptions[languageCode].collectibles={
|
||||||
{"1", "The Sad Onion", "↑ +0.7 Tears up"},
|
{"1", "The Sad Onion", "↑ +0.7 Tears up"},
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ EID.descriptions[languageCode].languageName = "Korean"
|
|||||||
|
|
||||||
korean_galmoori9, korean_galmoori11 is added for community request.
|
korean_galmoori9, korean_galmoori11 is added for community request.
|
||||||
]]
|
]]
|
||||||
EID.descriptions[languageCode].fonts = {"korean_hcrdotum", "korean_lanapixel", "korean_soyakkoma", "korean_soyakkoma_borderless", "korean_soyakkoma_inverted", "korean_soyanon", "korean_galmoori9", "korean_galmoori11"} -- Fonts to be used with this languagepack
|
EID.descriptions[languageCode].fonts = {{name="korean_hcrdotum", lineHeight=14}, {name="korean_lanapixel", lineHeight=14}, {name="korean_soyakkoma", lineHeight=14}, {name="korean_soyakkoma_borderless", lineHeight=14}, {name="korean_soyakkoma_inverted", lineHeight=14}, {name="korean_soyanon", lineHeight=14}, {name="korean_galmoori9", lineHeight=14}, {name="korean_galmoori11", lineHeight=14}} -- Fonts to be used with this languagepack
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ EID.descriptions[languageCode].custom = {} -- table for custom entity descriptio
|
|||||||
EID.descriptions[languageCode].languageName = "Chinese"
|
EID.descriptions[languageCode].languageName = "Chinese"
|
||||||
|
|
||||||
-- Fonts to be used with this languagepack
|
-- Fonts to be used with this languagepack
|
||||||
EID.descriptions[languageCode].fonts = {"default_cn"}
|
EID.descriptions[languageCode].fonts = {{name = "default_cn", lineHeight = 14}}
|
||||||
|
|
||||||
---------- Collectibles ----------
|
---------- Collectibles ----------
|
||||||
EID.descriptions[languageCode].collectibles={
|
EID.descriptions[languageCode].collectibles={
|
||||||
|
|||||||
+3
-2
@@ -1012,11 +1012,12 @@ function EID:fixDefinedFont()
|
|||||||
local curLang = EID.Config["Language"]
|
local curLang = EID.Config["Language"]
|
||||||
local curFont = EID.Config["FontType"]
|
local curFont = EID.Config["FontType"]
|
||||||
for _, v in ipairs(EID.descriptions[curLang].fonts) do
|
for _, v in ipairs(EID.descriptions[curLang].fonts) do
|
||||||
if curFont == v then
|
if curFont == v.name then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
EID.Config["FontType"] = EID.descriptions[curLang].fonts[1]
|
EID.Config["FontType"] = EID.descriptions[curLang].fonts[1].name
|
||||||
|
EID.lineHeight = EID.descriptions[curLang].fonts[1].lineHeight
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ EID.UserConfig = {
|
|||||||
-- Set the Y Position (height) of the description texts
|
-- Set the Y Position (height) of the description texts
|
||||||
-- Default = 45
|
-- Default = 45
|
||||||
["YPosition"] = 45,
|
["YPosition"] = 45,
|
||||||
|
-- Set the height of a line, effectivly changing the distance between two lines of text
|
||||||
|
-- Default = 11 (11 for English, 14 for Korean / Chinese)
|
||||||
|
["LineHeight"] = 11,
|
||||||
-- Set the distance between an item and its information display (in tiles)
|
-- Set the distance between an item and its information display (in tiles)
|
||||||
-- Default = 5
|
-- Default = 5
|
||||||
["MaxDistance"] = 5,
|
["MaxDistance"] = 5,
|
||||||
@@ -344,6 +347,7 @@ EID.DefaultConfig = {
|
|||||||
["HUDOffset"] = 10,
|
["HUDOffset"] = 10,
|
||||||
["XPosition"] = 60,
|
["XPosition"] = 60,
|
||||||
["YPosition"] = 45,
|
["YPosition"] = 45,
|
||||||
|
["LineHeight"] = 11,
|
||||||
["DisplayMode"] = "default",
|
["DisplayMode"] = "default",
|
||||||
["LocalScale"] = 0.5,
|
["LocalScale"] = 0.5,
|
||||||
["LocalModeCentered"] = true,
|
["LocalModeCentered"] = true,
|
||||||
|
|||||||
@@ -1081,6 +1081,8 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
EID.isHidden = EID.Config["InitiallyHidden"]
|
EID.isHidden = EID.Config["InitiallyHidden"]
|
||||||
EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"])
|
EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"])
|
||||||
EID.Scale = EID.Config["Scale"]
|
EID.Scale = EID.Config["Scale"]
|
||||||
|
EID.lineHeight = EID.Config["LineHeight"]
|
||||||
|
|
||||||
EID:fixDefinedFont()
|
EID:fixDefinedFont()
|
||||||
EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt")
|
EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt")
|
||||||
if REPENTANCE then
|
if REPENTANCE then
|
||||||
@@ -1112,6 +1114,7 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
end
|
end
|
||||||
EID.Config["FlipItemPositions"] = flipItemTable or {}
|
EID.Config["FlipItemPositions"] = flipItemTable or {}
|
||||||
end
|
end
|
||||||
|
EID.Config["LineHeight"] = EID.lineHeight
|
||||||
EID.SaveData(EID, json.encode(EID.Config))
|
EID.SaveData(EID, json.encode(EID.Config))
|
||||||
EID:hidePermanentText()
|
EID:hidePermanentText()
|
||||||
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_CUBE_OF_MEAT] = nil
|
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_CUBE_OF_MEAT] = nil
|
||||||
|
|||||||
+53
-9
@@ -27,26 +27,28 @@ local colorNameArray = {}
|
|||||||
local function renderDummyDesc()
|
local function renderDummyDesc()
|
||||||
MCMCompat_oldPermanentObj = EID.permanentDisplayTextObj
|
MCMCompat_oldPermanentObj = EID.permanentDisplayTextObj
|
||||||
local demoDescObj = EID:getDescriptionObj(5, 100, 33)
|
local demoDescObj = EID:getDescriptionObj(5, 100, 33)
|
||||||
demoDescObj.Name = "Demo Object Name"
|
demoDescObj.Name = EID:getDescriptionEntry("MCM","demoObjectName")
|
||||||
demoDescObj.Transformation = "Demo Transformation"
|
demoDescObj.Transformation = EID:getDescriptionEntry("MCM","demoObjectTransformation")
|
||||||
demoDescObj.Description = "A very cool description as a demonstration of the power of EID!#\1 This is also a cool line#This line loves you {{Heart}}"
|
demoDescObj.Description = EID:getDescriptionEntry("MCM","demoObjectText")
|
||||||
EID:displayPermanentText(demoDescObj)
|
EID:displayPermanentText(demoDescObj)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- get list of all defined fonts per language file
|
-- get list of all defined fonts per language file
|
||||||
local fonts = {}
|
local fonts = {}
|
||||||
|
local fontNames = {}
|
||||||
for k, pack in pairs(EID.descriptions) do
|
for k, pack in pairs(EID.descriptions) do
|
||||||
if pack.fonts then
|
if pack.fonts then
|
||||||
for _,fontToAdd in ipairs(pack.fonts) do
|
for _,fontToAdd in ipairs(pack.fonts) do
|
||||||
local exists = false
|
local exists = false
|
||||||
for _,font in ipairs(fonts) do
|
for _,font in ipairs(fontNames) do
|
||||||
if font == fontToAdd then
|
if font == fontToAdd.name then
|
||||||
exists = true
|
exists = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not exists then
|
if not exists then
|
||||||
table.insert(fonts, fontToAdd)
|
table.insert(fonts, fontToAdd)
|
||||||
|
table.insert(fontNames, fontToAdd.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -306,6 +308,48 @@ if MCMLoaded then
|
|||||||
Info = {"Default = 45"}
|
Info = {"Default = 45"}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
-- Line Height
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"General",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenu.OptionType.NUMBER,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return EID.lineHeight
|
||||||
|
end,
|
||||||
|
Minimum = 1,
|
||||||
|
Maximum = 100,
|
||||||
|
Display = function()
|
||||||
|
return "Line Height: " .. EID.lineHeight
|
||||||
|
end,
|
||||||
|
OnChange = function(currentNum)
|
||||||
|
EID.lineHeight = currentNum
|
||||||
|
end,
|
||||||
|
Info = {"Default = 11","Lineheight will automatically change when changing a font/language"}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
-- Textbox Width
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"General",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenu.OptionType.NUMBER,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return EID.Config["TextboxWidth"]
|
||||||
|
end,
|
||||||
|
Minimum = 1,
|
||||||
|
Maximum = 500,
|
||||||
|
ModifyBy = 5,
|
||||||
|
Display = function()
|
||||||
|
return "Textbox Width: " .. EID.Config["TextboxWidth"]
|
||||||
|
end,
|
||||||
|
OnChange = function(currentNum)
|
||||||
|
EID.Config["TextboxWidth"] = currentNum
|
||||||
|
end,
|
||||||
|
Info = {"Default = 100","Width of the EID textbox, in pixels"}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
MCM.AddSpace("EID", "General")
|
MCM.AddSpace("EID", "General")
|
||||||
|
|
||||||
@@ -957,16 +1001,17 @@ if MCMLoaded then
|
|||||||
{
|
{
|
||||||
Type = ModConfigMenu.OptionType.NUMBER,
|
Type = ModConfigMenu.OptionType.NUMBER,
|
||||||
CurrentSetting = function()
|
CurrentSetting = function()
|
||||||
return AnIndexOf(fonts, EID.Config["FontType"])
|
return AnIndexOf(fontNames, EID.Config["FontType"])
|
||||||
end,
|
end,
|
||||||
Minimum = 1,
|
Minimum = 1,
|
||||||
Maximum = #fonts,
|
Maximum = #fontNames,
|
||||||
Display = function()
|
Display = function()
|
||||||
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
|
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
|
||||||
return "Font Type: " .. EID.Config["FontType"]
|
return "Font Type: " .. EID.Config["FontType"]
|
||||||
end,
|
end,
|
||||||
OnChange = function(currentNum)
|
OnChange = function(currentNum)
|
||||||
EID.Config["FontType"] = fonts[currentNum]
|
EID.Config["FontType"] = fontNames[currentNum]
|
||||||
|
EID.lineHeight = fonts[currentNum].lineHeight
|
||||||
EID:fixDefinedFont()
|
EID:fixDefinedFont()
|
||||||
local fontFile = EID.Config["FontType"] or "default"
|
local fontFile = EID.Config["FontType"] or "default"
|
||||||
EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt")
|
EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt")
|
||||||
@@ -1598,7 +1643,6 @@ if MCMLoaded then
|
|||||||
Maximum = 1000,
|
Maximum = 1000,
|
||||||
Display = function()
|
Display = function()
|
||||||
if EID.Config["ModIndicatorTextColor"] == nil then EID.Config["TextColor"] = EID.DefaultConfig["ModIndicatorTextColor"] end
|
if EID.Config["ModIndicatorTextColor"] == nil then EID.Config["TextColor"] = EID.DefaultConfig["ModIndicatorTextColor"] end
|
||||||
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
|
|
||||||
return "Mod Indicator: " .. string.gsub(EID.Config["ModIndicatorTextColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ModIndicatorTextColor"]).."/"..#colorNameArray..")"
|
return "Mod Indicator: " .. string.gsub(EID.Config["ModIndicatorTextColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ModIndicatorTextColor"]).."/"..#colorNameArray..")"
|
||||||
end,
|
end,
|
||||||
OnChange = function(currentNum)
|
OnChange = function(currentNum)
|
||||||
|
|||||||
Reference in new issue
Block a user