mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-03 04:15:11 +00:00
Added Painting support to Atlas Editor
This commit is contained in:
@@ -113,7 +113,8 @@ namespace PckStudio.Forms.Editor
|
||||
"additionalmapicons" => (Tiles.AdditionalMapIconTileInfos, "additional_map_icons"),
|
||||
"moon_phases" => (Tiles.MoonPhaseTileInfos, "moon_phases"),
|
||||
"xporb" => (Tiles.ExperienceOrbTileInfos, "experience_orbs"),
|
||||
"explosion" => (Tiles.ExplosionTileInfos, "explosion"),
|
||||
"explosion" => (Tiles.ExplosionTileInfos, "explosions"),
|
||||
"kz" => (Tiles.PaintingTileInfos, "paintings"),
|
||||
_ => (null, null),
|
||||
};
|
||||
|
||||
|
||||
@@ -30,8 +30,15 @@ namespace PckStudio.Internal
|
||||
_ = Tiles.JsonExplosionData;
|
||||
_ = Tiles.JsonMapIconData;
|
||||
_ = Tiles.JsonExperienceOrbData;
|
||||
_ = Tiles.ItemImageList;
|
||||
_ = Tiles.JsonPaintingData;
|
||||
_ = Tiles.BlockImageList;
|
||||
_ = Tiles.ItemImageList;
|
||||
_ = Tiles.ParticleImageList;
|
||||
_ = Tiles.ExplosionImageList;
|
||||
_ = Tiles.MapIconImageList;
|
||||
_ = Tiles.ExperienceOrbImageList;
|
||||
_ = Tiles.MoonPhaseImageList;
|
||||
_ = Tiles.PaintingImageList;
|
||||
SettingsManager.Initialize();
|
||||
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,11 @@ namespace PckStudio.Internal.Json
|
||||
[JsonProperty("experience_orbs")]
|
||||
public List<JsonTileInfo> ExperienceOrbs { get; set; }
|
||||
|
||||
[JsonProperty("explosion")]
|
||||
public List<JsonTileInfo> Explosion { get; set; }
|
||||
[JsonProperty("explosions")]
|
||||
public List<JsonTileInfo> Explosions { get; set; }
|
||||
|
||||
[JsonProperty("paintings")]
|
||||
public List<JsonTileInfo> Paintings { get; set; }
|
||||
}
|
||||
|
||||
internal static class Tiles
|
||||
@@ -44,7 +47,7 @@ namespace PckStudio.Internal.Json
|
||||
_jsonBlockData, _jsonItemData,
|
||||
_jsonParticleData, _jsonMoonPhaseData,
|
||||
_jsonMapIconData, _jsonExplosionData,
|
||||
_jsonExperienceOrbData;
|
||||
_jsonExperienceOrbData, _jsonPaintingData;
|
||||
internal static JsonTiles JsonBlockData => _jsonBlockData ??= JsonConvert.DeserializeObject<JsonTiles>(Resources.blockData);
|
||||
internal static JsonTiles JsonItemData => _jsonItemData ??= JsonConvert.DeserializeObject<JsonTiles>(Resources.itemData);
|
||||
internal static JsonTiles JsonParticleData => _jsonParticleData ??= JsonConvert.DeserializeObject<JsonTiles>(Resources.particleData);
|
||||
@@ -52,6 +55,7 @@ namespace PckStudio.Internal.Json
|
||||
internal static JsonTiles JsonMapIconData => _jsonMapIconData ??= JsonConvert.DeserializeObject<JsonTiles>(Resources.mapIconData);
|
||||
internal static JsonTiles JsonExplosionData => _jsonExplosionData ??= JsonConvert.DeserializeObject<JsonTiles>(Resources.explosionData);
|
||||
internal static JsonTiles JsonExperienceOrbData => _jsonExperienceOrbData ??= JsonConvert.DeserializeObject<JsonTiles>(Resources.experienceOrbData);
|
||||
internal static JsonTiles JsonPaintingData => _jsonPaintingData ??= JsonConvert.DeserializeObject<JsonTiles>(Resources.paintingData);
|
||||
|
||||
internal static List<JsonTileInfo> ItemTileInfos => JsonItemData.Items;
|
||||
internal static List<JsonTileInfo> BlockTileInfos => JsonBlockData.Blocks;
|
||||
@@ -60,7 +64,8 @@ namespace PckStudio.Internal.Json
|
||||
internal static List<JsonTileInfo> MapIconTileInfos => JsonMapIconData.MapIcons;
|
||||
internal static List<JsonTileInfo> AdditionalMapIconTileInfos => JsonMapIconData.AdditionalMapIcons;
|
||||
internal static List<JsonTileInfo> ExperienceOrbTileInfos => JsonExperienceOrbData.ExperienceOrbs;
|
||||
internal static List<JsonTileInfo> ExplosionTileInfos => JsonExplosionData.Explosion;
|
||||
internal static List<JsonTileInfo> ExplosionTileInfos => JsonExplosionData.Explosions;
|
||||
internal static List<JsonTileInfo> PaintingTileInfos => JsonPaintingData.Paintings;
|
||||
|
||||
private static Image[] _itemImages;
|
||||
public static Image[] ItemImages => _itemImages ??= Resources.items_atlas.SplitHorizontal(16).ToArray();
|
||||
@@ -84,7 +89,10 @@ namespace PckStudio.Internal.Json
|
||||
public static Image[] ExperienceOrbImages => _experienceOrbIconImages ??= Resources.experience_orbs_atlas.SplitHorizontal(4).ToArray();
|
||||
|
||||
private static Image[] _explosionImages;
|
||||
public static Image[] ExplosionImages => _explosionImages ??= Resources.explosion_atlas.SplitHorizontal(4).ToArray();
|
||||
public static Image[] ExplosionImages => _explosionImages ??= Resources.explosions_atlas.SplitHorizontal(4).ToArray();
|
||||
|
||||
private static Image[] _paintingImages;
|
||||
public static Image[] PaintingImages => _paintingImages ??= Resources.paintings_atlas.SplitHorizontal(16).ToArray();
|
||||
|
||||
private static ImageList GetImageList(Image[] images)
|
||||
{
|
||||
@@ -114,9 +122,12 @@ namespace PckStudio.Internal.Json
|
||||
public static ImageList AdditionalMapIconImageList { get { return _additionalMapIconImageList; } }
|
||||
|
||||
private static ImageList _experienceOrbsImageList = GetImageList(ExperienceOrbImages);
|
||||
public static ImageList ExperienceOrbsImageList { get { return _experienceOrbsImageList; } }
|
||||
public static ImageList ExperienceOrbImageList { get { return _experienceOrbsImageList; } }
|
||||
|
||||
private static ImageList _explosionImageList = GetImageList(ExplosionImages);
|
||||
public static ImageList ExplosionImageList { get { return _explosionImageList; } }
|
||||
|
||||
private static ImageList _paintingImageList = GetImageList(PaintingImages);
|
||||
public static ImageList PaintingImageList { get { return _paintingImageList; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,11 +382,12 @@ namespace PckStudio
|
||||
bool isMapIcons = file.Filename == "res/misc/mapicons.png";
|
||||
bool isAdditionalMapIcons = file.Filename == "res/misc/additionalmapicons.png";
|
||||
bool isXPOrbs = file.Filename == "res/item/xporb.png";
|
||||
bool isExplosion = file.Filename == "res/misc/explosion.png";
|
||||
bool isExplosions = file.Filename == "res/misc/explosion.png";
|
||||
bool isPaintings = file.Filename == "res/art/kz.png";
|
||||
|
||||
if (
|
||||
isTerrain || isItems || isParticles || isMoonPhases ||
|
||||
isMapIcons || isAdditionalMapIcons || isXPOrbs || isExplosion
|
||||
isTerrain || isItems || isParticles || isMoonPhases || isPaintings ||
|
||||
isMapIcons || isAdditionalMapIcons || isXPOrbs || isExplosions
|
||||
)
|
||||
{
|
||||
var img = file.GetTexture();
|
||||
@@ -394,7 +395,7 @@ namespace PckStudio
|
||||
// all of the other atlases so far use 4
|
||||
var columnCount = 4;
|
||||
|
||||
if (isTerrain || isItems || isParticles) columnCount = 16;
|
||||
if (isTerrain || isItems || isParticles || isPaintings) columnCount = 16;
|
||||
|
||||
var resolution = img.Width / columnCount;
|
||||
var size = new Size(resolution, resolution);
|
||||
|
||||
@@ -635,6 +635,7 @@
|
||||
<None Include="Resources\atlases\itemData.json" />
|
||||
<None Include="Resources\atlases\mapIconData.json" />
|
||||
<None Include="Resources\atlases\moonPhaseData.json" />
|
||||
<None Include="Resources\atlases\paintingData.json" />
|
||||
<None Include="Resources\atlases\particleData.json" />
|
||||
<None Include="Resources\TexturePackIcon.png" />
|
||||
<None Include="Resources\binka\binkawin.asi" />
|
||||
@@ -691,6 +692,7 @@
|
||||
<Content Include="Resources\atlases\items.png" />
|
||||
<Content Include="Resources\atlases\moon_phases.png" />
|
||||
<None Include="Resources\atlases\particles.png" />
|
||||
<None Include="Resources\atlases\paintings.png" />
|
||||
<Content Include="Resources\atlases\terrain.png" />
|
||||
<Content Include="Resources\icons\file_delete.png" />
|
||||
<Content Include="Resources\icons\file_empty.png" />
|
||||
|
||||
64
PCK-Studio/Properties/Resources.Designer.cs
generated
64
PCK-Studio/Properties/Resources.Designer.cs
generated
@@ -366,20 +366,10 @@ namespace PckStudio.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap explosion_atlas {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("explosion_atlas", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {
|
||||
/// "COMMENT_1": "JSON by MattNL",
|
||||
/// "explosion": [
|
||||
/// "explosions": [
|
||||
/// {
|
||||
/// "internalName": "explosion_0",
|
||||
/// "displayName": "Explosion (Stage 1)",
|
||||
@@ -399,7 +389,7 @@ namespace PckStudio.Properties {
|
||||
/// "colourEntry": {
|
||||
/// "defaultName": "Particle_Explode",
|
||||
/// "variants": [
|
||||
/// [rest of string was truncated]";.
|
||||
/// [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
public static string explosionData {
|
||||
get {
|
||||
@@ -407,6 +397,16 @@ namespace PckStudio.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap explosions_atlas {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("explosions_atlas", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -696,6 +696,46 @@ namespace PckStudio.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {
|
||||
/// "COMMENT_1": "JSON by MattNL",
|
||||
/// "paintings": [
|
||||
/// {
|
||||
/// "internalName": "Kebab",
|
||||
/// "displayName": "\"Kebab med tre pepperoni\" by Kristoffer Zetterstrand"
|
||||
/// },
|
||||
/// {
|
||||
/// "internalName": "Aztec",
|
||||
/// "displayName": "\"de_aztec\" by Kristoffer Zetterstrand"
|
||||
/// },
|
||||
/// {
|
||||
/// "internalName": "Alban",
|
||||
/// "displayName": "\"Albanian\" by Kristoffer Zetterstrand"
|
||||
/// },
|
||||
/// {
|
||||
/// "internalName": "Aztec2",
|
||||
/// "displayName": "\"de_aztec\" by Kristoffer Zetterstrand"
|
||||
/// },
|
||||
/// {
|
||||
/// "internalName": "Bomb",
|
||||
/// "di [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
public static string paintingData {
|
||||
get {
|
||||
return ResourceManager.GetString("paintingData", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap paintings_atlas {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("paintings_atlas", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {
|
||||
/// "COMMENT_1": "JSON by MattNL",
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
<data name="explosionData" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\explosionData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="explosion_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<data name="explosions_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\explosion.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="itemData" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
@@ -364,4 +364,10 @@
|
||||
<data name="particles_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\particles.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="paintingData" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\paintingData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="paintings_atlas" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\paintings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"COMMENT_1": "JSON by MattNL",
|
||||
"explosion": [
|
||||
"explosions": [
|
||||
{
|
||||
"internalName": "explosion_0",
|
||||
"displayName": "Explosion (Stage 1)",
|
||||
|
||||
1062
PCK-Studio/Resources/atlases/paintingData.json
Normal file
1062
PCK-Studio/Resources/atlases/paintingData.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
PCK-Studio/Resources/atlases/paintings.png
Normal file
BIN
PCK-Studio/Resources/atlases/paintings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
Reference in New Issue
Block a user