From fedfc68fc26b8f1001c4ff6720fac48f88556981 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:14:15 +0200 Subject: [PATCH] Rename & Move HasCustomColor to AllowCustomColour and move from ColorEntry to TileInfo --- PCK-Studio/Forms/Editor/TextureAtlasEditor.cs | 4 +- PCK-Studio/Internal/Json/ColorEntry.cs | 3 - PCK-Studio/Internal/Json/TileInfo.cs | 3 + PCK-Studio/Resources/atlases/blockData.json | 4 +- PCK-Studio/Resources/atlases/itemData.json | 21 ++--- .../Resources/atlases/particleData.json | 87 +++++++++---------- 6 files changed, 57 insertions(+), 65 deletions(-) diff --git a/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs b/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs index 8b1fc861..dfa5d294 100644 --- a/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs +++ b/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs @@ -255,7 +255,9 @@ namespace PckStudio.Forms.Editor } } - if (setColorButton.Enabled = clearColorButton.Enabled = dataTile.Tile.HasColourEntry) + setColorButton.Enabled = dataTile.Tile.AllowCustomColour; + + if (setColorButton.Enabled) { setColorButton.Enabled = clearColorButton.Enabled = dataTile.Tile.ColourEntry.HasCustomColour; clearColorButton.Enabled = false; diff --git a/PCK-Studio/Internal/Json/ColorEntry.cs b/PCK-Studio/Internal/Json/ColorEntry.cs index 39390d81..8523a311 100644 --- a/PCK-Studio/Internal/Json/ColorEntry.cs +++ b/PCK-Studio/Internal/Json/ColorEntry.cs @@ -15,9 +15,6 @@ namespace PckStudio.Internal.Json [JsonProperty("isWaterColour", DefaultValueHandling = DefaultValueHandling.Populate)] public bool IsWaterColour { get; set; } - [JsonProperty("hasCustomColour", DefaultValueHandling = DefaultValueHandling.Populate)] - public bool HasCustomColour { get; set; } - [JsonProperty("variants", DefaultValueHandling = DefaultValueHandling.Populate)] public string[] Variants { get; set; } } diff --git a/PCK-Studio/Internal/Json/TileInfo.cs b/PCK-Studio/Internal/Json/TileInfo.cs index 5c8aa704..b5fb0510 100644 --- a/PCK-Studio/Internal/Json/TileInfo.cs +++ b/PCK-Studio/Internal/Json/TileInfo.cs @@ -27,6 +27,9 @@ namespace PckStudio.Internal.Json [JsonProperty("colourEntry", DefaultValueHandling = DefaultValueHandling.Populate)] public JsonColorEntry ColourEntry { get; set; } + [JsonProperty("allowCustomColour", DefaultValueHandling = DefaultValueHandling.Populate)] + public bool AllowCustomColour { get; set; } + public JsonTileInfo(string displayName, string internalName) { DisplayName = displayName; diff --git a/PCK-Studio/Resources/atlases/blockData.json b/PCK-Studio/Resources/atlases/blockData.json index c2cb1b8f..2b9e4550 100644 --- a/PCK-Studio/Resources/atlases/blockData.json +++ b/PCK-Studio/Resources/atlases/blockData.json @@ -2317,11 +2317,11 @@ { "internalName": "cauldron_water", "displayName": "Cauldron Water", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "Cauldron_Water", - "variants": [ + "variants": [ "Cauldron_Water", "Effect_MovementSpeed", "Effect_MovementSlowDown", diff --git a/PCK-Studio/Resources/atlases/itemData.json b/PCK-Studio/Resources/atlases/itemData.json index 0c49ee02..51c380b7 100644 --- a/PCK-Studio/Resources/atlases/itemData.json +++ b/PCK-Studio/Resources/atlases/itemData.json @@ -5,9 +5,9 @@ { "internalName": "helmetCloth", "displayName": "Leather Cap", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "Armour_Default_Leather_Colour", "variants": [ "Armour_Default_Leather_Colour" ] } @@ -75,9 +75,9 @@ { "internalName": "chestplateCloth", "displayName": "Leather Tunic", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "Armour_Default_Leather_Colour", "variants": [ "Armour_Default_Leather_Colour" ] } @@ -145,9 +145,9 @@ { "internalName": "leggingsCloth", "displayName": "Leather Pants", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "Armour_Default_Leather_Colour", "variants": [ "Armour_Default_Leather_Colour" ] } @@ -215,9 +215,9 @@ { "internalName": "bootsCloth", "displayName": "Leather Boots", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "Armour_Default_Leather_Colour", "variants": [ "Armour_Default_Leather_Colour" ] } @@ -593,11 +593,11 @@ { "internalName": "potion_contents", "displayName": "Potion (Overlay)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1013,12 +1013,7 @@ { "internalName": "fireworks_charge_overlay", "displayName": "Firework Star (Overlay)", - "hasColourEntry": true, - "colourEntry": { - "hasCustomColour": true, - "defaultName": "", - "variants": [""] - } + "allowCustomColour": true }, { "internalName": "netherquartz", @@ -1099,9 +1094,9 @@ { "internalName": "leather_horse_armor_base", "displayName": "Leather Horse Armor", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "Armour_Default_Leather_Colour", "variants": [ "Armour_Default_Leather_Colour" ] } diff --git a/PCK-Studio/Resources/atlases/particleData.json b/PCK-Studio/Resources/atlases/particleData.json index e89bcf85..f4dae017 100644 --- a/PCK-Studio/Resources/atlases/particleData.json +++ b/PCK-Studio/Resources/atlases/particleData.json @@ -301,12 +301,7 @@ "displayName": "Firework Flash", "width": 4, "height": 4, - "hasColourEntry": true, - "colourEntry": { - "hasCustomColour": true, - "defaultName": "", - "variants": [""] - } + "allowCustomColour": true }, { "internalName": "flash", @@ -754,10 +749,10 @@ "internalName": "effect_0", "displayName": "Effect (Stage 1)", "hasColourEntry": true, + "allowCustomColour": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -794,10 +789,10 @@ "internalName": "effect_1", "displayName": "Effect (Stage 2)", "hasColourEntry": true, + "allowCustomColour": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -833,11 +828,11 @@ { "internalName": "effect_2", "displayName": "Effect (Stage 3)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -873,11 +868,11 @@ { "internalName": "effect_3", "displayName": "Effect (Stage 4)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -913,11 +908,11 @@ { "internalName": "effect_4", "displayName": "Effect (Stage 5)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -953,11 +948,11 @@ { "internalName": "effect_5", "displayName": "Effect (Stage 6)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -993,11 +988,11 @@ { "internalName": "effect_6", "displayName": "Effect (Stage 7)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1033,11 +1028,11 @@ { "internalName": "effect_7", "displayName": "Effect (Stage 8)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1105,11 +1100,11 @@ { "internalName": "spell_0", "displayName": "Splash Effect (Stage 1)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1145,11 +1140,11 @@ { "internalName": "spell_1", "displayName": "Splash Effect (Stage 2)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1185,11 +1180,11 @@ { "internalName": "spell_2", "displayName": "Splash Effect (Stage 3)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1225,11 +1220,11 @@ { "internalName": "spell_3", "displayName": "Splash Effect (Stage 4)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1265,11 +1260,11 @@ { "internalName": "spell_4", "displayName": "Splash Effect (Stage 5)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1305,11 +1300,11 @@ { "internalName": "spell_5", "displayName": "Splash Effect (Stage 6)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1345,11 +1340,11 @@ { "internalName": "spell_6", "displayName": "Splash Effect (Stage 7)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1385,11 +1380,11 @@ { "internalName": "spell_7", "displayName": "Splash Effect (Stage 8)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { "defaultName": "Potion_BaseColour", - "hasCustomColour": true, - "variants": [ + "variants": [ "Potion_BaseColour", "Effect_MovementSpeed", "Effect_MovementSlowDown", @@ -1457,9 +1452,9 @@ { "internalName": "spark_0", "displayName": "Firework Spark (Stage 1)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None", @@ -1472,9 +1467,9 @@ { "internalName": "spark_1", "displayName": "Firework Spark (Stage 2)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None", @@ -1487,9 +1482,9 @@ { "internalName": "spark_2", "displayName": "Firework Spark (Stage 3)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None", @@ -1502,9 +1497,9 @@ { "internalName": "spark_3", "displayName": "Firework Spark (Stage 4)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None", @@ -1517,9 +1512,9 @@ { "internalName": "spark_4", "displayName": "Firework Spark (Stage 5)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None", @@ -1532,9 +1527,9 @@ { "internalName": "spark_5", "displayName": "Firework Spark (Stage 6)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None", @@ -1547,9 +1542,9 @@ { "internalName": "spark_6", "displayName": "Firework Spark (Stage 7)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None", @@ -1562,9 +1557,9 @@ { "internalName": "spark_7", "displayName": "Firework Spark (Stage 8)", + "allowCustomColour": true, "hasColourEntry": true, "colourEntry": { - "hasCustomColour": true, "defaultName": "None", "variants": [ "None",