Files
PCK-Studio/PckStudio.Core/ResourceLocations.cs
2025-11-30 10:37:13 +01:00

128 lines
9.8 KiB
C#

/* Copyright (c) 2024-present miku-666
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1.The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
using System.Drawing;
using PckStudio.Core.Properties;
using PckStudio.Json;
namespace PckStudio.Core
{
public static class ResourceLocations
{
static ResourceLocations()
{
_all = new ResourceLocation[] {
new GroupResource("textures/items", ResourceCategory.ItemAnimation),
new GroupResource("textures/blocks", ResourceCategory.BlockAnimation),
new GroupResource("mob", ResourceCategory.MobEntityTextures),
new GroupResource("item", ResourceCategory.ItemEntityTextures),
new GroupResource("armor", ResourceCategory.ArmorTextures),
new AtlasResource("terrain.png", AtlasResource.AtlasType.BlockAtlas, 16, Resources.terrain_atlas, tilesInfo: Tiles.BlockTileInfos, atlasGroups: _terrainAtlasGroups),
new AtlasResource("items.png", AtlasResource.AtlasType.ItemAtlas, 16, Resources.items_atlas, tilesInfo: Tiles.ItemTileInfos, atlasGroups: _itemsAtlasGroups),
new AtlasResource("particles.png", AtlasResource.AtlasType.ParticleAtlas, 16, Resources.particles_atlas, tilesInfo: Tiles.ParticleTileInfos, atlasGroups: _particaleAtlasGroups),
new AtlasResource("item/banner/Banner_Atlas.png", AtlasResource.AtlasType.BannerAtlas, new Size(6, 7), Resources.banners_atlas, AtlasResource.TillingMode.XY, tilesInfo: Tiles.BannerTileInfos),
new AtlasResource("art/kz.png", AtlasResource.AtlasType.PaintingAtlas, 16, Resources.paintings_atlas, tilesInfo: Tiles.PaintingTileInfos, atlasGroups: _paintingAtlasGroups),
new AtlasResource("misc/explosion.png", AtlasResource.AtlasType.ExplosionAtlas, 16, Resources.explosions_atlas, tilesInfo: Tiles.ExplosionTileInfos),
new AtlasResource("item/xporb.png", AtlasResource.AtlasType.ExperienceOrbAtlas, 4, Resources.experience_orbs_atlas, tilesInfo: Tiles.ExperienceOrbTileInfos),
new AtlasResource("terrain/moon_phases.png", AtlasResource.AtlasType.MoonPhaseAtlas, 4, Resources.moon_phases_atlas, tilesInfo: Tiles.MoonPhaseTileInfos),
new AtlasResource("misc/mapicons.png", AtlasResource.AtlasType.MapIconAtlas, 4, Resources.map_icons_atlas, tilesInfo: Tiles.MapIconTileInfos),
new AtlasResource("misc/additionalmapicons.png", AtlasResource.AtlasType.AdditionalMapIconsAtlas, 4, Resources.additional_map_icons_atlas, tilesInfo: Tiles.AdditionalMapIconTileInfos),
};
}
public static ResourceLocation GetFromCategory(ResourceCategory category) => ResourceLocation.GetFromCategory(category);
public static ResourceLocation GetFromPath(string path) => ResourceLocation.GetFromPath(path);
public static ResourceCategory GetCategoryFromPath(string path) => ResourceLocation.GetCategoryFromPath(path);
public static string GetPathFromCategory(ResourceCategory category) => ResourceLocation.GetPathFromCategory(category);
private static readonly AtlasGroup[] _particaleAtlasGroups =
{
new AtlasGroupAnimation("generic" , row: 0, column: 0, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("splash" , row: 3, column: 1, frameCount: 4, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("drip" , row: 0, column: 7, frameCount: 3, ImageLayoutDirection.Horizontal, 4),
new AtlasGroupAnimation("effect" , row: 0, column: 8, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("splash_effect" , row: 0, column: 9, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("firework_spark" , row: 0, column: 10, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("glitter" , row: 0, column: 11, frameCount: 8, ImageLayoutDirection.Horizontal, 2),
new AtlasGroupAnimation("BE_explosion" , row: 0, column: 12, frameCount: 16, ImageLayoutDirection.Horizontal),
new AtlasGroupLargeTile("flash" , row: 4, column: 2, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTileAnimation("bubble_pop", row: 6, column: 6, rowSpan: 2, columnSpan: 2, frameCount: 5, ImageLayoutDirection.Horizontal, 2),
};
private static readonly AtlasGroup[] _terrainAtlasGroups =
{
new AtlasGroupLargeTile("Oak Door" , row: 1, column: 5, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Iron Door" , row: 2, column: 5, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Acacia Door" , row: 0, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Birch Door" , row: 1, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Dark Oak Door", row: 2, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Jungle Door" , row: 3, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Spruce Door" , row: 4, column: 23, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Large Fern" , row: 0, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Double Tall Grass", row: 1, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Poeny" , row: 2, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Rose Bush" , row: 3, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Lilac" , row: 4, column: 20, rowSpan: 1, columnSpan: 2),
new AtlasGroupAnimation("Wheat" , row: 8, column: 5, frameCount: 8, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Potatoes" , row: 9, column: 16, frameCount: 4, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Carrots" , row: 8, column: 12, frameCount: 4, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Beetroots" , row: 0, column: 25, frameCount: 4, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Nether Wart", row: 2, column: 14, frameCount: 3, ImageLayoutDirection.Horizontal, 5),
new AtlasGroupAnimation("Destroy" , row: 0, column: 15, frameCount: 10, ImageLayoutDirection.Horizontal, 3),
};
private static readonly AtlasGroup[] _itemsAtlasGroups =
{
new AtlasGroupAnimation("Bow Pulling", row: 5, column: 6, frameCount: 3, ImageLayoutDirection.Vertical, 6),
};
private static readonly AtlasGroup[] _paintingAtlasGroups =
{
new AtlasGroupLargeTile("The Pool" , row: 0, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Bonjour Monsiuer Courbet", row: 2, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Seaside" , row: 4, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("sunset_dense" , row: 6, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Creebet" , row: 8, column: 2, rowSpan: 2, columnSpan: 1),
new AtlasGroupLargeTile("Wanderer" , row: 0, column: 4, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Graham" , row: 1, column: 4, rowSpan: 1, columnSpan: 2),
new AtlasGroupLargeTile("Fighters" , row: 0, column: 6, rowSpan: 4, columnSpan: 2),
new AtlasGroupLargeTile("Match" , row: 0, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Bust" , row: 2, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("The stage is set" , row: 4, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("The Void" , row: 6, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Skull and Roses" , row: 8, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Wither" , row: 10, column: 8, rowSpan: 2, columnSpan: 2),
new AtlasGroupLargeTile("Mortal Coil" , row: 12, column: 4, rowSpan: 4, columnSpan: 3),
new AtlasGroupLargeTile("Kong" , row: 12, column: 7, rowSpan: 4, columnSpan: 3),
new AtlasGroupLargeTile("Back Texture" , row: 12, column: 0, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTile("Pointer" , row: 0, column: 12, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTile("Pigscene" , row: 4, column: 12, rowSpan: 4, columnSpan: 4),
new AtlasGroupLargeTile("Skull On Fire" , row: 8, column: 12, rowSpan: 4, columnSpan: 4),
};
private static readonly ResourceLocation[] _all;
}
}