Fixed wrong initialization of KColor objects
This commit is contained in:
1 parent
5df8efde7f
commit
46513ca399
2 files changed
+25
-65
No files matched your search
+8
-48
@@ -1,29 +1,4 @@
|
|||||||
--[[
|
-- Init legacy global variables for other mods to hand over Descriptions
|
||||||
EID features 6 tables for mods to define their descriptions:
|
|
||||||
__eidTrinketDescriptions for trinkets
|
|
||||||
__eidCardDescriptions for cards
|
|
||||||
__eidPillDescriptions for pills
|
|
||||||
__eidItemDescriptions for Collectibles / items
|
|
||||||
__eidItemTransformations assigns transformation-informations to collectibles
|
|
||||||
__eidEntityDescriptions for entities
|
|
||||||
__eidEntityDescriptions["ID.Variant.Subtype"] = {"HEADLINE","DESCRIPTION"};
|
|
||||||
|
|
||||||
To assign a unique description for a specific entity: entity:GetData()["EID_Description"] = {"HEADLINE","DESCRIPTION"}
|
|
||||||
|
|
||||||
|
|
||||||
For example: to add the item "My Item Name" and the Description "Most Fitting Description" do something like this:
|
|
||||||
|
|
||||||
-- 1. Get your itemid
|
|
||||||
local item = Isaac.GetItemIdByName("My Item Name");
|
|
||||||
-- 2. Make sure we're not adding to a nil table
|
|
||||||
if not __eidItemDescriptions then
|
|
||||||
__eidItemDescriptions = {};
|
|
||||||
end
|
|
||||||
-- 3. Add the description
|
|
||||||
__eidItemDescriptions[item] = "Most Fitting Description";
|
|
||||||
|
|
||||||
--]]
|
|
||||||
-- Init variables for other mods to hand over Descriptions if they were not yet inited by another mod.
|
|
||||||
if not __eidItemDescriptions then
|
if not __eidItemDescriptions then
|
||||||
__eidItemDescriptions = {}
|
__eidItemDescriptions = {}
|
||||||
end
|
end
|
||||||
@@ -113,7 +88,7 @@ function EID:addTransformation(targetType, targetIdentifier, transformationStrin
|
|||||||
EID.descriptions[language].custom["transformations_"..targetType.."_".. targetIdentifier] = {targetType, targetIdentifier, transformationString}
|
EID.descriptions[language].custom["transformations_"..targetType.."_".. targetIdentifier] = {targetType, targetIdentifier, transformationString}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Adds a description for a pilleffect id. Optional parameters: language, transformations
|
-- Adds a description for a an Entity. Optional parameters: language, transformations
|
||||||
-- when subtype is -1 or empty, it will affect all subtypes of that entity
|
-- when subtype is -1 or empty, it will affect all subtypes of that entity
|
||||||
function EID:addEntity(id, variant, subtype, entityName, description, language)
|
function EID:addEntity(id, variant, subtype, entityName, description, language)
|
||||||
subtype = subtype or nil
|
subtype = subtype or nil
|
||||||
@@ -500,17 +475,14 @@ function EID:interpolateColors(kColor1, kColor2, fraction)
|
|||||||
(kColor2.Red - kColor1.Red) * fraction + kColor1.Red,
|
(kColor2.Red - kColor1.Red) * fraction + kColor1.Red,
|
||||||
(kColor2.Green - kColor1.Green) * fraction + kColor1.Green,
|
(kColor2.Green - kColor1.Green) * fraction + kColor1.Green,
|
||||||
(kColor2.Blue - kColor1.Blue) * fraction + kColor1.Blue,
|
(kColor2.Blue - kColor1.Blue) * fraction + kColor1.Blue,
|
||||||
(kColor2.Alpha - kColor1.Alpha) * fraction + kColor1.Alpha,
|
(kColor2.Alpha - kColor1.Alpha) * fraction + kColor1.Alpha
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
)
|
)
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Creates a copy of a KColor object. This prevents overwriting existing
|
-- Creates a copy of a KColor object. This prevents overwriting existing
|
||||||
function EID:copyKColor(colorObj)
|
function EID:copyKColor(colorObj)
|
||||||
return KColor(colorObj.Red, colorObj.Green, colorObj.Blue, colorObj.Alpha, 0, 0, 0)
|
return KColor(colorObj.Red, colorObj.Green, colorObj.Blue, colorObj.Alpha)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Compares two KColors. Returns true if they are equal
|
-- Compares two KColors. Returns true if they are equal
|
||||||
@@ -524,10 +496,7 @@ function EID:getNameColor()
|
|||||||
EIDConfig["ItemNameColor"][1],
|
EIDConfig["ItemNameColor"][1],
|
||||||
EIDConfig["ItemNameColor"][2],
|
EIDConfig["ItemNameColor"][2],
|
||||||
EIDConfig["ItemNameColor"][3],
|
EIDConfig["ItemNameColor"][3],
|
||||||
EIDConfig["Transparency"],
|
EIDConfig["Transparency"]
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -537,10 +506,7 @@ function EID:getTextColor()
|
|||||||
EIDConfig["TextColor"][1],
|
EIDConfig["TextColor"][1],
|
||||||
EIDConfig["TextColor"][2],
|
EIDConfig["TextColor"][2],
|
||||||
EIDConfig["TextColor"][3],
|
EIDConfig["TextColor"][3],
|
||||||
EIDConfig["Transparency"],
|
EIDConfig["Transparency"]
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -550,10 +516,7 @@ function EID:getTransformationColor()
|
|||||||
EIDConfig["TransformationColor"][1],
|
EIDConfig["TransformationColor"][1],
|
||||||
EIDConfig["TransformationColor"][2],
|
EIDConfig["TransformationColor"][2],
|
||||||
EIDConfig["TransformationColor"][3],
|
EIDConfig["TransformationColor"][3],
|
||||||
EIDConfig["Transparency"],
|
EIDConfig["Transparency"]
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -563,9 +526,6 @@ function EID:getErrorColor()
|
|||||||
EIDConfig["ErrorColor"][1],
|
EIDConfig["ErrorColor"][1],
|
||||||
EIDConfig["ErrorColor"][2],
|
EIDConfig["ErrorColor"][2],
|
||||||
EIDConfig["ErrorColor"][3],
|
EIDConfig["ErrorColor"][3],
|
||||||
EIDConfig["Transparency"],
|
EIDConfig["Transparency"]
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
+17
-17
@@ -131,23 +131,23 @@ EID.InlineColors = {
|
|||||||
["ColorObjName"] = function(_) return EID:getNameColor() end,
|
["ColorObjName"] = function(_) return EID:getNameColor() end,
|
||||||
["ColorReset"] = function(_) return EID.LastRenderCallColor end,
|
["ColorReset"] = function(_) return EID.LastRenderCallColor end,
|
||||||
-- Basic Colors
|
-- Basic Colors
|
||||||
["ColorBlack"] = KColor(0, 0, 0, 1, 0, 0, 0),
|
["ColorBlack"] = KColor(0, 0, 0, 1),
|
||||||
["ColorWhite"] = KColor(1, 1, 1, 1, 0, 0, 0),
|
["ColorWhite"] = KColor(1, 1, 1, 1),
|
||||||
["ColorRed"] = KColor(1, 0, 0, 1, 0, 0, 0),
|
["ColorRed"] = KColor(1, 0, 0, 1),
|
||||||
["ColorLime"] = KColor(0, 1, 0, 1, 0, 0, 0),
|
["ColorLime"] = KColor(0, 1, 0, 1),
|
||||||
["ColorBlue"] = KColor(0, 0, 1, 1, 0, 0, 0),
|
["ColorBlue"] = KColor(0, 0, 1, 1),
|
||||||
["ColorYellow"] = KColor(1, 1, 0, 1, 0, 0, 0),
|
["ColorYellow"] = KColor(1, 1, 0, 1),
|
||||||
["ColorCyan"] = KColor(0, 1, 1, 1, 0, 0, 0),
|
["ColorCyan"] = KColor(0, 1, 1, 1),
|
||||||
["ColorPink"] = KColor(1, 0, 1, 1, 0, 0, 0),
|
["ColorPink"] = KColor(1, 0, 1, 1),
|
||||||
["ColorSilver"] = KColor(0.75, 0.75, 0.75, 1, 0, 0, 0),
|
["ColorSilver"] = KColor(0.75, 0.75, 0.75, 1),
|
||||||
["ColorGray"] = KColor(0.5, 0.5, 0.5, 1, 0, 0, 0),
|
["ColorGray"] = KColor(0.5, 0.5, 0.5, 1),
|
||||||
["ColorMaroon"] = KColor(0.5, 0, 0, 1, 0, 0, 0),
|
["ColorMaroon"] = KColor(0.5, 0, 0, 1),
|
||||||
["ColorOlive"] = KColor(0.5, 0.5, 0, 1, 0, 0, 0),
|
["ColorOlive"] = KColor(0.5, 0.5, 0, 1),
|
||||||
["ColorGreen"] = KColor(0, 0.5, 0, 1, 0, 0, 0),
|
["ColorGreen"] = KColor(0, 0.5, 0, 1),
|
||||||
["ColorPurple"] = KColor(0.5, 0, 0.5, 1, 0, 0, 0),
|
["ColorPurple"] = KColor(0.5, 0, 0.5, 1),
|
||||||
["ColorTeal"] = KColor(0, 0.5, 0.5, 1, 0, 0, 0),
|
["ColorTeal"] = KColor(0, 0.5, 0.5, 1),
|
||||||
["ColorNavy"] = KColor(0, 0, 0.5, 1, 0, 0, 0),
|
["ColorNavy"] = KColor(0, 0, 0.5, 1),
|
||||||
["ColorOrange"] = KColor(1, 0.54, 0, 1, 0, 0, 0),
|
["ColorOrange"] = KColor(1, 0.54, 0, 1),
|
||||||
-- Swag Colors
|
-- Swag Colors
|
||||||
|
|
||||||
-- Rainbow color effect
|
-- Rainbow color effect
|
||||||
|
|||||||
Reference in new issue
Block a user