Fixed some minor bugs
This commit is contained in:
1 parent
931d505bc9
commit
e565ab65a9
5 files changed
+824
-812
No files matched your search
+779
-781
File diff suppressed because it is too large.
Load diff
+19
-5
@@ -205,7 +205,7 @@ end
|
||||
|
||||
-- Returns if EID is displaying text right now
|
||||
function EID:isDisplayingText()
|
||||
return EID.isDisplayingText
|
||||
return EID.isDisplaying
|
||||
end
|
||||
|
||||
-- Returns true, if curse of blind is active
|
||||
@@ -261,7 +261,7 @@ function EID:getDescriptionObj(Type, Variant, SubType)
|
||||
description.Name = EID:getObjectName(Type, Variant, description.ID)
|
||||
|
||||
local tableEntry = EID:getDescriptionData(Type, Variant, description.ID)
|
||||
description.Description =tableEntry and tableEntry[3] or "MISSING DESCRIPTION"
|
||||
description.Description =tableEntry and tableEntry[3] or EID:getXMLDescription(Type, Variant, description.ID)
|
||||
|
||||
description.Transformation = EID:getTransformation(Type, Variant, description.ID)
|
||||
|
||||
@@ -353,11 +353,12 @@ end
|
||||
-- tries to get the ingame name of an item based on its ID
|
||||
function EID:getObjectName(Type, Variant, SubType)
|
||||
local tableEntry = EID:getDescriptionData(Type, Variant, SubType)
|
||||
if tableEntry == nil then return Type.."."..Variant.."."..SubType end
|
||||
local tableName = EID:getTableName(Type, Variant)
|
||||
local name = nil
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" then
|
||||
name = tableEntry[2]
|
||||
if tableEntry ~= nil then
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" then
|
||||
name = tableEntry[2]
|
||||
end
|
||||
end
|
||||
if tableName == "collectibles" then
|
||||
return name or EID.itemConfig:GetCollectible(SubType).Name
|
||||
@@ -378,6 +379,19 @@ function EID:getObjectName(Type, Variant, SubType)
|
||||
return Type.."."..Variant.."."..SubType
|
||||
end
|
||||
|
||||
-- tries to get the ingame description of an object, based on their description in the XML files
|
||||
function EID:getXMLDescription(Type, Variant, SubType)
|
||||
local tableName = EID:getTableName(Type, Variant)
|
||||
local desc= nil
|
||||
if tableName == "collectibles" then
|
||||
desc = EID.itemConfig:GetCollectible(SubType).Description
|
||||
elseif tableName == "trinkets" then
|
||||
desc = EID.itemConfig:GetTrinket(SubType).Description
|
||||
elseif tableName == "cards" then
|
||||
desc = EID.itemConfig:GetCard(SubType).Description
|
||||
end
|
||||
return desc or "(No Description available)"
|
||||
end
|
||||
-- check if an entity is part of the describable entities
|
||||
function EID:hasDescription(entity)
|
||||
local isAllowed = false
|
||||
|
||||
+20
-20
@@ -100,29 +100,29 @@ EID:addColor("ColorBlackBlink", nil, function(color)
|
||||
|
||||
|
||||
local function onDebugRender(t)
|
||||
for i,v in ipairs(Isaac.FindByType(5,10,3,true,false)) do
|
||||
if v:GetData()["EID_Description"] == nil then
|
||||
v:GetData()["EID_Description"] = "Test specific description#Init seed: ".. v.InitSeed
|
||||
end
|
||||
for i,v in ipairs(Isaac.FindByType(5,10,3,true,false)) do
|
||||
if v:GetData()["EID_Description"] == nil then
|
||||
v:GetData()["EID_Description"] = "Test specific description#Init seed: ".. v.InitSeed
|
||||
end
|
||||
for i,v in ipairs(Isaac.FindByType(5,10,4,true,false)) do
|
||||
if v:GetData()["EID_Description"] == nil then
|
||||
local descTable = {
|
||||
["Name"] = "Some Item with seed ".. v.InitSeed ,
|
||||
["Description"] = "Test specific description#Init seed: ".. v.InitSeed,
|
||||
["Transformation"] = "1,2"
|
||||
}
|
||||
v:GetData()["EID_Description"] = descTable
|
||||
end
|
||||
end
|
||||
for i,v in ipairs(Isaac.FindByType(5,10,4,true,false)) do
|
||||
if v:GetData()["EID_Description"] == nil then
|
||||
local descTable = {
|
||||
["Name"] = "Some Item with seed ".. v.InitSeed ,
|
||||
["Description"] = "Test specific description#Init seed: ".. v.InitSeed,
|
||||
["Transformation"] = "1,2"
|
||||
}
|
||||
v:GetData()["EID_Description"] = descTable
|
||||
end
|
||||
end
|
||||
|
||||
for i, v in ipairs(charsToDebug) do
|
||||
local pos = EID.getTextPosition() + Vector(-5, - 15 + ((i - 1) * 14))
|
||||
EID:renderString(v, pos, Vector(EID.Config["Scale"], EID.Config["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0))
|
||||
|
||||
if not showDebugChars then
|
||||
break
|
||||
end
|
||||
for i, v in ipairs(charsToDebug) do
|
||||
local pos = EID.getTextPosition() + Vector(-5, - 15 + ((i - 1) * 14))
|
||||
EID:renderString(v, pos, Vector(EID.Config["Scale"], EID.Config["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0))
|
||||
|
||||
if not showDebugChars then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_POST_RENDER, onDebugRender)
|
||||
@@ -13,7 +13,7 @@ EID.isHidden = EID.Config["Hidden"]
|
||||
-- general variables
|
||||
EID.PositionModifiers = {}
|
||||
EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"])
|
||||
EID.isDisplayingText = false
|
||||
EID.isDisplaying = false
|
||||
EID.isDisplayingPermanent = false
|
||||
EID.permanentDisplayTextObj = nil
|
||||
EID.lastDescriptionEntity = nil
|
||||
@@ -285,7 +285,7 @@ end
|
||||
---------------------------On Render Function------------------------------
|
||||
|
||||
local function onRender(t)
|
||||
EID.isDisplayingText = false
|
||||
EID.isDisplaying = false
|
||||
if Input.IsButtonTriggered(EID.Config["HideKey"], 0) then
|
||||
EID.isHidden = not EID.isHidden
|
||||
end
|
||||
@@ -308,7 +308,7 @@ local function onRender(t)
|
||||
|
||||
if EID.isDisplayingPermanent and EID.permanentDisplayTextObj ~= nil then
|
||||
EID:printDescription(EID.permanentDisplayTextObj)
|
||||
EID.isDisplayingText = true
|
||||
EID.isDisplaying = true
|
||||
return
|
||||
end
|
||||
|
||||
@@ -346,7 +346,7 @@ local function onRender(t)
|
||||
return
|
||||
end
|
||||
EID.lastDescriptionEntity = closest
|
||||
EID.isDisplayingText = true
|
||||
EID.isDisplaying = true
|
||||
|
||||
--Handle Indicators
|
||||
EID:renderIndicator(closest)
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<name>!!External item descriptions</name>
|
||||
<name>!!~External item descriptions</name>
|
||||
<directory>external item descriptions</directory>
|
||||
<id>836319872</id>
|
||||
<description>This mod displays detailed information about all items, trinkets, cards, runes and pills DIRECTLY onto your screen. Say goodbye to your browsertab with platinumgod open ;)
|
||||
@@ -76,7 +76,7 @@ https://moddingofisaac.com/mod/1079/external-item-descriptions
|
||||
- [url=https://steamcommunity.com/id/whytefang/]adc[/url] for creating an awesome new Languagepack and providing ideas for new functionalities
|
||||
|
||||
[img]https://i.imgur.com/P6a8043.png[/img] [url=https://github.com/wofsauge/External-Item-Descriptions]Any Problems? Visit this project on GitHub[/url]</description>
|
||||
<version>3.4</version>
|
||||
<version>3.5</version>
|
||||
<visibility>Public</visibility>
|
||||
<tag id="Lua"/>
|
||||
<tag id="Items"/>
|
||||
|
||||
Reference in new issue
Block a user