Removed some global variables and formatted files

This commit is contained in:
Wofsauge committed 2020-11-01 19:44:27 +01:00
1 parent bfa6addf65
commit 1c7df4ffb4
3 files changed
+53 -17

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
{
"Lua.diagnostics.globals": [
"__eidItemDescriptions",
"__eidTrinketDescriptions",
"__eidCardDescriptions",
"__eidPillDescriptions",
"__eidItemTransformations",
"__eidEntityDescriptions",
"Game",
"LevelCurse",
"Vector",
"PickupVariant",
"EntityType",
"Color",
"KColor",
"RegisterMod",
"Isaac",
"Sprite",
"Font",
"ModCallbacks",
"RoomType",
"DamageFlag",
"Input",
"CollectibleType",
"ModConfigMenu",
"Keyboard",
"ModConfigMenuOptionType"
]
}
+11 -4
View File
@@ -127,7 +127,6 @@ EID.InlineColors ={
["ColorError"] = function(_) return EID:getErrorColor() end, ["ColorError"] = function(_) return EID:getErrorColor() end,
["ColorObjName"] = function(_) return EID:getNameColor() end, ["ColorObjName"] = function(_) return EID:getNameColor() end,
["ColorReset"] = function(_) return EID.LastRenderCallColor end, ["ColorReset"] = function(_) return EID.LastRenderCallColor end,
-- Basic Colors -- Basic Colors
["ColorBlack"] = KColor(0, 0, 0, 1, 0, 0, 0), ["ColorBlack"] = KColor(0, 0, 0, 1, 0, 0, 0),
["ColorWhite"] = KColor(1, 1, 1, 1, 0, 0, 0), ["ColorWhite"] = KColor(1, 1, 1, 1, 0, 0, 0),
@@ -157,10 +156,18 @@ EID.InlineColors ={
local colorFractions = (maxAnimTime - 1) / #colors local colorFractions = (maxAnimTime - 1) / #colors
local subAnm = math.floor(animTime / (colorFractions + 1)) + 1 local subAnm = math.floor(animTime / (colorFractions + 1)) + 1
local primaryColorIndex = subAnm % (#colors + 1) local primaryColorIndex = subAnm % (#colors + 1)
if primaryColorIndex == 0 then primaryColorIndex = 1 end if primaryColorIndex == 0 then
primaryColorIndex = 1
end
local secondaryColorIndex = (subAnm + 1) % (#colors + 1) local secondaryColorIndex = (subAnm + 1) % (#colors + 1)
if secondaryColorIndex == 0 then secondaryColorIndex = 1 end if secondaryColorIndex == 0 then
return EID:interpolateColors(colors[primaryColorIndex], colors[secondaryColorIndex], (animTime%(colorFractions+1))/colorFractions) secondaryColorIndex = 1
end
return EID:interpolateColors(
colors[primaryColorIndex],
colors[secondaryColorIndex],
(animTime % (colorFractions + 1)) / colorFractions
)
end, end,
-- Text will blink frequently -- Text will blink frequently
["ColorBlink"] = function(color) ["ColorBlink"] = function(color)
+13 -13
View File
@@ -84,7 +84,7 @@ local function posY()
return modifiedPosY ~= false and modifiedPosY or EIDConfig["YPosition"] return modifiedPosY ~= false and modifiedPosY or EIDConfig["YPosition"]
end end
function printDescription(desc) function EID:printDescription(desc)
local padding = posY() local padding = posY()
local itemType = -1 local itemType = -1
if tonumber(desc.ID) ~= nil then if tonumber(desc.ID) ~= nil then
@@ -197,10 +197,10 @@ end
---------------------------Handle Rendering-------------------------------- ---------------------------Handle Rendering--------------------------------
function EID:renderQuestionMark() function EID:renderQuestionMark()
IconSprite:Play("CurseOfBlind") EID.IconSprite:Play("CurseOfBlind")
IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"]) EID.IconSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"])
IconSprite:Update() EID.IconSprite:Update()
IconSprite:Render( EID.IconSprite:Render(
Vector(EIDConfig["XPosition"] + 5 * EIDConfig["Scale"], posY() + 5 * EIDConfig["Scale"]), Vector(EIDConfig["XPosition"] + 5 * EIDConfig["Scale"], posY() + 5 * EIDConfig["Scale"]),
Vector(0, 0), Vector(0, 0),
Vector(0, 0) Vector(0, 0)
@@ -275,12 +275,12 @@ local function onRender(t)
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
printDescription(EID:getDescriptionObj("sacrifice", EID.sacrificeCounter)) EID:printDescription(EID:getDescriptionObj("sacrifice", 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 EIDConfig["DisplayDiceInfo"] and type(closestDice) ~= type(nil)
then then
printDescription(EID:getDescriptionObj("dice", closestDice.SubType + 1)) EID:printDescription(EID:getDescriptionObj("dice", closestDice.SubType + 1))
EID:renderIndicator(closestDice) EID:renderIndicator(closestDice)
end end
return return
@@ -308,28 +308,28 @@ local function onRender(t)
EID:getLegacyModDescription("custom", objIDString) or EID:getLegacyModDescription("custom", objIDString) or
nil nil
if EIDConfig["EnableEntityDescriptions"] and tableEntry ~= nil then if EIDConfig["EnableEntityDescriptions"] and tableEntry ~= nil then
printDescription(EID:getDescriptionObj("custom", objIDString)) EID:printDescription(EID:getDescriptionObj("custom", objIDString))
return return
end end
--Handle Trinkets --Handle Trinkets
if closest.Variant == PickupVariant.PICKUP_TRINKET then if closest.Variant == PickupVariant.PICKUP_TRINKET then
--Handle Collectibles --Handle Collectibles
printDescription(EID:getDescriptionObj("trinkets", closest.SubType)) EID:printDescription(EID:getDescriptionObj("trinkets", closest.SubType))
elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then
--Handle Cards & Runes --Handle Cards & Runes
if EID:hasCurseBlind() and EIDConfig["DisableOnCurse"] then if EID:hasCurseBlind() and EIDConfig["DisableOnCurse"] then
EID:renderQuestionMark() EID:renderQuestionMark()
return return
end end
printDescription(EID:getDescriptionObj("collectibles", closest.SubType)) EID:printDescription(EID:getDescriptionObj("collectibles", closest.SubType))
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
--Handle Pills --Handle Pills
if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayCardInfoShop"] then if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayCardInfoShop"] then
EID:renderQuestionMark() EID:renderQuestionMark()
return return
end end
printDescription(EID:getDescriptionObj("cards", closest.SubType)) EID:printDescription(EID:getDescriptionObj("cards", closest.SubType))
if closest.SubType <= 54 then if closest.SubType <= 54 then
CardSprite:Play(tostring(closest.SubType)) CardSprite:Play(tostring(closest.SubType))
CardSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"]) CardSprite.Scale = Vector(EIDConfig["Scale"], EIDConfig["Scale"])
@@ -355,7 +355,7 @@ local function onRender(t)
local pillEffect = pool:GetPillEffect(pillColor) local pillEffect = pool:GetPillEffect(pillColor)
local identified = pool:IsPillIdentified(pillColor) local identified = pool:IsPillIdentified(pillColor)
if (identified or EIDConfig["ShowUnidentifiedPillDescriptions"]) then if (identified or EIDConfig["ShowUnidentifiedPillDescriptions"]) then
printDescription(EID:getDescriptionObj("pills", pillEffect + 1)) EID:printDescription(EID:getDescriptionObj("pills", pillEffect + 1))
else else
EID:renderString( EID:renderString(
EID:getDescriptionTable("unidentifiedPill"), EID:getDescriptionTable("unidentifiedPill"),
@@ -393,7 +393,7 @@ if ModConfigMenu then
function OnGameStart(isSave) function OnGameStart(isSave)
--Loading Moddata-- --Loading Moddata--
if EID:HasData() then if EID:HasData() then
savedEIDConfig = json.decode(Isaac.LoadModData(EID)) local savedEIDConfig = json.decode(Isaac.LoadModData(EID))
-- hardcode Language usage -- hardcode Language usage
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