mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-27 05:44:43 +00:00
ResourcePackImporter - Add WIP support foe java ui import
This commit is contained in:
@@ -21,6 +21,7 @@ using PckStudio.Core.App;
|
||||
using PckStudio.Core.DLC;
|
||||
using PckStudio.Core.Extensions;
|
||||
using PckStudio.Core.Interfaces;
|
||||
using PckStudio.Core.IO.Java;
|
||||
using PckStudio.External.API.Miles;
|
||||
using PckStudio.Forms;
|
||||
using PckStudio.Forms.Additional_Popups;
|
||||
@@ -567,7 +568,7 @@ namespace PckStudio
|
||||
var importDialog = new JavaImportForm(new FileInfo(fileDialog.FileName), _dlcManager);
|
||||
if (importDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var dlcPackage = new RawAssetDLCPackage(importDialog.Result.Name, importDialog.Result.MainPck, _dlcManager.ByteOrder);
|
||||
var dlcPackage = new RawAssetDLCPackage("TexturePack.pck", importDialog.Result.MainPck, _dlcManager.ByteOrder);
|
||||
var datadlcPackage = new RawAssetDLCPackage(importDialog.Result.DataFolder?.TexturePck.Name, importDialog.Result.DataFolder?.TexturePck.Value, _dlcManager.ByteOrder);
|
||||
|
||||
if (CemuPanel.TryGetCemuMLCPath(out DirectoryInfo mlcDir) &&
|
||||
@@ -580,18 +581,23 @@ namespace PckStudio
|
||||
MessageBoxEx.ShowError("Failed to find dlc folder", "DLC Folder not found");
|
||||
return;
|
||||
}
|
||||
DirectoryInfo installDir = dlcDir.CreateSubdirectory(importDialog.Result.Name);
|
||||
string name = JavaConstants.EsapceMiencarftJavaFormat(Path.GetFileNameWithoutExtension(fileDialog.SafeFileName));
|
||||
|
||||
DirectoryInfo installDir = dlcDir.CreateSubdirectory(name);
|
||||
FileSystemInfo res = null;
|
||||
if (_dlcManager.ContentSerilasationType == DLCPackageContentSerilasationType.Local)
|
||||
res = CreateLocalPackage(installDir, importDialog.Result);
|
||||
if (_dlcManager.ContentSerilasationType == DLCPackageContentSerilasationType.Share)
|
||||
res = CreateSharablePackage(fileDialog.FileName, importDialog.Result);
|
||||
Process.Start("explorer.exe", res.FullName);
|
||||
res = CreateSharablePackage(fileDialog.FileName, importDialog.Result);
|
||||
MessageBoxEx.ShowInfo($"Imported '{Path.GetFileNameWithoutExtension(fileDialog.SafeFileName)}' into:\n{res.FullName}", "Import successful");
|
||||
//Process.Start("explorer.exe", res.FullName);
|
||||
}
|
||||
|
||||
|
||||
AddEditorPage(dlcPackage);
|
||||
AddEditorPage(datadlcPackage);
|
||||
if (MessageBoxEx.AskQuestion("Open pack ?", "Open", System.Windows.MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes)
|
||||
{
|
||||
AddEditorPage(dlcPackage);
|
||||
AddEditorPage(datadlcPackage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,7 +605,7 @@ namespace PckStudio
|
||||
{
|
||||
var fileInfo = new FileInfo(Path.Combine(Path.GetDirectoryName(name), Path.GetFileNameWithoutExtension(name) + "_pck.zip"));
|
||||
Stream zipStream = fileInfo.OpenWrite();
|
||||
|
||||
|
||||
using var zip = new ZipArchive(zipStream, ZipArchiveMode.Create);
|
||||
{
|
||||
zip.WriteEntry($"{(packageContent.HasDataFolder ? "TexturePack" : "Pack")}.pck", new PckFileWriter(packageContent.MainPck, _dlcManager.ByteOrder));
|
||||
@@ -608,7 +614,7 @@ namespace PckStudio
|
||||
if (packageContent.HasDataFolder)
|
||||
{
|
||||
zip.WriteEntry($"Data/{packageContent.DataFolder.TexturePck.Name}", new PckFileWriter(packageContent.DataFolder.TexturePck.Value, _dlcManager.ByteOrder));
|
||||
|
||||
|
||||
foreach (NamedData<byte[]> file in packageContent.DataFolder.Files)
|
||||
{
|
||||
zip.WriteEntry($"Data/{file.Name}", file.Value);
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace PckStudio.Core
|
||||
public bool SetGroup(AtlasGroup group, Image texture)
|
||||
{
|
||||
Size splitSize = group.IsLargeTile() ? new Size(texture.Width / ((AtlasLargeTile)group).RowSpan, texture.Height /((AtlasLargeTile)group).ColumnSpan) : TileSize;
|
||||
Image[] images = texture.Split(splitSize, _layoutDirection).ToArray();
|
||||
Image[] images = texture.Split(splitSize, group.Direction).ToArray();
|
||||
if (!images.All(img => img.Size == splitSize))
|
||||
return false;
|
||||
if (images.Length != group.Count)
|
||||
|
||||
@@ -44,8 +44,8 @@ namespace PckStudio.Core
|
||||
|
||||
public override Size GetSize(Size tileSize) => new Size(tileSize.Width * (Direction == ImageLayoutDirection.Horizontal ? Count : 1), tileSize.Height * (Direction == ImageLayoutDirection.Vertical ? Count : 1));
|
||||
|
||||
public AtlasAnimation(string name, int row, int column, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME, bool allowCustomColor = default)
|
||||
: base(name, row, column, allowCustomColor)
|
||||
public AtlasAnimation(string name, string internalName, int row, int column, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME, bool allowCustomColor = default)
|
||||
: base(name, internalName, row: row, column: column, allowCustomColor: allowCustomColor)
|
||||
{
|
||||
_frameCount = frameCount;
|
||||
Direction = direction;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -25,9 +26,16 @@ namespace PckStudio.Core
|
||||
{
|
||||
[JsonProperty("name", Required = Required.Always, Order = 0)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DefaultValue("")]
|
||||
[JsonProperty("internalName")]
|
||||
public string InternalName { get; set; }
|
||||
|
||||
[JsonProperty("row", Required = Required.Always, Order = 1)]
|
||||
public int Row { get; }
|
||||
|
||||
[JsonProperty("column", Required = Required.Always, Order = 2)]
|
||||
|
||||
public int Column { get; }
|
||||
[JsonProperty("allowCustomColor", DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||
public bool AllowCustomColor { get; }
|
||||
@@ -44,9 +52,10 @@ namespace PckStudio.Core
|
||||
[JsonProperty("direction")]
|
||||
public virtual ImageLayoutDirection Direction => Column > Row ? ImageLayoutDirection.Vertical : ImageLayoutDirection.Horizontal;
|
||||
|
||||
public AtlasGroup(string name, int row, int column, bool allowCustomColor)
|
||||
public AtlasGroup(string name, string internalName, int row, int column, bool allowCustomColor)
|
||||
{
|
||||
Name = name;
|
||||
InternalName = internalName;
|
||||
Row = Math.Max(0, row);
|
||||
Column = Math.Max(0, column);
|
||||
AllowCustomColor = allowCustomColor;
|
||||
|
||||
@@ -34,8 +34,10 @@ namespace PckStudio.Core
|
||||
|
||||
bool allowCustomColor = default;
|
||||
jObject.TryGetValue("allowCustomColor", out allowCustomColor);
|
||||
string internalName = default;
|
||||
jObject.TryGetValue("internalName", out internalName);
|
||||
if (jObject.TryGetValue("overlay", out JsonRowAndColumn rowsAndColumns))
|
||||
return new AtlasOverlayGroup(name, row, column, rowsAndColumns, allowCustomColor);
|
||||
return new AtlasOverlayGroup(name, internalName, row, column, rowsAndColumns, allowCustomColor);
|
||||
|
||||
int frameTime = Animation.MINIMUM_FRAME_TIME;
|
||||
int frameCount = default;
|
||||
@@ -47,11 +49,11 @@ namespace PckStudio.Core
|
||||
jObject.TryGetValue("direction", out direction);
|
||||
bool isLargeTile = jObject.TryGetValue("rowSpan", out rowSpan) && jObject.TryGetValue("columnSpan", out columnSpan);
|
||||
if (isAnimation && isLargeTile)
|
||||
return new AtlasLargeTileAnimation(name, row, column, rowSpan, columnSpan, frameCount, direction, frameTime, allowCustomColor);
|
||||
return new AtlasLargeTileAnimation(name, internalName, row, column, rowSpan, columnSpan, frameCount, direction, frameTime, allowCustomColor);
|
||||
if (isAnimation)
|
||||
return new AtlasAnimation(name, row, column, frameCount, direction, frameTime, allowCustomColor);
|
||||
return new AtlasAnimation(name, internalName, row, column, frameCount, direction, frameTime, allowCustomColor);
|
||||
if (isLargeTile)
|
||||
return new AtlasLargeTile(name, row, column, rowSpan, columnSpan, allowCustomColor);
|
||||
return new AtlasLargeTile(name, internalName, row, column, rowSpan, columnSpan, allowCustomColor);
|
||||
return default;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace PckStudio.Core
|
||||
|
||||
public override Size GetSize(Size tileSize) => new Size(RowSpan * tileSize.Width, ColumnSpan * tileSize.Height);
|
||||
|
||||
public AtlasLargeTile(string name, int row, int column, int rowSpan, int columnSpan, bool allowCustomColor)
|
||||
: base(name, row, column, allowCustomColor)
|
||||
public AtlasLargeTile(string name, string internalName, int row, int column, int rowSpan, int columnSpan, bool allowCustomColor)
|
||||
: base(name, internalName, row: row, column: column, allowCustomColor: allowCustomColor)
|
||||
{
|
||||
RowSpan = Math.Max(1, rowSpan);
|
||||
ColumnSpan = Math.Max(1, columnSpan);
|
||||
|
||||
@@ -54,8 +54,8 @@ namespace PckStudio.Core
|
||||
|
||||
public override Size GetSize(Size tileSize) => new Size(RowSpan * tileSize.Width * (Direction == ImageLayoutDirection.Horizontal ? _frameCount : 1), ColumnSpan * tileSize.Height * (Direction == ImageLayoutDirection.Vertical ? _frameCount : 1));
|
||||
|
||||
public AtlasLargeTileAnimation(string name, int row, int column, int rowSpan, int columnSpan, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME, bool allowCustomColor = default)
|
||||
: base(name, row, column, allowCustomColor)
|
||||
public AtlasLargeTileAnimation(string name, string internalName, int row, int column, int rowSpan, int columnSpan, int frameCount, ImageLayoutDirection direction, int frameTime = Animation.MINIMUM_FRAME_TIME, bool allowCustomColor = default)
|
||||
: base(name, internalName, row: row, column: column, allowCustomColor: allowCustomColor)
|
||||
{
|
||||
_frameCount = Math.Abs(frameCount);
|
||||
RowSpan = Math.Max(1, rowSpan);
|
||||
@@ -69,7 +69,7 @@ namespace PckStudio.Core
|
||||
{
|
||||
for (int i = 0; i < _frameCount; i++)
|
||||
{
|
||||
yield return new AtlasLargeTile($"{Name}_{i}", Row + (Direction == ImageLayoutDirection.Horizontal ? i * RowSpan : 0), Column + (Direction == ImageLayoutDirection.Vertical ? i * ColumnSpan : 0), RowSpan, ColumnSpan, AllowCustomColor);
|
||||
yield return new AtlasLargeTile($"{Name}_{i}", $"{Name}_{i}", Row + (Direction == ImageLayoutDirection.Horizontal ? i * RowSpan : 0), Column + (Direction == ImageLayoutDirection.Vertical ? i * ColumnSpan : 0), RowSpan, ColumnSpan, AllowCustomColor);
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace PckStudio.Core
|
||||
{
|
||||
private JsonRowAndColumn _overlayAtlasLocation;
|
||||
|
||||
public AtlasOverlayGroup(string name, int row, int column, JsonRowAndColumn overlayAtlasLocation, bool allowCustomColor)
|
||||
: base(name, row, column, allowCustomColor)
|
||||
public AtlasOverlayGroup(string name, string internalName, int row, int column, JsonRowAndColumn overlayAtlasLocation, bool allowCustomColor)
|
||||
: base(name, internalName, row: row, column: column, allowCustomColor: allowCustomColor)
|
||||
{
|
||||
_overlayAtlasLocation = overlayAtlasLocation;
|
||||
}
|
||||
|
||||
18
PckStudio.Core/Extensions/ListenerExtensions.cs
Normal file
18
PckStudio.Core/Extensions/ListenerExtensions.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PckStudio.Core.Extensions
|
||||
{
|
||||
public static class DebugEx
|
||||
{
|
||||
public static void WriteLine<T>(IEnumerable<T> values)
|
||||
{
|
||||
foreach (T value in values)
|
||||
Debug.WriteLine(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OMI.Formats.Archive;
|
||||
using OMI.Formats.FUI;
|
||||
using OMI.Workers.FUI;
|
||||
using PckStudio.Core.Deserializer;
|
||||
using PckStudio.Core.DLC;
|
||||
using PckStudio.Core.Extensions;
|
||||
@@ -18,8 +21,7 @@ namespace PckStudio.Core.IO.Java
|
||||
public class ResourcePackImporter
|
||||
{
|
||||
internal const int TARGET_FORMAT_VERSION = 4;
|
||||
private const string JAVA_RESOURCE_PACK_PATH = "assets/minecraft/";
|
||||
private const string JAVA_TEXTURES_PATH = "textures";
|
||||
private const string JAVA_RESOURCE_PACK_PATH = "assets/minecraft/textures";
|
||||
|
||||
static readonly IReadOnlyDictionary<Version, IMinecraftJavaVersion> _formatVeriosnToGameVersion = new Dictionary<Version, IMinecraftJavaVersion>()
|
||||
{
|
||||
@@ -71,7 +73,7 @@ namespace PckStudio.Core.IO.Java
|
||||
private readonly LCEGameVersion _gameVersion;
|
||||
private string _name;
|
||||
private ImportStatusReport _importStatus;
|
||||
private McPackmeta.McPack _packMeta;
|
||||
private McPack _packMeta;
|
||||
private Dictionary<string, ZipArchiveEntry> _resoursePackData;
|
||||
|
||||
public ResourcePackImporter(LCEGameVersion gameVersion)
|
||||
@@ -79,7 +81,9 @@ namespace PckStudio.Core.IO.Java
|
||||
_gameVersion = gameVersion;
|
||||
}
|
||||
|
||||
public static bool IsJavaResourcePack(ZipArchive zip) => zip.GetEntry("pack.mcmeta") is not null;
|
||||
public static bool IsJavaResourcePack(ZipArchive zip)
|
||||
=> zip.GetEntry("pack.mcmeta") is not null &&
|
||||
McMeta.LoadMcMeta(zip.GetEntry("pack.mcmeta").ReadAllText()).Contains("pack");
|
||||
|
||||
public bool StartImport(string name, ZipArchive zip, ImportStatusReport importStatus)
|
||||
{
|
||||
@@ -89,17 +93,16 @@ namespace PckStudio.Core.IO.Java
|
||||
return false;
|
||||
}
|
||||
_name = name;
|
||||
_importStatus = importStatus;
|
||||
_importStatus = importStatus ?? ImportStatusReport.CreateEmpty();
|
||||
_packMeta = ReadPackMeta(zip);
|
||||
string path = Path.Combine(JAVA_RESOURCE_PACK_PATH, JAVA_TEXTURES_PATH);
|
||||
_resoursePackData = zip.GetDirectoryContent(path, includeSubDirectories: true).ToDictionary(e => e.FullName.Substring(path.Length + 1));
|
||||
_resoursePackData = zip.GetDirectoryContent(JAVA_RESOURCE_PACK_PATH, includeSubDirectories: true).ToDictionary(e => e.FullName.Substring(JAVA_RESOURCE_PACK_PATH.Length + 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
public McPackmeta.McPack ReadPackMeta(ZipArchive zip)
|
||||
public McPack ReadPackMeta(ZipArchive zip)
|
||||
{
|
||||
StreamReader packmeta = new StreamReader(zip.GetEntry("pack.mcmeta").Open());
|
||||
McPackmeta.McPack pack = JsonConvert.DeserializeObject<McPackmeta>(packmeta.ReadToEnd()).Pack;
|
||||
string json = zip.GetEntry("pack.mcmeta").ReadAllText();
|
||||
McPack pack = McMeta.LoadMcMeta(json)["pack"].ToObject<McPack>();
|
||||
if (pack.Format == TARGET_FORMAT_VERSION)
|
||||
_importStatus.Post("Target format version... less work?");
|
||||
_importStatus.Post($"Importing textures from resource pack of version: {GetJavaGameVersionFromResourcePackFormat(pack.Format)}(Format:{pack.Format})");
|
||||
@@ -152,14 +155,36 @@ namespace PckStudio.Core.IO.Java
|
||||
|
||||
ImportResult<(Dictionary<string, Image> mobs, Dictionary<string, Image> items), TextureImportStats> entityModelTextures = ImportEntityModels();
|
||||
|
||||
ImportResult<Dictionary<string, Image>, TextureImportStats> misc = ImportMisc();
|
||||
|
||||
const int cCHEST_BREAK_TEXTURE = 149;
|
||||
const int cENDERCHEST_BREAK_TEXTURE = 150;
|
||||
if (entityModelTextures.Result.items.TryGetValue("item/chest", out Image chest))
|
||||
{
|
||||
block.Result.Atlas[cCHEST_BREAK_TEXTURE].Texture = chest.Resize(block.Result.Atlas.TileSize, GraphicsConfig.PixelPerfect());
|
||||
block.Stats.textures++;
|
||||
}
|
||||
|
||||
if (entityModelTextures.Result.items.TryGetValue("item/enderchest", out Image enderchest))
|
||||
{
|
||||
block.Result.Atlas[cENDERCHEST_BREAK_TEXTURE].Texture = enderchest.Resize(block.Result.Atlas.TileSize, GraphicsConfig.PixelPerfect());
|
||||
block.Stats.textures++;
|
||||
}
|
||||
|
||||
ConsoleArchive mediaArc = default;
|
||||
if (MessageBoxEx.AskQuestion("Import UI?\nThis will take more time to import!", "Include UI", System.Windows.MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes)
|
||||
{
|
||||
mediaArc = ImportUI();
|
||||
}
|
||||
|
||||
DLCTexturePackage.MetaData metaData = new DLCTexturePackage.MetaData(null, _packMeta.Icon);
|
||||
|
||||
int id = new Random().Next(0, GameConstants.MAX_PACK_ID - 1);
|
||||
|
||||
TextureImportStats stats = block.Stats + item.Stats + particles.Stats + envData.Stats + armorSets.Stats + entityModelTextures.Stats;
|
||||
TextureImportStats stats = block.Stats + item.Stats + particles.Stats + envData.Stats + armorSets.Stats + entityModelTextures.Stats + misc.Stats;
|
||||
|
||||
string name = ConvertJavaTextFormatToLCE(_name.Replace("_", " "));
|
||||
string description = ConvertJavaTextFormatToLCE(_packMeta.Description);
|
||||
string name = JavaConstants.EsapceMiencarftJavaFormat(_name.Replace("_", " "));
|
||||
string description = JavaConstants.ConvertJavaTextFormatToHTML(_packMeta.Description);
|
||||
|
||||
DLCTexturePackage dlcTexturePackage = new DLCTexturePackage(name, description, id,
|
||||
metaData,
|
||||
@@ -187,32 +212,27 @@ namespace PckStudio.Core.IO.Java
|
||||
itemAnimations: item.Result.Animations,
|
||||
blockAnimations: block.Result.Animations,
|
||||
sun: envData.Result.sun,
|
||||
moon: null, parentPackage: null);
|
||||
moon: null,
|
||||
mediaArc: mediaArc,
|
||||
misc: misc.Result,
|
||||
parentPackage: null);
|
||||
return new ImportResult<DLCTexturePackage, TextureImportStats>(dlcTexturePackage, stats);
|
||||
}
|
||||
|
||||
private string ConvertJavaTextFormatToLCE(string text)
|
||||
private ImportResult<Dictionary<string, Image>, TextureImportStats> ImportMisc()
|
||||
{
|
||||
string[] sections = text.Split(['§'], StringSplitOptions.RemoveEmptyEntries);
|
||||
if (sections.Length == 0 || sections.Length == 1)
|
||||
return text;
|
||||
string formatText = string.Join("", sections
|
||||
.Select(s => {
|
||||
if (string.IsNullOrWhiteSpace(s) || !(s.Length > 1))
|
||||
return s;
|
||||
string colorFormat = "§" + s[0];
|
||||
string colorText = s.Substring(1);
|
||||
if (JavaConstants.JavaColorCodeToColor.TryGetValue(colorFormat, out (Color foreground, Color background) color))
|
||||
{
|
||||
string htmlColor = color.foreground.ToHTMLColor();
|
||||
if (colorText.EndsWith("\n"))
|
||||
return $"<font color=\"{htmlColor}\">{colorText.Substring(0, colorText.Length - 1)}</font>\n";
|
||||
return $"<font color=\"{htmlColor}\">{colorText}</font>";
|
||||
}
|
||||
return s;
|
||||
Dictionary<string, Image> res = new Dictionary<string, Image>();
|
||||
TextureImportStats stats = new TextureImportStats(latest2lce_misc.Count);
|
||||
foreach (KeyValuePair<string, JavaResourceConvertJson> item in latest2lce_misc)
|
||||
{
|
||||
if (GetEntries(item.Key).FirstOrDefault().Value is ZipArchiveEntry entry)
|
||||
{
|
||||
Image texture = entry.GetImage();
|
||||
res.Add(item.Value.LceName, texture);
|
||||
stats.textures++;
|
||||
}
|
||||
));
|
||||
return formatText;
|
||||
}
|
||||
return new ImportResult<Dictionary<string, Image>, TextureImportStats>(res, stats);
|
||||
}
|
||||
|
||||
private Animation ImportAnimation(string suffix, AtlasResource.AtlasType atlasType)
|
||||
@@ -232,42 +252,45 @@ namespace PckStudio.Core.IO.Java
|
||||
|
||||
public ImportResult<(Atlas Atlas, IDictionary<string, Animation> Animations), TextureImportStats> ImportAtlas(AtlasResource atlasResource)
|
||||
{
|
||||
_importStatus.Post($"[{nameof(ImportAtlas)}] Importing: '{atlasResource.Path}'");
|
||||
_importStatus.Post($"[{nameof(ImportAtlas)}] Importing: Atlas('{atlasResource.Path}')");
|
||||
Atlas atlas = Atlas.CreateDefault(atlasResource, _gameVersion);
|
||||
string path = GetAtlasPathFromFormat(_packMeta.Format, atlasResource.Type);
|
||||
IDictionary<string, ZipArchiveEntry> entries = GetEntries(path);
|
||||
|
||||
IReadOnlyDictionary<string, JavaResourceConvertJson> lookUpTable = GetVersionLookUpTable(atlasResource.Type);
|
||||
|
||||
IEnumerable<(int index, JsonTileInfo value)> a = atlasResource.TilesInfo.Enumerate().GroupBy(it => it.value.InternalName).Select(grp => grp.FirstOrDefault());
|
||||
IEnumerable<(int index, JsonTileInfo value)> a = atlasResource.TilesInfo.Select((v, i) => (i, v)).GroupBy(it => it.v.InternalName).Select(grp => grp.FirstOrDefault());
|
||||
IReadOnlyDictionary<string, int> map = a.ToDictionary(tileInfo => string.IsNullOrEmpty(tileInfo.value.InternalName) ? $"{Guid.NewGuid()}.{tileInfo.index}" : tileInfo.value.InternalName.ToLowerInvariant(), it => it.index);
|
||||
|
||||
IReadOnlyDictionary<string, ZipArchiveEntry> javaAnimations = entries.Values.Where(e => e.FullName.EndsWith(".mcmeta")).ToDictionary(entry => entry.FullName);
|
||||
IReadOnlyDictionary<string, ZipArchiveEntry> mcMetaFiles = entries.Values.Where(e => e.FullName.EndsWith(".mcmeta")).ToDictionary(entry => entry.FullName);
|
||||
|
||||
TextureImportStats stats = new TextureImportStats(atlasResource.TilesInfo.Where(t => !string.IsNullOrWhiteSpace(t.InternalName)).Count());
|
||||
IDictionary<string, Animation> animations = new Dictionary<string, Animation>();
|
||||
foreach (ZipArchiveEntry entry in entries.Values)
|
||||
{
|
||||
_importStatus.Post(entry.FullName);
|
||||
if (!entry.FullName.EndsWith(".png"))
|
||||
continue;
|
||||
string name = Path.GetFileNameWithoutExtension(entry.FullName);
|
||||
if (!map.TryGetValue(name, out int index) && !(lookUpTable.TryGetValue(name, out JavaResourceConvertJson lceKey) && map.TryGetValue(lceKey.LceName.ToLowerInvariant(), out index)) || !index.IsWithinRangeOf(0, atlas.TileCount - 1))
|
||||
bool isPartOfGroup = atlasResource.AtlasGroups.Any(grp => grp.InternalName == name);
|
||||
if (!map.TryGetValue(name, out int index) &&
|
||||
!isPartOfGroup &&
|
||||
!(lookUpTable.TryGetValue(name, out JavaResourceConvertJson lceKey) && map.TryGetValue(lceKey.LceName.ToLowerInvariant(), out index)) || !index.IsWithinRangeOf(0, atlas.TileCount - 1))
|
||||
continue;
|
||||
|
||||
JsonTileInfo tileInfo = atlas[index]?.GetUserDataOfType<JsonTileInfo>();
|
||||
AtlasGroup atlasGroup = atlasResource.AtlasGroups.FirstOrDefault(grp => grp.InternalName == name);
|
||||
AtlasTile tile = isPartOfGroup ? atlas[atlasGroup.Row, atlasGroup.Column] : atlas[index];
|
||||
JsonTileInfo tileInfo = tile?.GetUserDataOfType<JsonTileInfo>();
|
||||
|
||||
Image img = entry.GetImage();
|
||||
bool hasMcMeta = javaAnimations.TryGetValue(entry.FullName + ".mcmeta", out ZipArchiveEntry archiveEntry);
|
||||
bool hasMcMeta = mcMetaFiles.TryGetValue(entry.FullName + ".mcmeta", out ZipArchiveEntry archiveEntry);
|
||||
if (hasMcMeta)
|
||||
{
|
||||
string jsonData = archiveEntry.ReadAllText();
|
||||
Debug.WriteLine(jsonData);
|
||||
JObject mcMetaJson = JObject.Parse(jsonData);
|
||||
McMeta mcMeta = McMeta.LoadMcMeta(jsonData);
|
||||
string animationName = tileInfo?.InternalName ?? name;
|
||||
if (mcMetaJson["animation"] != null && !animations.ContainsKey(animationName))
|
||||
if (mcMeta.Contains("animation") && !animations.ContainsKey(animationName))
|
||||
{
|
||||
Animation animation = AnimationDeserializer.DefaultDeserializer.DeserializeJavaAnimation(mcMetaJson, img);
|
||||
Animation animation = AnimationDeserializer.DefaultDeserializer.DeserializeJavaAnimation(mcMeta, img);
|
||||
if (animation.FrameCount > 0)
|
||||
animations.Add(animationName, animation);
|
||||
stats.animations++;
|
||||
@@ -275,7 +298,13 @@ namespace PckStudio.Core.IO.Java
|
||||
stats.textures++;
|
||||
}
|
||||
}
|
||||
atlas[index].Texture = img;
|
||||
if (isPartOfGroup && atlasGroup is not null)
|
||||
{
|
||||
atlas.SetGroup(atlasGroup, img);
|
||||
continue;
|
||||
}
|
||||
|
||||
tile.Texture = img;
|
||||
stats.textures++;
|
||||
}
|
||||
ImportResult<(Atlas atlas, IDictionary<string, Animation> animations), TextureImportStats> result = new ImportResult<(Atlas atlas, IDictionary<string, Animation> animations), TextureImportStats>((atlas, animations), stats);
|
||||
@@ -288,6 +317,7 @@ namespace PckStudio.Core.IO.Java
|
||||
static readonly IReadOnlyDictionary<string, JavaResourceConvertJson> latest2lce_blocks = JsonConvert.DeserializeObject<Dictionary<string, JavaResourceConvertJson>>(Resources.latest2lce_blocks);
|
||||
static readonly IReadOnlyDictionary<string, JavaResourceConvertJson> latest2lce_items = JsonConvert.DeserializeObject<Dictionary<string, JavaResourceConvertJson>>(Resources.latest2lce_items);
|
||||
static readonly IReadOnlyDictionary<string, JavaResourceConvertJson> latest2lce_entities = JsonConvert.DeserializeObject<Dictionary<string, JavaResourceConvertJson>>(Resources.latest2lce_entities);
|
||||
static readonly IReadOnlyDictionary<string, JavaResourceConvertJson> latest2lce_misc = JsonConvert.DeserializeObject<Dictionary<string, JavaResourceConvertJson>>(Resources.latest2lce_misc);
|
||||
|
||||
class JavaResourceConvertJson
|
||||
{
|
||||
@@ -353,11 +383,11 @@ namespace PckStudio.Core.IO.Java
|
||||
Size s = source.Size;
|
||||
if (textureRemap.SourceSize != Size.Empty || textureRemap.TargetSize != Size.Empty)
|
||||
{
|
||||
xSclar = source.Width / textureRemap.SourceSize.Width;
|
||||
ySclar = source.Height / textureRemap.SourceSize.Height;
|
||||
xSclar = Math.Max(source.Width / textureRemap.SourceSize.Width, 1);
|
||||
ySclar = Math.Max(source.Height / textureRemap.SourceSize.Height, 1);
|
||||
s = textureRemap.TargetSize;
|
||||
}
|
||||
Image res = new Bitmap(s.Width * xSclar, s.Height* ySclar);
|
||||
Image res = new Bitmap(s.Width * xSclar, s.Height * ySclar);
|
||||
|
||||
using Graphics g = Graphics.FromImage(res);
|
||||
g.ApplyConfig(GraphicsConfig.PixelPerfect());
|
||||
@@ -372,7 +402,7 @@ namespace PckStudio.Core.IO.Java
|
||||
{
|
||||
if (remapArea.Rotation == 90f)
|
||||
sourceAreaImg.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
if (remapArea.Rotation == -90f)
|
||||
if (remapArea.Rotation == -90f || remapArea.Rotation == 270f)
|
||||
sourceAreaImg.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
||||
if (remapArea.Rotation == 180f)
|
||||
sourceAreaImg.RotateFlip(RotateFlipType.Rotate180FlipNone);
|
||||
@@ -432,6 +462,7 @@ namespace PckStudio.Core.IO.Java
|
||||
|
||||
private ImportResult<(ArmorSet Leather, ArmorSet Chain, ArmorSet Gold, ArmorSet Iron, ArmorSet Diamond, ArmorSet Turtle), TextureImportStats> ImportArmorSets()
|
||||
{
|
||||
_importStatus.Post($"[{nameof(ImportArmorSets)}] Importing: Armor");
|
||||
string path = Path.Combine("models", "armor");
|
||||
IDictionary<string, ZipArchiveEntry> entries = GetEntries(path, ".png");
|
||||
|
||||
@@ -475,6 +506,8 @@ namespace PckStudio.Core.IO.Java
|
||||
|
||||
private ImportResult<(DLCTexturePackage.EnvironmentData environmentData, Atlas moonPhases, Image sun), TextureImportStats> ImportEnvironmentData()
|
||||
{
|
||||
_importStatus.Post($"[{nameof(ImportEnvironmentData)}] Importing: Environment Data");
|
||||
|
||||
string path = Path.Combine("environment");
|
||||
|
||||
IDictionary<string, ZipArchiveEntry> entries = GetEntries(path, ".png");
|
||||
@@ -498,8 +531,11 @@ namespace PckStudio.Core.IO.Java
|
||||
return new ImportResult<(DLCTexturePackage.EnvironmentData environmentData, Atlas moonPhases, Image sun), TextureImportStats>((environmentData, moonPhases, sun), stats);
|
||||
}
|
||||
|
||||
//! TODO: fix villiager (v1.14 or higher), husk(64x64=>64x32),
|
||||
private ImportResult<(Dictionary<string, Image> mobs, Dictionary<string, Image> items), TextureImportStats> ImportEntityModels()
|
||||
{
|
||||
_importStatus.Post($"[{nameof(ImportArmorSets)}] Importing: Entity Models");
|
||||
|
||||
string path = "entity";
|
||||
IDictionary<string, ZipArchiveEntry> entries = GetEntries(path, ".png", includeSubDirectories: true);
|
||||
|
||||
@@ -663,7 +699,7 @@ namespace PckStudio.Core.IO.Java
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_packMeta.Format > 5)
|
||||
if (_packMeta.Format > TARGET_FORMAT_VERSION)
|
||||
{
|
||||
if (!items.ContainsKey("item/largechest") && GetLargeChestTexture("normal", out Image texture))
|
||||
{
|
||||
@@ -675,8 +711,315 @@ namespace PckStudio.Core.IO.Java
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new ImportResult<(Dictionary<string, Image> mobs, Dictionary<string, Image> items), TextureImportStats>((mobs, items), stats);
|
||||
}
|
||||
|
||||
private ConsoleArchive ImportUI()
|
||||
{
|
||||
_importStatus.Post($"[{nameof(ImportArmorSets)}] Importing: UI");
|
||||
|
||||
IDictionary<string, ZipArchiveEntry> javaGui = GetEntries("gui", includeSubDirectories: true);
|
||||
|
||||
ConsoleArchive mediaArc = new ConsoleArchive();
|
||||
|
||||
FourjUserInterface skinHud = new FourjUIReader().FromStream(new MemoryStream(Resources.skinHud));
|
||||
|
||||
|
||||
FourjUserInterface skinGraphicsHud = new FourjUIReader().FromStream(new MemoryStream(Resources.skinGraphicsHud));
|
||||
FourjUserInterface skinGraphicsInGame = new FourjUIReader().FromStream(new MemoryStream(Resources.skinGraphicsInGame));
|
||||
|
||||
FourjUserInterface skinPlatform = new FourjUIReader().FromStream(new MemoryStream(Resources.skinWiiU));
|
||||
// skinWiiU.fui
|
||||
if (
|
||||
javaGui.TryGetValue("title/background/panorama_0.png", out ZipArchiveEntry panorama0Entry) &&
|
||||
javaGui.TryGetValue("title/background/panorama_1.png", out ZipArchiveEntry panorama1Entry) &&
|
||||
javaGui.TryGetValue("title/background/panorama_2.png", out ZipArchiveEntry panorama2Entry) &&
|
||||
javaGui.TryGetValue("title/background/panorama_3.png", out ZipArchiveEntry panorama3Entry))
|
||||
{
|
||||
|
||||
Image panorama0Texture = panorama0Entry.GetImage();
|
||||
Image panorama1Texture = panorama1Entry.GetImage();
|
||||
Image panorama2Texture = panorama2Entry.GetImage();
|
||||
Image panorama3Texture = panorama3Entry.GetImage();
|
||||
|
||||
//! TODO: make more efficent !? -null
|
||||
Image panorama = new Image[] { panorama0Texture, panorama1Texture, panorama2Texture, panorama3Texture }.Combine(ImageLayoutDirection.Horizontal);
|
||||
panorama = panorama.Resize(new Size(820, 144), GraphicsConfig.PixelPerfect());
|
||||
skinPlatform.SetSymbol("Panorama_Background_S", panorama);
|
||||
skinPlatform.SetSymbol("Panorama_Background_N", panorama);
|
||||
|
||||
}
|
||||
if (javaGui.TryGetValue("title/minecraft.png", out ZipArchiveEntry minecraftLogo))
|
||||
skinPlatform.SetSymbol("MenuTitle", minecraftLogo.GetImage());
|
||||
|
||||
FuiTimeline hudTimeline = skinHud.GetNamedTimeline("fourj.FJ_Hud");
|
||||
|
||||
// base size : 256x256
|
||||
if (javaGui.TryGetValue("widgets.png", out ZipArchiveEntry widgetsEntry))
|
||||
{
|
||||
Image widgetsTexture = widgetsEntry.GetImage();
|
||||
Size baseSize = new Size(256, 256);
|
||||
Size targetSize = widgetsTexture.Size;
|
||||
Size scale = new Size(Math.Max(targetSize.Width / baseSize.Width, 1), Math.Max(targetSize.Height / baseSize.Height, 1));
|
||||
Image hotbarItemBackTexture = widgetsTexture.GetArea(0, 0, 182, 22, scale);
|
||||
Image hotbarItemSelectedTexture = widgetsTexture.GetArea(0, 22, 24, 24, scale);
|
||||
Image hotbarOffhandSlotTexture = widgetsTexture.GetArea(24, 23, 22, 22, scale);
|
||||
skinGraphicsHud.SetSymbol("hotbar_item_back", hotbarItemBackTexture);
|
||||
skinGraphicsHud.SetSymbol("hotbar_item_selected", hotbarItemSelectedTexture);
|
||||
skinGraphicsHud.SetSymbol("hotbar_offhand_slot", hotbarOffhandSlotTexture);
|
||||
|
||||
FuiTimelineEvent fuiTimelineEvent = hudTimeline.FindNamedEvent("HotBar");
|
||||
FuiTimeline eventTimelineHotbar = skinHud.GetEventTimeline(fuiTimelineEvent);
|
||||
// event 0 is a ref named "hotbar_item_back"
|
||||
eventTimelineHotbar.Frames[0].Events[0].Matrix = System.Numerics.Matrix3x2.CreateScale(3f / scale.Width, 3f / scale.Height);
|
||||
eventTimelineHotbar.FindNamedEvent("HotbarSelector").Matrix *= System.Numerics.Matrix3x2.CreateScale(1f / scale.Width, 1f / scale.Height);
|
||||
}
|
||||
|
||||
// base size : 256x256
|
||||
if (javaGui.TryGetValue("icons.png", out ZipArchiveEntry iconsEntry))
|
||||
{
|
||||
Image iconsTexture = iconsEntry.GetImage();
|
||||
Size iconSize = new Size(9, 9);
|
||||
|
||||
Size baseSize = new Size(256, 256);
|
||||
Size targetSize = iconsTexture.Size;
|
||||
Size scale = new Size(Math.Max(targetSize.Width / baseSize.Width, 1), Math.Max(targetSize.Height / baseSize.Height, 1));
|
||||
|
||||
skinHud.GetEventTimeline(hudTimeline.FindNamedEvent("FJ_ArmourBar")).Frames[0].Events[0].Matrix *= System.Numerics.Matrix3x2.CreateScale(1f / scale.Width, 1f / scale.Height);
|
||||
skinHud.GetEventTimeline(hudTimeline.FindNamedEvent("ExpBar")).Frames[0].Events[0].Matrix *= System.Numerics.Matrix3x2.CreateScale(1f / scale.Width, 1f / scale.Height);
|
||||
skinHud.GetEventTimeline(hudTimeline.FindNamedEvent("FJ_FoodBar")).Frames[0].Events[0].Matrix *= System.Numerics.Matrix3x2.CreateScale(1f / scale.Width, 1f / scale.Height);
|
||||
|
||||
DebugEx.WriteLine(skinHud.GetEventTimeline(hudTimeline.FindNamedEvent("FJ_ArmourBar")).Frames[0].Events);
|
||||
DebugEx.WriteLine(skinHud.GetEventTimeline(hudTimeline.FindNamedEvent("ExpBar")).Frames[0].Events);
|
||||
DebugEx.WriteLine(skinHud.GetEventTimeline(hudTimeline.FindNamedEvent("FJ_FoodBar")).Frames[0].Events);
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Crosshair", iconsTexture.GetArea(0, 0, 15, 15, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("experience_bar_empty", iconsTexture.GetArea(0, 64, 182, 5, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("experience_bar_full", iconsTexture.GetArea(0, 69, 182, 5, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HorseJump_bar_empty", iconsTexture.GetArea(0, 84, 182, 5, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HorseJump_bar_full", iconsTexture.GetArea(0, 89, 182, 5, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Background", iconsTexture.GetArea(new Point(16, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Background_Flash", iconsTexture.GetArea(new Point(25, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Full", iconsTexture.GetArea(new Point(52, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Half", iconsTexture.GetArea(new Point(61, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Flash", iconsTexture.GetArea(new Point(70, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Flash", iconsTexture.GetArea(new Point(79, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Poison", iconsTexture.GetArea(new Point(88, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Poison", iconsTexture.GetArea(new Point(97, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Poison_Flash", iconsTexture.GetArea(new Point(106, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Poison_Flash", iconsTexture.GetArea(new Point(115, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Wither", iconsTexture.GetArea(new Point(124, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Wither", iconsTexture.GetArea(new Point(133, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Wither_Flash", iconsTexture.GetArea(new Point(142, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Wither_Flash", iconsTexture.GetArea(new Point(151, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Absorb", iconsTexture.GetArea(new Point(160, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Absorb", iconsTexture.GetArea(new Point(169, 0), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Armour_Empty", iconsTexture.GetArea(new Point(16, 9), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Armour_Half", iconsTexture.GetArea(new Point(25, 9), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Armour_Full", iconsTexture.GetArea(new Point(34, 9), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Air_Bubble", iconsTexture.GetArea(new Point(16, 18), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Air_Pop", iconsTexture.GetArea(new Point(25, 18), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Background", iconsTexture.GetArea(new Point(16, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Background_Flash", iconsTexture.GetArea(new Point(25, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full", iconsTexture.GetArea(new Point(52, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half", iconsTexture.GetArea(new Point(61, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full_Flash", iconsTexture.GetArea(new Point(70, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half_Flash", iconsTexture.GetArea(new Point(79, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full_Poison", iconsTexture.GetArea(new Point(88, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half_Poison", iconsTexture.GetArea(new Point(97, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full_Poison_Flash", iconsTexture.GetArea(new Point(106, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half_Poison_Flash", iconsTexture.GetArea(new Point(115, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Background_Poison", iconsTexture.GetArea(new Point(133, 27), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Full", iconsTexture.GetArea(new Point(88, 9), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Half", iconsTexture.GetArea(new Point(97, 9), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Full_Flash", iconsTexture.GetArea(new Point(106, 9), iconSize, scale));
|
||||
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Half_Flash", iconsTexture.GetArea(new Point(115, 9), iconSize, scale));
|
||||
|
||||
}
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/crosshair.png", out ZipArchiveEntry crosshairEntry))
|
||||
skinGraphicsHud.SetSymbol("HUD_Crosshair", crosshairEntry.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/hotbar.png", out ZipArchiveEntry hotbar))
|
||||
skinGraphicsHud.SetSymbol("hotbar_item_back", hotbar.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/hotbar_selection.png", out ZipArchiveEntry hotbar_selection))
|
||||
skinGraphicsHud.SetSymbol("hotbar_item_selected", hotbar_selection.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/hotbar_offhand_left.png", out ZipArchiveEntry hotbar_offhand_left))
|
||||
skinGraphicsHud.SetSymbol("hotbar_offhand_slot", hotbar_offhand_left.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/experience_bar_background.png", out ZipArchiveEntry experienceBarBackgroundEntry))
|
||||
skinGraphicsHud.SetSymbol("experience_bar_empty", experienceBarBackgroundEntry.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/experience_bar_progress.png", out ZipArchiveEntry experience_bar_progress))
|
||||
skinGraphicsHud.SetSymbol("experience_bar_full", experience_bar_progress.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/jump_bar_background.png", out ZipArchiveEntry jump_bar_background))
|
||||
skinGraphicsHud.SetSymbol("HorseJump_bar_empty", jump_bar_background.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/jump_bar_progress.png", out ZipArchiveEntry jump_bar_progress))
|
||||
skinGraphicsHud.SetSymbol("HorseJump_bar_full", jump_bar_progress.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/armor_empty.png", out ZipArchiveEntry armor_empty))
|
||||
skinGraphicsHud.SetSymbol("HUD_Armour_Empty", armor_empty.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/armor_half.png", out ZipArchiveEntry armor_half))
|
||||
skinGraphicsHud.SetSymbol("HUD_Armour_Half", armor_half.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/armor_full.png", out ZipArchiveEntry armor_full))
|
||||
skinGraphicsHud.SetSymbol("HUD_Armour_Full", armor_full.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/air.png", out ZipArchiveEntry air))
|
||||
skinGraphicsHud.SetSymbol("HUD_Air_Bubble", air.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/air_bursting.png", out ZipArchiveEntry air_bursting))
|
||||
skinGraphicsHud.SetSymbol("HUD_Air_Pop", air_bursting.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/container.png", out ZipArchiveEntry container))
|
||||
skinGraphicsHud.SetSymbol("Health_Background", container.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/container_blinking.png", out ZipArchiveEntry container_blinking))
|
||||
skinGraphicsHud.SetSymbol("Health_Background_Flash", container_blinking.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/full.png", out ZipArchiveEntry full))
|
||||
skinGraphicsHud.SetSymbol("Health_Full", full.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/full_blinking.png", out ZipArchiveEntry full_blinking))
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Flash", full_blinking.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/half.png", out ZipArchiveEntry half))
|
||||
skinGraphicsHud.SetSymbol("Health_Half", half.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/half_blinking.png", out ZipArchiveEntry half_blinking))
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Flash", half_blinking.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/poisoned_full.png", out ZipArchiveEntry poisoned_full))
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Poison", poisoned_full.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/poisoned_half.png", out ZipArchiveEntry poisoned_half))
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Poison", poisoned_half.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/poisoned_full_blinking.png", out ZipArchiveEntry poisoned_full_blinking))
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Poison_Flash", poisoned_full_blinking.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/poisoned_half_blinking.png", out ZipArchiveEntry poisoned_half_blinking))
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Poison_Flash", poisoned_half_blinking.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/withered_full.png", out ZipArchiveEntry withered_full))
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Wither", withered_full.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/withered_half.png", out ZipArchiveEntry withered_half))
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Wither", withered_half.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/withered_full_blinking.png", out ZipArchiveEntry withered_full_blinking))
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Wither_Flash", withered_full_blinking.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/withered_half_blinking.png", out ZipArchiveEntry withered_half_blinking))
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Wither_Flash", withered_half_blinking.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/absorbing_full.png", out ZipArchiveEntry absorbing_full))
|
||||
skinGraphicsHud.SetSymbol("Health_Full_Absorb", absorbing_full.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/absorbing_half.png", out ZipArchiveEntry absorbing_half))
|
||||
skinGraphicsHud.SetSymbol("Health_Half_Absorb", absorbing_half.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/food_empty.png", out ZipArchiveEntry food_empty))
|
||||
{
|
||||
Image food_emptyTexture = food_empty.GetImage();
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Background", food_emptyTexture);
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Background_Flash", food_emptyTexture);
|
||||
}
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/food_full.png", out ZipArchiveEntry food_full))
|
||||
{
|
||||
Image food_fullTexture = food_full.GetImage();
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full", food_fullTexture);
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full_Flash", food_fullTexture);
|
||||
}
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/food_half.png", out ZipArchiveEntry food_half))
|
||||
{
|
||||
Image food_halfTexture = food_half.GetImage();
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half", food_halfTexture);
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half_Flash", food_halfTexture);
|
||||
}
|
||||
if (javaGui.TryGetValue("sprites/hud/food_full_hunger.png", out ZipArchiveEntry food_full_hunger))
|
||||
{
|
||||
Image food_full_hungerTexture = food_full_hunger.GetImage();
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full_Poison", food_full_hungerTexture);
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Full_Poison_Flash", food_full_hungerTexture);
|
||||
}
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/food_half_hunger.png", out ZipArchiveEntry food_half_hunger))
|
||||
{
|
||||
Image food_half_hungerTexture = food_half_hunger.GetImage();
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half_Poison", food_half_hungerTexture);
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Half_Poison_Flash", food_half_hungerTexture);
|
||||
}
|
||||
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/food_empty_hunger.png", out ZipArchiveEntry food_empty_hunger))
|
||||
skinGraphicsHud.SetSymbol("HUD_Food_Background_Poison", food_empty_hunger.GetImage());
|
||||
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/vehicle_full.png", out ZipArchiveEntry vehicle_full))
|
||||
{
|
||||
Image vehicle_fullfTexture = vehicle_full.GetImage();
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Full", vehicle_fullfTexture);
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Full_Flash", vehicle_fullfTexture);
|
||||
}
|
||||
if (javaGui.TryGetValue("sprites/hud/heart/vehicle_half.png", out ZipArchiveEntry vehicle_half))
|
||||
{
|
||||
Image vehicle_halfTexture = vehicle_half.GetImage();
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Half", vehicle_halfTexture);
|
||||
skinGraphicsHud.SetSymbol("HorseHealth_Half_Flash", vehicle_halfTexture);
|
||||
}
|
||||
|
||||
mediaArc.Add("skinHud.fui", new FourjUIWriter(skinHud));
|
||||
mediaArc.Add("skinWiiU.fui", new FourjUIWriter(skinPlatform));
|
||||
mediaArc.Add("skinGraphicsHud.fui", new FourjUIWriter(skinGraphicsHud));
|
||||
|
||||
return mediaArc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Extensions\DirectoryInfoExtensions.cs" />
|
||||
<Compile Include="Extensions\FileInfoExtensions.cs" />
|
||||
<Compile Include="Extensions\ListenerExtensions.cs" />
|
||||
<Compile Include="Extensions\MessageBoxEx.cs" />
|
||||
<Compile Include="Extensions\StringExtensions.cs" />
|
||||
<Compile Include="Extensions\ZipArchiveEntryExtensions.cs" />
|
||||
@@ -265,6 +266,12 @@
|
||||
<None Include="Resources\entityBehavioursData.json" />
|
||||
<None Include="Resources\entityMaterialsData.json" />
|
||||
<None Include="Resources\entityModelsData.json" />
|
||||
<None Include="Resources\fui\skinGraphics.fui" />
|
||||
<None Include="Resources\fui\skinGraphicsHud.fui" />
|
||||
<None Include="Resources\fui\skinGraphicsInGame.fui" />
|
||||
<None Include="Resources\fui\skinGraphicsLabels.fui" />
|
||||
<None Include="Resources\fui\skinHud.fui" />
|
||||
<None Include="Resources\fui\skinWiiU.fui" />
|
||||
<None Include="Resources\java\latest2lce_entities.json" />
|
||||
<None Include="Resources\java\latest2lce_paintings.json" />
|
||||
<None Include="Resources\entityModelMetaData.json" />
|
||||
|
||||
83
PckStudio.Core/Properties/Resources.Designer.cs
generated
83
PckStudio.Core/Properties/Resources.Designer.cs
generated
@@ -608,6 +608,29 @@ namespace PckStudio.Core.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {
|
||||
/// "misc/pumpkinblur": { "lce_name": "pumpkinblur" },
|
||||
/// "misc/shadow": { "lce_name": "shadow" },
|
||||
/// "misc/vignette": { "lce_name": "vignette" },
|
||||
/// "misc/underwater": { "lce_name": "water" },
|
||||
/// "misc/enchanted_item_glint": { "lce_name": "glint" },
|
||||
///
|
||||
/// "map/map_background": { "lce_name": "mapbg" },
|
||||
///
|
||||
/// "colormap/foliage": { "lce_name": "foliagecolor" },
|
||||
/// "colormap/grass": { "lce_name": "grasscolor" },
|
||||
///
|
||||
/// "environment/end_sky": { "lce_name": "tunnel" },
|
||||
///
|
||||
/// "particle/footprint": { "lce_name": "fo [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
public static string latest2lce_misc {
|
||||
get {
|
||||
return ResourceManager.GetString("latest2lce_misc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -868,6 +891,66 @@ namespace PckStudio.Core.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] skinGraphics {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("skinGraphics", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] skinGraphicsHud {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("skinGraphicsHud", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] skinGraphicsInGame {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("skinGraphicsInGame", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] skinGraphicsLabels {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("skinGraphicsLabels", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] skinHud {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("skinHud", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
public static byte[] skinWiiU {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("skinWiiU", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@@ -259,4 +259,25 @@
|
||||
<data name="latest2lce_entities" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\java\latest2lce_entities.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="latest2lce_misc" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\java\latest2lce_misc.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="skinGraphics" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fui\skinGraphics.fui;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="skinGraphicsHud" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fui\skinGraphicsHud.fui;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="skinGraphicsInGame" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fui\skinGraphicsInGame.fui;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="skinGraphicsLabels" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fui\skinGraphicsLabels.fui;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="skinWiiU" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fui\skinWiiU.fui;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="skinHud" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fui\skinHud.fui;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -49,6 +49,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Shulker/End Rod Glitter",
|
||||
"internalName": "glitter",
|
||||
"row": 0,
|
||||
"column": 11,
|
||||
"frameCount": 8,
|
||||
@@ -65,6 +66,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Firework Flash",
|
||||
"internalName": "flash",
|
||||
"row": 4,
|
||||
"column": 2,
|
||||
"rowSpan": 4,
|
||||
@@ -74,6 +76,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Bubble Pop (Unused)",
|
||||
"internalName": "bubble_pop",
|
||||
"row": 6,
|
||||
"column": 6,
|
||||
"frameCount": 5,
|
||||
|
||||
BIN
PckStudio.Core/Resources/fui/skinGraphics.fui
Normal file
BIN
PckStudio.Core/Resources/fui/skinGraphics.fui
Normal file
Binary file not shown.
BIN
PckStudio.Core/Resources/fui/skinGraphicsHud.fui
Normal file
BIN
PckStudio.Core/Resources/fui/skinGraphicsHud.fui
Normal file
Binary file not shown.
BIN
PckStudio.Core/Resources/fui/skinGraphicsInGame.fui
Normal file
BIN
PckStudio.Core/Resources/fui/skinGraphicsInGame.fui
Normal file
Binary file not shown.
BIN
PckStudio.Core/Resources/fui/skinGraphicsLabels.fui
Normal file
BIN
PckStudio.Core/Resources/fui/skinGraphicsLabels.fui
Normal file
Binary file not shown.
BIN
PckStudio.Core/Resources/fui/skinHud.fui
Normal file
BIN
PckStudio.Core/Resources/fui/skinHud.fui
Normal file
Binary file not shown.
BIN
PckStudio.Core/Resources/fui/skinWiiU.fui
Normal file
BIN
PckStudio.Core/Resources/fui/skinWiiU.fui
Normal file
Binary file not shown.
2
Vendor/OMI-Lib
vendored
2
Vendor/OMI-Lib
vendored
Submodule Vendor/OMI-Lib updated: de0894bea6...bedf961a04
Reference in New Issue
Block a user