Added feature to add custom Transformations
This commit is contained in:
1 parent
46513ca399
commit
924bbafca6
10 files changed
+5060
-4876
No files matched your search
+802
-803
File diff suppressed because it is too large.
Load diff
+799
-800
File diff suppressed because it is too large.
Load diff
+803
-805
File diff suppressed because it is too large.
Load diff
+800
-804
File diff suppressed because it is too large.
Load diff
+806
-799
File diff suppressed because it is too large.
Load diff
+801
-804
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,125 @@
|
||||
-- Format: [BASENAME] = {["LANGUAGE"]="Display name",...}
|
||||
EID.CustomTransformations = {}
|
||||
|
||||
-- Format: [ID.VARIANT.SUBTYPE] = "Transformation Basename or id"
|
||||
EID.CustomTransformAssignments = {}
|
||||
|
||||
-- default transformations
|
||||
-- Format: [ID.VARIANT.SUBTYPE] = "Transformation string"
|
||||
EID.EntityTransformations = {
|
||||
-- Collectibles
|
||||
["5.100.8"] = "4",
|
||||
["5.100.9"] = "3",
|
||||
["5.100.10"] = "3",
|
||||
["5.100.11"] = "2",
|
||||
["5.100.12"] = "2,15",
|
||||
["5.100.13"] = "5",
|
||||
["5.100.14"] = "5",
|
||||
["5.100.29"] = "6",
|
||||
["5.100.30"] = "6",
|
||||
["5.100.31"] = "6",
|
||||
["5.100.33"] = "10,12",
|
||||
["5.100.34"] = "12",
|
||||
["5.100.35"] = "12",
|
||||
["5.100.36"] = "7",
|
||||
["5.100.39"] = "6",
|
||||
["5.100.41"] = "6",
|
||||
["5.100.42"] = "8",
|
||||
["5.100.51"] = "9",
|
||||
["5.100.55"] = "6",
|
||||
["5.100.57"] = "3",
|
||||
["5.100.58"] = "12",
|
||||
["5.100.65"] = "12",
|
||||
["5.100.67"] = "4",
|
||||
["5.100.70"] = "5",
|
||||
["5.100.71"] = "2",
|
||||
["5.100.72"] = "10",
|
||||
["5.100.78"] = "12",
|
||||
["5.100.79"] = "9",
|
||||
["5.100.80"] = "9",
|
||||
["5.100.81"] = "1",
|
||||
["5.100.83"] = "9",
|
||||
["5.100.89"] = "13",
|
||||
["5.100.97"] = "12",
|
||||
["5.100.100"] = "4",
|
||||
["5.100.101"] = "10",
|
||||
["5.100.102"] = "6",
|
||||
["5.100.110"] = "6",
|
||||
["5.100.112"] = "10",
|
||||
["5.100.114"] = "6",
|
||||
["5.100.118"] = "9",
|
||||
["5.100.120"] = "2",
|
||||
["5.100.121"] = "2",
|
||||
["5.100.123"] = "12",
|
||||
["5.100.128"] = "3",
|
||||
["5.100.133"] = "1",
|
||||
["5.100.134"] = "1",
|
||||
["5.100.139"] = "6",
|
||||
["5.100.140"] = "8",
|
||||
["5.100.143"] = "5",
|
||||
["5.100.144"] = "11",
|
||||
["5.100.145"] = "1",
|
||||
["5.100.148"] = "3",
|
||||
["5.100.149"] = "8",
|
||||
["5.100.151"] = "3",
|
||||
["5.100.153"] = "13",
|
||||
["5.100.159"] = "9",
|
||||
["5.100.167"] = "4",
|
||||
["5.100.171"] = "13",
|
||||
["5.100.173"] = "10",
|
||||
["5.100.184"] = "10",
|
||||
["5.100.185"] = "10",
|
||||
["5.100.187"] = "1",
|
||||
["5.100.192"] = "12",
|
||||
["5.100.195"] = "6",
|
||||
["5.100.199"] = "6",
|
||||
["5.100.200"] = "6",
|
||||
["5.100.209"] = "7",
|
||||
["5.100.211"] = "13",
|
||||
["5.100.212"] = "1",
|
||||
["5.100.217"] = "6",
|
||||
["5.100.228"] = "6",
|
||||
["5.100.230"] = "9",
|
||||
["5.100.236"] = "7",
|
||||
["5.100.240"] = "5",
|
||||
["5.100.248"] = "3",
|
||||
["5.100.264"] = "3",
|
||||
["5.100.268"] = "4",
|
||||
["5.100.269"] = "4",
|
||||
["5.100.272"] = "3",
|
||||
["5.100.273"] = "8",
|
||||
["5.100.274"] = "3",
|
||||
["5.100.278"] = "11",
|
||||
["5.100.279"] = "3",
|
||||
["5.100.282"] = "12",
|
||||
["5.100.287"] = "12",
|
||||
["5.100.288"] = "13",
|
||||
["5.100.291"] = "7",
|
||||
["5.100.292"] = "12",
|
||||
["5.100.302"] = "15",
|
||||
["5.100.313"] = "10",
|
||||
["5.100.320"] = "3",
|
||||
["5.100.322"] = "4",
|
||||
["5.100.342"] = "2",
|
||||
["5.100.345"] = "5",
|
||||
["5.100.355"] = "6",
|
||||
["5.100.363"] = "10",
|
||||
["5.100.364"] = "3",
|
||||
["5.100.365"] = "3",
|
||||
["5.100.388"] = "11",
|
||||
["5.100.398"] = "2",
|
||||
["5.100.399"] = "9",
|
||||
["5.100.403"] = "13",
|
||||
["5.100.426"] = "3",
|
||||
["5.100.430"] = "3",
|
||||
["5.100.434"] = "3",
|
||||
["5.100.493"] = "5",
|
||||
["5.100.496"] = "5",
|
||||
["5.100.508"] = "6",
|
||||
["5.100.511"] = "3",
|
||||
["5.100.545"] = "12",
|
||||
["5.100.552"] = "6",
|
||||
-- Pills
|
||||
["5.70.9"] = "14",
|
||||
["5.70.32"] = "15",
|
||||
}
|
||||
+81
-20
@@ -80,12 +80,27 @@ function EID:addPill(id, description, itemName, language)
|
||||
EID.descriptions[language].custom["pill_" .. id] = {id, itemName, description}
|
||||
end
|
||||
|
||||
-- Adds transformations to an entity.
|
||||
-- valid target types: [collectible, trinket, card, pill, entity]
|
||||
-- when type = entity, targetIdentifier must be in the format ["ID.Variant.subtype"]. for any other type, it can just be the id
|
||||
function EID:addTransformation(targetType, targetIdentifier, transformationString, language)
|
||||
-- Creates a new transformation with a given unique name and a display name
|
||||
function EID:createTransformation(uniqueName, displayName, language)
|
||||
language = language or "en_us"
|
||||
EID.descriptions[language].custom["transformations_"..targetType.."_".. targetIdentifier] = {targetType, targetIdentifier, transformationString}
|
||||
if EID.CustomTransformations[uniqueName] == nil then
|
||||
EID.CustomTransformations[uniqueName] = {}
|
||||
end
|
||||
EID.CustomTransformations[uniqueName][language] = displayName
|
||||
end
|
||||
|
||||
-- Assigns transformations to an entity
|
||||
-- valid target types: [collectible, trinket, card, pill, entity]
|
||||
-- when type = entity, targetIdentifier must be in the format "ID.Variant.subtype". for any other type, it can just be the id
|
||||
-- EXAMPLE: EID:assignTransformation("collectible", 1, "My Transformation")
|
||||
function EID:assignTransformation(targetType, targetIdentifier, transformationString)
|
||||
local entryID = EID:getIDVariantString(targetType)
|
||||
if entryID ~= nil then
|
||||
entryID = entryID.."."..targetIdentifier
|
||||
else
|
||||
entryID = targetIdentifier
|
||||
end
|
||||
EID.CustomTransformAssignments[entryID] = transformationString
|
||||
end
|
||||
|
||||
-- Adds a description for a an Entity. Optional parameters: language, transformations
|
||||
@@ -123,6 +138,27 @@ function EID:addColor(shortcut, kColor, callback)
|
||||
end
|
||||
end
|
||||
|
||||
-- function to turn entity type names into actual ingame ID.Variant pairs
|
||||
function EID:getIDVariantString(typeName)
|
||||
if typeName == "collectible" or typeName == "collectibles" then return "5.100"
|
||||
elseif typeName == "trinket" or typeName == "trinkets" then return "5.350."
|
||||
elseif typeName == "card" or typeName == "cards" then return "5.300."
|
||||
elseif typeName == "pill" or typeName == "pills" then return "5.70."
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Loads a given font from a given file path and use it to render text
|
||||
function EID:loadFont(fontFileName)
|
||||
EID.font:Load(fontFileName)
|
||||
EID.font:SetMissingCharacter(2)
|
||||
if not EID.font:IsLoaded() then
|
||||
Isaac.DebugString("EID - ERROR: Could not load font from '" .. EID.modPath .. "resources/font/default.fnt" .. "'")
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- Returns if EID is displaying text right now
|
||||
function EID:isDisplayingText()
|
||||
return EID.isDisplayingText
|
||||
@@ -145,6 +181,7 @@ end
|
||||
|
||||
-- returns descriptions from the legacy mod descriptions if they exist
|
||||
function EID:getLegacyModDescription(objTable, id)
|
||||
id = tonumber(id)
|
||||
if objTable == "collectibles" then
|
||||
return __eidItemDescriptions[id]
|
||||
elseif objTable == "trinkets" then
|
||||
@@ -178,21 +215,45 @@ function EID:getDescriptionObj(objTable, objID)
|
||||
description.Name = EID:getObjectName(objID, objTable) or objTable
|
||||
|
||||
local legacyModdedDescription = EID:getLegacyModDescription(objTable, objID)
|
||||
description.Description = legacyModdedDescription or tableEntry[4] or "MISSING DESCRIPTION"
|
||||
description.Description = legacyModdedDescription or tableEntry[3] or "MISSING DESCRIPTION"
|
||||
|
||||
local legacyModdedTransformation = nil
|
||||
if objTable == "collectibles" then
|
||||
legacyModdedTransformation = EID:getLegacyModDescription("transformations", objID)
|
||||
local itemString = EID:getIDVariantString(objTable)
|
||||
if itemString ~= nil then
|
||||
itemString = itemString.."."..objID
|
||||
else
|
||||
itemString = objID
|
||||
end
|
||||
description.Transformation = legacyModdedTransformation or tableEntry[2] or "0"
|
||||
description.fullItemString = itemString
|
||||
description.Transformation = EID:getTransformation(itemString)
|
||||
|
||||
return description
|
||||
end
|
||||
|
||||
--Get the name of the given transformation by its ID
|
||||
-- Get the transformation uniqueName / ID of a given "ID.Variant.Subtype" pair
|
||||
-- Example: EID:getTransformation("5.100.34") will return "12" which is the id for Bookworm
|
||||
function EID:getTransformation(entityIdentifier)
|
||||
local custom = EID.CustomTransformAssignments[entityIdentifier]
|
||||
local customLegacy = nil
|
||||
local splitString = {}
|
||||
for identifier in string.gsub(entityIdentifier,"%f[.]%.%f[^.]", "\0"):gmatch("%Z+") do
|
||||
table.insert(splitString,identifier)
|
||||
end
|
||||
if splitString[1] == "5" and splitString[2] == "100" then
|
||||
customLegacy = EID:getLegacyModDescription("transformations", splitString[3])
|
||||
end
|
||||
local default = EID.EntityTransformations[entityIdentifier]
|
||||
return custom or customLegacy or default or "0"
|
||||
end
|
||||
|
||||
--Get the name of the given transformation by its uniqueName / ID
|
||||
function EID:getTransformationName(id)
|
||||
local str = "Custom"
|
||||
if tonumber(id) == nil then
|
||||
-- get translated custom name
|
||||
local customTransform = EID.CustomTransformations[id]
|
||||
if customTransform ~= nil then
|
||||
return customTransform[EIDConfig["Language"]] or customTransform["en_us"] or id
|
||||
end
|
||||
return id
|
||||
end
|
||||
return EID:getObjectName(tonumber(id) + 1, "transformations") or str
|
||||
@@ -202,30 +263,30 @@ end
|
||||
function EID:getObjectName(objID, objType)
|
||||
local tableEntry = EID.descriptions[EIDConfig["Language"]][objType][objID] or EID.descriptions["en_us"][objType][objID]
|
||||
if objType == "collectibles" then
|
||||
if EIDConfig["Language"] ~= "en_us" and #tableEntry == 4 then
|
||||
if tableEntry[3] ~= nil and tableEntry[3] ~= "" then
|
||||
return tableEntry[3]
|
||||
if EIDConfig["Language"] ~= "en_us" and #tableEntry == 3 then
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" then
|
||||
return tableEntry[2]
|
||||
end
|
||||
end
|
||||
return EID.itemConfig:GetCollectible(objID).Name
|
||||
elseif objType == "trinkets" then
|
||||
if EIDConfig["Language"] ~= "en_us" and #tableEntry == 3 then
|
||||
if tableEntry[3] ~= nil and tableEntry[3] ~= "" then
|
||||
return tableEntry[3]
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" then
|
||||
return tableEntry[2]
|
||||
end
|
||||
end
|
||||
return EID.itemConfig:GetTrinket(objID).Name
|
||||
elseif objType == "cards" then
|
||||
if EIDConfig["Language"] ~= "en_us" and #tableEntry == 3 then
|
||||
if tableEntry[3] ~= nil and tableEntry[3] ~= "" then
|
||||
return tableEntry[3]
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" then
|
||||
return tableEntry[2]
|
||||
end
|
||||
end
|
||||
return EID.itemConfig:GetCard(objID).Name
|
||||
elseif objType == "pills" then
|
||||
if EIDConfig["Language"] ~= "en_us" and #tableEntry == 3 then
|
||||
if tableEntry[3] ~= nil and tableEntry[3] ~= "" then
|
||||
return tableEntry[3]
|
||||
if tableEntry[2] ~= nil and tableEntry[2] ~= "" then
|
||||
return tableEntry[2]
|
||||
end
|
||||
end
|
||||
return EID.itemConfig:GetPillEffect(objID).Name
|
||||
|
||||
+33
-29
@@ -16,9 +16,9 @@ local charsToDebug = {
|
||||
"Markup roomtypes: |{{DevilRoom}}|{{AngelRoom}}|{{ChallengeRoom}}|{{IsaacsRoom}}|{{TreasureRoom}}|{{ArcadeRoom}}|{{BossRushRoom}}|{{Shop}}|{{SuperSecretRoom}}|{{BarrenRoom}}|{{MiniBoss}}|{{DiceRoom}}|{{GreedTreasureRoom}}|{{SecretRoom}}|{{Library}}|{{ChestRoom}}|{{BossRoom}}|{{CursedRoom}}|{{SacrificeRoom}}|",
|
||||
"Markup roomshapes: |{{Room}}|{{RoomLongHorizontal}}|{{RoomLongThinHorizontal}}|{{RoomSmallHorizontal}}|{{RoomLBottomRight}}|{{RoomSmallVertical}}|{{RoomLBottomLeft}}|{{RoomLTopLeft}}|{{RoomL}}|{{RoomLongVertical}}|{{RoomXL}}|{{RoomLongThinVertical}}|",
|
||||
"Markup transformations: |{{CustomTransformation}}|{{Guppy}}|{{FunGuy}}|{{LordoftheFlies}}|{{Conjoined}}|{{Spun}}|{{Mom}}|{{OhCrap}}|{{Bob}}|{{Leviathan}}|{{Seraphim}}|{{SuperBum}}|{{Bookworm}}|{{SpiderBaby}}|{{Adult}}|{{Stompy}}|",
|
||||
"Markup Main Colors: {{ColorText}}Text {{ColorTransform}}Transform {{ColorError}}Error {{ColorObjName}}ObjName",
|
||||
"Markup Colors: {{ColorBlack}}Black {{ColorWhite}}White {{ColorRed}}Red {{ColorLime}}Lime {{ColorBlue}}Blue {{ColorYellow}}Yellow {{ColorCyan}}Cyan {{ColorPink}}Pink {{ColorSilver}}Silver {{ColorGray}}Gray {{ColorMaroon}}Maroon {{ColorOlive}}Olive {{ColorGreen}}Green {{ColorPurple}}Purple {{ColorTeal}}Teal {{ColorNavy}}Navy ",
|
||||
"Markup swag Colors: {{ColorFade}}Fade {{CR}}{{ColorBlink}}Blink {{ColorRainbow}}Rainbow {{ColorBlink}}BlinkWithColor {{ColorFade}}BlinkColorFade",
|
||||
"Markup Main Colors: {{ColorText}}Text {{ColorTransform}}Transform {{ColorError}}Error {{ColorObjName}}ObjName {{ColorBlack}}Black {{ColorWhite}}White {{ColorRed}}Red {{ColorLime}}Lime {{ColorBlue}}Blue",
|
||||
"Markup Colors: {{ColorYellow}}Yellow {{ColorCyan}}Cyan {{ColorPink}}Pink {{ColorSilver}}Silver {{ColorGray}}Gray {{ColorMaroon}}Maroon {{ColorOlive}}Olive {{ColorGreen}}Green {{ColorPurple}}Purple {{ColorTeal}}Teal {{ColorNavy}}Navy {{ColorOrange}}Orange ",
|
||||
"Markup special Colors: {{ColorFade}}Fade {{CR}}{{ColorBlink}}Blink {{ColorRainbow}}Rainbow {{ColorBlink}}BlinkWithColor {{ColorFade}}BlinkColorFade",
|
||||
"End of line"
|
||||
}
|
||||
|
||||
@@ -26,21 +26,15 @@ local charsToDebug = {
|
||||
----------------LEGACY METHODS-----------------
|
||||
-----------------------------------------------
|
||||
------ Legacy Overriding descriptions ------
|
||||
__eidItemDescriptions[1] = "\1 Overriden description" -- 5.100.1 = Sad Onion
|
||||
__eidTrinketDescriptions[1] = "\2 Overriden " -- 5.350.1 = swallowed penny
|
||||
__eidCardDescriptions[1] = "Overriden Card description" -- 5.300.1 = the fool
|
||||
__eidPillDescriptions[21] = "Test" -- Pill Effect 20 = Hematemesis
|
||||
__eidItemTransformations[1] = "Test Transformation" -- add custom transformation Text to Sad Onion
|
||||
__eidItemDescriptions[1] = "\1 Overriden Legacy description" -- 5.100.1 = Sad Onion
|
||||
__eidTrinketDescriptions[1] = "\2 Overriden Legacy description" -- 5.350.1 = swallowed penny
|
||||
__eidCardDescriptions[1] = "Overriden Legacy description" -- 5.300.1 = the fool
|
||||
__eidPillDescriptions[21] = "Overriden Legacy description" -- Pill Effect 20 = Hematemesis
|
||||
__eidItemTransformations[1] = "Legacy Transformation" -- add custom transformation Text to Sad Onion
|
||||
|
||||
------ Legacy add Description to entity ------
|
||||
__eidEntityDescriptions["5.10.1"] = {"Entity Name", "Entity description"} -- Adds description to full red hearts
|
||||
|
||||
-- the Transformation icon will try to get an icon with the same name as the transformation, but without any spaces. Default Icon otherwise
|
||||
__eidItemTransformations[2] = "Some Test Transformation"
|
||||
|
||||
------ Test: Add all transformations to spoon bender ------
|
||||
__eidItemTransformations[3] = "1,2,3,4,5,6,7,8,9,10,11,12,13"
|
||||
|
||||
------ Test: Description with colors ------
|
||||
__eidItemDescriptions[3] =
|
||||
"Some {{ColorRed}}long ass Test string with a lot of Words that sound interesting#With{{ColorBlink}} cool {{CR}}{{ColorRed}}C{{ColorGreen}}o{{ColorBlue}}l{{ColorYellow}}o{{ColorOrange}}r{{ColorPink}}s{{ColorWhite}} and a high amount of nifty {{ColorRainbow}}Swag "
|
||||
@@ -49,35 +43,45 @@ __eidItemDescriptions[3] =
|
||||
------------------NEW METHODS------------------
|
||||
-----------------------------------------------
|
||||
------ Overriding descriptions------
|
||||
EID:addCollectible(5, "New override Method") -- minimal method
|
||||
EID:addCollectible(6, "New override Method", "new Name", "ru") -- maximal method
|
||||
EID:addCollectible(2, "New override Method") -- minimal method
|
||||
EID:addCollectible(2, "New override Method", "new Name", "ru") -- maximal method
|
||||
EID:addCard(2, "New override Method", "new Name") -- card
|
||||
EID:addPill(2, "New override Method", "new Name") -- pill
|
||||
EID:addEntity(5, 10, 2, "Custom Name", "Custom description") -- Entity
|
||||
EID:addTransformation("collectible", 5, "New transformation") -- Transformation
|
||||
EID:addEntity(5, 10, 2, "Custom Name", "Custom description") -- Entity
|
||||
|
||||
------ Test: adding custom icons ------
|
||||
------ Test: adding custom transformation icon ------
|
||||
local dummySprite = Sprite()
|
||||
dummySprite:Load("gfx/eid_inline_icons.anm2", true)
|
||||
-- add animated icon using api function (Make sure to create new Sprite Obj when using animated icons. Reuse objects when only using static icons)
|
||||
EID:addIcon("TestIcon", "hearts", -1, 9, 9, -1, 0, dummySprite)
|
||||
-- add icon directly
|
||||
EID.InlineIcons["NewTransform1"] = {"hearts", 2, 9, 12, -1, 0,dummySprite}
|
||||
-- the Transformation icon will try to get an icon with the same name as the transformation, but without any spaces. Default Icon otherwise
|
||||
EID:createTransformation("NewTransform1", "New transformation") -- Transformation
|
||||
EID:createTransformation("NewTransform1", "New russian transformation", "ru") -- add Transformation name in russian
|
||||
|
||||
EID:assignTransformation("collectible", 5, "NewTransform1") -- Add Transformation to My Reflection
|
||||
|
||||
------ Test: Add all transformations + some customs ones to Inner Eye ------
|
||||
EID:assignTransformation("collectible", 2, "1,2,3,4,5,6,7,8,9,10,11,12,13,something Custom,NewTransform1")
|
||||
|
||||
------ Test: adding custom icons ------
|
||||
local dummySprite2 = Sprite()
|
||||
dummySprite2:Load("gfx/eid_inline_icons.anm2", true)
|
||||
EID.InlineIcons["Test"] = {"pickups", -1, 9, 9, -1, 0, dummySprite2}
|
||||
-- add animated icon using api function (Make sure to create new Sprite Obj when using animated icons. Reuse objects when only using static icons)
|
||||
EID:addIcon("TestIcon", "hearts", -1, 9, 9, -1, 0, dummySprite2)
|
||||
|
||||
|
||||
-- add icon directly
|
||||
local dummySprite3 = Sprite()
|
||||
dummySprite3:Load("gfx/eid_inline_icons.anm2", true)
|
||||
EID.InlineIcons["Test"] = {"pickups", -1, 9, 9, -1, 0, dummySprite3}
|
||||
|
||||
|
||||
__eidItemDescriptions[2] = "{{Bomb}} Emote {{Key}} Test {{Test}}{{TestIcon}} {{ColorBlackBlink}}description {{SomeInvalidInnerStuff}} cool" -- 5.100.2 = Inner Eye
|
||||
__eidItemDescriptions[6] = "This item as Inline Icon {{Collectible6}}#And here are others {{Collectible69}} {{Collectible16}} {{Collectible323}} {{Collectible345}} {{Collectible223}}#And some trinket sprites {{Trinket12}} {{Trinket22}} {{Trinket1}} {{Trinket55}} {{Trinket100}} {{Trinket123}}" -- 5.100.2 = Inner Eye
|
||||
|
||||
------ Test: adding custom transformation icon ------
|
||||
EID.InlineIcons["SomeTestTransformation"] = {"hearts", 2, 9, 9, -1, 0, dummySprite}
|
||||
|
||||
------ Test: adding custom icons ------
|
||||
EID:addColor("ColorTwitterBlue", KColor(0, 0.671875, 0.9296875, 1, 0, 0, 0), nil)
|
||||
EID:addColor(
|
||||
"ColorBlackBlink",
|
||||
nil,
|
||||
function(color)
|
||||
EID:addColor("ColorBlackBlink", nil, function(color)
|
||||
local maxAnimTime = 30
|
||||
local animTime = Game():GetFrameCount() % maxAnimTime
|
||||
color = EID:copyKColor(color) or EID:getTextColor()
|
||||
|
||||
@@ -26,6 +26,8 @@ CardSprite:Load("gfx/cardfronts.anm2", true)
|
||||
|
||||
require("eid_config")
|
||||
require("mod_config_menu")
|
||||
|
||||
require("descriptions.ab+.transformations")
|
||||
--languages
|
||||
require("descriptions.ab+.en_us")
|
||||
require("descriptions.ab+.en_us_detailed")
|
||||
@@ -46,16 +48,12 @@ local _, err = pcall(require, "")
|
||||
local _, basePathStart = string.find(err, "no file '", 1)
|
||||
local _, modPathStart = string.find(err, "no file '", basePathStart)
|
||||
local modPathEnd, _ = string.find(err, ".lua'", modPathStart)
|
||||
local modPath = string.sub(err, modPathStart + 1, modPathEnd - 1)
|
||||
modPath = string.gsub(modPath, "\\", "/")
|
||||
modPath = string.gsub(modPath, ":/", ":\\")
|
||||
EID.modPath = string.sub(err, modPathStart + 1, modPathEnd - 1)
|
||||
EID.modPath = string.gsub(EID.modPath, "\\", "/")
|
||||
EID.modPath = string.gsub(EID.modPath, ":/", ":\\")
|
||||
|
||||
EID.font = Font() -- init font object
|
||||
EID.font:Load(modPath .. "resources/font/eid_default.fnt") -- load a font into the font object
|
||||
EID.font:SetMissingCharacter(2)
|
||||
if not EID.font:IsLoaded() then
|
||||
Isaac.DebugString("EID - ERROR: Could not load font from '" .. modPath .. "resources/font/default.fnt" .. "'")
|
||||
end
|
||||
EID:loadFont(EID.modPath .. "resources/font/eid_default.fnt")
|
||||
|
||||
--Makes textscale smaller, when using detailed english descriptions
|
||||
if EIDConfig["Language"] == "en_us_detailed" and EIDConfig["Scale"] > 0.5 then
|
||||
@@ -65,19 +63,19 @@ end
|
||||
---------------------------------------------------------------------------
|
||||
-------------------------Handle Sacrifice Room-----------------------------
|
||||
if EIDConfig["DisplaySacrificeInfo"] then
|
||||
function onNewFloor()
|
||||
function EID:onNewFloor()
|
||||
EID.sacrificeCounter = 1
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, onNewFloor)
|
||||
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.onNewFloor)
|
||||
|
||||
function onDamage(_, entity, _, flag, source)
|
||||
function EID:onSacrificeDamage(_, _, flag, source)
|
||||
if Game():GetRoom():GetType() == RoomType.ROOM_SACRIFICE and source.Type == 0 and flag == DamageFlag.DAMAGE_SPIKES then
|
||||
if EID.sacrificeCounter < 12 then
|
||||
EID.sacrificeCounter = EID.sacrificeCounter + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, onDamage, EntityType.ENTITY_PLAYER)
|
||||
EID:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, EID.onSacrificeDamage, EntityType.ENTITY_PLAYER)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user