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