Readded support for custom entity descriptions

This commit is contained in:
Wofsauge committed 2020-10-25 19:32:56 +01:00
1 parent 86cb44d122
commit 996ae3cc9c
11 files changed
+26 -16

No files matched your search

+1
View File
@@ -13,6 +13,7 @@
-- init bul table -- init bul table
EID.descriptions["bul"] = {} EID.descriptions["bul"] = {}
EID.descriptions["bul"].custom = {} -- table for custom entity descriptions
EID.descriptions["bul"].collectibles={ EID.descriptions["bul"].collectibles={
{"1", "0", "Тъжният лук", "\1 0.7 Скорост на сълзите"}, {"1", "0", "Тъжният лук", "\1 0.7 Скорост на сълзите"},
+1
View File
@@ -13,6 +13,7 @@
-- init en_us table -- init en_us table
EID.descriptions["en_us"] = {} EID.descriptions["en_us"] = {}
EID.descriptions["en_us"].custom = {} -- table for custom entity descriptions
EID.descriptions["en_us"].collectibles={{"1", "0", "", "↑ +0.7 Tears up"}, EID.descriptions["en_us"].collectibles={{"1", "0", "", "↑ +0.7 Tears up"},
{"2", "0", "", "Triple shot#↓ Tears down"}, {"2", "0", "", "Triple shot#↓ Tears down"},
+1
View File
@@ -10,6 +10,7 @@
-- init en_us_detailed table -- init en_us_detailed table
EID.descriptions["en_us_detailed"] = {} EID.descriptions["en_us_detailed"] = {}
EID.descriptions["en_us_detailed"].custom = {} -- table for custom entity descriptions
EID.descriptions["en_us_detailed"].collectibles={ EID.descriptions["en_us_detailed"].collectibles={
{"1", "0", "", "+0.7 Tears up."}, {"1", "0", "", "+0.7 Tears up."},
+1
View File
@@ -17,6 +17,7 @@
-- init fr table -- init fr table
EID.descriptions["fr"] = {} EID.descriptions["fr"] = {}
EID.descriptions["fr"].custom = {} -- table for custom entity descriptions
EID.descriptions["fr"].collectibles={ EID.descriptions["fr"].collectibles={
{"1", "0", "", "↑ +0.7 Cadence de tir"}, {"1", "0", "", "↑ +0.7 Cadence de tir"},
+1
View File
@@ -20,6 +20,7 @@
-- init pl table -- init pl table
EID.descriptions["pl"] = {} EID.descriptions["pl"] = {}
EID.descriptions["pl"].custom = {} -- table for custom entity descriptions
EID.descriptions["pl"].collectibles={{"1","0","\1 +0.7 Szybkostrzelno¶ci"}, EID.descriptions["pl"].collectibles={{"1","0","\1 +0.7 Szybkostrzelno¶ci"},
{"2","0","Potrójne strza³y#\2 Mniejsza Szybkostrzelno¶æ"}, {"2","0","Potrójne strza³y#\2 Mniejsza Szybkostrzelno¶æ"},
+1
View File
@@ -16,6 +16,7 @@
-- init pt table -- init pt table
EID.descriptions["pt"] = {} EID.descriptions["pt"] = {}
EID.descriptions["pt"].custom = {} -- table for custom entity descriptions
EID.descriptions["pt"].collectibles={ EID.descriptions["pt"].collectibles={
{"1", "0", "", "↑ +0.7 lágrimas up"}, {"1", "0", "", "↑ +0.7 lágrimas up"},
+1
View File
@@ -1,6 +1,7 @@
-- init ru table -- init ru table
EID.descriptions["ru"] = {} EID.descriptions["ru"] = {}
EID.descriptions["ru"].custom = {} -- table for custom entity descriptions
EID.descriptions["ru"].collectibles={ EID.descriptions["ru"].collectibles={
{"1", "0", "Грустный Лук", "\1 0.7 к скорострельности"}, {"1", "0", "Грустный Лук", "\1 0.7 к скорострельности"},
+1
View File
@@ -16,6 +16,7 @@
-- init spa table -- init spa table
EID.descriptions["spa"] = {} EID.descriptions["spa"] = {}
EID.descriptions["spa"].custom = {} -- table for custom entity descriptions
EID.descriptions["spa"].collectibles={ EID.descriptions["spa"].collectibles={
{"1", "0", "", "↑ +0,7 de lágrimas"}, {"1", "0", "", "↑ +0,7 de lágrimas"},
+6 -5
View File
@@ -110,7 +110,7 @@ function EID:getLegacyModDescription(objTable, id)
elseif objTable == "transformation" then elseif objTable == "transformation" then
return (__eidItemTransformations) and (__eidItemTransformations[id]) return (__eidItemTransformations) and (__eidItemTransformations[id])
elseif objTable == "custom" then elseif objTable == "custom" then
return (__eidEntityDescriptions) and (__eidEntityDescriptions[id]) return (__eidEntityDescriptions) and (__eidEntityDescriptions[id][2])
end end
end end
@@ -123,10 +123,11 @@ end
-- returns the description object of the specified object table translated with the current language -- returns the description object of the specified object table translated with the current language
-- falls back to english if the objID isnt available -- falls back to english if the objID isnt available
function EID:getDescriptionObj(objTable, objID) function EID:getDescriptionObj(objTable, objID)
local tableEntry = EID.descriptions[EIDConfig["Language"]][objTable][tonumber(objID)] or EID.descriptions["en_us"][objTable][tonumber(objID)] local tableEntry = EID.descriptions[EIDConfig["Language"]][objTable][objID] or EID.descriptions["en_us"][objTable][objID] or {}
local description = {} local description = {}
description.ID = tonumber(tableEntry[1]) or objID description.ID = objID
description.Name = EID:getObjectName(objID, objTable) or objTable description.Name = EID:getObjectName(objID, objTable) or objTable
local legacyModdedDescription = EID:getLegacyModDescription(objTable, objID) local legacyModdedDescription = EID:getLegacyModDescription(objTable, objID)
@@ -152,7 +153,7 @@ end
-- tries to get the ingame name of an item based on its ID -- tries to get the ingame name of an item based on its ID
function EID:getObjectName(objID, objType) function EID:getObjectName(objID, objType)
local tableEntry = EID.descriptions[EIDConfig["Language"]][objType][tonumber(objID)] or EID.descriptions["en_us"][objType][tonumber(objID)] local tableEntry = EID.descriptions[EIDConfig["Language"]][objType][objID] or EID.descriptions["en_us"][objType][objID]
if objType == "collectibles" then if objType == "collectibles" then
if EIDConfig["Language"]~="en_us" and #tableEntry==4 then if EIDConfig["Language"]~="en_us" and #tableEntry==4 then
if tableEntry[3] ~= nil and tableEntry[3] ~= "" then if tableEntry[3] ~= nil and tableEntry[3] ~= "" then
@@ -186,7 +187,7 @@ function EID:getObjectName(objID, objType)
elseif objType == "dice" then elseif objType == "dice" then
return EID:getDescriptionTable("diceHeader") return EID:getDescriptionTable("diceHeader")
elseif objType == "custom" then elseif objType == "custom" then
return objID return __eidEntityDescriptions[objID][1] or tableEntry[1] or objID
end end
end end
+2 -2
View File
@@ -25,9 +25,9 @@ __eidItemDescriptions[1] = "\1 Overriden description" -- 5.100.1 = Sad Onion
__eidTrinketDescriptions[1] = "\2 Overriden " -- 5.350.1 = swallowed penny __eidTrinketDescriptions[1] = "\2 Overriden " -- 5.350.1 = swallowed penny
__eidCardDescriptions[1] = "Overriden Card description" -- 5.300.1 = the fool __eidCardDescriptions[1] = "Overriden Card description" -- 5.300.1 = the fool
__eidPillDescriptions[21] = "Test" -- Pill Effect 20 = Hematemesis __eidPillDescriptions[21] = "Test" -- Pill Effect 20 = Hematemesis
__eidItemTransformations[1] = "Test Transformation" -- add custom transformation Text to Sad Onion
-- Legacy add Description -- Legacy add Description to entity
__eidItemTransformations[1] = "Test Transformation"
__eidEntityDescriptions["5.10.1"] = {"Entity Name","Entity description"} -- Adds description to full red hearts __eidEntityDescriptions["5.10.1"] = {"Entity Name","Entity description"} -- Adds description to full red hearts
-- test adding custom icons -- test adding custom icons
+10 -9
View File
@@ -84,8 +84,10 @@ end
function printDescription(desc) function printDescription(desc)
local padding = posY() local padding = posY()
local itemType = EID.itemConfig:GetCollectible(desc.ID).Type local itemType = -1
if tonumber(desc.ID)~=nil then
itemType = EID.itemConfig:GetCollectible(tonumber(desc.ID)).Type or -1
end
--Display ItemType / Charge --Display ItemType / Charge
if EIDConfig["ShowItemType"] and (itemType == 3 or itemType == 4) then if EIDConfig["ShowItemType"] and (itemType == 3 or itemType == 4) then
local offsetY = 2 * EIDConfig["Scale"] local offsetY = 2 * EIDConfig["Scale"]
@@ -319,25 +321,24 @@ local function onRender(t)
printTrinketDescription({closest.Type, closest:GetData()["EID_Description"]}, "custom") printTrinketDescription({closest.Type, closest:GetData()["EID_Description"]}, "custom")
return return
end end
]]--
--Handle Entities (omni) --Handle Entities (omni)
if EIDConfig["EnableEntityDescriptions"] and if EIDConfig["EnableEntityDescriptions"] then
__eidEntityDescriptions[closest.Type .. "." .. closest.Variant .. "." .. closest.SubType] ~= nil
then
printDescription(EID:getDescriptionObj("custom", closest.Type .. "." .. closest.Variant .. "." .. closest.SubType)) printDescription(EID:getDescriptionObj("custom", closest.Type .. "." .. closest.Variant .. "." .. closest.SubType))
return return
end]]-- end
--Handle Trinkets --Handle Trinkets
if closest.Variant == PickupVariant.PICKUP_TRINKET then if closest.Variant == PickupVariant.PICKUP_TRINKET then
printDescription(EID:getDescriptionObj("trinkets",closest.SubType)) printDescription(EID:getDescriptionObj("trinkets", closest.SubType))
--Handle Collectibles --Handle Collectibles
elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then elseif closest.Variant == PickupVariant.PICKUP_COLLECTIBLE then
if EID:hasCurseBlind() and EIDConfig["DisableOnCurse"] then if EID:hasCurseBlind() and EIDConfig["DisableOnCurse"] then
renderQuestionMark() renderQuestionMark()
return return
end end
printDescription(EID:getDescriptionObj("collectibles",closest.SubType)) printDescription(EID:getDescriptionObj("collectibles", closest.SubType))
--Handle Cards & Runes --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 if closest:ToPickup():IsShopItem() and not EIDConfig["DisplayCardInfoShop"] then