Added feature to allow icon backgrounds.
Added VirtuesCollectibleX icons
This commit is contained in:
1 parent
3a6b675280
commit
b9f217eae3
3 files changed
+24
-6
No files matched your search
+14
-4
@@ -1169,6 +1169,7 @@ end
|
|||||||
---@return EID_Icon?
|
---@return EID_Icon?
|
||||||
function EID:createItemIconObject(str)
|
function EID:createItemIconObject(str)
|
||||||
local item = nil
|
local item = nil
|
||||||
|
local backgroundImage = ""
|
||||||
local subTypeIdentifier = 0
|
local subTypeIdentifier = 0
|
||||||
|
|
||||||
-- Check for {{Item#.##.###}} markup; easiest way to handle it is to just call this function again
|
-- Check for {{Item#.##.###}} markup; easiest way to handle it is to just call this function again
|
||||||
@@ -1184,6 +1185,15 @@ function EID:createItemIconObject(str)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Add background image to Icon, if the keyword can be found in the markup string
|
||||||
|
for keyword, imagePath in pairs(EID.MarkupBackgroundKeywords) do
|
||||||
|
if string.find(str, keyword) then
|
||||||
|
str = string.gsub(str, keyword, "")
|
||||||
|
backgroundImage = imagePath
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---@diagnostic disable
|
---@diagnostic disable
|
||||||
local collID,numReplace = string.gsub(str, "Collectible", "")
|
local collID,numReplace = string.gsub(str, "Collectible", "")
|
||||||
if numReplace > 0 and collID ~= "" and tonumber(collID) ~= nil then
|
if numReplace > 0 and collID ~= "" and tonumber(collID) ~= nil then
|
||||||
@@ -1206,19 +1216,19 @@ function EID:createItemIconObject(str)
|
|||||||
return {"Pills", tonumber(pillID % 2048)-1, 9, 8, 0, 1, EID.CardPillSprite}
|
return {"Pills", tonumber(pillID % 2048)-1, 9, 8, 0, 1, EID.CardPillSprite}
|
||||||
end
|
end
|
||||||
---@diagnostic enable
|
---@diagnostic enable
|
||||||
|
|
||||||
if item == nil then
|
if item == nil then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
if dynamicSpriteCache[str] then
|
if dynamicSpriteCache[backgroundImage .. str] then
|
||||||
return dynamicSpriteCache[str]
|
return dynamicSpriteCache[backgroundImage .. str]
|
||||||
else
|
else
|
||||||
local spriteDummy = Sprite()
|
local spriteDummy = Sprite()
|
||||||
spriteDummy:Load("gfx/eid_inline_icons.anm2", true)
|
spriteDummy:Load("gfx/eid_inline_icons.anm2", true)
|
||||||
|
spriteDummy:ReplaceSpritesheet(0, backgroundImage)
|
||||||
spriteDummy:ReplaceSpritesheet(1, item.GfxFileName)
|
spriteDummy:ReplaceSpritesheet(1, item.GfxFileName)
|
||||||
spriteDummy:LoadGraphics()
|
spriteDummy:LoadGraphics()
|
||||||
local newDynamicSprite = { "ItemIcon", subTypeIdentifier, 11, 8, -2, -2, spriteDummy }
|
local newDynamicSprite = { "ItemIcon", subTypeIdentifier, 11, 8, -2, -2, spriteDummy }
|
||||||
dynamicSpriteCache[str] = newDynamicSprite
|
dynamicSpriteCache[backgroundImage .. str] = newDynamicSprite
|
||||||
return newDynamicSprite
|
return newDynamicSprite
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -975,6 +975,12 @@ EID.RoomShapeToMarkup = { "{{Room}}", "{{RoomSmallHorizontal}}", "{{RoomSmallVer
|
|||||||
EID.RoomTypeToMarkup = { "{{Room}}", "{{Shop}}", "{{ErrorRoom}}", "{{TreasureRoom}}", "{{BossRoom}}", "{{MiniBoss}}", "{{SecretRoom}}", "{{SuperSecretRoom}}", "{{ArcadeRoom}}", "{{CursedRoom}}", "{{ChallengeRoom}}", "{{Library}}", "{{SacrificeRoom}}", "{{DevilRoom}}", "{{AngelRoom}}", "{{LadderRoom}}", "{{Room}}" --[[boss rush]], "{{IsaacsRoom}}", "{{BarrenRoom}}", "{{ChestRoom}}", "{{DiceRoom}}", "{{Shop}}", "{{Room}}", --[[Black Market / Greed Exit]] "{{Planetarium}}", "{{Teleporter}}","{{Teleporter}}", "{{Room}}", "{{Room}}" --[[Blue Key rooms]], "{{UltraSecretRoom}}" }
|
EID.RoomTypeToMarkup = { "{{Room}}", "{{Shop}}", "{{ErrorRoom}}", "{{TreasureRoom}}", "{{BossRoom}}", "{{MiniBoss}}", "{{SecretRoom}}", "{{SuperSecretRoom}}", "{{ArcadeRoom}}", "{{CursedRoom}}", "{{ChallengeRoom}}", "{{Library}}", "{{SacrificeRoom}}", "{{DevilRoom}}", "{{AngelRoom}}", "{{LadderRoom}}", "{{Room}}" --[[boss rush]], "{{IsaacsRoom}}", "{{BarrenRoom}}", "{{ChestRoom}}", "{{DiceRoom}}", "{{Shop}}", "{{Room}}", --[[Black Market / Greed Exit]] "{{Planetarium}}", "{{Teleporter}}","{{Teleporter}}", "{{Room}}", "{{Room}}" --[[Blue Key rooms]], "{{UltraSecretRoom}}" }
|
||||||
EID.ItemPoolTypeToMarkup = { [0] = "{{ItemPoolTreasure}}", "{{ItemPoolShop}}", "{{ItemPoolBoss}}", "{{ItemPoolDevil}}", "{{ItemPoolAngel}}", "{{ItemPoolSecret}}", "{{ItemPoolLibrary}}", "{{ItemPoolShellGame}}", "{{ItemPoolGoldenChest}}", "{{ItemPoolRedChest}}", "{{ItemPoolBeggar}}", "{{ItemPoolDemonBeggar}}", "{{ItemPoolCurse}}", "{{ItemPoolKeyMaster}}", "{{ItemPoolBombBum}}", "{{ItemPoolMomsChest}}", "{{ItemPoolGreedTreasure}}", "{{ItemPoolGreedShop}}", "{{ItemPoolGreedBoss}}", "{{ItemPoolGreedDevil}}", "{{ItemPoolGreedAngel}}", "{{ItemPoolGreedCurse}}", "{{ItemPoolGreedSecret}}", "{{ItemPoolCraneGame}}", "{{ItemPoolUltraSecret}}", "{{ItemPoolBatteryBum}}", "{{ItemPoolPlanetarium}}", "{{ItemPoolOldChest}}", "{{ItemPoolBabyShop}}", "{{ItemPoolWoodenChest}}", "{{ItemPoolRottenBeggar}}"}
|
EID.ItemPoolTypeToMarkup = { [0] = "{{ItemPoolTreasure}}", "{{ItemPoolShop}}", "{{ItemPoolBoss}}", "{{ItemPoolDevil}}", "{{ItemPoolAngel}}", "{{ItemPoolSecret}}", "{{ItemPoolLibrary}}", "{{ItemPoolShellGame}}", "{{ItemPoolGoldenChest}}", "{{ItemPoolRedChest}}", "{{ItemPoolBeggar}}", "{{ItemPoolDemonBeggar}}", "{{ItemPoolCurse}}", "{{ItemPoolKeyMaster}}", "{{ItemPoolBombBum}}", "{{ItemPoolMomsChest}}", "{{ItemPoolGreedTreasure}}", "{{ItemPoolGreedShop}}", "{{ItemPoolGreedBoss}}", "{{ItemPoolGreedDevil}}", "{{ItemPoolGreedAngel}}", "{{ItemPoolGreedCurse}}", "{{ItemPoolGreedSecret}}", "{{ItemPoolCraneGame}}", "{{ItemPoolUltraSecret}}", "{{ItemPoolBatteryBum}}", "{{ItemPoolPlanetarium}}", "{{ItemPoolOldChest}}", "{{ItemPoolBabyShop}}", "{{ItemPoolWoodenChest}}", "{{ItemPoolRottenBeggar}}"}
|
||||||
|
|
||||||
|
-- Background icon markup substrings
|
||||||
|
EID.MarkupBackgroundKeywords = {
|
||||||
|
["Virtues"] = "gfx/ui/hud_bookofvirtues.png",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
-- additional offset of the textbox to the entity position. Only applies in local description mode.
|
-- additional offset of the textbox to the entity position. Only applies in local description mode.
|
||||||
-- If a function returns a value, it will be used as the offset
|
-- If a function returns a value, it will be used as the offset
|
||||||
EID.LocalModePositionOffset = {
|
EID.LocalModePositionOffset = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<AnimatedActor>
|
<AnimatedActor>
|
||||||
<Info CreatedBy="Unknown" CreatedOn="5/7/2025 12:24:54 PM" Version="215" Fps="30"/>
|
<Info CreatedBy="Unknown" CreatedOn="07.05.2025 23:49:05" Version="216" Fps="30"/>
|
||||||
<Content>
|
<Content>
|
||||||
<Spritesheets>
|
<Spritesheets>
|
||||||
<Spritesheet Path="eid_inline_icons.png" Id="0"/>
|
<Spritesheet Path="eid_inline_icons.png" Id="0"/>
|
||||||
@@ -276,7 +276,9 @@
|
|||||||
<Frame XPosition="0" YPosition="0" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
<Frame XPosition="0" YPosition="0" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||||
</RootAnimation>
|
</RootAnimation>
|
||||||
<LayerAnimations>
|
<LayerAnimations>
|
||||||
<LayerAnimation LayerId="0" Visible="true"/>
|
<LayerAnimation LayerId="0" Visible="true">
|
||||||
|
<Frame XPosition="0" YPosition="0" XPivot="0" YPivot="0" XCrop="0" YCrop="0" Width="32" Height="32" XScale="50" YScale="50" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||||
|
</LayerAnimation>
|
||||||
<LayerAnimation LayerId="1" Visible="true">
|
<LayerAnimation LayerId="1" Visible="true">
|
||||||
<Frame XPosition="0" YPosition="0" XPivot="0" YPivot="0" XCrop="0" YCrop="0" Width="32" Height="32" XScale="50" YScale="50" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
<Frame XPosition="0" YPosition="0" XPivot="0" YPivot="0" XCrop="0" YCrop="0" Width="32" Height="32" XScale="50" YScale="50" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||||
</LayerAnimation>
|
</LayerAnimation>
|
||||||
|
|||||||
Reference in new issue
Block a user