Renamed "Scale" config functions into "Size" (resets scale settings to fix bug caused by Scale button mapping)

This commit is contained in:
Wofsauge committed 2022-02-01 19:16:40 +01:00
1 parent 2ef086e546
commit e826895d38
3 files changed
+26 -26

No files matched your search

+6 -6
View File
@@ -29,10 +29,10 @@ EID.UserConfig = {
["TextboxWidth"] = 130, ["TextboxWidth"] = 130,
-- Change the size of the info boxes. Range: [0,...,1] -- Change the size of the info boxes. Range: [0,...,1]
-- Default = 1 -- Default = 1
["Scale"] = 1, ["Size"] = 1,
-- Press or hold the key to change scale. Keyboard.KEY_F5 is recommended -- Press or hold the key to change scale. Keyboard.KEY_F5 is recommended
-- Default = none -- Default = none
["ScaleKey"] = -1, ["SizeHotkey"] = -1,
-- Set the background transparency. Range: [0,...,1] -- Set the background transparency. Range: [0,...,1]
-- Default = 0.75 -- Default = 0.75
["Transparency"] = 0.75, ["Transparency"] = 0.75,
@@ -90,7 +90,7 @@ EID.UserConfig = {
["DisplayMode"] = "default", ["DisplayMode"] = "default",
-- Change the size of the info boxes for local mode -- Change the size of the info boxes for local mode
-- Default = 0.5 -- Default = 0.5
["LocalScale"] = 0.5, ["LocalModeSize"] = 0.5,
-- Changes the position of the text in local mode, relative to the described object to be centered. Set to false to make it left-aligned -- Changes the position of the text in local mode, relative to the described object to be centered. Set to false to make it left-aligned
-- Default = true -- Default = true
["LocalModeCentered"] = true, ["LocalModeCentered"] = true,
@@ -365,15 +365,15 @@ EID.DefaultConfig = {
["TranslateItemName"] = 2, ["TranslateItemName"] = 2,
["FontType"] = "default", ["FontType"] = "default",
["TextboxWidth"] = 130, ["TextboxWidth"] = 130,
["Scale"] = 1, ["Size"] = 1,
["ScaleKey"] = -1, ["SizeHotkey"] = -1,
["Transparency"] = 0.75, ["Transparency"] = 0.75,
["HUDOffset"] = 10, ["HUDOffset"] = 10,
["XPosition"] = 60, ["XPosition"] = 60,
["YPosition"] = 45, ["YPosition"] = 45,
["LineHeight"] = 11, ["LineHeight"] = 11,
["DisplayMode"] = "default", ["DisplayMode"] = "default",
["LocalScale"] = 0.5, ["LocalModeSize"] = 0.5,
["LocalModeCentered"] = true, ["LocalModeCentered"] = true,
["MaxDistance"] = 5, ["MaxDistance"] = 5,
["Indicator"] = "none", ["Indicator"] = "none",
+11 -11
View File
@@ -18,7 +18,7 @@ EID.player = nil
EID.PositionModifiers = {} EID.PositionModifiers = {}
EID.DescModifiers = {} EID.DescModifiers = {}
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["Size"]
EID.isDisplaying = false EID.isDisplaying = false
EID.isDisplayingPermanent = false EID.isDisplayingPermanent = false
EID.achievementsEnabled = false EID.achievementsEnabled = false
@@ -390,13 +390,13 @@ local scaleSpeed = 0.01 -- scale size per frame
local scaleToBigger = true local scaleToBigger = true
local scaleHoldFrame = 0 local scaleHoldFrame = 0
local function handleScaleKey() local function handleScaleKey()
local ScaleKey = EID.Config["ScaleKey"] local scaleKey = EID.Config["SizeHotkey"]
-- press and hold ScaleKey -- press and hold ScaleKey
if Input.IsButtonPressed(ScaleKey, 0) then if Input.IsButtonPressed(scaleKey, 0) then
if scaleHoldFrame > 60 then if scaleHoldFrame > 60 then
EID.MCM_OptionChanged = true EID.MCM_OptionChanged = true
local scaleConfigName = (EID.Config["DisplayMode"] == "local" and "LocalScale" or "Scale") local scaleConfigName = (EID.Config["DisplayMode"] == "local" and "LocalModeSize" or "Size")
if scaleToBigger then if scaleToBigger then
local newScale = EID.Scale + scaleSpeed local newScale = EID.Scale + scaleSpeed
@@ -421,11 +421,11 @@ local function handleScaleKey()
end end
end end
-- press ScaleKey -- press ScaleKey
if Input.IsButtonTriggered(ScaleKey, 0) then if Input.IsButtonTriggered(scaleKey, 0) then
EID.MCM_OptionChanged = true EID.MCM_OptionChanged = true
scaleHoldFrame = 0 scaleHoldFrame = 0
local scale local scale
local scaleConfigName = (EID.Config["DisplayMode"] == "local" and "LocalScale" or "Scale") local scaleConfigName = (EID.Config["DisplayMode"] == "local" and "LocalModeSize" or "Size")
scale = EID.Scale scale = EID.Scale
@@ -748,10 +748,10 @@ end
function EID:ScaleValue(entity) function EID:ScaleValue(entity)
if entity.Variant == EffectVariant.DICE_FLOOR then if entity.Variant == EffectVariant.DICE_FLOOR then
EID.Scale = EID.Config["Scale"] EID.Scale = EID.Config["Size"]
EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"]) EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"])
elseif EID.Config["DisplayMode"] == "local" then elseif EID.Config["DisplayMode"] == "local" then
EID.Scale = EID.Config["LocalScale"] EID.Scale = EID.Config["LocalModeSize"]
end end
end end
@@ -772,7 +772,7 @@ function EID:PositionLocalMode(entity)
end end
else else
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["Size"]
end end
end end
@@ -1056,7 +1056,7 @@ local function onRender(t)
local sacrificeDesc = EID:getDescriptionObj(-999, -1, curCounter) local sacrificeDesc = EID:getDescriptionObj(-999, -1, curCounter)
sacrificeDesc.Name = sacrificeDesc.Name.." ("..curCounter.."/12)" sacrificeDesc.Name = sacrificeDesc.Name.." ("..curCounter.."/12)"
EID:alterTextPos(Vector(EID.Config["XPosition"], EID.Config["YPosition"])) EID:alterTextPos(Vector(EID.Config["XPosition"], EID.Config["YPosition"]))
EID.Scale = EID.Config["Scale"] EID.Scale = EID.Config["Size"]
EID:printDescription(sacrificeDesc) EID:printDescription(sacrificeDesc)
end end
return return
@@ -1294,7 +1294,7 @@ if EID.MCMLoaded or REPENTANCE then
end end
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["Size"]
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")
+9 -9
View File
@@ -897,36 +897,36 @@ if MCMLoaded then
Type = ModConfigMenu.OptionType.NUMBER, Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function() CurrentSetting = function()
if EID.Config["DisplayMode"] == "local" then if EID.Config["DisplayMode"] == "local" then
return AnIndexOf(textScales, EID.Config["LocalScale"]) return AnIndexOf(textScales, EID.Config["LocalModeSize"])
else else
return AnIndexOf(textScales, EID.Config["Scale"]) return AnIndexOf(textScales, EID.Config["Size"])
end end
end, end,
Minimum = 1, Minimum = 1,
Maximum = 6, Maximum = 6,
Display = function() Display = function()
if EID.Config["DisplayMode"] == "local" then if EID.Config["DisplayMode"] == "local" then
return "Text Size (Local mode): " .. EID.Config["LocalScale"] return "Text Size (Local mode): " .. EID.Config["LocalModeSize"]
else else
return "Text Size: " .. EID.Config["Scale"] return "Text Size: " .. EID.Config["Size"]
end end
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EID.MCM_OptionChanged = true EID.MCM_OptionChanged = true
if EID.Config["DisplayMode"] == "local" then if EID.Config["DisplayMode"] == "local" then
EID.Config["LocalScale"] = textScales[currentNum] EID.Config["LocalModeSize"] = textScales[currentNum]
else else
EID.Config["Scale"] = textScales[currentNum] EID.Config["Size"] = textScales[currentNum]
end end
EID.Scale = textScales[currentNum] EID.Scale = textScales[currentNum]
end, end,
Info = {"Change text size. CAN BE HARD TO READ IN SOME SETTINGS!"} Info = {"Change text size","CAN BE HARD TO READ IN SOME SETTINGS!"}
} }
) )
-- SCALE Hotkey -- SCALE Hotkey
EID:AddHotkeySetting("Visuals", EID:AddHotkeySetting("Visuals",
"ScaleKey", "Toggle Scale (Keyboard)", "SizeHotkey", "Toggle Size (Keyboard)",
"Press or hold this key to toggle the scale.", false) {"Press this key to change the text size.", "Hold this key to smoothly change the text size"}, false)
-- Local Mode Centered or not -- Local Mode Centered or not
MCM.AddSetting( MCM.AddSetting(