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