mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-25 11:16:20 +00:00
Added MapIcon support to Atlas Editor
This commit is contained in:
@@ -104,7 +104,9 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
"terrain" => (Tiles.BlockTileInfos, "blocks"),
|
||||
"items" => (Tiles.ItemTileInfos, "items"),
|
||||
"moon_phases" => (Tiles.MoonPhasesTileInfos, "moon_phases"),
|
||||
"mapicons" => (Tiles.MapIconTileInfos, "map_icons"),
|
||||
"additionalmapicons" => (Tiles.AdditionalMapIconTileInfos, "additional_map_icons"),
|
||||
"moon_phases" => (Tiles.MoonPhaseTileInfos, "moon_phases"),
|
||||
_ => (null, null),
|
||||
};
|
||||
originalPictureBox.Image = atlas;
|
||||
@@ -152,6 +154,13 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
dataTile = _selectedTile;
|
||||
|
||||
if (string.IsNullOrEmpty(dataTile.Tile.InternalName))
|
||||
{
|
||||
selectTilePictureBox.Image = dataTile.Texture;
|
||||
tileNameLabel.Text = "Unused";
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(dataTile.Tile.DisplayName))
|
||||
{
|
||||
dataTile = _tiles.Find(t => t.Tile.InternalName == _selectedTile.Tile.InternalName);
|
||||
|
||||
@@ -19,6 +19,10 @@ namespace PckStudio.Internal.Json
|
||||
public List<JsonTileInfo> Items { get; set; }
|
||||
[JsonProperty("moon_phases")]
|
||||
public List<JsonTileInfo> MoonPhases { get; set; }
|
||||
[JsonProperty("map_icons")]
|
||||
public List<JsonTileInfo> MapIcons { get; set; }
|
||||
[JsonProperty("additional_map_icons")]
|
||||
public List<JsonTileInfo> AdditionalMapIcons { get; set; }
|
||||
}
|
||||
|
||||
internal static class Tiles
|
||||
@@ -29,7 +33,9 @@ namespace PckStudio.Internal.Json
|
||||
internal static List<JsonTileInfo> ItemTileInfos => JsonTileData.Items;
|
||||
|
||||
internal static List<JsonTileInfo> BlockTileInfos => JsonTileData.Blocks;
|
||||
internal static List<JsonTileInfo> MoonPhasesTileInfos => JsonTileData.MoonPhases;
|
||||
internal static List<JsonTileInfo> MoonPhaseTileInfos => JsonTileData.MoonPhases;
|
||||
internal static List<JsonTileInfo> MapIconTileInfos => JsonTileData.MapIcons;
|
||||
internal static List<JsonTileInfo> AdditionalMapIconTileInfos => JsonTileData.AdditionalMapIcons;
|
||||
|
||||
private static Image[] _itemImages;
|
||||
public static Image[] ItemImages => _itemImages ??= Resources.items_sheet.SplitHorizontal(16).ToArray();
|
||||
@@ -37,8 +43,14 @@ namespace PckStudio.Internal.Json
|
||||
private static Image[] _blockImages;
|
||||
public static Image[] BlockImages => _blockImages ??= Resources.terrain_sheet.SplitHorizontal(16).ToArray();
|
||||
|
||||
private static Image[] _moonPhasesImages;
|
||||
public static Image[] MoonPhasesImages => _moonPhasesImages ??= Resources.moon_phases_sheet.SplitHorizontal(8).ToArray();
|
||||
private static Image[] _moonPhaseImages;
|
||||
public static Image[] MoonPhaseImages => _moonPhaseImages ??= Resources.moon_phases_sheet.SplitHorizontal(4).ToArray();
|
||||
|
||||
private static Image[] _mapIconImages;
|
||||
public static Image[] MapIconImages => _mapIconImages ??= Resources.map_icons_sheet.SplitHorizontal(4).ToArray();
|
||||
|
||||
private static Image[] _additionalMapIconImages;
|
||||
public static Image[] AdditionalMapIconImages => _mapIconImages ??= Resources.additional_map_icons_sheet.SplitHorizontal(4).ToArray();
|
||||
|
||||
private static ImageList _itemImageList;
|
||||
public static ImageList ItemImageList
|
||||
@@ -70,18 +82,33 @@ namespace PckStudio.Internal.Json
|
||||
}
|
||||
}
|
||||
|
||||
private static ImageList _moonPhasesImageList;
|
||||
public static ImageList MoonPhasesImageList
|
||||
private static ImageList _moonPhaseImageList;
|
||||
public static ImageList MoonPhaseImageList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_moonPhasesImageList is null)
|
||||
if (_moonPhaseImageList is null)
|
||||
{
|
||||
_moonPhasesImageList = new ImageList();
|
||||
_moonPhasesImageList.ColorDepth = ColorDepth.Depth32Bit;
|
||||
_moonPhasesImageList.Images.AddRange(MoonPhasesImages);
|
||||
_moonPhaseImageList = new ImageList();
|
||||
_moonPhaseImageList.ColorDepth = ColorDepth.Depth32Bit;
|
||||
_moonPhaseImageList.Images.AddRange(MoonPhaseImages);
|
||||
}
|
||||
return _moonPhasesImageList;
|
||||
return _moonPhaseImageList;
|
||||
}
|
||||
}
|
||||
|
||||
private static ImageList _mapIconImageList;
|
||||
public static ImageList MapIconImageList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_mapIconImageList is null)
|
||||
{
|
||||
_mapIconImageList = new ImageList();
|
||||
_mapIconImageList.ColorDepth = ColorDepth.Depth32Bit;
|
||||
_mapIconImageList.Images.AddRange(MapIconImages);
|
||||
}
|
||||
return _mapIconImageList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,15 +376,17 @@ namespace PckStudio
|
||||
}
|
||||
|
||||
bool isTerrainOrItems = file.Filename == "res/terrain.png" || file.Filename == "res/items.png";
|
||||
bool isMoon = file.Filename == "res/terrain/moon_phases.png";
|
||||
bool isMoonPhases = file.Filename == "res/terrain/moon_phases.png";
|
||||
bool isMapIcons = file.Filename == "res/misc/mapicons.png";
|
||||
bool isAdditionalMapIcons = file.Filename == "res/misc/additionalmapicons.png";
|
||||
|
||||
if (isTerrainOrItems || isMoon)
|
||||
if (isTerrainOrItems || isMoonPhases || isMapIcons || isAdditionalMapIcons)
|
||||
{
|
||||
var img = file.GetTexture();
|
||||
|
||||
var columnCount = 0;
|
||||
if (isTerrainOrItems) columnCount = 16;
|
||||
else if (isMoon) columnCount = 4;
|
||||
else if (isMoonPhases || isMapIcons || isAdditionalMapIcons) columnCount = 4;
|
||||
|
||||
var resolution = img.Width / columnCount;
|
||||
var size = new Size(resolution, resolution);
|
||||
|
||||
@@ -139,6 +139,11 @@
|
||||
<Compile Include="Internal\AnimationCategory.cs" />
|
||||
<Compile Include="Internal\SkinAnimFlag.cs" />
|
||||
<Compile Include="Internal\SkinAnimMask.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ToolboxItems\BlendPictureBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -613,11 +618,6 @@
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
@@ -628,7 +628,8 @@
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\entityData.json" />
|
||||
<None Include="Resources\atlases\entityData.json" />
|
||||
<None Include="Resources\atlases\tileData.json" />
|
||||
<None Include="Resources\TexturePackIcon.png" />
|
||||
<None Include="Resources\binka\binkawin.asi" />
|
||||
<None Include="Resources\fileTemplates\1.91_colours.col" />
|
||||
@@ -644,16 +645,13 @@
|
||||
<None Include="Resources\fileTemplates\tu53colours.col" />
|
||||
<None Include="Resources\fileTemplates\tu54colours.col" />
|
||||
<None Include="Resources\fileTemplates\tu69colours.col" />
|
||||
<None Include="Resources\tileData.json" />
|
||||
<None Include="Resources\external\Youtube.png" />
|
||||
<None Include="Resources\pckClosed.png" />
|
||||
<None Include="Resources\external\Discord.png" />
|
||||
<None Include="Resources\icons\clock.png" />
|
||||
<None Include="Resources\changeTile.png" />
|
||||
<None Include="Resources\items.png" />
|
||||
<None Include="Resources\HamburgerMenuIcon.png" />
|
||||
<None Include="Resources\pack.png" />
|
||||
<None Include="Resources\terrain.png" />
|
||||
<None Include="Resources\external\Xbox.png" />
|
||||
<None Include="Resources\external\PS3.png" />
|
||||
<None Include="Resources\external\WiiU.png" />
|
||||
@@ -679,7 +677,12 @@
|
||||
<None Include="Resources\Comparison.png" />
|
||||
<None Include="Resources\iconImageList\ENTITY MATERIALS ICON.png" />
|
||||
<None Include="Resources\iconImageList\blank.png" />
|
||||
<None Include="Resources\entities.png" />
|
||||
<None Include="Resources\atlases\additional_mapicons.png" />
|
||||
<None Include="Resources\atlases\map_icons.png" />
|
||||
<Content Include="Resources\atlases\entities.png" />
|
||||
<Content Include="Resources\atlases\items.png" />
|
||||
<Content Include="Resources\atlases\moon_phases.png" />
|
||||
<Content Include="Resources\atlases\terrain.png" />
|
||||
<Content Include="Resources\icons\file_delete.png" />
|
||||
<Content Include="Resources\icons\file_empty.png" />
|
||||
<None Include="Resources\icons\file_export.png" />
|
||||
@@ -689,7 +692,6 @@
|
||||
<None Include="Resources\icons\ranch.png" />
|
||||
<Content Include="Resources\icons\Replace.png" />
|
||||
<Content Include="Resources\icons\Save.png" />
|
||||
<None Include="Resources\moon_phases.png" />
|
||||
<Content Include="Resources\NoImageFound.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
20
PCK-Studio/Properties/Resources.Designer.cs
generated
20
PCK-Studio/Properties/Resources.Designer.cs
generated
@@ -70,6 +70,16 @@ namespace PckStudio.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap additional_map_icons_sheet {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("additional_map_icons_sheet", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -404,6 +414,16 @@ namespace PckStudio.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap map_icons_sheet {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("map_icons_sheet", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@@ -331,4 +331,10 @@
|
||||
<data name="moon_phases_sheet" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\moon_phases.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="additional_map_icons_sheet" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\additional_mapicons.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="map_icons_sheet" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\atlases\map_icons.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user