Formatted files very nicely

This commit is contained in:
wofsauge committed 2020-08-31 22:29:29 +02:00
1 parent 8c6564e69f
commit fedec6ac37
5 files changed
+348 -157

No files matched your search

+58 -18
View File
@@ -23,28 +23,26 @@ end
__eidItemDescriptions[item] = "Most Fitting Description"; __eidItemDescriptions[item] = "Most Fitting Description";
--]] --]]
-- Init variables for other mods to hand over Descriptions if they were not yet inited by another mod. -- Init variables for other mods to hand over Descriptions if they were not yet inited by another mod.
if not __eidItemDescriptions then if not __eidItemDescriptions then
__eidItemDescriptions = {}; __eidItemDescriptions = {}
end end
if not __eidTrinketDescriptions then if not __eidTrinketDescriptions then
__eidTrinketDescriptions = {}; __eidTrinketDescriptions = {}
end end
if not __eidCardDescriptions then if not __eidCardDescriptions then
__eidCardDescriptions = {}; __eidCardDescriptions = {}
end end
if not __eidPillDescriptions then if not __eidPillDescriptions then
__eidPillDescriptions = {}; __eidPillDescriptions = {}
end end
if not __eidItemTransformations then if not __eidItemTransformations then
__eidItemTransformations = {}; __eidItemTransformations = {}
end end
if not __eidEntityDescriptions then if not __eidEntityDescriptions then
__eidEntityDescriptions = {}; __eidEntityDescriptions = {}
end end
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-------------------------Handle Custom Enum ----------------------------- -------------------------Handle Custom Enum -----------------------------
@@ -65,7 +63,7 @@ EID.TRANSFORMATION = {
["BOOKWORM"] = 12, ["BOOKWORM"] = 12,
["ADULT"] = 14, ["ADULT"] = 14,
["SPIDERBABY"] = 13, ["SPIDERBABY"] = 13,
["SUPERBUM"] = 11, ["SUPERBUM"] = 11
} }
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@@ -92,7 +90,7 @@ end
--Get the name of the given transformation by its ID --Get the name of the given transformation by its ID
function EID:getTransformation(id) function EID:getTransformation(id)
local str="Custom"; local str = "Custom"
if (tonumber(id) <= #transformations - 1) then if (tonumber(id) <= #transformations - 1) then
return transformations[tonumber(id) + 1] return transformations[tonumber(id) + 1]
end end
@@ -103,7 +101,9 @@ end
function EID:hasDescription(entity) function EID:hasDescription(entity)
local isAllowed = false local isAllowed = false
if EIDConfig["EnableEntityDescriptions"] then if EIDConfig["EnableEntityDescriptions"] then
isAllowed = isAllowed or (__eidEntityDescriptions[entity.Type.."."..entity.Variant.."."..entity.SubType]~=nil --[[or type(entity:GetData()["EID_Description"]) ~= type(nil)]]) isAllowed =
isAllowed or
(__eidEntityDescriptions[entity.Type .. "." .. entity.Variant .. "." .. entity.SubType] ~= nil) --[[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 EIDConfig["DisplayItemInfo"])
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EIDConfig["DisplayTrinketInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EIDConfig["DisplayTrinketInfo"])
@@ -134,32 +134,72 @@ function EID:getBulletpointIcon(text)
return v return v
end end
end end
return '\007' return "\007"
end end
--needs to be called in a render Callback --needs to be called in a render Callback
-- args: string, Vector(int, int), Vector(float,float), KColor obj, bool -- args: string, Vector(int, int), Vector(float,float), KColor obj, bool
function EID:renderString(str, position, scale, kcolor, centered) function EID:renderString(str, position, scale, kcolor, centered)
EID.font:DrawStringScaledUTF8(str, position.X, position.Y, scale.X ,scale.Y ,kcolor ,EID.font:GetStringWidthUTF8(str), centered) EID.font:DrawStringScaledUTF8(
str,
position.X,
position.Y,
scale.X,
scale.Y,
kcolor,
EID.font:GetStringWidthUTF8(str),
centered
)
end end
-- Get KColor object of "Entity Name" texts -- Get KColor object of "Entity Name" texts
function EID:getNameColor() function EID:getNameColor()
return KColor(EIDConfig["ItemNameColor"][1] , EIDConfig["ItemNameColor"][2], EIDConfig["ItemNameColor"][3],EIDConfig["Transparency"],0,0,0) return KColor(
EIDConfig["ItemNameColor"][1],
EIDConfig["ItemNameColor"][2],
EIDConfig["ItemNameColor"][3],
EIDConfig["Transparency"],
0,
0,
0
)
end end
-- Get KColor object of "Description" texts -- Get KColor object of "Description" texts
function EID:getTextColor() function EID:getTextColor()
return KColor(EIDConfig["TextColor"][1] , EIDConfig["TextColor"][2], EIDConfig["TextColor"][3],EIDConfig["Transparency"],0,0,0) return KColor(
EIDConfig["TextColor"][1],
EIDConfig["TextColor"][2],
EIDConfig["TextColor"][3],
EIDConfig["Transparency"],
0,
0,
0
)
end end
-- Get KColor object of "Transformation" texts -- Get KColor object of "Transformation" texts
function EID:getTransformationColor() function EID:getTransformationColor()
return KColor(EIDConfig["TransformationColor"][1] , EIDConfig["TransformationColor"][2], EIDConfig["TransformationColor"][3],EIDConfig["Transparency"],0,0,0) return KColor(
EIDConfig["TransformationColor"][1],
EIDConfig["TransformationColor"][2],
EIDConfig["TransformationColor"][3],
EIDConfig["Transparency"],
0,
0,
0
)
end end
-- Get KColor object of "Error" texts -- Get KColor object of "Error" texts
function EID:getErrorColor() function EID:getErrorColor()
return KColor(EIDConfig["ErrorColor"][1] , EIDConfig["ErrorColor"][2], EIDConfig["ErrorColor"][3],EIDConfig["Transparency"],0,0,0) return KColor(
EIDConfig["ErrorColor"][1],
EIDConfig["ErrorColor"][2],
EIDConfig["ErrorColor"][3],
EIDConfig["Transparency"],
0,
0,
0
)
end end
-15
View File
@@ -1,5 +1,4 @@
EIDConfig = { EIDConfig = {
-------GENERAL--------- -------GENERAL---------
-- Change language of the mod. -- Change language of the mod.
@@ -13,7 +12,6 @@ EIDConfig={
-- Russian (https://steamcommunity.com/sharedfiles/filedetails/?id=1552851879) -- Russian (https://steamcommunity.com/sharedfiles/filedetails/?id=1552851879)
-- 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",
-- Change Width of the info boxes. (In characters) -- Change Width of the info boxes. (In characters)
-- Default = 25 -- Default = 25
["TextboxWidth"] = 25, ["TextboxWidth"] = 25,
@@ -37,18 +35,15 @@ EIDConfig={
-- Arrow = moving arrow pointing at the item | Blink = the whole sprite blinks white | Border = Blinking white border around the sprite | Highlight = White border around the sprite | None = Disable funtion -- Arrow = moving arrow pointing at the item | Blink = the whole sprite blinks white | Border = Blinking white border around the sprite | Highlight = White border around the sprite | None = Disable funtion
-- Default = "none" -- Default = "none"
["Indicator"] = "none", ["Indicator"] = "none",
-- Set the keybinding to toggle the descriptions -- Set the keybinding to toggle the descriptions
-- look into the AB+ documentation for the key names -- look into the AB+ documentation for the key names
-- Default = Keyboard.KEY_F2 -- Default = Keyboard.KEY_F2
["HideKey"] = Keyboard.KEY_F2, ["HideKey"] = Keyboard.KEY_F2,
-------------CURSE------------- -------------CURSE-------------
-- Display informations when the floor has curse of the blind ( ? - Items) -- Display informations when the floor has curse of the blind ( ? - Items)
-- Default = true -- Default = true
["DisableOnCurse"] = true, ["DisableOnCurse"] = true,
----------ITEM NAMES----------- ----------ITEM NAMES-----------
-- Toggle Display of Collectible / Card and Pill names -- Toggle Display of Collectible / Card and Pill names
@@ -66,7 +61,6 @@ EIDConfig={
-- Set the RGB color of the Itemname text -- Set the RGB color of the Itemname text
-- Default = {0.8, 0.3, 0.8} -- Default = {0.8, 0.3, 0.8}
["ItemNameColor"] = {0.8, 0.3, 0.8}, ["ItemNameColor"] = {0.8, 0.3, 0.8},
-------TRANSFORMATIONS--------- -------TRANSFORMATIONS---------
-- Toggle Display of Transformation text -- Toggle Display of Transformation text
@@ -78,7 +72,6 @@ EIDConfig={
-- Set the RGB color of the Transformation text -- Set the RGB color of the Transformation text
-- Default = { 0.5, 0.5, 1} -- Default = { 0.5, 0.5, 1}
["TransformationColor"] = {0.5, 0.5, 1}, ["TransformationColor"] = {0.5, 0.5, 1},
------------CARDS-------------- ------------CARDS--------------
-- Toggle Display of Card / Rune descriptions -- Toggle Display of Card / Rune descriptions
@@ -87,7 +80,6 @@ EIDConfig={
-- Toggle Display of Card / Rune descriptions when its a shop item -- Toggle Display of Card / Rune descriptions when its a shop item
-- Default = false -- Default = false
["DisplayCardInfoShop"] = false, ["DisplayCardInfoShop"] = false,
------------PILLS-------------- ------------PILLS--------------
-- Toggle Display of Pill descriptions -- Toggle Display of Pill descriptions
@@ -99,22 +91,16 @@ EIDConfig={
-- Toggle Display of Pill descriptions that arent known to you yet -- Toggle Display of Pill descriptions that arent known to you yet
-- Default = false -- Default = false
["ShowUnidentifiedPillDescriptions"] = false, ["ShowUnidentifiedPillDescriptions"] = false,
--------Sacrifice Room--------- --------Sacrifice Room---------
-- Toggle Display of next Sacrifice room Payout descriptions -- Toggle Display of next Sacrifice room Payout descriptions
-- Default = true -- Default = true
["DisplaySacrificeInfo"] = true, ["DisplaySacrificeInfo"] = true,
--------Dice Room--------- --------Dice Room---------
-- Toggle Display of Diceroom descriptions -- Toggle Display of Diceroom descriptions
-- Default = true -- Default = true
["DisplayDiceInfo"] = true, ["DisplayDiceInfo"] = true,
-------------MISC--------------- -------------MISC---------------
-- Error message displayed when an error occurs -- Error message displayed when an error occurs
@@ -129,7 +115,6 @@ EIDConfig={
-- Enables or disables custom Descriptions for entities -- Enables or disables custom Descriptions for entities
-- Default = true -- Default = true
["EnableEntityDescriptions"] = true ["EnableEntityDescriptions"] = true
} }
--END CONFIG-- --END CONFIG--
+4 -2
View File
@@ -9,8 +9,10 @@ EID:replaceMarkupStrings("!!! EID DEBUG MODE ACTIVATED !!!"), -- Header
"cyrillic 2: Пп Рр Сс Тт Уу Фф Хх Цц Чч Шш Щщ Ъъ Ыы Ьь Ээ Юю Яя", "cyrillic 2: Пп Рр Сс Тт Уу Фф Хх Цц Чч Шш Щщ Ъъ Ыы Ьь Ээ Юю Яя",
"polish: Ąą Ćć Ęę Łł Ńń Óó Śś Źź Żż", "polish: Ąą Ćć Ęę Łł Ńń Óó Śś Źź Żż",
"custom icons: ↑Positive ↓Negative \007bulletpoint !Exclamation ǃWarning !!!shortcut", "custom icons: ↑Positive ↓Negative \007bulletpoint !Exclamation ǃWarning !!!shortcut",
EID:replaceMarkupStrings("legacy icon Markup: \\1:\1Positive \\2:\2Negative \\3:\3Warning ! \\6:\6 heart \\5:\5 Key \\015:\015 Coin \\8\\189:\8\189 Bomb"), EID:replaceMarkupStrings(
"emotes: ☆★〠♠♣♥♦♤♧♡♢☀☂♨♪♭♯♂♀", "legacy icon Markup: \\1:\1Positive \\2:\2Negative \\3:\3Warning ! \\6:\6 heart \\5:\5 Key \\015:\015 Coin \\8\\189:\8\189 Bomb"
),
"emotes: ☆★〠♠♣♥♦♤♧♡♢☀☂♨♪♭♯♂♀"
} }
local function onDebugRender(t) local function onDebugRender(t)
+154 -56
View File
@@ -1,4 +1,4 @@
EID = RegisterMod( "External Item Descriptions" ,1 ); EID = RegisterMod("External Item Descriptions", 1)
local itemConfig = Isaac.GetItemConfig() local itemConfig = Isaac.GetItemConfig()
local lineHeight = 11 local lineHeight = 11
@@ -31,7 +31,6 @@ local modPath = string.sub(err, modPathStart+1, modPathEnd-1)
modPath = string.gsub(modPath, "\\", "/") modPath = string.gsub(modPath, "\\", "/")
modPath = string.gsub(modPath, ":/", ":\\") modPath = string.gsub(modPath, ":/", ":\\")
EID.font = Font() -- init font object EID.font = Font() -- init font object
EID.font:Load(modPath .. "resources/font/default.fnt") -- load a font into the font object EID.font:Load(modPath .. "resources/font/default.fnt") -- load a font into the font object
EID.font:SetMissingCharacter(2) EID.font:SetMissingCharacter(2)
@@ -44,11 +43,9 @@ if EIDConfig["Language"]=="en_us_detailed" and EIDConfig["Scale"] > 0.5 then
EIDConfig["Scale"] = 0.5 EIDConfig["Scale"] = 0.5
end end
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-------------------------Handle Sacrifice Room----------------------------- -------------------------Handle Sacrifice Room-----------------------------
if EIDConfig["DisplaySacrificeInfo"] then if EIDConfig["DisplaySacrificeInfo"] then
function onNewFloor() function onNewFloor()
EID.sacrificeCounter = 1 EID.sacrificeCounter = 1
end end
@@ -62,7 +59,6 @@ if EIDConfig["DisplaySacrificeInfo"] then
end end
end end
EID:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, onDamage, EntityType.ENTITY_PLAYER) EID:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, onDamage, EntityType.ENTITY_PLAYER)
end end
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@@ -87,11 +83,19 @@ function printDescription(desc)
IconSprite:Play(itemTypes[itemType]) IconSprite:Play(itemTypes[itemType])
IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"]) IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"])
IconSprite:Update() IconSprite:Update()
IconSprite:Render(Vector(EIDConfig["XPosition"]-3*EIDConfig["Scale"],padding+offsetY), Vector(0,0), Vector(0,0)) IconSprite:Render(
Vector(EIDConfig["XPosition"] - 3 * EIDConfig["Scale"], padding + offsetY),
Vector(0, 0),
Vector(0, 0)
)
if itemType == 3 then -- Display Charge if itemType == 3 then -- Display Charge
IconSprite:Play(itemConfig:GetCollectible(desc[1]).MaxCharges) IconSprite:Play(itemConfig:GetCollectible(desc[1]).MaxCharges)
IconSprite:Update() IconSprite:Update()
IconSprite:Render(Vector(EIDConfig["XPosition"]-3*EIDConfig["Scale"],padding+offsetY), Vector(0,0), Vector(0,0)) IconSprite:Render(
Vector(EIDConfig["XPosition"] - 3 * EIDConfig["Scale"], padding + offsetY),
Vector(0, 0),
Vector(0, 0)
)
end end
if not EIDConfig["ShowItemName"] then if not EIDConfig["ShowItemName"] then
padding = padding + lineHeight * EIDConfig["Scale"] padding = padding + lineHeight * EIDConfig["Scale"]
@@ -100,13 +104,24 @@ function printDescription(desc)
--Display Itemname --Display Itemname
if EIDConfig["ShowItemName"] then if EIDConfig["ShowItemName"] then
local offset = 0 local offset = 0
if EIDConfig["ShowItemType"]then if itemType==3 then offset = 9 else offset = 6 end end if EIDConfig["ShowItemType"] then
EID:renderString(itemConfig:GetCollectible(desc[1]).Name, Vector(EIDConfig["XPosition"]+offset*EIDConfig["Scale"], padding-4), Vector(EIDConfig["Scale"],EIDConfig["Scale"]), EID:getNameColor(), false) if itemType == 3 then
offset = 9
else
offset = 6
end
end
EID:renderString(
itemConfig:GetCollectible(desc[1]).Name,
Vector(EIDConfig["XPosition"] + offset * EIDConfig["Scale"], padding - 4),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
EID:getNameColor(),
false
)
padding = padding + lineHeight * EIDConfig["Scale"] padding = padding + lineHeight * EIDConfig["Scale"]
end end
--Display Transformation --Display Transformation
if not (desc[2] == "0" or desc[2] == "" or desc[2] == nil) then if not (desc[2] == "0" or desc[2] == "" or desc[2] == nil) then
if EIDConfig["TransformationText"] then if EIDConfig["TransformationText"] then
@@ -118,13 +133,23 @@ function printDescription(desc)
else else
transformationText = EID:getTransformation(desc[2]) transformationText = EID:getTransformation(desc[2])
end end
EID:renderString(transformationText, Vector(EIDConfig["XPosition"]+16*EIDConfig["Scale"], padding-1), Vector(EIDConfig["Scale"],EIDConfig["Scale"]), EID:getTransformationColor(), false) EID:renderString(
transformationText,
Vector(EIDConfig["XPosition"] + 16 * EIDConfig["Scale"], padding - 1),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
EID:getTransformationColor(),
false
)
end end
if EIDConfig["TransformationIcons"] and not (EID:getTransformation(desc[2]) == "Custom") then if EIDConfig["TransformationIcons"] and not (EID:getTransformation(desc[2]) == "Custom") then
IconSprite:Play("Transformation" .. desc[2]) IconSprite:Play("Transformation" .. desc[2])
IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"]) IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"])
IconSprite:Update() IconSprite:Update()
IconSprite:Render(Vector(EIDConfig["XPosition"]+5*EIDConfig["Scale"],padding+5*EIDConfig["Scale"]), Vector(0,0), Vector(0,0)) IconSprite:Render(
Vector(EIDConfig["XPosition"] + 5 * EIDConfig["Scale"], padding + 5 * EIDConfig["Scale"]),
Vector(0, 0),
Vector(0, 0)
)
end end
if (EIDConfig["TransformationIcons"] or EIDConfig["TransformationText"]) then if (EIDConfig["TransformationIcons"] or EIDConfig["TransformationText"]) then
padding = padding + lineHeight * EIDConfig["Scale"] padding = padding + lineHeight * EIDConfig["Scale"]
@@ -153,7 +178,13 @@ function printTrinketDescription(desc,typ)
name = desc[2][1] name = desc[2][1]
Description = desc[2][2] Description = desc[2][2]
end end
EID:renderString(name, Vector(EIDConfig["XPosition"],padding), Vector(EIDConfig["Scale"],EIDConfig["Scale"]), EID:getNameColor(), false) EID:renderString(
name,
Vector(EIDConfig["XPosition"], padding),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
EID:getNameColor(),
false
)
padding = padding + lineHeight * EIDConfig["Scale"] padding = padding + lineHeight * EIDConfig["Scale"]
end end
@@ -162,10 +193,10 @@ end
function printBulletPoints(description, padding) function printBulletPoints(description, padding)
local textboxWidth = tonumber(EIDConfig["TextboxWidth"]) local textboxWidth = tonumber(EIDConfig["TextboxWidth"])
for line in string.gmatch(description, '([^#]+)') do for line in string.gmatch(description, "([^#]+)") do
local array = {} local array = {}
local text = "" local text = ""
for word in string.gmatch(line, '([^ ]+)') do for word in string.gmatch(line, "([^ ]+)") do
if string.len(text) + string.len(word) <= textboxWidth then if string.len(text) + string.len(word) <= textboxWidth then
text = text .. " " .. word text = text .. " " .. word
else else
@@ -180,18 +211,23 @@ function printBulletPoints(description, padding)
local bpIcon = " " -- no bulletpoint local bpIcon = " " -- no bulletpoint
if i == 1 then if i == 1 then
bpIcon = EID:getBulletpointIcon(v) bpIcon = EID:getBulletpointIcon(v)
if string.find(bpIcon,'\007') == nil then if string.find(bpIcon, "\007") == nil then
v = string.sub(v, 3 + #bpIcon) v = string.sub(v, 3 + #bpIcon)
posX = posX - 2 -- Move a bit to the left, to center icons posX = posX - 2 -- Move a bit to the left, to center icons
end end
end end
EID:renderString(bpIcon..EID:replaceMarkupStrings(v), Vector(posX, padding), Vector(EIDConfig["Scale"],EIDConfig["Scale"]), textColor, false) EID:renderString(
bpIcon .. EID:replaceMarkupStrings(v),
Vector(posX, padding),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
textColor,
false
)
padding = padding + lineHeight * EIDConfig["Scale"] padding = padding + lineHeight * EIDConfig["Scale"]
end end
end end
end end
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
---------------------------Handle Rendering-------------------------------- ---------------------------Handle Rendering--------------------------------
function HasCurseBlind() function HasCurseBlind()
@@ -210,8 +246,14 @@ function renderQuestionMark()
IconSprite:Play("CurseOfBlind") IconSprite:Play("CurseOfBlind")
IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"]) IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"])
IconSprite:Update() IconSprite:Update()
IconSprite:Render(Vector(EIDConfig["XPosition"]+5*EIDConfig["Scale"],posY()+5*EIDConfig["Scale"]), Vector(0,0), Vector(0,0)) IconSprite:Render(
if Isaac.GetPlayer(0):HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then modifiedPosY =EIDConfig["YPosition"] -30 end Vector(EIDConfig["XPosition"] + 5 * EIDConfig["Scale"], posY() + 5 * EIDConfig["Scale"]),
Vector(0, 0),
Vector(0, 0)
)
if Isaac.GetPlayer(0):HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then
modifiedPosY = EIDConfig["YPosition"] - 30
end
end end
function renderIndicator(entity) function renderIndicator(entity)
@@ -220,7 +262,6 @@ function renderIndicator(entity)
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, 0)) entity:Render(Vector(0, 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)
elseif EIDConfig["Indicator"] == "border" then elseif EIDConfig["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)
@@ -230,7 +271,6 @@ function 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(Vector(0, 0)) entity:Render(Vector(0, 0))
elseif EIDConfig["Indicator"] == "highlight" then elseif EIDConfig["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))
@@ -239,16 +279,16 @@ function 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(Vector(0, 0)) entity:Render(Vector(0, 0))
elseif EIDConfig["Indicator"] == "arrow" then elseif EIDConfig["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 ArrowOffset = Vector(0,-62) end if entity.Variant == 100 and not entity:ToPickup():IsShopItem() then
ArrowOffset = Vector(0, -62)
end
ArrowSprite:Render(Game():GetRoom():WorldToScreenPosition(entity.Position + ArrowOffset), Vector(0, 0), Vector(0, 0)) ArrowSprite:Render(Game():GetRoom():WorldToScreenPosition(entity.Position + ArrowOffset), Vector(0, 0), Vector(0, 0))
end end
end end
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
---------------------------On Render Function------------------------------ ---------------------------On Render Function------------------------------
@@ -259,35 +299,42 @@ local function onRender(t)
local closestDice = nil local closestDice = nil
local dist = 10000 local dist = 10000
if Input.IsButtonTriggered(EIDConfig["HideKey"], 0) then if Input.IsButtonTriggered(EIDConfig["HideKey"], 0) then
hideDescToggle = not hideDescToggle; hideDescToggle = not hideDescToggle
end
if hideDescToggle then
return
end end
if hideDescToggle then return end
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 closestDice= entity end if Game():GetRoom():GetType() == RoomType.ROOM_DICE and entity.Type == 1000 and entity.Variant == 76 then
closestDice = entity
end
if EID:hasDescription(entity) then if EID:hasDescription(entity) then
local diff = entity.Position:__sub(player.Position); local diff = entity.Position:__sub(player.Position)
if diff:Length() < dist then if diff:Length() < dist then
closest = entity; closest = entity
dist = diff:Length(); dist = diff:Length()
end end
end end
end end
if dist / 40 > tonumber(EIDConfig["MaxDistance"]) or not closest.Type == EntityType.ENTITY_PICKUP then if dist / 40 > tonumber(EIDConfig["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 EIDConfig["DisplaySacrificeInfo"] then
printTrinketDescription(sacrificeDescriptions[EID.sacrificeCounter], "sacrifice") printTrinketDescription(sacrificeDescriptions[EID.sacrificeCounter], "sacrifice")
end end
if Game():GetRoom():GetType()==RoomType.ROOM_DICE and EIDConfig["DisplayDiceInfo"] and type(closestDice) ~= type(nil) then if
Game():GetRoom():GetType() == RoomType.ROOM_DICE and EIDConfig["DisplayDiceInfo"] and type(closestDice) ~= type(nil)
then
printTrinketDescription(diceDescriptions[closestDice.SubType + 1], "dice") printTrinketDescription(diceDescriptions[closestDice.SubType + 1], "dice")
renderIndicator(closestDice) renderIndicator(closestDice)
end end
return return
end end
if closest==nil then return end if closest == nil then
return
end
lastDescriptionEntity = closest lastDescriptionEntity = closest
isDisplayingText = true isDisplayingText = true
@@ -301,24 +348,39 @@ local function onRender(t)
end end
--Handle Entities (omni) --Handle Entities (omni)
if EIDConfig["EnableEntityDescriptions"] and __eidEntityDescriptions[closest.Type.."."..closest.Variant.."."..closest.SubType] ~=nil then if
printTrinketDescription({closest.Type,EID:getModDescription(__eidEntityDescriptions,closest.Type.."."..closest.Variant.."."..closest.SubType)},"custom") EIDConfig["EnableEntityDescriptions"] and
__eidEntityDescriptions[closest.Type .. "." .. closest.Variant .. "." .. closest.SubType] ~= nil
then
printTrinketDescription(
{
closest.Type,
EID:getModDescription(__eidEntityDescriptions, closest.Type .. "." .. closest.Variant .. "." .. closest.SubType)
},
"custom"
)
return return
end end
--Handle Trinkets --Handle Trinkets
if closest.Variant == PickupVariant.PICKUP_TRINKET then if closest.Variant == PickupVariant.PICKUP_TRINKET then
--Handle Collectibles
if closest.SubType <= 128 then if closest.SubType <= 128 then
printTrinketDescription(trinketdescriptions[closest.SubType], "trinket") printTrinketDescription(trinketdescriptions[closest.SubType], "trinket")
elseif EID:getModDescription(__eidTrinketDescriptions, closest.SubType) then elseif EID:getModDescription(__eidTrinketDescriptions, closest.SubType) then
printTrinketDescription({closest.SubType,EID:getModDescription(__eidTrinketDescriptions,closest.SubType)},"trinket") printTrinketDescription(
{closest.SubType, EID:getModDescription(__eidTrinketDescriptions, closest.SubType)},
"trinket"
)
else else
printTrinketDescription({closest.SubType, itemConfig:GetTrinket(closest.SubType).Description}) printTrinketDescription({closest.SubType, itemConfig:GetTrinket(closest.SubType).Description})
end end
--Handle Collectibles
elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then
if HasCurseBlind() and EIDConfig["DisableOnCurse"] then renderQuestionMark() return end --Handle Cards & Runes
if HasCurseBlind() and EIDConfig["DisableOnCurse"] then
renderQuestionMark()
return
end
if EID:getModDescription(__eidItemDescriptions, closest.SubType) then if EID:getModDescription(__eidItemDescriptions, closest.SubType) then
local tranformation = "0" local tranformation = "0"
if EID:getModDescription(__eidItemTransformations, closest.SubType) then if EID:getModDescription(__eidItemTransformations, closest.SubType) then
@@ -327,16 +389,25 @@ local function onRender(t)
printDescription({closest.SubType, tranformation, EID:getModDescription(__eidItemDescriptions, closest.SubType)}) printDescription({closest.SubType, tranformation, EID:getModDescription(__eidItemDescriptions, closest.SubType)})
elseif closest.SubType <= 552 then elseif closest.SubType <= 552 then
if EID:getModDescription(__eidItemTransformations, closest.SubType) then if EID:getModDescription(__eidItemTransformations, closest.SubType) then
printDescription({closest.SubType,EID:getModDescription(__eidItemTransformations,closest.SubType),descriptarray[closest.SubType][3]}) printDescription(
{
closest.SubType,
EID:getModDescription(__eidItemTransformations, closest.SubType),
descriptarray[closest.SubType][3]
}
)
else else
printDescription(descriptarray[closest.SubType]) printDescription(descriptarray[closest.SubType])
end end
else else
printDescription({closest.SubType, "", itemConfig:GetCollectible(closest.SubType).Description}) printDescription({closest.SubType, "", itemConfig:GetCollectible(closest.SubType).Description})
end end
--Handle Cards & Runes
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayCardInfoShop"] then renderQuestionMark() return end --Handle Pills
if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayCardInfoShop"] then
renderQuestionMark()
return
end
if EID:getModDescription(__eidCardDescriptions, closest.SubType) then if EID:getModDescription(__eidCardDescriptions, closest.SubType) then
printTrinketDescription({closest.SubType, EID:getModDescription(__eidCardDescriptions, closest.SubType)}, "card") printTrinketDescription({closest.SubType, EID:getModDescription(__eidCardDescriptions, closest.SubType)}, "card")
elseif closest.SubType <= 54 then elseif closest.SubType <= 54 then
@@ -345,14 +416,22 @@ local function onRender(t)
CardSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"]) CardSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"])
CardSprite:Update() CardSprite:Update()
local offsetX = 0 local offsetX = 0
if EIDConfig["ShowItemName"] then offsetX = 10 end if EIDConfig["ShowItemName"] then
CardSprite:Render(Vector(EIDConfig["XPosition"]-9*EIDConfig["Scale"],posY()+(12+offsetX)*EIDConfig["Scale"]), Vector(0,0), Vector(0,0)) offsetX = 10
end
CardSprite:Render(
Vector(EIDConfig["XPosition"] - 9 * EIDConfig["Scale"], posY() + (12 + offsetX) * EIDConfig["Scale"]),
Vector(0, 0),
Vector(0, 0)
)
else else
printTrinketDescription({closest.SubType, itemConfig:GetCard(closest.SubType).Description}) printTrinketDescription({closest.SubType, itemConfig:GetCard(closest.SubType).Description})
end end
--Handle Pills
elseif closest.Variant == PickupVariant.PICKUP_PILL then elseif closest.Variant == PickupVariant.PICKUP_PILL then
if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayPillInfoShop"] then renderQuestionMark() return end if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayPillInfoShop"] then
renderQuestionMark()
return
end
local pillColor = closest.SubType local pillColor = closest.SubType
local pool = Game():GetItemPool() local pool = Game():GetItemPool()
@@ -364,27 +443,44 @@ local function onRender(t)
elseif pillEffect < 47 then elseif pillEffect < 47 then
printTrinketDescription(pillDescriptions[pillEffect + 1], "pill") printTrinketDescription(pillDescriptions[pillEffect + 1], "pill")
else else
EID:renderString(EIDConfig["ErrorMessage"], Vector(EIDConfig["XPosition"], posY()), Vector(EIDConfig["Scale"],EIDConfig["Scale"]), EID:getErrorColor(), false) EID:renderString(
EIDConfig["ErrorMessage"],
Vector(EIDConfig["XPosition"], posY()),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
EID:getErrorColor(),
false
)
end end
else else
EID:renderString(unidentifiedPillMessage, Vector(EIDConfig["XPosition"], posY()), Vector(EIDConfig["Scale"],EIDConfig["Scale"]), EID:getErrorColor(), false) EID:renderString(
unidentifiedPillMessage,
Vector(EIDConfig["XPosition"], posY()),
Vector(EIDConfig["Scale"], EIDConfig["Scale"]),
EID:getErrorColor(),
false
)
end end
local pillsprite = closest:GetSprite() local pillsprite = closest:GetSprite()
pillsprite.Scale = Vector(EIDConfig["Scale"] * 0.75, EIDConfig["Scale"] * 0.75) pillsprite.Scale = Vector(EIDConfig["Scale"] * 0.75, EIDConfig["Scale"] * 0.75)
pillsprite:Update() pillsprite:Update()
local offsetX = 0 local offsetX = 0
if EIDConfig["ShowItemName"] and (identified or EIDConfig["ShowUnidentifiedPillDescriptions"]) then offsetX = 10 end if EIDConfig["ShowItemName"] and (identified or EIDConfig["ShowUnidentifiedPillDescriptions"]) then
pillsprite:Render(Vector(EIDConfig["XPosition"]+2*EIDConfig["Scale"],posY()+(11+offsetX)*EIDConfig["Scale"]), Vector(0,0), Vector(0,0)) offsetX = 10
end
pillsprite:Render(
Vector(EIDConfig["XPosition"] + 2 * EIDConfig["Scale"], posY() + (11 + offsetX) * EIDConfig["Scale"]),
Vector(0, 0),
Vector(0, 0)
)
pillsprite.Scale = Vector(1, 1) pillsprite.Scale = Vector(1, 1)
end end
if player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then modifiedPosY =EIDConfig["YPosition"] +30 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 ModConfigMenu then if ModConfigMenu then
local json = require("json") local json = require("json")
-------------------------------- --------------------------------
@@ -398,7 +494,9 @@ local json = require("json")
savedEIDConfig["Language"] = EIDConfig["Language"] 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 for key, value in pairs(EIDConfig) do
if savedEIDConfig[key]~=nil then EIDConfig[key]=savedEIDConfig[key] end if savedEIDConfig[key] ~= nil then
EIDConfig[key] = savedEIDConfig[key]
end
end end
end end
end end
+132 -66
View File
@@ -1,18 +1,21 @@
if ModConfigMenu then if ModConfigMenu 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 return k end if v == val then
return k
end
end end
return 1 return 1
end end
ModConfigMenu.AddText("EID", "General", "Change Language in the Config file.") ModConfigMenu.AddText("EID", "General", "Change Language in the Config file.")
ModConfigMenu.AddSpace("EID", "General") ModConfigMenu.AddSpace("EID", "General")
-- Disable on Curse -- Disable on Curse
ModConfigMenu.AddSetting("EID","General", { ModConfigMenu.AddSetting(
"EID",
"General",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisableOnCurse"] return EIDConfig["DisableOnCurse"]
@@ -22,15 +25,19 @@ if ModConfigMenu then
if EIDConfig["DisableOnCurse"] then if EIDConfig["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 EIDConfig["DisableOnCurse"] = currentBool
end, end
}) }
)
--indicator --indicator
local indicators = {"arrow", "blink", "border", "highlight", "none"} local indicators = {"arrow", "blink", "border", "highlight", "none"}
ModConfigMenu.AddSetting("EID", "General", { ModConfigMenu.AddSetting(
"EID",
"General",
{
Type = ModConfigMenuOptionType.NUMBER, Type = ModConfigMenuOptionType.NUMBER,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(indicators, EIDConfig["Indicator"]) return AnIndexOf(indicators, EIDConfig["Indicator"])
@@ -42,12 +49,15 @@ if ModConfigMenu then
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["Indicator"] = indicators[currentNum] EIDConfig["Indicator"] = indicators[currentNum]
end
end, }
}) )
--------ShowUnidentifiedPillDescriptions--------- --------ShowUnidentifiedPillDescriptions---------
ModConfigMenu.AddSetting("EID","General", { ModConfigMenu.AddSetting(
"EID",
"General",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["ShowUnidentifiedPillDescriptions"] return EIDConfig["ShowUnidentifiedPillDescriptions"]
@@ -61,10 +71,14 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["ShowUnidentifiedPillDescriptions"] = currentBool EIDConfig["ShowUnidentifiedPillDescriptions"] = currentBool
end, end
}) }
)
--------Sacrifice Room--------- --------Sacrifice Room---------
ModConfigMenu.AddSetting("EID","Rooms", { ModConfigMenu.AddSetting(
"EID",
"Rooms",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplaySacrificeInfo"] return EIDConfig["DisplaySacrificeInfo"]
@@ -78,11 +92,15 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplaySacrificeInfo"] = currentBool EIDConfig["DisplaySacrificeInfo"] = currentBool
end, end
}) }
)
--------Dice Room--------- --------Dice Room---------
ModConfigMenu.AddSetting("EID","Rooms", { ModConfigMenu.AddSetting(
"EID",
"Rooms",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayDiceInfo"] return EIDConfig["DisplayDiceInfo"]
@@ -96,13 +114,16 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayDiceInfo"] = currentBool EIDConfig["DisplayDiceInfo"] = currentBool
end, end
}) }
)
------------Collectibles-------------- ------------Collectibles--------------
ModConfigMenu.AddSetting("EID","General", { ModConfigMenu.AddSetting(
"EID",
"General",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayItemInfo"] return EIDConfig["DisplayItemInfo"]
@@ -116,11 +137,15 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayItemInfo"] = currentBool EIDConfig["DisplayItemInfo"] = currentBool
end, end
}) }
)
------------Trinkets-------------- ------------Trinkets--------------
ModConfigMenu.AddSetting("EID","General", { ModConfigMenu.AddSetting(
"EID",
"General",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayTrinketInfo"] return EIDConfig["DisplayTrinketInfo"]
@@ -134,11 +159,15 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayTrinketInfo"] = currentBool EIDConfig["DisplayTrinketInfo"] = currentBool
end, end
}) }
)
------------CARDS-------------- ------------CARDS--------------
ModConfigMenu.AddSetting("EID","General", { ModConfigMenu.AddSetting(
"EID",
"General",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayCardInfo"] return EIDConfig["DisplayCardInfo"]
@@ -152,11 +181,15 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayCardInfo"] = currentBool EIDConfig["DisplayCardInfo"] = currentBool
end, end
}) }
)
------------PILLS-------------- ------------PILLS--------------
ModConfigMenu.AddSetting("EID","General", { ModConfigMenu.AddSetting(
"EID",
"General",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayPillInfo"] return EIDConfig["DisplayPillInfo"]
@@ -170,16 +203,18 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayPillInfo"] = currentBool EIDConfig["DisplayPillInfo"] = currentBool
end, end
}) }
)
ModConfigMenu.AddSpace("EID", "Rooms") ModConfigMenu.AddSpace("EID", "Rooms")
ModConfigMenu.AddText("EID", "Rooms", "Display Infos in Shops") ModConfigMenu.AddText("EID", "Rooms", "Display Infos in Shops")
------------CARDS-------------- ------------CARDS--------------
ModConfigMenu.AddSetting("EID","Rooms", { ModConfigMenu.AddSetting(
"EID",
"Rooms",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayCardInfoShop"] return EIDConfig["DisplayCardInfoShop"]
@@ -193,11 +228,15 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayCardInfoShop"] = currentBool EIDConfig["DisplayCardInfoShop"] = currentBool
end, end
}) }
)
------------PILLS-------------- ------------PILLS--------------
ModConfigMenu.AddSetting("EID","Rooms", { ModConfigMenu.AddSetting(
"EID",
"Rooms",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["DisplayPillInfoShop"] return EIDConfig["DisplayPillInfoShop"]
@@ -211,14 +250,16 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["DisplayPillInfoShop"] = currentBool EIDConfig["DisplayPillInfoShop"] = currentBool
end, end
}) }
)
-- SCALE -- SCALE
local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2} local textScales = {0.5, 0.75, 1, 1.25, 1.5, 2}
ModConfigMenu.AddSetting("EID", "Display", { ModConfigMenu.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenuOptionType.NUMBER, Type = ModConfigMenuOptionType.NUMBER,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(textScales, EIDConfig["Scale"]) return AnIndexOf(textScales, EIDConfig["Scale"])
@@ -230,40 +271,53 @@ if ModConfigMenu then
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["Scale"] = textScales[currentNum] EIDConfig["Scale"] = textScales[currentNum]
end
end, }
}) )
-- maxDistance -- maxDistance
local distances = {1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10} local distances = {1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10}
ModConfigMenu.AddSetting("EID", "Display", { ModConfigMenu.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenuOptionType.SCROLL, Type = ModConfigMenuOptionType.SCROLL,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(distances, EIDConfig["MaxDistance"]) - 1 return AnIndexOf(distances, EIDConfig["MaxDistance"]) - 1
end, end,
Display = function() Display = function()
return "Display Distance: $scroll" .. AnIndexOf(distances,EIDConfig["MaxDistance"])-1 .." "..EIDConfig["MaxDistance"].." Grids" return "Display Distance: $scroll" ..
AnIndexOf(distances, EIDConfig["MaxDistance"]) - 1 .. " " .. EIDConfig["MaxDistance"] .. " Grids"
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["MaxDistance"] = distances[currentNum + 1] EIDConfig["MaxDistance"] = distances[currentNum + 1]
end end
}) }
)
-- Transparency -- Transparency
local transparencies = {0.1, 0.175, 0.25, 0.3, 0.4, 0.5, 0.6, 0.75, 0.8, 0.9, 1} local transparencies = {0.1, 0.175, 0.25, 0.3, 0.4, 0.5, 0.6, 0.75, 0.8, 0.9, 1}
ModConfigMenu.AddSetting("EID", "Display", { ModConfigMenu.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenuOptionType.SCROLL, Type = ModConfigMenuOptionType.SCROLL,
CurrentSetting = function() CurrentSetting = function()
return AnIndexOf(transparencies, EIDConfig["Transparency"]) - 1 return AnIndexOf(transparencies, EIDConfig["Transparency"]) - 1
end, end,
Display = function() Display = function()
return "Transparency: $scroll" .. AnIndexOf(transparencies,EIDConfig["Transparency"])-1 .." "..EIDConfig["Transparency"] return "Transparency: $scroll" ..
AnIndexOf(transparencies, EIDConfig["Transparency"]) - 1 .. " " .. EIDConfig["Transparency"]
end, end,
OnChange = function(currentNum) OnChange = function(currentNum)
EIDConfig["Transparency"] = transparencies[currentNum + 1] EIDConfig["Transparency"] = transparencies[currentNum + 1]
end end
}) }
)
--------ShowItemName--------- --------ShowItemName---------
ModConfigMenu.AddSetting("EID","Display", { ModConfigMenu.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["ShowItemName"] return EIDConfig["ShowItemName"]
@@ -277,10 +331,14 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["ShowItemName"] = currentBool EIDConfig["ShowItemName"] = currentBool
end, end
}) }
)
--------ShowItemType--------- --------ShowItemType---------
ModConfigMenu.AddSetting("EID","Display", { ModConfigMenu.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["ShowItemType"] return EIDConfig["ShowItemType"]
@@ -294,11 +352,15 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["ShowItemType"] = currentBool EIDConfig["ShowItemType"] = currentBool
end, end
}) }
)
-------TRANSFORMATIONS--------- -------TRANSFORMATIONS---------
ModConfigMenu.AddSetting("EID","Display", { ModConfigMenu.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["TransformationText"] return EIDConfig["TransformationText"]
@@ -312,9 +374,13 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["TransformationText"] = currentBool EIDConfig["TransformationText"] = currentBool
end, end
}) }
ModConfigMenu.AddSetting("EID","Display", { )
ModConfigMenu.AddSetting(
"EID",
"Display",
{
Type = ModConfigMenuOptionType.BOOLEAN, Type = ModConfigMenuOptionType.BOOLEAN,
CurrentSetting = function() CurrentSetting = function()
return EIDConfig["TransformationIcons"] return EIDConfig["TransformationIcons"]
@@ -328,7 +394,7 @@ if ModConfigMenu then
end, end,
OnChange = function(currentBool) OnChange = function(currentBool)
EIDConfig["TransformationIcons"] = currentBool EIDConfig["TransformationIcons"] = currentBool
end, end
}) }
)
end end