Improved Birthright description display
This commit is contained in:
1 parent
7242967086
commit
9ee7ff4db5
2 files changed
+6
-4
No files matched your search
+1
-1
@@ -135,7 +135,7 @@ EID.InlineIcons = {
|
|||||||
["RoomLBottomLeft"] = {"roomshape", 10, 10, 10},
|
["RoomLBottomLeft"] = {"roomshape", 10, 10, 10},
|
||||||
["RoomLBottomRight"] = {"roomshape", 11, 10, 10},
|
["RoomLBottomRight"] = {"roomshape", 11, 10, 10},
|
||||||
-- Transformation Icons
|
-- 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},
|
["Guppy"] = {"Transformation1", 0, 16, 16, 0, -1, EID.IconSprite},
|
||||||
["FunGuy"] = {"Transformation2", 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},
|
["LordoftheFlies"] = {"Transformation3", 0, 16, 16, 0, -1, EID.IconSprite},
|
||||||
|
|||||||
+5
-3
@@ -7,12 +7,14 @@ local game = Game()
|
|||||||
end
|
end
|
||||||
local function BirthrightCallback(descObj)
|
local function BirthrightCallback(descObj)
|
||||||
descObj.Description = ""
|
descObj.Description = ""
|
||||||
|
local describedPlayerTypes = {}
|
||||||
for i = 0,game:GetNumPlayers() - 1 do
|
for i = 0,game:GetNumPlayers() - 1 do
|
||||||
local player = Isaac.GetPlayer(i)
|
local player = Isaac.GetPlayer(i)
|
||||||
if not player:IsSubPlayer() and player:GetMainTwin( ):GetPlayerType() == player:GetPlayerType() then
|
local playerID = player:GetPlayerType()
|
||||||
local playerID = player:GetPlayerType() + 1
|
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 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
|
if birthrightDesc ~=nil then
|
||||||
local playerName = birthrightDesc[1] or player:GetName()
|
local playerName = birthrightDesc[1] or player:GetName()
|
||||||
descObj.Description = descObj.Description.."{{CustomTransformation}} {{ColorGray}}"..playerName.."{{CR}}#"..birthrightDesc[3].."#"
|
descObj.Description = descObj.Description.."{{CustomTransformation}} {{ColorGray}}"..playerName.."{{CR}}#"..birthrightDesc[3].."#"
|
||||||
|
|||||||
Reference in new issue
Block a user