From 16a59bd9381dec96c0e2b1b2c804829629bd55d3 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sun, 29 Nov 2020 21:43:20 +0100 Subject: [PATCH] Fixed some Isses with rendering Icons --- eid_api.lua | 4 ++-- eid_data.lua | 40 ++++++++++++++++++++-------------------- eid_debugging.lua | 4 ++-- main.lua | 5 ++++- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index aca3fc96..9002df9b 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -485,8 +485,8 @@ end -- Returns the icon used for the bulletpoint. It will look at the first word in the given string. function EID:handleBulletpointIcon(text) - local firstWord = string.match(text, "{{.-}}") - if EID:getIcon(firstWord) ~= EID.InlineIcons["ERROR"] then + local firstWord = string.match(text, "([^%s]+)") + if EID:getIcon(firstWord) ~= EID.InlineIcons["ERROR"] and string.find(firstWord, "{{.-}}")~=nil then return firstWord end return "\007" diff --git a/eid_data.lua b/eid_data.lua index aa6340b7..6087451c 100644 --- a/eid_data.lua +++ b/eid_data.lua @@ -75,27 +75,27 @@ EID.InlineIcons = { ----- Modded Trinket-icons are automatically generated. No code needed! ["Slotmachine"] = {"Slotmachine", 0, 7, 7}, -- Room Icons - ["Shop"] = {"roomicons", 0, 7, 9}, - ["SecretRoom"] = {"roomicons", 1, 7, 9}, - ["SuperSecretRoom"] = {"roomicons", 2, 7, 9}, - ["Library"] = {"roomicons", 3, 8, 9}, - ["TreasureRoom"] = {"roomicons", 4, 7, 9}, - ["AngelRoom"] = {"roomicons", 5, 7, 9}, - ["DevilRoom"] = {"roomicons", 6, 7, 9}, - ["MiniBoss"] = {"roomicons", 7, 7, 9}, - ["BossRoom"] = {"roomicons", 8, 9, 9}, - ["ChallengeRoom"] = {"roomicons", 9, 7, 9}, - ["BossRushRoom"] = {"roomicons", 10, 7, 9}, - ["CursedRoom"] = {"roomicons", 11, 7, 9}, - ["SacrificeRoom"] = {"roomicons", 12, 7, 9}, - ["ArcadeRoom"] = {"roomicons", 13, 7, 9}, - ["GreedTreasureRoom"] = {"roomicons", 14, 7, 9}, - ["DiceRoom"] = {"roomicons", 15, 8, 9}, - ["ChestRoom"] = {"roomicons", 16, 8, 9}, - ["IsaacsRoom"] = {"roomicons", 17, 8, 9}, - ["BarrenRoom"] = {"roomicons", 18, 8, 9}, + ["Shop"] = {"roomicons", 0, 8, 9, 0, 2}, + ["SecretRoom"] = {"roomicons", 1, 8, 9, 0, 2}, + ["SuperSecretRoom"] = {"roomicons", 2, 8, 9, 0, 2}, + ["Library"] = {"roomicons", 3, 8, 9, 0, 2}, + ["TreasureRoom"] = {"roomicons", 4, 8, 9, 0, 2}, + ["AngelRoom"] = {"roomicons", 5, 8, 9, 0, 2}, + ["DevilRoom"] = {"roomicons", 6, 8, 9, 0, 2}, + ["MiniBoss"] = {"roomicons", 7, 8, 9, 0, 2}, + ["BossRoom"] = {"roomicons", 8, 9, 9, 0, 2}, + ["ChallengeRoom"] = {"roomicons", 9, 8, 9, 0, 2}, + ["BossRushRoom"] = {"roomicons", 10, 8, 9, 0, 2}, + ["CursedRoom"] = {"roomicons", 11, 8, 9, 0, 2}, + ["SacrificeRoom"] = {"roomicons", 12, 8, 9, 0, 2}, + ["ArcadeRoom"] = {"roomicons", 13, 8, 9, 0, 2}, + ["GreedTreasureRoom"] = {"roomicons", 14, 8, 9, 0, 2}, + ["DiceRoom"] = {"roomicons", 15, 8, 9, 0, 2}, + ["ChestRoom"] = {"roomicons", 16, 8, 9, 0, 2}, + ["IsaacsRoom"] = {"roomicons", 17, 8, 9, 0, 2}, + ["BarrenRoom"] = {"roomicons", 18, 8, 9, 0, 2}, -- Roomshape Icons - ["Room"] = {"roomshape", 0, 9, 9}, + ["Room"] = {"roomshape", 0, 9, 9, 0, 2}, ["RoomSmallHorizontal"] = {"roomshape", 1, 9, 9}, ["RoomSmallVertical"] = {"roomshape", 2, 7, 6}, ["RoomLongVertical"] = {"roomshape", 3, 7, 9}, diff --git a/eid_debugging.lua b/eid_debugging.lua index 2c841787..49dcf14d 100644 --- a/eid_debugging.lua +++ b/eid_debugging.lua @@ -107,7 +107,7 @@ local function onDebugRender(t) for i,v in ipairs(Isaac.FindByType(5,10,4,true,false)) do if v:GetData()["EID_Description"] == nil then local descTable = { - --["Name"] = "Some Item with seed ".. v.InitSeed , + ["Name"] = "Some Item with seed ".. v.InitSeed , ["Description"] = "Test specific description#Init seed: ".. v.InitSeed, ["Transformation"] = "1,2" } @@ -116,7 +116,7 @@ local function onDebugRender(t) end for i, v in ipairs(charsToDebug) do - local pos = EID.getTextPosition() + Vector(0, - 15 + ((i - 1) * 14)) + local pos = EID.getTextPosition() + Vector(-5, - 15 + ((i - 1) * 14)) EID:renderString(v, pos, Vector(EID.Config["Scale"], EID.Config["Scale"]), KColor(1, 1, 1, 1, 0, 0, 0)) if not showDebugChars then diff --git a/main.lua b/main.lua index 24974407..710e4fde 100644 --- a/main.lua +++ b/main.lua @@ -3,6 +3,7 @@ EID = RegisterMod("External Item Descriptions", 1) EID.GameVersion = "ab+" EID.Languages = {"en_us", "en_us_detailed", "fr", "pt", "ru", "spa", "bul", "pl", "turkish"} EID.descriptions = {} -- Table that holds all translation strings +local enableDebug = false require("eid_config") EID.Config = EID.DefaultConfig @@ -445,4 +446,6 @@ if EID.MCMLoaded then EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame) end -require("eid_debugging") \ No newline at end of file +if enableDebug then + require("eid_debugging") +end \ No newline at end of file