From fc46d61289b93ceddddcec4f8944c770cbbb5a23 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Tue, 23 Apr 2024 22:28:36 +0200 Subject: [PATCH] Added function EID:GetPlayerIcon() --- eid_modifiers.lua | 10 +++++----- main.lua | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index d18b9b4b..eb3fbc2e 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -280,7 +280,7 @@ if EID.isRepentance then local birthrightDesc = EID:getDescriptionEntry("birthright", playerID+1) if birthrightDesc ~=nil then local playerName = birthrightDesc[1] or player:GetName() - EID:appendToDescription(descObj, (EID:getIcon("Player"..playerID) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerID.."}}" or "{{CustomTransformation}}").." {{ColorGray}}"..playerName.."{{CR}}#"..birthrightDesc[3].."#") + EID:appendToDescription(descObj, EID:GetPlayerIcon(playerID) .. " {{ColorGray}}"..playerName.."{{CR}}#"..birthrightDesc[3].."#") end end end @@ -399,7 +399,7 @@ if EID.isRepentance then end end - local newStr = "#" .. (EID:getIcon("Player"..playerID) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerID.."}} " or "") .. " {{ColorGray}}"..playerName.."{{CR}}#" + local newStr = "#" .. EID:GetPlayerIcon(playerID) .. " {{ColorGray}}"..playerName.."{{CR}}#" local voidNames = EID:getDescriptionEntry("VoidNames") for i,v in ipairs(statsToDisplay) do @@ -678,7 +678,7 @@ if EID.isRepentance then local tableName = EID:getTableName(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType) local name = EID:getPillName(lastUsedPill, tableName == "horsepills") if #EID.coopAllPlayers == 1 then EID:appendToDescription(descObj, "#{{Pill}}") - else EID:appendToDescription(descObj, "#" .. (EID:getIcon("Player"..playerType) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerType.."}}" or ("P" .. i .. ":"))) end + else EID:appendToDescription(descObj, "#" .. EID:GetPlayerIcon(playerType, "P" .. i .. ":")) end EID:appendToDescription(descObj, " {{ColorSilver}}" .. name) end end @@ -721,7 +721,7 @@ if EID.isRepentance then end else expPillString = EID:getDescriptionEntry("ExperimentalPillPHD") end EID:appendToDescription(descObj, "#") - if #EID.coopAllPlayers > 1 then EID:appendToDescription(descObj, (EID:getIcon("Player"..playerType) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerType.."}} " or ("P" .. i .. ": "))) end + if #EID.coopAllPlayers > 1 then EID:appendToDescription(descObj, EID:GetPlayerIcon(playerType, "P" .. i .. ":")) end EID:appendToDescription(descObj, "{{Collectible" .. pillModifierID .. "}} " .. expPillString) end end @@ -768,7 +768,7 @@ if EID.isRepentance then if not printedDescs[pillObj.Name] then -- new pill effect to print printedDescs[pillObj.Name] = true - EID:appendToDescription(descObj, "#" .. (EID:getIcon("Player"..playerID) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerID.."}}" or ("P" .. i .. ":")).." {{ColorObjName}}"..pillObj.Name .."{{CR}}#"..pillObj.Description) + EID:appendToDescription(descObj, "#" .. EID:GetPlayerIcon(playerID, "P" .. i .. ":") .." {{ColorObjName}}"..pillObj.Name .."{{CR}}#"..pillObj.Description) end end EID.pillPlayer = nil diff --git a/main.lua b/main.lua index a71e8ee2..d647664f 100644 --- a/main.lua +++ b/main.lua @@ -670,8 +670,7 @@ function EID:printDescription(desc, cachedID) local playerType = player:GetPlayerType() if playerType ~= PlayerType.PLAYER_THESOUL_B and player:GetBabySkin() == -1 then if #EID.coopAllPlayers > 1 then - local playerIcon = EID:getIcon("Player"..playerType) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerType.."}}" or "{{CustomTransformation}}" - transformationName = transformationName .. playerIcon + transformationName = transformationName .. EID:GetPlayerIcon(playerType) end local numCollected = EID.TransformationProgress[EID:getPlayerID(player)] and EID.TransformationProgress[EID:getPlayerID(player)][transform] or 0 local numMax = EID.TransformationData[transform] and EID.TransformationData[transform].NumNeeded or 3