Improved Birthright description display

This commit is contained in:
Wofsauge committed 2021-06-04 17:44:02 +02:00
1 parent 7242967086
commit 9ee7ff4db5
2 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@ EID.InlineIcons = {
["RoomLBottomLeft"] = {"roomshape", 10, 10, 10},
["RoomLBottomRight"] = {"roomshape", 11, 10, 10},
-- Transformation Icons
["CustomTransformation"] = {"TransformationCustom", 0, 16, 16, 0, -1, EID.IconSprite},
["CustomTransformation"] = {"TransformationCustom", 0, 16, 16, -5, -1, EID.IconSprite},
["Guppy"] = {"Transformation1", 0, 16, 16, 0, -1, EID.IconSprite},
["FunGuy"] = {"Transformation2", 0, 16, 16, 0, -1, EID.IconSprite},
["LordoftheFlies"] = {"Transformation3", 0, 16, 16, 0, -1, EID.IconSprite},
+5 -3
View File
@@ -7,12 +7,14 @@ local game = Game()
end
local function BirthrightCallback(descObj)
descObj.Description = ""
local describedPlayerTypes = {}
for i = 0,game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
if not player:IsSubPlayer() and player:GetMainTwin( ):GetPlayerType() == player:GetPlayerType() then
local playerID = player:GetPlayerType() + 1
local playerID = player:GetPlayerType()
if not player:IsSubPlayer() and player:GetMainTwin( ):GetPlayerType() == playerID and not describedPlayerTypes[playerID] then
describedPlayerTypes[playerID] = true
local translatedDesc = EID.descriptions[EID.Config["Language"]]["birthright"]
local birthrightDesc = (translatedDesc and translatedDesc[playerID]) or EID.descriptions["en_us"]["birthright"][playerID] or nil
local birthrightDesc = (translatedDesc and translatedDesc[playerID+1]) or EID.descriptions["en_us"]["birthright"][playerID+1] or nil
if birthrightDesc ~=nil then
local playerName = birthrightDesc[1] or player:GetName()
descObj.Description = descObj.Description.."{{CustomTransformation}} {{ColorGray}}"..playerName.."{{CR}}#"..birthrightDesc[3].."#"