Made config and Position handling way more flexible

This commit is contained in:
Wofsauge committed 2020-11-27 22:40:58 +01:00
1 parent 207792168d
commit 4cb51d0672
5 files changed
+224 -202

No files matched your search

+56 -31
View File
@@ -18,6 +18,9 @@ if not __eidEntityDescriptions then
__eidEntityDescriptions = {} __eidEntityDescriptions = {}
end end
EID.PositionModifiers = {}
EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"])
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-------------------------Handle Custom Enum ----------------------------- -------------------------Handle Custom Enum -----------------------------
@@ -199,7 +202,29 @@ end
-- returns the current text position -- returns the current text position
function EID:getTextPosition() function EID:getTextPosition()
return Vector(EIDConfig["XPosition"], EIDConfig["YPosition"]) local posVector = EID.UsedPosition
for _,modifier in pairs(EID.PositionModifiers) do
posVector = posVector + modifier
end
return posVector
end
-- Adds a text position modifier Vector, which will be applied to the text position variable
-- Useful to add small offsets. For example: for schoolbag HUD
function EID:addTextPosModifier(identifier, modifierVector)
EID.PositionModifiers[identifier] = modifierVector
end
-- Removes a text position modifier Vector
-- Useful to remove small offsets. For example: for schoolbag HUD
function EID:removeTextPosModifier(identifier)
EID.PositionModifiers[identifier] = nil
end
-- Changes the initial position of all eid descriptions
-- Useful to totally alter and override the current initial Overlay position
function EID:alterTextPos(newPosVector)
EID.UsedPosition = newPosVector
end end
-- returns the entity that is currently described. returns last described entity if currently not displaying text -- returns the entity that is currently described. returns last described entity if currently not displaying text
@@ -252,18 +277,18 @@ end
-- returns the specified object table in the current language. -- returns the specified object table in the current language.
-- falls back to english if it doesnt exist -- falls back to english if it doesnt exist
function EID:getDescriptionTable(objTable) function EID:getDescriptionTable(objTable)
return EID.descriptions[EIDConfig["Language"]][objTable] or EID.descriptions["en_us"][objTable] return EID.descriptions[EID.Config["Language"]][objTable] or EID.descriptions["en_us"][objTable]
end end
-- returns the description data table related to a given id, variant and subtype -- returns the description data table related to a given id, variant and subtype
-- falls back to english if it doesnt exist -- falls back to english if it doesnt exist
function EID:getDescriptionData(Type, Variant, SubType) function EID:getDescriptionData(Type, Variant, SubType)
local fullString = Type.."."..Variant local fullString = Type.."."..Variant
local moddedDesc = EID.descriptions[EIDConfig["Language"]].custom[fullString.."."..SubType] or local moddedDesc = EID.descriptions[EID.Config["Language"]].custom[fullString.."."..SubType] or
EID.descriptions["en_us"].custom[fullString.."."..SubType] or nil EID.descriptions["en_us"].custom[fullString.."."..SubType] or nil
local tableName = EID:getTableName(Type, Variant) local tableName = EID:getTableName(Type, Variant)
local legacyModdedDescription = EID:getLegacyModDescription(Type, Variant, SubType) local legacyModdedDescription = EID:getLegacyModDescription(Type, Variant, SubType)
local defaultDesc = EID.descriptions[EIDConfig["Language"]][tableName][SubType] or EID.descriptions["en_us"][tableName][SubType] or nil local defaultDesc = EID.descriptions[EID.Config["Language"]][tableName][SubType] or EID.descriptions["en_us"][tableName][SubType] or nil
return moddedDesc or legacyModdedDescription or defaultDesc return moddedDesc or legacyModdedDescription or defaultDesc
end end
@@ -291,7 +316,7 @@ function EID:getTransformationName(id)
-- get translated custom name -- get translated custom name
local customTransform = EID.CustomTransformations[id] local customTransform = EID.CustomTransformations[id]
if customTransform ~= nil then if customTransform ~= nil then
return customTransform[EIDConfig["Language"]] or customTransform["en_us"] or id return customTransform[EID.Config["Language"]] or customTransform["en_us"] or id
end end
return id return id
end end
@@ -328,14 +353,14 @@ end
-- check if an entity is part of the describable entities -- check if an entity is part of the describable entities
function EID:hasDescription(entity) function EID:hasDescription(entity)
local isAllowed = false local isAllowed = false
if EIDConfig["EnableEntityDescriptions"] then if EID.Config["EnableEntityDescriptions"] then
isAllowed = __eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil isAllowed = __eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil
--isAllowed = isAllowed or type(entity:GetData()["EID_Description"]) ~= type(nil) --isAllowed = isAllowed or type(entity:GetData()["EID_Description"]) ~= type(nil)
end end
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and EIDConfig["DisplayItemInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and EID.Config["DisplayItemInfo"])
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EIDConfig["DisplayTrinketInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EID.Config["DisplayTrinketInfo"])
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TAROTCARD and EIDConfig["DisplayCardInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TAROTCARD and EID.Config["DisplayCardInfo"])
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EIDConfig["DisplayPillInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EID.Config["DisplayPillInfo"])
return entity.Type == EntityType.ENTITY_PICKUP and isAllowed and entity.SubType > 0 return entity.Type == EntityType.ENTITY_PICKUP and isAllowed and entity.SubType > 0
end end
@@ -430,7 +455,7 @@ function EID:filterIconMarkup(text, textPosX, textPosY)
for word in string.gmatch(text, "{{.-}}") do for word in string.gmatch(text, "{{.-}}") do
local textposition = string.find(text, word) local textposition = string.find(text, word)
local lookup = EID:getIcon(word) local lookup = EID:getIcon(word)
local preceedingTextWidth = EID:getStrWidth(string.sub(text, 0, textposition - 1)) * EIDConfig["Scale"] local preceedingTextWidth = EID:getStrWidth(string.sub(text, 0, textposition - 1)) * EID.Config["Scale"]
table.insert(spriteTable, {lookup, preceedingTextWidth}) table.insert(spriteTable, {lookup, preceedingTextWidth})
text = string.gsub(text, word, EID:generatePlaceholderString(lookup[3]), 1) text = string.gsub(text, word, EID:generatePlaceholderString(lookup[3]), 1)
end end
@@ -457,8 +482,8 @@ end
-- helper function to render Icons in specific EID settins -- helper function to render Icons in specific EID settins
function EID:renderIcon(spriteObj, posX, posY) function EID:renderIcon(spriteObj, posX, posY)
spriteObj.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"]) spriteObj.Scale = Vector(EID.Config["Scale"], EID.Config["Scale"])
spriteObj.Color = Color(1, 1, 1, EIDConfig["Transparency"], 0, 0, 0) spriteObj.Color = Color(1, 1, 1, EID.Config["Transparency"], 0, 0, 0)
spriteObj:Render(Vector(posX, posY), nullVector, nullVector) spriteObj:Render(Vector(posX, posY), nullVector, nullVector)
end end
@@ -495,7 +520,7 @@ function EID:getColor(str, baseKColor)
end end
end end
color = EID:copyKColor(color) color = EID:copyKColor(color)
color.Alpha = math.min(color.Alpha, EIDConfig["Transparency"]) color.Alpha = math.min(color.Alpha, EID.Config["Transparency"])
return color, isColorMarkup return color, isColorMarkup
end end
@@ -510,7 +535,7 @@ function EID:filterColorMarkup(text, baseKColor)
local lookup, isColor = EID:getColor(word, lastColor) local lookup, isColor = EID:getColor(word, lastColor)
if isColor then if isColor then
local preceedingText = string.sub(text, lastPosition, textposition - 1) local preceedingText = string.sub(text, lastPosition, textposition - 1)
local preceedingTextWidth = EID:getStrWidth(preceedingText) * EIDConfig["Scale"] local preceedingTextWidth = EID:getStrWidth(preceedingText) * EID.Config["Scale"]
lastPosition = textposition lastPosition = textposition
table.insert(textPartsTable, {preceedingText, lastColor, preceedingTextWidth}) table.insert(textPartsTable, {preceedingText, lastColor, preceedingTextWidth})
lastColor = lookup lastColor = lookup
@@ -593,39 +618,39 @@ end
-- Get KColor object of "Entity Name" texts -- Get KColor object of "Entity Name" texts
function EID:getNameColor() function EID:getNameColor()
return KColor( return KColor(
EIDConfig["ItemNameColor"][1], EID.Config["ItemNameColor"][1],
EIDConfig["ItemNameColor"][2], EID.Config["ItemNameColor"][2],
EIDConfig["ItemNameColor"][3], EID.Config["ItemNameColor"][3],
EIDConfig["Transparency"] EID.Config["Transparency"]
) )
end end
-- Get KColor object of "Description" texts -- Get KColor object of "Description" texts
function EID:getTextColor() function EID:getTextColor()
return KColor( return KColor(
EIDConfig["TextColor"][1], EID.Config["TextColor"][1],
EIDConfig["TextColor"][2], EID.Config["TextColor"][2],
EIDConfig["TextColor"][3], EID.Config["TextColor"][3],
EIDConfig["Transparency"] EID.Config["Transparency"]
) )
end end
-- Get KColor object of "Transformation" texts -- Get KColor object of "Transformation" texts
function EID:getTransformationColor() function EID:getTransformationColor()
return KColor( return KColor(
EIDConfig["TransformationColor"][1], EID.Config["TransformationColor"][1],
EIDConfig["TransformationColor"][2], EID.Config["TransformationColor"][2],
EIDConfig["TransformationColor"][3], EID.Config["TransformationColor"][3],
EIDConfig["Transparency"] EID.Config["Transparency"]
) )
end end
-- Get KColor object of "Error" texts -- Get KColor object of "Error" texts
function EID:getErrorColor() function EID:getErrorColor()
return KColor( return KColor(
EIDConfig["ErrorColor"][1], EID.Config["ErrorColor"][1],
EIDConfig["ErrorColor"][2], EID.Config["ErrorColor"][2],
EIDConfig["ErrorColor"][3], EID.Config["ErrorColor"][3],
EIDConfig["Transparency"] EID.Config["Transparency"]
) )
end end
+2 -2
View File
@@ -16,8 +16,8 @@ EIDConfig = {
-- Default = "default" -- Default = "default"
["FontType"] = "default", ["FontType"] = "default",
-- Change Width of the info boxes. (In characters) -- Change Width of the info boxes. (In characters)
-- Default = 25 -- Default = 100
["TextboxWidth"] = 25, ["TextboxWidth"] = 100,
-- Change Size of the info boxes. Range: [0,...,1] -- Change Size of the info boxes. Range: [0,...,1]
-- Default = 1 -- Default = 1
["Scale"] = 1, ["Scale"] = 1,
+2 -2
View File
@@ -100,8 +100,8 @@ EID:addColor("ColorBlackBlink", nil, function(color)
local function onDebugRender(t) local function onDebugRender(t)
for i, v in ipairs(charsToDebug) do for i, v in ipairs(charsToDebug) do
local pos = Vector(EIDConfig["XPosition"], EIDConfig["YPosition"] - 15 + ((i - 1) * 14)) local pos = EID.getTextPosition() + Vector(0, - 15 + ((i - 1) * 14))
EID:renderString(v, pos, Vector(EIDConfig["Scale"], EIDConfig["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0)) EID:renderString(v, pos, Vector(EID.Config["Scale"], EID.Config["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0))
if not showDebugChars then if not showDebugChars then
break break
+68 -102
View File
@@ -27,6 +27,8 @@ ArrowSprite:Load("gfx/icons.anm2", true)
ArrowSprite:Play("Arrow", false) ArrowSprite:Play("Arrow", false)
require("eid_config") require("eid_config")
EID.Config = EID.DefaultConfig
EID.Config.Version = "3.0"
require("mod_config_menu") require("mod_config_menu")
require("descriptions.ab+.transformations") require("descriptions.ab+.transformations")
@@ -57,23 +59,12 @@ EID.modPath = string.gsub(EID.modPath, "\\", "/")
EID.modPath = string.gsub(EID.modPath, ":/", ":\\") EID.modPath = string.gsub(EID.modPath, ":/", ":\\")
EID.font = Font() -- init font object EID.font = Font() -- init font object
local fontFile = EIDConfig["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")
--Makes textscale smaller, when using detailed english descriptions
if EIDConfig["Language"] == "en_us_detailed" and EIDConfig["Scale"] > 0.5 then
EIDConfig["Scale"] = 0.5
end
-- MOD CONFIG MENU Compatibility
local MCMLoaded, MCM = pcall(require, "scripts.modconfig")
EID.MCMCompat_isDisplayingEIDTab = false
local MCMCompat_isDisplayingDummyMCMObj = false
local MCMCompat_oldPermanentObj = false
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-------------------------Handle Sacrifice Room----------------------------- -------------------------Handle Sacrifice Room-----------------------------
if EIDConfig["DisplaySacrificeInfo"] then if EID.Config["DisplaySacrificeInfo"] then
function EID:onNewFloor() function EID:onNewFloor()
EID.sacrificeCounter = 1 EID.sacrificeCounter = 1
end end
@@ -91,19 +82,16 @@ end
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
---------------------------Printing Functions------------------------------ ---------------------------Printing Functions------------------------------
local modifiedPosY = false -- When the player has the schoolbag it changes
local function posY()
return modifiedPosY ~= false and modifiedPosY or EIDConfig["YPosition"]
end
function EID:printDescription(desc) function EID:printDescription(desc)
local padding = posY() local textScale = Vector(EID.Config["Scale"], EID.Config["Scale"])
local renderPos = EID:getTextPosition()
local itemType = -1 local itemType = -1
if tonumber(desc.ID) ~= nil and desc.ItemType == 5 and desc.ItemVariant == 100 then if tonumber(desc.ID) ~= nil and desc.ItemType == 5 and desc.ItemVariant == 100 then
itemType = EID.itemConfig:GetCollectible(tonumber(desc.ID)).Type or -1 itemType = EID.itemConfig:GetCollectible(tonumber(desc.ID)).Type or -1
end end
local offsetX = 0 local offsetX = 0
if EIDConfig["ShowItemIcon"] then if EID.Config["ShowItemIcon"] then
local iconType = nil local iconType = nil
local renderID = desc.ID local renderID = desc.ID
if desc.ItemType == 5 and desc.ItemVariant == 100 then if desc.ItemType == 5 and desc.ItemVariant == 100 then
@@ -120,41 +108,41 @@ function EID:printDescription(desc)
offsetX = offsetX + 12 offsetX = offsetX + 12
EID:renderString( EID:renderString(
"{{" .. iconType .. renderID .. "}}", "{{" .. iconType .. renderID .. "}}",
Vector(EIDConfig["XPosition"]-3, padding - 5), renderPos + (Vector(-3, -5) * EID.Config["Scale"]),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]), textScale,
EID:getNameColor() EID:getNameColor()
) )
end end
end end
--Display ItemType / Charge --Display ItemType / Charge
if EIDConfig["ShowItemType"] and (itemType == 3 or itemType == 4) then if EID.Config["ShowItemType"] and (itemType == 3 or itemType == 4) then
local offsetY = 2 * EIDConfig["Scale"] local offsetY = 2
if EIDConfig["Scale"] < 1 then if EID.Config["Scale"] < 1 then
offsetY = -1 offsetY = -1
end end
EID.IconSprite:Play(EID.ItemTypeAnm2Names[itemType]) EID.IconSprite:Play(EID.ItemTypeAnm2Names[itemType])
EID:renderIcon(EID.IconSprite, EIDConfig["XPosition"] + offsetX, padding + offsetY) EID:renderIcon(EID.IconSprite, renderPos.X + offsetX * EID.Config["Scale"], renderPos.Y + offsetY * EID.Config["Scale"])
if itemType == 3 then -- Display Charge if itemType == 3 then -- Display Charge
EID.IconSprite:Play(EID.itemConfig:GetCollectible(desc.ID).MaxCharges) EID.IconSprite:Play(EID.itemConfig:GetCollectible(desc.ID).MaxCharges)
EID:renderIcon(EID.IconSprite, EIDConfig["XPosition"] + offsetX, padding + offsetY) EID:renderIcon(EID.IconSprite, renderPos.X + offsetX * EID.Config["Scale"], renderPos.Y + offsetY * EID.Config["Scale"])
offsetX = offsetX + 11 offsetX = offsetX + 11
elseif itemType == 4 then -- familiar elseif itemType == 4 then -- familiar
offsetX = offsetX + 8 offsetX = offsetX + 8
end end
if not EIDConfig["ShowItemName"] then if not EID.Config["ShowItemName"] then
padding = padding + lineHeight * EIDConfig["Scale"] renderPos.Y = renderPos.Y + lineHeight * EID.Config["Scale"]
end end
end end
--Display Itemname --Display Itemname
if EIDConfig["ShowItemName"] then if EID.Config["ShowItemName"] then
EID:renderString( EID:renderString(
desc.Name, desc.Name,
Vector(EIDConfig["XPosition"] + offsetX, padding - 4), renderPos + (Vector(offsetX, -4) * EID.Config["Scale"]),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]), textScale,
EID:getNameColor() EID:getNameColor()
) )
padding = padding + lineHeight * EIDConfig["Scale"] renderPos.Y = renderPos.Y + lineHeight * EID.Config["Scale"]
end end
--Display Transformation --Display Transformation
@@ -167,54 +155,53 @@ function EID:printDescription(desc)
local iconOffsetX = transformSprite[5] or -1 local iconOffsetX = transformSprite[5] or -1
local iconOffsetY = transformSprite[6] or -1 local iconOffsetY = transformSprite[6] or -1
local transformLineHeight = lineHeight local transformLineHeight = lineHeight
if EIDConfig["TransformationIcons"] then if EID.Config["TransformationIcons"] then
transformLineHeight = math.max(lineHeight, transformSprite[4]) transformLineHeight = math.max(lineHeight, transformSprite[4])
local iconSprite = transformSprite[7] or EID.InlineIconSprite local iconSprite = transformSprite[7] or EID.InlineIconSprite
iconSprite:Play(transformSprite[1]) iconSprite:Play(transformSprite[1])
EID:renderIcon( EID:renderIcon(
iconSprite, iconSprite,
EIDConfig["XPosition"] + iconOffsetX * EIDConfig["Scale"], renderPos.X + iconOffsetX * EID.Config["Scale"],
padding + iconOffsetY * EIDConfig["Scale"] renderPos.Y + iconOffsetY * EID.Config["Scale"]
) )
end end
if EIDConfig["TransformationText"] then if EID.Config["TransformationText"] then
local textOffsetY = math.min(0, (iconHeight - 9)) / 4 local textOffsetY = math.min(0, (iconHeight - 9)) / 4
EID:renderString( EID:renderString(
transformationName, transformationName,
Vector(EIDConfig["XPosition"] + iconWidth + 4, padding + textOffsetY), renderPos + (Vector(iconWidth + 4, textOffsetY)* EID.Config["Scale"]),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]), textScale,
EID:getTransformationColor() EID:getTransformationColor()
) )
end end
if (EIDConfig["TransformationIcons"] or EIDConfig["TransformationText"]) then if (EID.Config["TransformationIcons"] or EID.Config["TransformationText"]) then
padding = padding + transformLineHeight * EIDConfig["Scale"] renderPos.Y = renderPos.Y + transformLineHeight * EID.Config["Scale"]
end end
end end
end end
EID:printBulletPoints(desc.Description, padding) EID:printBulletPoints(desc.Description, renderPos)
end end
function EID:printBulletPoints(description, padding) function EID:printBulletPoints(description, renderPos)
local textboxWidth = tonumber(EIDConfig["TextboxWidth"]) * 4 local textboxWidth = tonumber(EID.Config["TextboxWidth"])
local textScale = Vector(EID.Config["Scale"], EID.Config["Scale"])
description = EID:replaceShortMarkupStrings(description) description = EID:replaceShortMarkupStrings(description)
for line in string.gmatch(description, "([^#]+)") do for line in string.gmatch(description, "([^#]+)") do
local formatedLines = EID:fitTextToWidth(line, textboxWidth) local formatedLines = EID:fitTextToWidth(line, textboxWidth)
local textColor = EID:getTextColor() local textColor = EID:getTextColor()
for i, lineToPrint in ipairs(formatedLines) do for i, lineToPrint in ipairs(formatedLines) do
-- render bulletpoint -- render bulletpoint
local posX = EIDConfig["XPosition"]
if i == 1 then if i == 1 then
local bpIcon = EID:handleBulletpointIcon(lineToPrint) local bpIcon = EID:handleBulletpointIcon(lineToPrint)
if EID:getIcon(bpIcon) ~= EID.InlineIcons["ERROR"] then if EID:getIcon(bpIcon) ~= EID.InlineIcons["ERROR"] then
lineToPrint = string.gsub(lineToPrint, bpIcon .. " ", "") lineToPrint = string.gsub(lineToPrint, bpIcon .. " ", "")
end end
textColor = textColor = EID:renderString(bpIcon, renderPos, textScale , textColor)
EID:renderString(bpIcon, Vector(posX, padding), Vector(EIDConfig["Scale"], EIDConfig["Scale"]), textColor)
end end
textColor = textColor = EID:renderString(lineToPrint, renderPos + Vector(12 * EID.Config["Scale"], 0), textScale, textColor)
EID:renderString(lineToPrint, Vector(posX + 12, padding), Vector(EIDConfig["Scale"], EIDConfig["Scale"]), textColor) renderPos.Y = renderPos.Y + lineHeight * EID.Config["Scale"]
padding = padding + lineHeight * EIDConfig["Scale"]
end end
end end
end end
@@ -224,19 +211,17 @@ end
function EID:renderQuestionMark() function EID:renderQuestionMark()
EID.IconSprite:Play("CurseOfBlind") EID.IconSprite:Play("CurseOfBlind")
EID:renderIcon(EID.IconSprite, EIDConfig["XPosition"] + 5 * EIDConfig["Scale"], posY() + 5 * EIDConfig["Scale"]) local pos = EID:getTextPosition()
if Isaac.GetPlayer(0):HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then EID:renderIcon(EID.IconSprite, pos.X + 5 * EID.Config["Scale"], pos.X + 5 * EID.Config["Scale"])
modifiedPosY = EIDConfig["YPosition"] - 30
end
end end
function EID:renderIndicator(entity) function EID:renderIndicator(entity)
if EIDConfig["Indicator"] == "blink" then if EID.Config["Indicator"] == "blink" then
local c = 255 - math.floor(255 * ((entity.FrameCount % 40) / 40)) local c = 255 - math.floor(255 * ((entity.FrameCount % 40) / 40))
entity:SetColor(Color(1, 1, 1, 1, c, c, c), 1, 1, false, false) entity:SetColor(Color(1, 1, 1, 1, c, c, c), 1, 1, false, false)
entity:Render(nullVector) entity:Render(nullVector)
entity:SetColor(Color(1, 1, 1, 1, 0, 0, 0), 2, 1, false, false) entity:SetColor(Color(1, 1, 1, 1, 0, 0, 0), 2, 1, false, false)
elseif EIDConfig["Indicator"] == "border" then elseif EID.Config["Indicator"] == "border" then
local c = 255 - math.floor(255 * ((entity.FrameCount % 40) / 40)) local c = 255 - math.floor(255 * ((entity.FrameCount % 40) / 40))
entity:SetColor(Color(1, 1, 1, 1, c, c, c), 1, 1, false, false) entity:SetColor(Color(1, 1, 1, 1, c, c, c), 1, 1, false, false)
entity:Render(Vector(0, 1)) entity:Render(Vector(0, 1))
@@ -245,7 +230,7 @@ function EID:renderIndicator(entity)
entity:Render(Vector(-1, 0)) entity:Render(Vector(-1, 0))
entity:SetColor(Color(1, 1, 1, 1, 0, 0, 0), 2, 1, false, false) entity:SetColor(Color(1, 1, 1, 1, 0, 0, 0), 2, 1, false, false)
entity:Render(nullVector) entity:Render(nullVector)
elseif EIDConfig["Indicator"] == "highlight" then elseif EID.Config["Indicator"] == "highlight" then
entity:SetColor(Color(1, 1, 1, 1, 255, 255, 255), 1, 1, false, false) entity:SetColor(Color(1, 1, 1, 1, 255, 255, 255), 1, 1, false, false)
entity:Render(Vector(0, 1)) entity:Render(Vector(0, 1))
entity:Render(Vector(0, -1)) entity:Render(Vector(0, -1))
@@ -253,7 +238,7 @@ function EID:renderIndicator(entity)
entity:Render(Vector(-1, 0)) entity:Render(Vector(-1, 0))
entity:SetColor(Color(1, 1, 1, 1, 0, 0, 0), 2, 1, false, false) entity:SetColor(Color(1, 1, 1, 1, 0, 0, 0), 2, 1, false, false)
entity:Render(nullVector) entity:Render(nullVector)
elseif EIDConfig["Indicator"] == "arrow" then elseif EID.Config["Indicator"] == "arrow" then
ArrowSprite:Update() ArrowSprite:Update()
local ArrowOffset = Vector(0, -35) local ArrowOffset = Vector(0, -35)
if entity.Variant == 100 and not entity:ToPickup():IsShopItem() then if entity.Variant == 100 and not entity:ToPickup():IsShopItem() then
@@ -268,36 +253,19 @@ end
local function onRender(t) local function onRender(t)
EID.isDisplayingText = false EID.isDisplayingText = false
local player = Isaac.GetPlayer(0) if Input.IsButtonTriggered(EID.Config["HideKey"], 0) then
local closest = nil
local closestDice = nil
local dist = 10000
if Input.IsButtonTriggered(EIDConfig["HideKey"], 0) then
hideDescToggle = not hideDescToggle hideDescToggle = not hideDescToggle
end end
if hideDescToggle then if hideDescToggle then
return return
end end
if MCMLoaded then local player = Isaac.GetPlayer(0)
if MCM.IsVisible and EID.permanentDisplayTextObj == nil and EID.MCMCompat_isDisplayingEIDTab then
MCMCompat_oldPermanentObj = EID.permanentDisplayTextObj EID:renderMCMDummyDescription()
local demoDescObj = EID:getDescriptionObj(5, 100, 33)
demoDescObj.Name = "Demo Object Name" if player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then
demoDescObj.Transformation = "Demo Transformation" EID:addTextPosModifier("Schoolbag", Vector(0,30))
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}}"
EID:displayPermanentText(demoDescObj)
MCMCompat_isDisplayingDummyMCMObj = true
elseif not MCM.IsVisible and MCMCompat_isDisplayingDummyMCMObj then
if MCMCompat_oldPermanentObj == nil then
EID:hidePermanentText()
else
EID.permanentDisplayTextObj = MCMCompat_oldPermanentObj
end
EID.MCMCompat_isDisplayingEIDTab = false
MCMCompat_oldPermanentObj = nil
MCMCompat_isDisplayingDummyMCMObj = false
end
end end
if EID.isDisplayingPermanent and EID.permanentDisplayTextObj ~= nil then if EID.isDisplayingPermanent and EID.permanentDisplayTextObj ~= nil then
@@ -306,6 +274,9 @@ local function onRender(t)
return return
end end
local closest = nil
local closestDice = nil
local dist = 10000
for i, entity in ipairs(Isaac.GetRoomEntities()) do for i, entity in ipairs(Isaac.GetRoomEntities()) do
if Game():GetRoom():GetType() == RoomType.ROOM_DICE and entity.Type == 1000 and entity.Variant == 76 then if Game():GetRoom():GetType() == RoomType.ROOM_DICE and entity.Type == 1000 and entity.Variant == 76 then
closestDice = entity closestDice = entity
@@ -320,12 +291,12 @@ local function onRender(t)
end end
end end
if dist / 40 > tonumber(EIDConfig["MaxDistance"]) or not closest.Type == EntityType.ENTITY_PICKUP then if dist / 40 > tonumber(EID.Config["MaxDistance"]) or not closest.Type == EntityType.ENTITY_PICKUP then
if Game():GetRoom():GetType() == RoomType.ROOM_SACRIFICE and EIDConfig["DisplaySacrificeInfo"] then if Game():GetRoom():GetType() == RoomType.ROOM_SACRIFICE and EID.Config["DisplaySacrificeInfo"] then
EID:printDescription(EID:getDescriptionObj(-999, -1, EID.sacrificeCounter)) EID:printDescription(EID:getDescriptionObj(-999, -1, EID.sacrificeCounter))
end end
if if
Game():GetRoom():GetType() == RoomType.ROOM_DICE and EIDConfig["DisplayDiceInfo"] and type(closestDice) ~= type(nil) Game():GetRoom():GetType() == RoomType.ROOM_DICE and EID.Config["DisplayDiceInfo"] and type(closestDice) ~= type(nil)
then then
EID:printDescription(EID:getDescriptionObj(-999, -2, closestDice.SubType + 1)) EID:printDescription(EID:getDescriptionObj(-999, -2, closestDice.SubType + 1))
EID:renderIndicator(closestDice) EID:renderIndicator(closestDice)
@@ -343,7 +314,7 @@ local function onRender(t)
EID:renderIndicator(closest) EID:renderIndicator(closest)
--Handle Entities (specific) --Handle Entities (specific)
--[[ if EIDConfig["EnableEntityDescriptions"] and type(closest:GetData()["EID_Description"]) ~= type(nil) then --[[ if EID.Config["EnableEntityDescriptions"] and type(closest:GetData()["EID_Description"]) ~= type(nil) then
printTrinketDescription({closest.Type, closest:GetData()["EID_Description"]}, "custom") printTrinketDescription({closest.Type, closest:GetData()["EID_Description"]}, "custom")
return return
end end
@@ -353,21 +324,21 @@ local function onRender(t)
EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType)) EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType))
elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then
--Handle Collectibles --Handle Collectibles
if EID:hasCurseBlind() and EIDConfig["DisableOnCurse"] then if EID:hasCurseBlind() and EID.Config["DisableOnCurse"] then
EID:renderQuestionMark() EID:renderQuestionMark()
return return
end end
EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType)) EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType))
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
--Handle Cards & Runes --Handle Cards & Runes
if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayCardInfoShop"] then if closest:ToPickup():IsShopItem() and not EID.Config["DisplayCardInfoShop"] then
EID:renderQuestionMark() EID:renderQuestionMark()
return return
end end
EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType)) EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType))
elseif closest.Variant == PickupVariant.PICKUP_PILL then elseif closest.Variant == PickupVariant.PICKUP_PILL then
--Handle Pills --Handle Pills
if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayPillInfoShop"] then if closest:ToPickup():IsShopItem() and not EID.Config["DisplayPillInfoShop"] then
EID:renderQuestionMark() EID:renderQuestionMark()
return return
end end
@@ -375,19 +346,19 @@ local function onRender(t)
local pillColor = closest.SubType local pillColor = closest.SubType
local pool = Game():GetItemPool() local pool = Game():GetItemPool()
local identified = pool:IsPillIdentified(pillColor) local identified = pool:IsPillIdentified(pillColor)
if (identified or EIDConfig["ShowUnidentifiedPillDescriptions"]) then if (identified or EID.Config["ShowUnidentifiedPillDescriptions"]) then
local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor) local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor)
descEntry["realSubType"] = pillColor descEntry["realSubType"] = pillColor
EID:printDescription(descEntry) EID:printDescription(descEntry)
else else
EID:renderString( EID:renderString(
"{{Pill"..pillColor.."}} "..EID:getDescriptionTable("unidentifiedPill"), "{{Pill"..pillColor.."}} "..EID:getDescriptionTable("unidentifiedPill"),
Vector(EIDConfig["XPosition"], posY()), EID:getTextPosition(),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]), Vector(EID.Config["Scale"], EID.Config["Scale"]),
EID:getErrorColor() EID:getErrorColor()
) )
end end
elseif EIDConfig["EnableEntityDescriptions"] then elseif EID.Config["EnableEntityDescriptions"] then
--Handle Entities (omni) --Handle Entities (omni)
local descriptionEntry = EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType) local descriptionEntry = EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType)
if descriptionEntry~=nil then if descriptionEntry~=nil then
@@ -395,14 +366,10 @@ local function onRender(t)
return return
end end
end end
if player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then
modifiedPosY = EIDConfig["YPosition"] + 30
end
end end
EID:AddCallback(ModCallbacks.MC_POST_RENDER, onRender) EID:AddCallback(ModCallbacks.MC_POST_RENDER, onRender)
if MCMLoaded then
local json = require("json") local json = require("json")
-------------------------------- --------------------------------
--------Handle Savadata--------- --------Handle Savadata---------
@@ -411,23 +378,22 @@ if MCMLoaded then
--Loading Moddata-- --Loading Moddata--
if EID:HasData() then if EID:HasData() then
local savedEIDConfig = json.decode(Isaac.LoadModData(EID)) local savedEIDConfig = json.decode(Isaac.LoadModData(EID))
-- hardcode Language usage
savedEIDConfig["Language"] = EIDConfig["Language"]
-- Only copy Saved config entries that exist in the save -- Only copy Saved config entries that exist in the save
for key, value in pairs(EIDConfig) do if savedEIDConfig.Version == EID.Config.Version then
for key, value in pairs(EID.Config) do
if savedEIDConfig[key] ~= nil then if savedEIDConfig[key] ~= nil then
EIDConfig[key] = savedEIDConfig[key] EID.Config[key] = savedEIDConfig[key]
end end
end end
end end
end
end end
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStart) EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStart)
--Saving Moddata-- --Saving Moddata--
function SaveGame() function SaveGame()
EID.SaveData(EID, json.encode(EIDConfig)) EID.SaveData(EID, json.encode(EID.Config))
end end
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame) EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame)
end
require("eid_debugging") require("eid_debugging")
+96 -65
View File
@@ -1,4 +1,35 @@
if ModConfigMenu then
-- MOD CONFIG MENU Compatibility
local MCMLoaded, MCM = pcall(require, "scripts.modconfig")
EID.MCMCompat_isDisplayingEIDTab = false
local MCMCompat_isDisplayingDummyMCMObj = false
local MCMCompat_oldPermanentObj = false
function EID:renderMCMDummyDescription()
if MCMLoaded then
EID:addTextPosModifier("MCM_HudOffset", Vector(MCM.Config.HudOffset*2,MCM.Config.HudOffset))
if MCM.IsVisible and EID.permanentDisplayTextObj == nil and EID.MCMCompat_isDisplayingEIDTab then
MCMCompat_oldPermanentObj = EID.permanentDisplayTextObj
local demoDescObj = EID:getDescriptionObj(5, 100, 33)
demoDescObj.Name = "Demo Object Name"
demoDescObj.Transformation = "Demo Transformation"
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}}"
EID:displayPermanentText(demoDescObj)
MCMCompat_isDisplayingDummyMCMObj = true
elseif not MCM.IsVisible and MCMCompat_isDisplayingDummyMCMObj then
if MCMCompat_oldPermanentObj == nil then
EID:hidePermanentText()
else
EID.permanentDisplayTextObj = MCMCompat_oldPermanentObj
end
EID.MCMCompat_isDisplayingEIDTab = false
MCMCompat_oldPermanentObj = nil
MCMCompat_isDisplayingDummyMCMObj = false
end
end
end
if MCMLoaded then
function AnIndexOf(t, val) function AnIndexOf(t, val)
for k, v in ipairs(t) do for k, v in ipairs(t) do
if v == val then if v == val then
@@ -17,15 +48,15 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.NUMBER, Type = ModConfigMenuOptionType.NUMBER,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(langLookup, EIDConfig["Language"]) return AnIndexOf(langLookup, EID.Config["Language"])
end, end,
Minimum = 1, Minimum = 1,
Maximum = #langLookup, Maximum = #langLookup,
Display = function() Display = function()
return "Language: " .. displayLanguage[AnIndexOf(langLookup, EIDConfig["Language"])] return "Language: " .. displayLanguage[AnIndexOf(langLookup, EID.Config["Language"])]
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["Language"] = langLookup[currentNum] EID.Config["Language"] = langLookup[currentNum]
end end
} }
) )
@@ -37,17 +68,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisableOnCurse"] return EID.Config["DisableOnCurse"]
end, end,
Display = function() Display = function()
local onOff = "True" local onOff = "True"
if EIDConfig["DisableOnCurse"] then if EID.Config["DisableOnCurse"] then
onOff = "False" onOff = "False"
end end
return 'Show on "Curse of Blind": ' .. onOff return 'Show on "Curse of Blind": ' .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisableOnCurse"] = currentBool EID.Config["DisableOnCurse"] = currentBool
end end
} }
) )
@@ -59,15 +90,15 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.NUMBER, Type = ModConfigMenuOptionType.NUMBER,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(indicators, EIDConfig["Indicator"]) return AnIndexOf(indicators, EID.Config["Indicator"])
end, end,
Minimum = 1, Minimum = 1,
Maximum = 5, Maximum = 5,
Display = function() Display = function()
return "Indicator: " .. EIDConfig["Indicator"] return "Indicator: " .. EID.Config["Indicator"]
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["Indicator"] = indicators[currentNum] EID.Config["Indicator"] = indicators[currentNum]
end end
} }
) )
@@ -79,17 +110,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["ShowUnidentifiedPillDescriptions"] return EID.Config["ShowUnidentifiedPillDescriptions"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["ShowUnidentifiedPillDescriptions"] then if EID.Config["ShowUnidentifiedPillDescriptions"] then
onOff = "True" onOff = "True"
end end
return "Show Unidentified Pilleffects: " .. onOff return "Show Unidentified Pilleffects: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["ShowUnidentifiedPillDescriptions"] = currentBool EID.Config["ShowUnidentifiedPillDescriptions"] = currentBool
end end
} }
) )
@@ -100,17 +131,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplaySacrificeInfo"] return EID.Config["DisplaySacrificeInfo"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplaySacrificeInfo"] then if EID.Config["DisplaySacrificeInfo"] then
onOff = "True" onOff = "True"
end end
return "Sacrifice Room Infos: " .. onOff return "Sacrifice Room Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplaySacrificeInfo"] = currentBool EID.Config["DisplaySacrificeInfo"] = currentBool
end end
} }
) )
@@ -122,17 +153,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayDiceInfo"] return EID.Config["DisplayDiceInfo"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplayDiceInfo"] then if EID.Config["DisplayDiceInfo"] then
onOff = "True" onOff = "True"
end end
return "Dice Room Infos: " .. onOff return "Dice Room Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayDiceInfo"] = currentBool EID.Config["DisplayDiceInfo"] = currentBool
end end
} }
) )
@@ -145,17 +176,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayItemInfo"] return EID.Config["DisplayItemInfo"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplayItemInfo"] then if EID.Config["DisplayItemInfo"] then
onOff = "True" onOff = "True"
end end
return "Collectible Infos: " .. onOff return "Collectible Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayItemInfo"] = currentBool EID.Config["DisplayItemInfo"] = currentBool
end end
} }
) )
@@ -167,17 +198,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayTrinketInfo"] return EID.Config["DisplayTrinketInfo"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplayTrinketInfo"] then if EID.Config["DisplayTrinketInfo"] then
onOff = "True" onOff = "True"
end end
return "Trinket Infos: " .. onOff return "Trinket Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayTrinketInfo"] = currentBool EID.Config["DisplayTrinketInfo"] = currentBool
end end
} }
) )
@@ -189,17 +220,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayCardInfo"] return EID.Config["DisplayCardInfo"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplayCardInfo"] then if EID.Config["DisplayCardInfo"] then
onOff = "True" onOff = "True"
end end
return "Card Infos: " .. onOff return "Card Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayCardInfo"] = currentBool EID.Config["DisplayCardInfo"] = currentBool
end end
} }
) )
@@ -211,17 +242,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayPillInfo"] return EID.Config["DisplayPillInfo"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplayPillInfo"] then if EID.Config["DisplayPillInfo"] then
onOff = "True" onOff = "True"
end end
return "Pill Infos: " .. onOff return "Pill Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayPillInfo"] = currentBool EID.Config["DisplayPillInfo"] = currentBool
end end
} }
) )
@@ -236,17 +267,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayCardInfoShop"] return EID.Config["DisplayCardInfoShop"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplayCardInfoShop"] then if EID.Config["DisplayCardInfoShop"] then
onOff = "True" onOff = "True"
end end
return "Card Infos: " .. onOff return "Card Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayCardInfoShop"] = currentBool EID.Config["DisplayCardInfoShop"] = currentBool
end end
} }
) )
@@ -258,17 +289,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayPillInfoShop"] return EID.Config["DisplayPillInfoShop"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["DisplayPillInfoShop"] then if EID.Config["DisplayPillInfoShop"] then
onOff = "True" onOff = "True"
end end
return "Pill Infos: " .. onOff return "Pill Infos: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayPillInfoShop"] = currentBool EID.Config["DisplayPillInfoShop"] = currentBool
end end
} }
) )
@@ -281,16 +312,16 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.NUMBER, Type = ModConfigMenuOptionType.NUMBER,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(textScales, EIDConfig["Scale"]) return AnIndexOf(textScales, EID.Config["Scale"])
end, end,
Minimum = 1, Minimum = 1,
Maximum = 6, Maximum = 6,
Display = function() Display = function()
EID.MCMCompat_isDisplayingEIDTab = true; EID.MCMCompat_isDisplayingEIDTab = true;
return "Text Size: " .. EIDConfig["Scale"] return "Text Size: " .. EID.Config["Scale"]
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["Scale"] = textScales[currentNum] EID.Config["Scale"] = textScales[currentNum]
end end
} }
) )
@@ -302,14 +333,14 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.SCROLL, Type = ModConfigMenuOptionType.SCROLL,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(distances, EIDConfig["MaxDistance"]) - 1 return AnIndexOf(distances, EID.Config["MaxDistance"]) - 1
end, end,
Display = function() Display = function()
return "Display Distance: $scroll" .. return "Display Distance: $scroll" ..
AnIndexOf(distances, EIDConfig["MaxDistance"]) - 1 .. " " .. EIDConfig["MaxDistance"] .. " Grids" AnIndexOf(distances, EID.Config["MaxDistance"]) - 1 .. " " .. EID.Config["MaxDistance"] .. " Grids"
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["MaxDistance"] = distances[currentNum + 1] EID.Config["MaxDistance"] = distances[currentNum + 1]
end end
} }
) )
@@ -322,14 +353,14 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.SCROLL, Type = ModConfigMenuOptionType.SCROLL,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(transparencies, EIDConfig["Transparency"]) - 1 return AnIndexOf(transparencies, EID.Config["Transparency"]) - 1
end, end,
Display = function() Display = function()
return "Transparency: $scroll" .. return "Transparency: $scroll" ..
AnIndexOf(transparencies, EIDConfig["Transparency"]) - 1 .. " " .. EIDConfig["Transparency"] AnIndexOf(transparencies, EID.Config["Transparency"]) - 1 .. " " .. EID.Config["Transparency"]
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["Transparency"] = transparencies[currentNum + 1] EID.Config["Transparency"] = transparencies[currentNum + 1]
end end
} }
) )
@@ -341,16 +372,16 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.NUMBER, Type = ModConfigMenuOptionType.NUMBER,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(fontTypes, EIDConfig["FontType"]) return AnIndexOf(fontTypes, EID.Config["FontType"])
end, end,
Minimum = 1, Minimum = 1,
Maximum = #fontTypes, Maximum = #fontTypes,
Display = function() Display = function()
return "Font Type: " .. EIDConfig["FontType"] return "Font Type: " .. EID.Config["FontType"]
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["FontType"] = fontTypes[currentNum] EID.Config["FontType"] = fontTypes[currentNum]
local fontFile = EIDConfig["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")
end end
} }
@@ -363,17 +394,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["ShowItemName"] return EID.Config["ShowItemName"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["ShowItemName"] then if EID.Config["ShowItemName"] then
onOff = "True" onOff = "True"
end end
return "Display Item Name: " .. onOff return "Display Item Name: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["ShowItemName"] = currentBool EID.Config["ShowItemName"] = currentBool
end end
} }
) )
@@ -384,17 +415,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["ShowItemType"] return EID.Config["ShowItemType"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["ShowItemType"] then if EID.Config["ShowItemType"] then
onOff = "True" onOff = "True"
end end
return "Display Item Type: " .. onOff return "Display Item Type: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["ShowItemType"] = currentBool EID.Config["ShowItemType"] = currentBool
end end
} }
) )
@@ -406,17 +437,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["TransformationText"] return EID.Config["TransformationText"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["TransformationText"] then if EID.Config["TransformationText"] then
onOff = "True" onOff = "True"
end end
return "Display Transformation Name: " .. onOff return "Display Transformation Name: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["TransformationText"] = currentBool EID.Config["TransformationText"] = currentBool
end end
} }
) )
@@ -426,17 +457,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["TransformationIcons"] return EID.Config["TransformationIcons"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["TransformationIcons"] then if EID.Config["TransformationIcons"] then
onOff = "True" onOff = "True"
end end
return "Display Transformation Icon: " .. onOff return "Display Transformation Icon: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["TransformationIcons"] = currentBool EID.Config["TransformationIcons"] = currentBool
end end
} }
) )
@@ -446,17 +477,17 @@ if ModConfigMenu then
{ {
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["ShowItemIcon"] return EID.Config["ShowItemIcon"]
end, end,
Display = function() Display = function()
local onOff = "False" local onOff = "False"
if EIDConfig["ShowItemIcon"] then if EID.Config["ShowItemIcon"] then
onOff = "True" onOff = "True"
end end
return "Display Item Icon: " .. onOff return "Display Item Icon: " .. onOff
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["ShowItemIcon"] = currentBool EID.Config["ShowItemIcon"] = currentBool
end end
} }
) )