Merge main into 'multi-pck-files-feature'

This commit is contained in:
miku-666
2024-07-07 15:00:21 +02:00
128 changed files with 4399 additions and 27035 deletions

View File

@@ -1,27 +1,44 @@
name: .NET
name: CI
on: [push, pull_request]
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
nuget-cache-key: nuget-package-cache
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: |
git submodule update --init --recursive
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.6
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore NuGet Packages
run: nuget restore PCK_Studio.sln
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Solution
run: msbuild PCK_Studio.sln
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Restore NuGet Packages
id: nuget-packages-restore
uses: actions/cache/restore@v4
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ runner.os }}-${{ env.nuget-cache-key }}
- name: Get NuGet Packages
run: nuget restore PCK_Studio.sln
- name: Cache NuGet Packages
id: nuget-packages-save
uses: actions/cache/save@v4
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ steps.nuget-packages-restore.outputs.cache-primary-key }}
- name: Build Solution
run: msbuild PCK_Studio.sln

55
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: Create release
on:
push:
tags: v*.*
env:
RELEASE_NAME: PCK-Studio
jobs:
on-main-branch-check:
runs-on: ubuntu-latest
outputs:
on_main: ${{ steps.contains_tag.outputs.retval }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: rickstaa/action-contains-tag@v1
id: contains_tag
with:
reference: "main"
tag: "${{ github.ref }}"
CreateRelease:
runs-on: windows-latest
needs: on-main-branch-check
if: ${{ needs.on-main-branch-check.outputs.on_main == 'true' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Get NuGet Packages
run: nuget restore PCK_Studio.sln
- name: Build solution
run: "msbuild PCK_Studio.sln -p:Configuration=Release"
- name: Package binary
run: Compress-Archive -Path "${{ github.workspace }}\PCK-Studio\bin\Release\*" -Destination ${{ env.RELEASE_NAME }}.zip
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.RELEASE_NAME }}.zip

3
.gitignore vendored
View File

@@ -250,3 +250,6 @@ paket-files/
# JetBrains Rider
.idea/
*.sln.iml
# Deploy util
makeUpdate.py

View File

@@ -1,6 +1,5 @@
7.0 (IN DEVELOPMENT)
7.0.0.0
====================
Some features may be completely missing or incomplete at this point in time!
-Added .3dst (3DS Texture) support
-Semi-added Sub-Pck editing

View File

@@ -1,22 +0,0 @@
using System.Text.RegularExpressions;
namespace PCKStudio_Updater
{
public sealed class GithubParams
{
public readonly string RepositoryOwnerName;
public readonly string RepositoryName;
public readonly string TargetExecutableName;
public readonly bool UsePreRelease;
public readonly Regex VersionMatcher;
public GithubParams(string repositoryOwnerName, string repositoryName, string targetExecutableName, bool usePreRelease, Regex versionMatcher)
{
RepositoryOwnerName = repositoryOwnerName;
RepositoryName = repositoryName;
TargetExecutableName = targetExecutableName;
UsePreRelease = usePreRelease;
VersionMatcher = versionMatcher;
}
}
}

View File

@@ -1,148 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Compression;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Octokit;
namespace PCKStudio_Updater
{
public sealed class GithubUpdateDownloader : IUpdateDownloader
{
private static readonly Assembly updaterAssembly = Assembly.GetAssembly(typeof(GithubUpdateDownloader));
private readonly GithubParams _updateParams;
private readonly GitHubClient githubClient;
private Release latestFetchedRelease;
private Version latestReleaseVersion;
private DirectoryInfo downloadDirectory;
public GithubUpdateDownloader(GithubParams updateParams)
{
_updateParams = updateParams;
var githubClientProductHeader = new ProductHeaderValue(updaterAssembly.GetName().Name);
githubClient = new GitHubClient(githubClientProductHeader);
}
public bool IsUpdateAvailable(FileVersionInfo fileVersionInfo)
{
return IsUpdateAvailable(fileVersionInfo.ProductVersion);
}
public bool IsUpdateAvailable(Assembly currentAssembly)
{
if (!File.Exists(currentAssembly.Location))
return false;
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(currentAssembly.Location);
return IsUpdateAvailable(fileVersionInfo.ProductVersion);
}
public bool IsUpdateAvailable(Version productVersion)
{
Debug.WriteLine("Release Product ver.: " + latestReleaseVersion);
Debug.WriteLine("Current Product ver.: " + productVersion);
return latestReleaseVersion.CompareTo(productVersion) > 0;
}
public bool IsUpdateAvailable(string productVersion)
{
GetLatestRelease(_updateParams.UsePreRelease);
if (Version.TryParse(productVersion, out var currentVersion))
{
return IsUpdateAvailable(currentVersion);
}
return false;
}
private void UnpackZip(string zipFilePath)
{
ZipFile.ExtractToDirectory(zipFilePath, Path.GetDirectoryName(zipFilePath));
}
private static void DownloadAsset(ReleaseAsset asset, Stream destination)
{
string downloadUrl = asset.BrowserDownloadUrl;
var client = new WebClient();
using (var serverStream = client.OpenRead(downloadUrl))
{
serverStream.CopyTo(destination);
}
}
private void GetLatestRelease(bool prerelease)
{
Release release;
if (prerelease)
{
var prereleaseTask = githubClient.Repository.Release.GetAll(_updateParams.RepositoryOwnerName, _updateParams.RepositoryName);
prereleaseTask.Wait();
var prereleases = prereleaseTask.Result.OrderByDescending(release => release.PublishedAt ?? release.CreatedAt).Where(release => release.Prerelease).ToArray();
release = latestFetchedRelease = prereleases[0];
}
else
{
var latestReleaseTask = githubClient.Repository.Release.GetLatest(_updateParams.RepositoryOwnerName, _updateParams.RepositoryName);
latestReleaseTask.Wait();
release = latestFetchedRelease = latestReleaseTask.Result;
}
var match = _updateParams.VersionMatcher.Match(release.Name);
if (match.Success)
{
string versionString = match.Value;
Version.TryParse(versionString, out latestReleaseVersion);
}
}
private void EmptyDirectory(DirectoryInfo directory)
{
string appname = Assembly.GetExecutingAssembly().GetName().Name;
foreach (FileInfo file in directory.GetFiles())
{
if (Path.GetFileNameWithoutExtension(file.Name) != appname && file.Name != "update.zip")
file.Delete();
}
foreach (DirectoryInfo subDirectory in directory.GetDirectories())
subDirectory.Delete(true);
}
public void DownloadTo(DirectoryInfo directory)
{
if (latestFetchedRelease is null)
GetLatestRelease(_updateParams.UsePreRelease);
if (latestFetchedRelease.Assets?.Count > 0)
{
var asset = latestFetchedRelease.Assets[0];
string zipFilePath = Path.Combine(directory.FullName, "update.zip");
using(var zipFileStream = File.OpenWrite(zipFilePath))
{
DownloadAsset(asset, zipFileStream);
}
Debug.WriteLine("Download Complete", category: nameof(GithubUpdateDownloader));
EmptyDirectory(directory);
UnpackZip(zipFilePath);
File.Delete(zipFilePath);
downloadDirectory = directory;
}
}
public void Launch()
{
if (downloadDirectory is null)
{
throw new ArgumentNullException("Download directory not set.");
}
var files = downloadDirectory.GetFiles(_updateParams.TargetExecutableName + ".exe", SearchOption.TopDirectoryOnly);
if (files is not null && files.Length > 0)
{
Process.Start(files[0].FullName);
}
}
}
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PCKStudio_Updater
{
public interface IUpdateDownloader
{
public bool IsUpdateAvailable(Version currentVersion);
public bool IsUpdateAvailable(string currentVersionString);
public void DownloadTo(DirectoryInfo directory);
public void Launch();
}
}

View File

@@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5B223556-15B9-41DA-AA0B-5E7F45E743BF}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>PCKStudio_Updater</RootNamespace>
<AssemblyName>PCK-Studio-Updater</AssemblyName>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>PCKStudio_Updater.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>ProjectLogo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="API\IUpdateDownloader.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="API\GithubParams.cs" />
<Compile Include="API\GithubUpdateDownloader.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Costura.Fody">
<Version>5.7.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Octokit">
<Version>7.1.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="ProjectLogo.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\app.manifest" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -1,58 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime;
using System.Text;
using System.Text.RegularExpressions;
namespace PCKStudio_Updater
{
internal class Program
{
static void Main(string[] args)
{
Uri projectUrl = new Uri("https://github.com/PhoenixARC/-PCK-Studio");
if (args.Length > 0)
{
projectUrl = new Uri(args[0]);
}
string executableName = "PCK-Studio";
if (args.Length > 1)
{
executableName = args[1];
}
bool prerelease = false;
if (args.Length > 2)
{
prerelease = args[2].ToLower() == "true" || args[2].ToLower() == "1";
}
var versionMatcher = new Regex("(\\*|\\d+(\\.\\d+){0,3}(\\.\\*)?)");
if (args.Length > 3)
{
versionMatcher = new Regex(args[3]);
}
GithubParams updateParams = new GithubParams(
Path.GetDirectoryName(projectUrl.AbsolutePath).Replace("\\", ""),
Path.GetFileName(projectUrl.AbsolutePath),
executableName,
prerelease,
versionMatcher
);
IUpdateDownloader updater = new GithubUpdateDownloader(updateParams);
if (!File.Exists(updateParams.TargetExecutableName + ".exe") || updater.IsUpdateAvailable(FileVersionInfo.GetVersionInfo(updateParams.TargetExecutableName + ".exe").ProductVersion))
{
updater.DownloadTo(new DirectoryInfo("."));
updater.Launch();
return;
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PckStudio-Updater")]
[assembly: AssemblyDescription("Updater for PCK-Studio")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PckStudio-Updater")]
[assembly: AssemblyCopyright("Copyright © 2023 Miku-666")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5b223556-15b9-41da-aa0b-5e7f45e743bf")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="JapanResource">
<Component Id="cmpC92B4EBC991F194A9EFC2763C7D9EB28" Guid="f7b87e8b-0cb7-4b66-8f9c-5ed89e95b3c6">
<File Id="fil02904FC8246BC6263528FF9F58B6FEE6" KeyPath="yes" Source="$(var.HarvestPath)\PCK Studio.resources.dll" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="HeatGenerated">
<ComponentRef Id="cmpC92B4EBC991F194A9EFC2763C7D9EB28" />
</ComponentGroup>
</Fragment>
</Wix>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

View File

@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>7ed78fd8-f3e6-475b-8979-fd5220545430</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>PCKStudio-Setup</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs" />
<Compile Include="HeatGeneratedFileList.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="Bitmaps\Banner.png" />
<Content Include="Bitmaps\Dialog.png" />
<Content Include="Icon.ico" />
<Content Include="License.rtf" />
</ItemGroup>
<ItemGroup>
<Folder Include="Bitmaps" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<PropertyGroup>
<PreBuildEvent></PreBuildEvent>
<DefineConstants>HarvestPath=..\MinecraftUSkinEditor\bin\Release\ja</DefineConstants>
</PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<Target Name="BeforeBuild">
<HeatDirectory Directory="..\MinecraftUSkinEditor\bin\Release\ja"
PreprocessorVariable="var.HarvestPath"
OutputFile="HeatGeneratedFileList.wxs"
ComponentGroupName="HeatGenerated"
DirectoryRefId="INSTALLDIR"
AutogenerateGuids="false"
ToolPath="$(WixToolPath)"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true" />
</Target>
-->
</Project>

View File

@@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
Name="PCK Studio"
Language="1033"
Version="6.5.0.1"
Manufacturer="PhoenixARC"
UpgradeCode="0bfb1026-21f2-4552-ad71-ca90aae10a25">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
<Property Id='ALLUSERS' Value='2' />
<Property Id='MSIINSTALLPERUSER' Value='1' />
<UI>
<UIRef Id="WixUI_InstallDir" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="CA.LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="Bitmaps/Banner.png" />
<WixVariable Id="WixUIDialogBmp" Value="Bitmaps/Dialog.png" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch PCK Studio" />
<Property Id="WixShellExecTarget" Value="[#PCK Studio.exe]" />
<CustomAction Id="CA.LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<Icon Id="I.MainIcon" SourceFile="Icon.ico" />
<Property Id="ARPPRODUCTICON" Value="I.MainIcon" />
<Feature Id="F.MainApplication" Title="PCK Studio" Level="1">
<ComponentGroupRef Id="CG.StartMenu" />
<ComponentGroupRef Id="CG.ProductComponents" />
<ComponentGroupRef Id="HeatGenerated" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramMenuFolder">
<Directory Id="D.StartFolder" Name="PCK Studio" />
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="PCK Studio">
<Directory Id="JapanResource" Name="ja" />
</Directory>
</Directory>
</Directory>
<ComponentGroup Id="CG.StartMenu" Directory="D.StartFolder">
<Component Id="C.NBTEShortcut" Guid="*">
<Shortcut Id="S.NBTEShortcut"
Name="PCK Studio"
Target="[INSTALLDIR]PCK Studio.exe"
WorkingDirectory="INSTALLDIR" />
<RemoveFolder Id="RF.StartFolder" On="uninstall" />
<RegistryValue Id="RV.NBTEShortcut" Root="HKCU" Key="Software\PCKStudio" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
<Component Id="C.Uninstall" Guid="*">
<Shortcut Id="S.Uninstall"
Name="Uninstall PCK Studio"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls the PCK Studio Application" />
<RemoveFolder Id="RF.Uninstall" On ="uninstall" />
<RegistryValue Id="RV.Uninstall" Root="HKCU" Key="Software\PCKStudio" Name="uninstall" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
<ComponentGroup Id="CG.ProductComponents" Directory="INSTALLDIR">
<Component Id="C.PCKStudio" Guid="*">
<File Source="../MinecraftUSkinEditor/bin/Release/PCK Studio.exe" KeyPath="yes" />
</Component>
<Component Id="C.discordrpcw32.dll" Guid="*">
<File Source="../MinecraftUSkinEditor/bin/Release/discord-rpc-w32.dll" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@@ -18,17 +18,16 @@ using PckStudio.Internal;
using PckStudio.Popups;
using PckStudio.Properties;
using PckStudio.Forms.Additional_Popups.Animation;
using PckStudio.IO._3DST;
using PckStudio.Internal.IO._3DST;
using PckStudio.Forms.Additional_Popups;
using PckStudio.IO.PckAudio;
using PckStudio.Classes.Misc;
using PckStudio.Internal.IO.PckAudio;
using PckStudio.Internal.Misc;
using OMI.Formats.Languages;
using OMI.Formats.Pck;
using OMI.Workers.Language;
using OMI.Workers.Pck;
using PckStudio.FileFormats;
using PckStudio.Helper;
using PckStudio.Internal.Deserializer;
using PckStudio.Internal.Serializer;
using OMI.Formats.GameRule;
@@ -36,6 +35,11 @@ using OMI.Workers.GameRule;
using OMI.Formats.Model;
using OMI.Workers.Model;
using OMI.Workers;
using OMI.Formats.Material;
using OMI.Workers.Material;
using OMI.Formats.Behaviour;
using OMI.Workers.Behaviour;
using PckStudio.Internal.Json;
namespace PckStudio.Controls
{
@@ -162,7 +166,7 @@ namespace PckStudio.Controls
private void CheckForPasswordAndRemove()
{
if (_pck.TryGetFile("0", PckAssetType.InfoFile, out PckAsset file))
if (_pck.TryGetAsset("0", PckAssetType.InfoFile, out PckAsset file))
{
file.RemoveProperties("LOCK");
}
@@ -187,23 +191,23 @@ namespace PckStudio.Controls
private void BuildPckTreeView(TreeNodeCollection root, PckFile pckFile, string parentPath = "")
{
foreach (var file in pckFile.GetFiles())
foreach (var assets in pckFile.GetAssets())
{
// fix any file paths that may be incorrect
//if (file.Filename.StartsWith(parentPath))
// file.Filename = file.Filename.Remove(0, parentPath.Length);
TreeNode node = BuildNodeTreeBySeperator(root, file.Filename, '/');
node.Tag = file;
TreeNode node = BuildNodeTreeBySeperator(root, assets.Filename, '/');
node.Tag = assets;
if (Settings.Default.LoadSubPcks &&
(file.Type == PckAssetType.SkinDataFile || file.Type == PckAssetType.TexturePackInfoFile) &&
file.Data.Length > 0)
(assets.Type == PckAssetType.SkinDataFile || assets.Type == PckAssetType.TexturePackInfoFile) &&
assets.Data.Length > 0)
{
try
{
var reader = new PckFileReader(GetEndianess());
PckFile subPCKfile = file.GetData(reader);
PckFile subPCKfile = assets.GetData(reader);
// passes parent path to remove from sub pck filepaths
BuildPckTreeView(node.Nodes, subPCKfile, file.Filename + "/");
BuildPckTreeView(node.Nodes, subPCKfile, assets.Filename + "/");
}
catch (OverflowException ex)
{
@@ -213,7 +217,7 @@ namespace PckStudio.Controls
Debug.WriteLine(ex.Message);
}
}
SetPckFileIcon(node, file.Type);
SetPckFileIcon(node, assets.Type);
};
}
@@ -293,7 +297,7 @@ namespace PckStudio.Controls
treeViewMain.Nodes.Clear();
BuildPckTreeView(treeViewMain.Nodes, _pck);
if (_isTemplateFile && _pck.HasFile("Skins.pck", PckAssetType.SkinDataFile))
if (_isTemplateFile && _pck.HasAsset("Skins.pck", PckAssetType.SkinDataFile))
{
TreeNode skinsNode = treeViewMain.Nodes.Find("Skins.pck", false).FirstOrDefault();
TreeNode folderNode = CreateNode("Skins");
@@ -377,7 +381,7 @@ namespace PckStudio.Controls
{
if (node.Tag is PckAsset node_file)
{
PckAsset new_file = newPCKFile.CreateNewFile(node_file.Filename.Replace(parent_file.Filename + "/", String.Empty), node_file.Type);
PckAsset new_file = newPCKFile.CreateNewAsset(node_file.Filename.Replace(parent_file.Filename + "/", String.Empty), node_file.Type);
foreach (var prop in node_file.GetProperties())
new_file.AddProperty(prop);
new_file.SetData(node_file.Data);
@@ -398,8 +402,8 @@ namespace PckStudio.Controls
private bool TryGetLocFile(out LOCFile locFile)
{
if (!_pck.TryGetFile("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locdata) &&
!_pck.TryGetFile("languages.loc", PckAssetType.LocalisationFile, out locdata))
if (!_pck.TryGetAsset("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locdata) &&
!_pck.TryGetAsset("languages.loc", PckAssetType.LocalisationFile, out locdata))
{
locFile = null;
return false;
@@ -424,8 +428,8 @@ namespace PckStudio.Controls
private bool TrySetLocFile(in LOCFile locFile)
{
if (!_pck.TryGetFile("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locdata) &&
!_pck.TryGetFile("languages.loc", PckAssetType.LocalisationFile, out locdata))
if (!_pck.TryGetAsset("localisation.loc", PckAssetType.LocalisationFile, out PckAsset locdata) &&
!_pck.TryGetAsset("languages.loc", PckAssetType.LocalisationFile, out locdata))
{
return false;
}
@@ -497,7 +501,7 @@ namespace PckStudio.Controls
using AddFilePrompt diag = new AddFilePrompt("res/" + Path.GetFileName(ofd.FileName));
if (diag.ShowDialog(this) == DialogResult.OK)
{
PckAsset file = _pck.CreateNewFile(
PckAsset file = _pck.CreateNewAsset(
diag.Filepath,
diag.Filetype,
() => File.ReadAllBytes(ofd.FileName));
@@ -522,7 +526,7 @@ namespace PckStudio.Controls
renamePrompt.LabelText = "Path";
if (renamePrompt.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(renamePrompt.NewText))
{
var file = _pck.CreateNewFile(renamePrompt.NewText, PckAssetType.TextureFile);
var file = _pck.CreateNewAsset(renamePrompt.NewText, PckAssetType.TextureFile);
file.SetData(File.ReadAllBytes(fileDialog.FileName));
BuildMainTreeView();
_wasModified = true;
@@ -541,7 +545,7 @@ namespace PckStudio.Controls
{
string skinNameImport = Path.GetFileName(contents.FileName);
byte[] data = File.ReadAllBytes(contents.FileName);
PckAsset mfNew = _pck.CreateNewFile(skinNameImport, PckAssetType.SkinFile);
PckAsset mfNew = _pck.CreateNewAsset(skinNameImport, PckAssetType.SkinFile);
mfNew.SetData(data);
string propertyFile = Path.GetFileNameWithoutExtension(contents.FileName) + ".txt";
if (File.Exists(propertyFile))
@@ -860,7 +864,7 @@ namespace PckStudio.Controls
MessageBox.Show(this, $"'{addFile.Filepath}' of type {addFile.Filetype} already exists.", "Import failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
continue;
}
_pck.CreateNewFile(addFile.Filepath, addFile.Filetype, () => File.ReadAllBytes(file));
_pck.CreateNewAsset(addFile.Filepath, addFile.Filetype, () => File.ReadAllBytes(file));
addedCount++;
BuildMainTreeView();
@@ -875,43 +879,43 @@ namespace PckStudio.Controls
{
LOCFile locFile = null;
TryGetLocFile(out locFile);
using AddNewSkin add = new AddNewSkin(locFile);
using AddSkinPrompt add = new AddSkinPrompt(locFile);
if (add.ShowDialog() == DialogResult.OK)
{
if (_pck.HasFile("Skins.pck", PckAssetType.SkinDataFile)) // Prioritize Skins.pck
if (_pck.HasAsset("Skins.pck", PckAssetType.SkinDataFile)) // Prioritize Skins.pck
{
TreeNode subPCK = treeViewMain.Nodes.Find("Skins.pck", false).FirstOrDefault();
if (subPCK.Nodes.ContainsKey("Skins")) add.SkinFile.Filename = add.SkinFile.Filename.Insert(0, "Skins/");
add.SkinFile.Filename = add.SkinFile.Filename.Insert(0, "Skins.pck/");
TreeNode newNode = new TreeNode(Path.GetFileName(add.SkinFile.Filename));
newNode.Tag = add.SkinFile;
if (subPCK.Nodes.ContainsKey("Skins")) add.SkinAsset.Filename = add.SkinAsset.Filename.Insert(0, "Skins/");
add.SkinAsset.Filename = add.SkinAsset.Filename.Insert(0, "Skins.pck/");
TreeNode newNode = new TreeNode(Path.GetFileName(add.SkinAsset.Filename));
newNode.Tag = add.SkinAsset;
SetNodeIcon(newNode, PckAssetType.SkinFile);
subPCK.Nodes.Add(newNode);
RebuildSubPCK(newNode.FullPath);
}
else
{
if (treeViewMain.Nodes.ContainsKey("Skins")) add.SkinFile.Filename = add.SkinFile.Filename.Insert(0, "Skins/"); // Then Skins folder
_pck.AddFile(add.SkinFile);
if (treeViewMain.Nodes.ContainsKey("Skins")) add.SkinAsset.Filename = add.SkinAsset.Filename.Insert(0, "Skins/"); // Then Skins folder
_pck.AddAsset(add.SkinAsset);
}
if (add.HasCape)
{
if (_pck.HasFile("Skins.pck", PckAssetType.SkinDataFile)) // Prioritize Skins.pck
if (_pck.HasAsset("Skins.pck", PckAssetType.SkinDataFile)) // Prioritize Skins.pck
{
TreeNode subPCK = treeViewMain.Nodes.Find("Skins.pck", false).FirstOrDefault();
if (subPCK.Nodes.ContainsKey("Skins")) add.CapeFile.Filename = add.CapeFile.Filename.Insert(0, "Skins/");
add.CapeFile.Filename = add.CapeFile.Filename.Insert(0, "Skins.pck/");
TreeNode newNode = new TreeNode(Path.GetFileName(add.CapeFile.Filename));
newNode.Tag = add.CapeFile;
if (subPCK.Nodes.ContainsKey("Skins")) add.CapeAsset.Filename = add.CapeAsset.Filename.Insert(0, "Skins/");
add.CapeAsset.Filename = add.CapeAsset.Filename.Insert(0, "Skins.pck/");
TreeNode newNode = new TreeNode(Path.GetFileName(add.CapeAsset.Filename));
newNode.Tag = add.CapeAsset;
SetNodeIcon(newNode, PckAssetType.SkinFile);
subPCK.Nodes.Add(newNode);
RebuildSubPCK(newNode.FullPath);
}
else
{
if (treeViewMain.Nodes.ContainsKey("Skins")) add.CapeFile.Filename = add.CapeFile.Filename.Insert(0, "Skins/"); // Then Skins folder
_pck.AddFile(add.CapeFile);
if (treeViewMain.Nodes.ContainsKey("Skins")) add.CapeAsset.Filename = add.CapeAsset.Filename.Insert(0, "Skins/"); // Then Skins folder
_pck.AddAsset(add.CapeAsset);
}
}
@@ -936,7 +940,7 @@ namespace PckStudio.Controls
if (animationEditor.ShowDialog() == DialogResult.OK)
{
_wasModified = true;
_pck.AddFile(file);
_pck.AddAsset(file);
BuildMainTreeView();
ReloadMetaTreeView();
}
@@ -960,7 +964,7 @@ namespace PckStudio.Controls
AudioEditor diag = new AudioEditor(file, LittleEndianCheckBox.Checked);
if (diag.ShowDialog(this) == DialogResult.OK)
{
_pck.AddFile(file);
_pck.AddAsset(file);
}
diag.Dispose();
BuildMainTreeView();
@@ -968,25 +972,25 @@ namespace PckStudio.Controls
private void colourscolToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_pck.TryGetFile("colours.col", PckAssetType.ColourTableFile, out _))
if (_pck.TryGetAsset("colours.col", PckAssetType.ColourTableFile, out _))
{
MessageBox.Show("A color table file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
var newColorFile = _pck.CreateNewFile("colours.col", PckAssetType.ColourTableFile);
var newColorFile = _pck.CreateNewAsset("colours.col", PckAssetType.ColourTableFile);
newColorFile.SetData(Resources.tu69colours);
BuildMainTreeView();
}
private void CreateSkinsPCKToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (_pck.TryGetFile("Skins.pck", PckAssetType.SkinDataFile, out _))
if (_pck.TryGetAsset("Skins.pck", PckAssetType.SkinDataFile, out _))
{
MessageBox.Show("A Skins.pck file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
_pck.CreateNewFile("Skins.pck", PckAssetType.SkinDataFile, () =>
_pck.CreateNewAsset("Skins.pck", PckAssetType.SkinDataFile, () =>
{
using var stream = new MemoryStream();
var writer = new PckFileWriter(new PckFile(3, true), GetEndianess());
@@ -1005,24 +1009,26 @@ namespace PckStudio.Controls
private void behavioursbinToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_pck.TryGetFile("behaviours.bin", PckAssetType.BehavioursFile, out _))
if (_pck.TryGetAsset("behaviours.bin", PckAssetType.BehavioursFile, out _))
{
MessageBox.Show("A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
_pck.CreateNewFile("behaviours.bin", PckAssetType.BehavioursFile, BehaviourResources.BehaviourFileInitializer);
_pck.CreateNewAsset("behaviours.bin", PckAssetType.BehavioursFile, new BehavioursWriter(new BehaviourFile()));
BuildMainTreeView();
}
private void entityMaterialsbinToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_pck.TryGetFile("entityMaterials.bin", PckAssetType.MaterialFile, out _))
if (_pck.TryGetAsset("entityMaterials.bin", PckAssetType.MaterialFile, out _))
{
MessageBox.Show("A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
return;
}
_pck.CreateNewFile("entityMaterials.bin", PckAssetType.MaterialFile, MaterialResources.MaterialsFileInitializer);
var materialContainer = new MaterialContainer();
materialContainer.InitializeDefault();
_pck.CreateNewAsset("entityMaterials.bin", PckAssetType.MaterialFile, new MaterialFileWriter(materialContainer));
BuildMainTreeView();
}
@@ -1038,7 +1044,7 @@ namespace PckStudio.Controls
return;
}
// creates variable to indicate wether current pck skin structure is mashup or regular skin
bool hasSkinsPck = _pck.HasFile("Skins.pck", PckAssetType.SkinDataFile);
bool hasSkinsPck = _pck.HasAsset("Skins.pck", PckAssetType.SkinDataFile);
foreach (var fullfilename in Directory.GetFiles(contents.SelectedPath, "*.png"))
{
@@ -1084,7 +1090,7 @@ namespace PckStudio.Controls
}
if (hasSkinsPck)
{
var skinsfile = _pck.GetFile("Skins.pck", PckAssetType.SkinDataFile);
var skinsfile = _pck.GetAsset("Skins.pck", PckAssetType.SkinDataFile);
using (var ms = new MemoryStream(skinsfile.Data))
{
//var reader = new PckFileReader(LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
@@ -1097,7 +1103,7 @@ namespace PckStudio.Controls
}
continue;
}
_pck.AddFile(newFile);
_pck.AddAsset(newFile);
}
BuildMainTreeView();
_wasModified = true;
@@ -1150,8 +1156,8 @@ namespace PckStudio.Controls
{
string mippedPath = $"{textureDirectory}/{textureName}MipMapLevel{i}{textureExtension}";
Debug.WriteLine(mippedPath);
if (_pck.HasFile(mippedPath, PckAssetType.TextureFile))
_pck.RemoveFile(_pck.GetFile(mippedPath, PckAssetType.TextureFile));
if (_pck.HasAsset(mippedPath, PckAssetType.TextureFile))
_pck.RemoveAsset(_pck.GetAsset(mippedPath, PckAssetType.TextureFile));
PckAsset MipMappedFile = new PckAsset(mippedPath, PckAssetType.TextureFile);
@@ -1173,7 +1179,7 @@ namespace PckStudio.Controls
MipMappedFile.SetData(texStream.ToArray());
texStream.Dispose();
_pck.InsertFile(_pck.IndexOfFile(file) + i - 1, MipMappedFile);
_pck.InsertAsset(_pck.IndexOfAsset(file) + i - 1, MipMappedFile);
}
BuildMainTreeView();
}
@@ -1264,7 +1270,7 @@ namespace PckStudio.Controls
}
else
{
foreach (var _file in _pck.GetFiles())
foreach (var _file in _pck.GetAssets())
{
if (_file.Filename.StartsWith(selectedFolder))
{
@@ -1326,7 +1332,7 @@ namespace PckStudio.Controls
if (node.Parent == null) treeViewMain.Nodes.Insert(node.Index + 1, newNode); //adds generated file node
else node.Parent.Nodes.Insert(node.Index + 1, newNode);//adds generated file node to selected folder
if (!IsSubPCKNode(node.FullPath)) _pck.InsertFile(node.Index + 1, NewFile);
if (!IsSubPCKNode(node.FullPath)) _pck.InsertAsset(node.Index + 1, NewFile);
else RebuildSubPCK(node.FullPath);
BuildMainTreeView();
_wasModified = true;
@@ -1346,7 +1352,7 @@ namespace PckStudio.Controls
{
if (node.Tag is PckAsset file)
{
if (_pck.TryGetFile(diag.NewText, file.Type, out _))
if (_pck.TryGetAsset(diag.NewText, file.Type, out _))
{
MessageBox.Show($"{diag.NewText} already exists", "File already exists");
return;
@@ -1448,7 +1454,7 @@ namespace PckStudio.Controls
if (node.TryGetTagData(out PckAsset file))
{
if (!BeforeFileRemove(file) && _pck.RemoveFile(file))
if (!BeforeFileRemove(file) && _pck.RemoveAsset(file))
{
node.Remove();
_wasModified = true;
@@ -1680,97 +1686,59 @@ namespace PckStudio.Controls
}
}
private void HandleTextureFile(PckAsset file)
private void HandleTextureFile(PckAsset asset)
{
_ = file.IsMipmappedFile() && _pck.TryGetValue(file.GetNormalPath(), PckAssetType.TextureFile, out file);
_ = asset.IsMipmappedFile() && _pck.TryGetValue(asset.GetNormalPath(), PckAssetType.TextureFile, out asset);
if (file.Size <= 0)
if (asset.Size <= 0)
{
Debug.WriteLine($"'{file.Filename}' size is 0.", category: nameof(HandleTextureFile));
Debug.WriteLine($"'{asset.Filename}' size is 0.", category: nameof(HandleTextureFile));
return;
}
bool isTerrain = file.Filename == "res/terrain.png";
bool isItems = file.Filename == "res/items.png";
bool isParticles = file.Filename == "res/particles.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";
bool isXPOrbs = file.Filename == "res/item/xporb.png";
bool isExplosions = file.Filename == "res/misc/explosion.png";
bool isPaintings = file.Filename == "res/art/kz.png";
bool isBanners = file.Filename == "res/item/banner/Banner_Atlas.png";
ResourceLocation resourceLocation = ResourceLocation.GetFromPath(asset.Filename);
Debug.WriteLine("Handling Resource file: " + resourceLocation?.ToString());
if (resourceLocation is null || resourceLocation.Category == ResourceCategory.Unknown)
return;
if (
isTerrain || isItems || isParticles || isMoonPhases || isPaintings ||
isMapIcons || isAdditionalMapIcons || isXPOrbs || isExplosions || isBanners
)
if (resourceLocation.Category != ResourceCategory.BlockAnimation &&
resourceLocation.Category != ResourceCategory.ItemAnimation)
{
var img = file.GetTexture();
var tile_size = new Size();
var banner_scale = img.Width / Resources.banners_atlas.Width;
if (isBanners)
Image img = asset.GetTexture();
var viewer = new TextureAtlasEditor(_pck, resourceLocation, img);
if (viewer.ShowDialog(this) == DialogResult.OK)
{
// The banner atlas has extra space on it that has to be truncated for the editor
img = img.GetArea(new Rectangle(0, 0, img.Width - (4 * banner_scale), img.Height - (1 * banner_scale)));
// banners are 42x41 because of course they are
tile_size = new Size(42 * banner_scale, 41 * banner_scale);
}
// most atlases have 4 columns
var columnCount = isBanners ? 6 : 4;
if (isTerrain || isItems || isParticles || isPaintings) columnCount = 16;
if (!isBanners)
{
var resolution = img.Width / columnCount;
tile_size = new Size(resolution, resolution);
}
var viewer = new TextureAtlasEditor(_pck, file.Filename, img, tile_size);
if (viewer.ShowDialog() == DialogResult.OK)
{
var texture = viewer.FinalTexture;
if (isBanners)
{
var graphicsConfig = new GraphicsConfig()
{
InterpolationMode = InterpolationMode.NearestNeighbor,
PixelOffsetMode = PixelOffsetMode.HighQuality
};
var _img = new Bitmap((Resources.banners_atlas.Width + 4) * banner_scale,
(Resources.banners_atlas.Height + 1) * banner_scale);
using (var g = Graphics.FromImage(_img))
{
g.ApplyConfig(graphicsConfig);
g.DrawImage(texture, 0, 0, texture.Width, texture.Height);
}
texture = _img;
}
file.SetTexture(texture);
Image texture = viewer.FinalTexture;
asset.SetTexture(texture);
_wasModified = true;
BuildMainTreeView();
}
return;
}
if (!file.Filename.StartsWith("res/textures/blocks/") && !file.Filename.StartsWith("res/textures/items/"))
if (resourceLocation.Category != ResourceCategory.ItemAnimation &&
resourceLocation.Category != ResourceCategory.BlockAnimation)
return;
var animation = file.GetDeserializedData<Animation>(AnimationDeserializer.DefaultDeserializer);
using (AnimationEditor animationEditor = new AnimationEditor(animation, Path.GetFileNameWithoutExtension(file.Filename)))
Animation animation = asset.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
string internalName = Path.GetFileNameWithoutExtension(asset.Filename);
var textureInfos = resourceLocation.Category switch
{
ResourceCategory.BlockAnimation => Tiles.BlockTileInfos,
ResourceCategory.ItemAnimation => Tiles.ItemTileInfos,
_ => Array.Empty<JsonTileInfo>().ToList()
};
string displayname = textureInfos.FirstOrDefault(p => p.InternalName == internalName)?.DisplayName ?? internalName;
string[] specialTileNames = { "clock", "compass" };
using (AnimationEditor animationEditor = new AnimationEditor(animation, displayname, internalName.ToLower().EqualsAny(specialTileNames)))
{
if (animationEditor.ShowDialog(this) == DialogResult.OK)
{
_wasModified = true;
file.SetSerializedData(animation, AnimationSerializer.DefaultSerializer);
asset.SetSerializedData(animationEditor.Result, AnimationSerializer.DefaultSerializer);
BuildMainTreeView();
}
}
@@ -2057,11 +2025,12 @@ namespace PckStudio.Controls
}
}
int index = pck.IndexOfFile(file);
int index = pck.IndexOfAsset(file);
if (index + amount < 0 || index + amount > pck.FileCount) return;
pck.RemoveFile(file);
pck.InsertFile(index + amount, file);
if (index + amount < 0 || index + amount > pck.AssetCount)
return;
pck.RemoveAsset(file);
pck.InsertAsset(index + amount, file);
if (IsSubPCK)
{

View File

@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AnimatedGif;
using Newtonsoft.Json.Linq;
using PckStudio.Internal;
@@ -11,6 +13,21 @@ namespace PckStudio.Extensions
{
internal static class AnimationExtensions
{
internal static Image CreateAnimationImage(this Animation animation)
{
if (animation.FrameCount == 0)
{
return null;
}
var ms = new System.IO.MemoryStream();
var generateor = new AnimatedGifCreator(ms, GameConstants.GameTickInMilliseconds, 0);
foreach (var frame in animation.GetInterpolatedFrames())
{
generateor.AddFrame(frame.Texture, frame.Ticks * GameConstants.GameTickInMilliseconds, GifQuality.Bit8);
}
ms.Position = 0;
return Image.FromStream(ms);
}
internal static JObject ConvertToJavaAnimation(this Animation animation)
{

View File

@@ -15,6 +15,11 @@ namespace PckStudio.Extensions
return new Vector4(color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f);
}
internal static int ToBGR(this Color color)
{
return color.B << 16 | color.G << 8 | color.R;
}
internal static byte BlendValues(byte source, byte overlay, BlendMode blendType)
{
return (byte)MathExtensions.Clamp(BlendValues(source / 255f, overlay / 255f, blendType) * 255, 0, 255);

View File

@@ -26,6 +26,7 @@ using System.Linq;
using PckStudio.Internal;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using PckStudio.Internal.App;
namespace PckStudio.Extensions
{
@@ -232,33 +233,38 @@ namespace PckStudio.Extensions
return image1;
BitmapData baseImageData = baseImage.LockBits(new Rectangle(Point.Empty, baseImage.Size),
ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
byte[] baseImageBuffer = new byte[baseImageData.Stride * baseImageData.Height];
Marshal.Copy(baseImageData.Scan0, baseImageBuffer, 0, baseImageBuffer.Length);
baseImage.UnlockBits(baseImageData);
BitmapData overlayImageData = overlayImage.LockBits(new Rectangle(Point.Empty, overlayImage.Size),
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
byte[] overlayImageBuffer = new byte[overlayImageData.Stride * overlayImageData.Height];
byte[] overlayImageBuffer = new byte[overlayImageData.Stride * overlayImageData.Height];
Marshal.Copy(overlayImageData.Scan0, overlayImageBuffer, 0, overlayImageBuffer.Length);
overlayImage.UnlockBits(overlayImageData);
byte[] finalBuffer = new byte[baseImageData.Stride * baseImageData.Height];
for (int k = 0; k < baseImageBuffer.Length && k < overlayImageBuffer.Length; k += 4)
{
baseImageBuffer[k + 0] = ColorExtensions.Mix(delta, baseImageBuffer[k + 0], overlayImageBuffer[k + 0]);
baseImageBuffer[k + 1] = ColorExtensions.Mix(delta, baseImageBuffer[k + 1], overlayImageBuffer[k + 1]);
baseImageBuffer[k + 2] = ColorExtensions.Mix(delta, baseImageBuffer[k + 2], overlayImageBuffer[k + 2]);
finalBuffer[k + 0] = ColorExtensions.Mix(delta, baseImageBuffer[k + 0], overlayImageBuffer[k + 0]);
finalBuffer[k + 1] = ColorExtensions.Mix(delta, baseImageBuffer[k + 1], overlayImageBuffer[k + 1]);
finalBuffer[k + 2] = ColorExtensions.Mix(delta, baseImageBuffer[k + 2], overlayImageBuffer[k + 2]);
finalBuffer[k + 3] = ColorExtensions.Mix(delta, baseImageBuffer[k + 3], overlayImageBuffer[k + 3]);
}
Bitmap bitmapResult = new Bitmap(baseImage.Width, baseImage.Height, PixelFormat.Format32bppArgb);
BitmapData resultImageData = bitmapResult.LockBits(new Rectangle(Point.Empty, bitmapResult.Size),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
Marshal.Copy(baseImageBuffer, 0, resultImageData.Scan0, baseImageBuffer.Length);
Marshal.Copy(finalBuffer, 0, resultImageData.Scan0, finalBuffer.Length);
bitmapResult.UnlockBits(resultImageData);
baseImage.UnlockBits(baseImageData);
overlayImage.UnlockBits(overlayImageData);
return bitmapResult;
}
}

View File

@@ -1,18 +1,15 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Material;
using OMI.Workers.Material;
namespace PckStudio.Helper
namespace PckStudio.Extensions
{
public static class MaterialResources
internal static class MaterialContainerExtensions
{
public static byte[] MaterialsFileInitializer()
{
using var stream = new MemoryStream();
var matFile = new MaterialContainer
{
private static readonly MaterialContainer.Material[] defaultMaterials = [
new MaterialContainer.Material("bat", "entity_alphatest"),
new MaterialContainer.Material("ender_dragon", "entity_emissive_alpha"),
new MaterialContainer.Material("blaze_head", "entity_emissive_alpha"),
@@ -35,10 +32,11 @@ namespace PckStudio.Helper
new MaterialContainer.Material("wither_boss", "entity_alphatest"),
new MaterialContainer.Material("wither_skeleton", "entity_alphatest"),
new MaterialContainer.Material("wolf", "entity_alphatest_change_color")
};
var writer = new MaterialFileWriter(matFile);
writer.WriteToStream(stream);
return stream.ToArray();
];
public static void InitializeDefault(this MaterialContainer materials)
{
materials.AddRange(defaultMaterials);
}
}
}

View File

@@ -10,7 +10,6 @@ using System.Threading.Tasks;
using OMI.Formats.Pck;
using OMI.Workers;
using PckStudio.Interfaces;
using PckStudio.IO.TGA;
using PckStudio.Internal.Deserializer;
using PckStudio.Internal.Serializer;
@@ -20,57 +19,57 @@ namespace PckStudio.Extensions
{
private const string MipMap = "MipMapLevel";
internal static Image GetTexture(this PckAsset file)
internal static Image GetTexture(this PckAsset asset)
{
if (file.Type != PckAssetType.SkinFile &&
file.Type != PckAssetType.CapeFile &&
file.Type != PckAssetType.TextureFile)
if (asset.Type != PckAssetType.SkinFile &&
asset.Type != PckAssetType.CapeFile &&
asset.Type != PckAssetType.TextureFile)
{
throw new Exception("File is not suitable to contain image data.");
throw new Exception("Asset is not suitable to contain image data.");
}
return file.GetDeserializedData(ImageDeserializer.DefaultDeserializer);
return asset.GetDeserializedData(ImageDeserializer.DefaultDeserializer);
}
internal static T GetDeserializedData<T>(this PckAsset file, IPckAssetDeserializer<T> deserializer)
internal static T GetDeserializedData<T>(this PckAsset asset, IPckAssetDeserializer<T> deserializer)
{
return deserializer.Deserialize(file);
return deserializer.Deserialize(asset);
}
internal static T GetData<T>(this PckAsset file, IDataFormatReader<T> formatReader) where T : class
internal static T GetData<T>(this PckAsset asset, IDataFormatReader<T> formatReader) where T : class
{
using var ms = new MemoryStream(file.Data);
using var ms = new MemoryStream(asset.Data);
return formatReader.FromStream(ms);
}
internal static void SetSerializedData<T>(this PckAsset file, T obj, IPckAssetSerializer<T> serializer)
internal static void SetSerializedData<T>(this PckAsset asset, T obj, IPckAssetSerializer<T> serializer)
{
serializer.Serialize(obj, ref file);
serializer.Serialize(obj, ref asset);
}
internal static void SetData(this PckAsset file, IDataFormatWriter formatWriter)
internal static void SetData(this PckAsset asset, IDataFormatWriter formatWriter)
{
using (var stream = new MemoryStream())
{
formatWriter.WriteToStream(stream);
file.SetData(stream.ToArray());
asset.SetData(stream.ToArray());
}
}
internal static void SetTexture(this PckAsset file, Image image)
internal static void SetTexture(this PckAsset asset, Image image)
{
if (file.Type != PckAssetType.SkinFile &&
file.Type != PckAssetType.CapeFile &&
file.Type != PckAssetType.TextureFile)
if (asset.Type != PckAssetType.SkinFile &&
asset.Type != PckAssetType.CapeFile &&
asset.Type != PckAssetType.TextureFile)
{
throw new Exception("File is not suitable to contain image data.");
throw new Exception("Asset is not suitable to contain image data.");
}
file.SetSerializedData(image, ImageSerializer.DefaultSerializer);
asset.SetSerializedData(image, ImageSerializer.DefaultSerializer);
}
internal static bool IsMipmappedFile(this PckAsset file)
internal static bool IsMipmappedFile(this PckAsset asset)
{
// We only want to test the file name itself. ex: "terrainMipMapLevel2"
string name = Path.GetFileNameWithoutExtension(file.Filename);
string name = Path.GetFileNameWithoutExtension(asset.Filename);
// check if last character is a digit (0-9). If not return false
if (!char.IsDigit(name[name.Length - 1]))
@@ -82,12 +81,34 @@ namespace PckStudio.Extensions
return true;
}
internal static string GetNormalPath(this PckAsset file)
internal static string GetNormalPath(this PckAsset asset)
{
if (!file.IsMipmappedFile())
return file.Filename;
string ext = Path.GetExtension(file.Filename);
return file.Filename.Remove(file.Filename.Length - (MipMap.Length + 1) - ext.Length) + ext;
if (!asset.IsMipmappedFile())
return asset.Filename;
string ext = Path.GetExtension(asset.Filename);
return asset.Filename.Remove(asset.Filename.Length - (MipMap.Length + 1) - ext.Length) + ext;
}
internal static void DeserializePropertiesFromString(this PckAsset asset, string serializedData)
{
string[] lines = serializedData.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
foreach (string line in lines)
{
int idx = line.IndexOf(' ');
if (idx == -1 || line.Length - 1 == idx)
continue;
asset.AddProperty(line.Substring(0, idx).Replace(":", string.Empty), line.Substring(idx + 1));
}
}
internal static string SerializePropertiesToString(this PckAsset asset)
{
StringBuilder builder = new StringBuilder(asset.PropertyCount * 20);
foreach (var property in asset.GetProperties())
{
builder.AppendLine(property.Key + ": " + property.Value);
}
return builder.ToString();
}
}
}

View File

@@ -11,20 +11,20 @@ namespace PckStudio.Extensions
{
internal static class PckFileExtensions
{
internal static PckAsset CreateNewFileIf(this PckFile pck, bool condition, string filename, PckAssetType filetype, IDataFormatWriter writer)
internal static PckAsset CreateNewAssetIf(this PckFile pck, bool condition, string filename, PckAssetType filetype, IDataFormatWriter writer)
{
if (condition)
{
return pck.CreateNewFile(filename, filetype, writer);
return pck.CreateNewAsset(filename, filetype, writer);
}
return null;
}
internal static PckAsset CreateNewFile(this PckFile pck, string filename, PckAssetType filetype, IDataFormatWriter writer)
internal static PckAsset CreateNewAsset(this PckFile pck, string filename, PckAssetType filetype, IDataFormatWriter writer)
{
var file = pck.CreateNewFile(filename, filetype);
file.SetData(writer);
return file;
var asset = pck.CreateNewAsset(filename, filetype);
asset.SetData(writer);
return asset;
}
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PckStudio.Extensions
{
internal static class PictureBoxExtensions
{
public static bool IsAnimating(this PictureBox pictureBox)
{
var fi = typeof(PictureBox).GetField("currentlyAnimating", BindingFlags.NonPublic | BindingFlags.Instance);
return (bool)fi.GetValue(pictureBox);
}
public static void Animate(this PictureBox pictureBox, bool animate)
{
var animateMethod = typeof(PictureBox).GetMethod("Animate", BindingFlags.NonPublic | BindingFlags.Instance,
null, new Type[] { typeof(bool) }, null);
animateMethod.Invoke(pictureBox, new object[] { animate });
}
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using PckStudio.Internal.App;
namespace PckStudio.Extensions
{
internal static class TreeViewExtensions
{
public static TreeNode[] FindPath(this TreeView treeView, string path)
{
if (string.IsNullOrWhiteSpace(path))
return Array.Empty<TreeNode>();
if (!path.Contains(treeView.PathSeparator))
{
return treeView.Nodes.Find(path, false);
}
string segment = path.Substring(0, path.IndexOf(treeView.PathSeparator));
if (treeView.Nodes.ContainsKey(segment))
{
var res = treeView.Nodes[segment].GetChildNodes().Where(node => node.FullPath == path).ToArray();
return res;
}
return Array.Empty<TreeNode>();
}
}
}

View File

@@ -4,9 +4,10 @@ using System.IO;
using System.Runtime.InteropServices;
using PckStudio.Extensions;
using PckStudio.Internal;
using PckStudio.Internal.App;
using SharpMSS;
namespace PckStudio.API.Miles
namespace PckStudio.External.API.Miles
{
internal static class Binka
{

View File

@@ -3,14 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PckStudio.API.Miles;
using PckStudio.Forms.Additional_Popups;
using System.Windows.Forms;
using System.IO;
using PckStudio.Internal;
using System.Text.RegularExpressions;
using PckStudio.Internal.App;
namespace PckStudio.Classes.Utils
namespace PckStudio.External.API.Miles
{
internal static class BinkaConverter
{

View File

@@ -1,6 +1,6 @@
namespace PckStudio.Popups
namespace PckStudio.Forms.Additional_Popups
{
partial class AddNewSkin
partial class AddSkinPrompt
{
/// <summary>
/// Required designer variable.
@@ -30,7 +30,7 @@
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.Label label3;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddNewSkin));
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddSkinPrompt));
System.Windows.Forms.Label label2;
System.Windows.Forms.Label label1;
this.textTheme = new System.Windows.Forms.TextBox();
@@ -308,6 +308,7 @@
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonCape);
this.Controls.Add(this.buttonAnimGen);
this.Controls.Add(this.capeLabel);
this.Controls.Add(this.textThemeName);
@@ -318,7 +319,6 @@
this.Controls.Add(this.radioButtonAuto);
this.Controls.Add(this.buttonDone);
this.Controls.Add(this.buttonModelGen);
this.Controls.Add(this.buttonCape);
this.Controls.Add(this.buttonSkin);
this.Controls.Add(this.capePictureBox);
this.Controls.Add(this.skinPictureBox);

View File

@@ -8,22 +8,22 @@ using OMI.Formats.Languages;
using OMI.Formats.Pck;
using PckStudio.Internal;
using PckStudio.Forms.Editor;
using PckStudio.IO._3DST;
using PckStudio.Internal.IO._3DST;
using PckStudio.Properties;
using PckStudio.Forms;
using PckStudio.Extensions;
namespace PckStudio.Popups
namespace PckStudio.Forms.Additional_Popups
{
public partial class AddNewSkin : MetroFramework.Forms.MetroForm
public partial class AddSkinPrompt : MetroFramework.Forms.MetroForm
{
public PckAsset SkinFile => skin;
public PckAsset CapeFile => cape;
public bool HasCape => cape is not null;
public PckAsset SkinAsset => _skin;
public PckAsset CapeAsset => _cape;
public bool HasCape => _cape is not null;
private LOCFile currentLoc;
private PckAsset skin = new PckAsset("dlcskinXYXYXYXY", PckAssetType.SkinFile);
private PckAsset cape;
private PckAsset _skin = new PckAsset("dlcskinXYXYXYXY", PckAssetType.SkinFile);
private PckAsset _cape;
private SkinANIM anim = new SkinANIM();
private Random rng = new Random();
@@ -39,7 +39,7 @@ namespace PckStudio.Popups
Custom,
}
public AddNewSkin(LOCFile loc)
public AddSkinPrompt(LOCFile loc)
{
InitializeComponent();
currentLoc = loc;
@@ -145,12 +145,12 @@ namespace PckStudio.Popups
private void buttonSkin_Click(object sender, EventArgs e)
{
contextMenuSkin.Show(this, Location.X + buttonSkin.Location.X + 2, Location.Y + buttonSkin.Location.Y + buttonSkin.Size.Height);
contextMenuSkin.Show(this, buttonSkin.Location.X + 2, buttonSkin.Location.Y + buttonSkin.Size.Height);
}
private void buttonCape_Click(object sender, EventArgs e)
{
contextMenuCape.Show(this, Location.X + buttonCape.Location.X + 2, Location.Y + buttonCape.Location.Y + buttonCape.Size.Height);
contextMenuCape.Show(this, buttonCape.Location.X + 2, buttonCape.Location.Y + buttonCape.Size.Height);
}
private void replaceToolStripMenuItem_Click(object sender, EventArgs e)
@@ -171,8 +171,8 @@ namespace PckStudio.Popups
{
contextMenuSkin.Show(
this,
x: Location.X + skinPictureBox.Location.X,
y: Location.Y + skinPictureBox.Location.Y + skinPictureBox.Size.Height
x: skinPictureBox.Location.X,
y: skinPictureBox.Location.Y + skinPictureBox.Size.Height
);
return;
}
@@ -207,8 +207,8 @@ namespace PckStudio.Popups
{
contextMenuCape.Show(
this,
x: Location.X + capePictureBox.Location.X,
y: Location.Y + capePictureBox.Location.Y + capePictureBox.Size.Height
x: capePictureBox.Location.X,
y: capePictureBox.Location.Y + capePictureBox.Size.Height
);
return;
}
@@ -226,8 +226,8 @@ namespace PckStudio.Popups
return;
}
capePictureBox.Image = Image.FromFile(ofd.FileName);
cape ??= new PckAsset("dlccapeXYXYXYXY", PckAssetType.CapeFile);
cape.SetData(File.ReadAllBytes(ofd.FileName));
_cape ??= new PckAsset("dlccapeXYXYXYXY", PckAssetType.CapeFile);
_cape.SetData(File.ReadAllBytes(ofd.FileName));
contextMenuCape.Items[0].Text = "Replace";
capeLabel.Visible = false;
contextMenuCape.Visible = true;
@@ -243,35 +243,35 @@ namespace PckStudio.Popups
return;
}
string skinId = _skinId.ToString("d08");
skin.Filename = $"dlcskin{skinId}.png";
skin.AddProperty("DISPLAYNAME", textSkinName.Text);
_skin.Filename = $"dlcskin{skinId}.png";
_skin.AddProperty("DISPLAYNAME", textSkinName.Text);
if (currentLoc is not null)
{
string skinDisplayNameLocKey = $"IDS_dlcskin{skinId}_DISPLAYNAME";
skin.AddProperty("DISPLAYNAMEID", skinDisplayNameLocKey);
_skin.AddProperty("DISPLAYNAMEID", skinDisplayNameLocKey);
currentLoc.AddLocKey(skinDisplayNameLocKey, textSkinName.Text);
}
if (!string.IsNullOrEmpty(textThemeName.Text))
{
skin.AddProperty("THEMENAME", textThemeName.Text);
_skin.AddProperty("THEMENAME", textThemeName.Text);
if (currentLoc is not null)
{
skin.AddProperty("THEMENAMEID", $"IDS_dlcskin{skinId}_THEMENAME");
_skin.AddProperty("THEMENAMEID", $"IDS_dlcskin{skinId}_THEMENAME");
currentLoc.AddLocKey($"IDS_dlcskin{skinId}_THEMENAME", textThemeName.Text);
}
}
skin.AddProperty("ANIM", anim);
skin.AddProperty("GAME_FLAGS", "0x18");
skin.AddProperty("FREE", "1");
_skin.AddProperty("ANIM", anim);
_skin.AddProperty("GAME_FLAGS", "0x18");
_skin.AddProperty("FREE", "1");
if (HasCape)
{
cape.Filename = $"dlccape{skinId}.png";
skin.AddProperty("CAPEPATH", cape.Filename);
_cape.Filename = $"dlccape{skinId}.png";
_skin.AddProperty("CAPEPATH", _cape.Filename);
}
skin.SetTexture(skinPictureBox.Image);
_skin.SetTexture(skinPictureBox.Image);
DialogResult = DialogResult.OK;
Close();
}
@@ -288,9 +288,9 @@ namespace PckStudio.Popups
if (MessageBox.Show(this, "Create your own custom skin model?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) != DialogResult.Yes)
return;
skin.SetTexture(Resources.classic_template);
_skin.SetTexture(Resources.classic_template);
using generateModel generate = new generateModel(skin);
using generateModel generate = new generateModel(_skin);
if (generate.ShowDialog() == DialogResult.OK)
{

View File

@@ -313,7 +313,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;buttonDone.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="buttonModelGen.Location" type="System.Drawing.Point, System.Drawing">
<value>14, 259</value>
@@ -337,7 +337,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;buttonModelGen.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="buttonCape.BackgroundImageLayout" type="System.Windows.Forms.ImageLayout, System.Windows.Forms">
<value>Center</value>
@@ -364,7 +364,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;buttonCape.ZOrder" xml:space="preserve">
<value>12</value>
<value>0</value>
</data>
<data name="buttonSkin.BackgroundImageLayout" type="System.Windows.Forms.ImageLayout, System.Windows.Forms">
<value>Center</value>
@@ -439,7 +439,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;radioButtonAuto.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="radioButtonManual.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -466,7 +466,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;radioButtonManual.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="resource.Image" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
@@ -505,7 +505,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;textSkinID.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="resource.Image1" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
@@ -544,7 +544,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;textSkinName.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="resource.Image2" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
@@ -583,7 +583,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;textThemeName.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="labelSelectTexture.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -616,7 +616,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;labelSelectTexture.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="capeLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -652,7 +652,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;capeLabel.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="buttonAnimGen.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
@@ -679,7 +679,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;buttonAnimGen.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="capePictureBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>None</value>
@@ -706,7 +706,7 @@
<value>capePictureBox</value>
</data>
<data name="&gt;&gt;capePictureBox.Type" xml:space="preserve">
<value>PckStudio.ToolboxItems.InterpolationPictureBox, PCK-Studio, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>PckStudio.ToolboxItems.InterpolationPictureBox, PCK-Studio, Version=7.0.0.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;capePictureBox.Parent" xml:space="preserve">
<value>$this</value>
@@ -736,7 +736,7 @@
<value>skinPictureBox</value>
</data>
<data name="&gt;&gt;skinPictureBox.Type" xml:space="preserve">
<value>PckStudio.ToolboxItems.InterpolationPictureBox, PCK-Studio, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>PckStudio.ToolboxItems.InterpolationPictureBox, PCK-Studio, Version=7.0.0.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;skinPictureBox.Parent" xml:space="preserve">
<value>$this</value>

View File

@@ -1,215 +0,0 @@
namespace PckStudio.Forms.Additional_Popups.Animation
{
partial class ChangeTile
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangeTile));
this.acceptBtn = new System.Windows.Forms.Button();
this.CancelBtn = new System.Windows.Forms.Button();
this.treeViewBlocks = new System.Windows.Forms.TreeView();
this.treeViewItems = new System.Windows.Forms.TreeView();
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
this.metroTextBox1 = new MetroFramework.Controls.MetroTextBox();
this.metroTabControl1 = new MetroFramework.Controls.MetroTabControl();
this.Blocks = new System.Windows.Forms.TabPage();
this.Items = new System.Windows.Forms.TabPage();
this.metroTabControl1.SuspendLayout();
this.Blocks.SuspendLayout();
this.Items.SuspendLayout();
this.SuspendLayout();
//
// acceptBtn
//
this.acceptBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.acceptBtn.ForeColor = System.Drawing.Color.White;
this.acceptBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.acceptBtn.Location = new System.Drawing.Point(92, 196);
this.acceptBtn.Name = "acceptBtn";
this.acceptBtn.Size = new System.Drawing.Size(75, 23);
this.acceptBtn.TabIndex = 7;
this.acceptBtn.Text = "Save";
this.acceptBtn.UseVisualStyleBackColor = true;
this.acceptBtn.Click += new System.EventHandler(this.AcceptBtn_Click);
//
// CancelBtn
//
this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.CancelBtn.ForeColor = System.Drawing.Color.White;
this.CancelBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.CancelBtn.Location = new System.Drawing.Point(172, 196);
this.CancelBtn.Name = "CancelBtn";
this.CancelBtn.Size = new System.Drawing.Size(75, 23);
this.CancelBtn.TabIndex = 13;
this.CancelBtn.Text = "Cancel";
this.CancelBtn.UseVisualStyleBackColor = true;
this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
//
// treeViewBlocks
//
this.treeViewBlocks.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.treeViewBlocks.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeViewBlocks.ForeColor = System.Drawing.Color.White;
this.treeViewBlocks.Location = new System.Drawing.Point(0, 0);
this.treeViewBlocks.Name = "treeViewBlocks";
this.treeViewBlocks.Size = new System.Drawing.Size(318, 142);
this.treeViewBlocks.TabIndex = 14;
this.treeViewBlocks.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViews_AfterSelect);
//
// treeViewItems
//
this.treeViewItems.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.treeViewItems.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeViewItems.ForeColor = System.Drawing.Color.White;
this.treeViewItems.Location = new System.Drawing.Point(0, 0);
this.treeViewItems.Name = "treeViewItems";
this.treeViewItems.Size = new System.Drawing.Size(318, 142);
this.treeViewItems.TabIndex = 14;
this.treeViewItems.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViews_AfterSelect);
//
// metroLabel2
//
this.metroLabel2.AutoSize = true;
this.metroLabel2.Location = new System.Drawing.Point(133, 19);
this.metroLabel2.Name = "metroLabel2";
this.metroLabel2.Size = new System.Drawing.Size(46, 19);
this.metroLabel2.TabIndex = 16;
this.metroLabel2.Text = "Filter: ";
this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// metroTextBox1
//
//
//
//
this.metroTextBox1.CustomButton.Image = null;
this.metroTextBox1.CustomButton.Location = new System.Drawing.Point(134, 1);
this.metroTextBox1.CustomButton.Name = "";
this.metroTextBox1.CustomButton.Size = new System.Drawing.Size(21, 21);
this.metroTextBox1.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.metroTextBox1.CustomButton.TabIndex = 1;
this.metroTextBox1.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.metroTextBox1.CustomButton.UseSelectable = true;
this.metroTextBox1.CustomButton.Visible = false;
this.metroTextBox1.Lines = new string[0];
this.metroTextBox1.Location = new System.Drawing.Point(173, 18);
this.metroTextBox1.MaxLength = 32767;
this.metroTextBox1.Name = "metroTextBox1";
this.metroTextBox1.PasswordChar = '\0';
this.metroTextBox1.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.metroTextBox1.SelectedText = "";
this.metroTextBox1.SelectionLength = 0;
this.metroTextBox1.SelectionStart = 0;
this.metroTextBox1.ShortcutsEnabled = true;
this.metroTextBox1.Size = new System.Drawing.Size(156, 23);
this.metroTextBox1.TabIndex = 17;
this.metroTextBox1.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroTextBox1.UseSelectable = true;
this.metroTextBox1.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.metroTextBox1.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
this.metroTextBox1.TextChanged += new System.EventHandler(this.filter_TextChanged);
//
// metroTabControl1
//
this.metroTabControl1.Controls.Add(this.Blocks);
this.metroTabControl1.Controls.Add(this.Items);
this.metroTabControl1.Location = new System.Drawing.Point(6, 8);
this.metroTabControl1.Name = "metroTabControl1";
this.metroTabControl1.SelectedIndex = 0;
this.metroTabControl1.Size = new System.Drawing.Size(326, 184);
this.metroTabControl1.Style = MetroFramework.MetroColorStyle.White;
this.metroTabControl1.TabIndex = 18;
this.metroTabControl1.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroTabControl1.UseSelectable = true;
//
// Blocks
//
this.Blocks.BackColor = System.Drawing.SystemColors.WindowFrame;
this.Blocks.Controls.Add(this.treeViewBlocks);
this.Blocks.Location = new System.Drawing.Point(4, 38);
this.Blocks.Name = "Blocks";
this.Blocks.Size = new System.Drawing.Size(318, 142);
this.Blocks.TabIndex = 0;
this.Blocks.Text = "Blocks";
//
// Items
//
this.Items.BackColor = System.Drawing.SystemColors.WindowFrame;
this.Items.Controls.Add(this.treeViewItems);
this.Items.Location = new System.Drawing.Point(4, 38);
this.Items.Name = "Items";
this.Items.Size = new System.Drawing.Size(318, 142);
this.Items.TabIndex = 0;
this.Items.Text = "Items";
//
// ChangeTile
//
this.AcceptButton = this.acceptBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBtn;
this.ClientSize = new System.Drawing.Size(338, 228);
this.ControlBox = false;
this.Controls.Add(this.metroTextBox1);
this.Controls.Add(this.metroLabel2);
this.Controls.Add(this.metroTabControl1);
this.Controls.Add(this.CancelBtn);
this.Controls.Add(this.acceptBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ChangeTile";
this.Resizable = false;
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroTabControl1.ResumeLayout(false);
this.Blocks.ResumeLayout(false);
this.Items.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
private void MetroTextBox1_TextChanged(object sender, System.EventArgs e)
{
throw new System.NotImplementedException();
}
#endregion
private System.Windows.Forms.Button acceptBtn;
private System.Windows.Forms.Button CancelBtn;
private System.Windows.Forms.TreeView treeViewBlocks;
private System.Windows.Forms.TreeView treeViewItems;
private MetroFramework.Controls.MetroLabel metroLabel2;
private MetroFramework.Controls.MetroTextBox metroTextBox1;
private MetroFramework.Controls.MetroTabControl metroTabControl1;
private System.Windows.Forms.TabPage Blocks;
private System.Windows.Forms.TabPage Items;
}
}

View File

@@ -2,14 +2,18 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
using MetroFramework.Controls;
using System.Xml.Linq;
using MetroFramework.Forms;
using PckStudio.Extensions;
using PckStudio.Internal;
using PckStudio.Internal.App;
using PckStudio.Internal.Json;
namespace PckStudio.Forms.Additional_Popups.Animation
{
internal partial class ChangeTile : MetroForm
/// Wrapper class kept for simplicity
internal class ChangeTile : IDisposable
{
private JsonTileInfo selectedTile;
private ResourceCategory category = ResourceCategory.BlockAnimation;
@@ -17,121 +21,69 @@ namespace PckStudio.Forms.Additional_Popups.Animation
public JsonTileInfo SelectedTile => selectedTile;
public ResourceCategory Category => category;
List<TreeNode> treeViewBlockCache = new List<TreeNode>();
List<TreeNode> treeViewItemCache = new List<TreeNode>();
private FilterPrompt filterPrompt;
public ChangeTile()
{
InitializeComponent();
treeViewBlocks.ImageList = Tiles.BlockImageList;
treeViewItems.ImageList = Tiles.ItemImageList;
filterPrompt = new FilterPrompt();
filterPrompt.OnSelectedItemChanged += filterPrompt_OnSelectedItemChanged;
InitializeTreeviews();
}
private void InitializeTreeviews()
{
Profiler.Start();
GetTileDataToView(ResourceCategory.BlockAnimation, treeViewBlocks.Nodes, treeViewBlockCache.Add);
GetTileDataToView(ResourceCategory.ItemAnimation, treeViewItems.Nodes, treeViewItemCache.Add);
GetTileDataToView(ResourceCategory.BlockAnimation);
GetTileDataToView(ResourceCategory.ItemAnimation);
Profiler.Stop();
}
private void treeViews_AfterSelect(object sender, TreeViewEventArgs e)
public DialogResult ShowDialog(IWin32Window owner)
{
if (e.Node.Tag is JsonTileInfo tileData)
return filterPrompt.ShowDialog(owner);
}
private void filterPrompt_OnSelectedItemChanged(object sender, EventArgs e)
{
if (filterPrompt.SelectedItem is JsonTileInfo tileData)
{
selectedTile = tileData;
category = e.Node.TreeView == treeViewItems
? ResourceCategory.ItemAnimation
: ResourceCategory.BlockAnimation;
category = filterPrompt.SelectedTabIndex == 0 ? ResourceCategory.BlockAnimation : ResourceCategory.ItemAnimation;
}
}
private void GetTileDataToView(ResourceCategory key, TreeNodeCollection collection, Action<TreeNode> additionalAction)
private void GetTileDataToView(ResourceCategory key)
{
List<JsonTileInfo> textureInfos = key switch
(List<JsonTileInfo> textureInfos, ImageList imgList, string name) = key switch
{
ResourceCategory.BlockAnimation => Tiles.BlockTileInfos,
ResourceCategory.ItemAnimation => Tiles.ItemTileInfos,
ResourceCategory.BlockAnimation => (Tiles.BlockTileInfos, Tiles.BlockImageList, "Blocks"),
ResourceCategory.ItemAnimation => (Tiles.ItemTileInfos, Tiles.ItemImageList, "Items"),
_ => throw new InvalidOperationException(nameof(key))
};
Profiler.Start();
if (textureInfos is not null)
{
foreach ((int i, var tileData) in textureInfos.enumerate())
var view = filterPrompt.AddFilterPage(name, null, filterPredicate);
view.ImageList = imgList;
foreach ((int i, var tileData) in textureInfos?.enumerate())
{
if (string.IsNullOrEmpty(tileData.InternalName) || view.Nodes.ContainsKey(tileData.InternalName))
continue;
TreeNode tileNode = new TreeNode(tileData.DisplayName, i, i)
{
if (string.IsNullOrEmpty(tileData.InternalName) || collection.ContainsKey(tileData.InternalName))
continue;
TreeNode tileNode = new TreeNode(tileData.DisplayName, i, i)
{
Name = tileData.InternalName,
Tag = tileData
};
collection.Add(tileNode);
additionalAction(tileNode);
}
}
Profiler.Stop();
Name = tileData.InternalName,
Tag = tileData
};
view.Nodes.Add(tileNode);
(view.Tag as List<TreeNode>).Add(tileNode);
}
}
void filter_TextChanged(object sender, EventArgs e)
{
// Some code in this function is modified code from this StackOverflow answer - MattNL
//https://stackoverflow.com/questions/8260322/filter-a-treeview-with-a-textbox-in-a-c-sharp-winforms-app
private bool filterPredicate(string filterText, object nodeTag)
{
return nodeTag is JsonTileInfo tileInfo && tileInfo.InternalName.ToLower().Contains(filterText.ToLower());
}
//blocks repainting tree until all objects loaded
treeViewBlocks.BeginUpdate();
treeViewBlocks.Nodes.Clear();
treeViewItems.BeginUpdate();
treeViewItems.Nodes.Clear();
if (!string.IsNullOrEmpty(metroTextBox1.Text))
{
foreach (TreeNode _node in treeViewBlockCache)
{
if (_node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()) ||
(_node.Tag as JsonTileInfo).InternalName.ToLower().Contains(metroTextBox1.Text.ToLower()))
{
treeViewBlocks.Nodes.Add((TreeNode)_node.Clone());
}
}
foreach (TreeNode _node in treeViewItemCache)
{
if (_node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()) ||
(_node.Tag as JsonTileInfo).InternalName.ToLower().Contains(metroTextBox1.Text.ToLower()))
{
treeViewItems.Nodes.Add((TreeNode)_node.Clone());
}
}
}
else
{
foreach (TreeNode _node in treeViewBlockCache)
{
treeViewBlocks.Nodes.Add((TreeNode)_node.Clone());
}
foreach (TreeNode _node in treeViewItemCache)
{
treeViewItems.Nodes.Add((TreeNode)_node.Clone());
}
}
//enables redrawing tree after all objects have been added
treeViewBlocks.EndUpdate();
treeViewItems.EndUpdate();
}
private void CancelBtn_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void AcceptBtn_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(selectedTile.InternalName))
{
DialogResult = DialogResult.Cancel;
return;
}
DialogResult = DialogResult.OK;
}
}
public void Dispose()
{
filterPrompt.Dispose();
}
}
}

View File

@@ -1,187 +0,0 @@
namespace PckStudio.Forms.Additional_Popups.EntityForms
{
partial class AddEntry
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddEntry));
this.acceptBtn = new System.Windows.Forms.Button();
this.CancelBtn = new System.Windows.Forms.Button();
this.treeViewEntity = new System.Windows.Forms.TreeView();
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
this.metroTextBox1 = new MetroFramework.Controls.MetroTextBox();
this.metroTabControl1 = new MetroFramework.Controls.MetroTabControl();
this.Blocks = new System.Windows.Forms.TabPage();
this.metroTabControl1.SuspendLayout();
this.Blocks.SuspendLayout();
this.SuspendLayout();
//
// acceptBtn
//
this.acceptBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.acceptBtn.ForeColor = System.Drawing.Color.White;
this.acceptBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.acceptBtn.Location = new System.Drawing.Point(92, 196);
this.acceptBtn.Name = "acceptBtn";
this.acceptBtn.Size = new System.Drawing.Size(75, 23);
this.acceptBtn.TabIndex = 7;
this.acceptBtn.Text = "Add";
this.acceptBtn.UseVisualStyleBackColor = true;
this.acceptBtn.Click += new System.EventHandler(this.AcceptBtn_Click);
//
// CancelBtn
//
this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.CancelBtn.ForeColor = System.Drawing.Color.White;
this.CancelBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.CancelBtn.Location = new System.Drawing.Point(172, 196);
this.CancelBtn.Name = "CancelBtn";
this.CancelBtn.Size = new System.Drawing.Size(75, 23);
this.CancelBtn.TabIndex = 13;
this.CancelBtn.Text = "Cancel";
this.CancelBtn.UseVisualStyleBackColor = true;
this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
//
// treeViewEntity
//
this.treeViewEntity.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.treeViewEntity.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeViewEntity.ForeColor = System.Drawing.Color.White;
this.treeViewEntity.Location = new System.Drawing.Point(0, 0);
this.treeViewEntity.Name = "treeViewEntity";
this.treeViewEntity.Size = new System.Drawing.Size(318, 142);
this.treeViewEntity.TabIndex = 14;
this.treeViewEntity.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViews_AfterSelect);
//
// metroLabel2
//
this.metroLabel2.AutoSize = true;
this.metroLabel2.Location = new System.Drawing.Point(133, 19);
this.metroLabel2.Name = "metroLabel2";
this.metroLabel2.Size = new System.Drawing.Size(46, 19);
this.metroLabel2.TabIndex = 16;
this.metroLabel2.Text = "Filter: ";
this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// metroTextBox1
//
//
//
//
this.metroTextBox1.CustomButton.Image = null;
this.metroTextBox1.CustomButton.Location = new System.Drawing.Point(134, 1);
this.metroTextBox1.CustomButton.Name = "";
this.metroTextBox1.CustomButton.Size = new System.Drawing.Size(21, 21);
this.metroTextBox1.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.metroTextBox1.CustomButton.TabIndex = 1;
this.metroTextBox1.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.metroTextBox1.CustomButton.UseSelectable = true;
this.metroTextBox1.CustomButton.Visible = false;
this.metroTextBox1.Lines = new string[0];
this.metroTextBox1.Location = new System.Drawing.Point(173, 18);
this.metroTextBox1.MaxLength = 32767;
this.metroTextBox1.Name = "metroTextBox1";
this.metroTextBox1.PasswordChar = '\0';
this.metroTextBox1.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.metroTextBox1.SelectedText = "";
this.metroTextBox1.SelectionLength = 0;
this.metroTextBox1.SelectionStart = 0;
this.metroTextBox1.ShortcutsEnabled = true;
this.metroTextBox1.Size = new System.Drawing.Size(156, 23);
this.metroTextBox1.TabIndex = 17;
this.metroTextBox1.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroTextBox1.UseSelectable = true;
this.metroTextBox1.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.metroTextBox1.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
this.metroTextBox1.TextChanged += new System.EventHandler(this.filter_TextChanged);
//
// metroTabControl1
//
this.metroTabControl1.Controls.Add(this.Blocks);
this.metroTabControl1.Location = new System.Drawing.Point(6, 8);
this.metroTabControl1.Name = "metroTabControl1";
this.metroTabControl1.SelectedIndex = 0;
this.metroTabControl1.Size = new System.Drawing.Size(326, 184);
this.metroTabControl1.Style = MetroFramework.MetroColorStyle.White;
this.metroTabControl1.TabIndex = 18;
this.metroTabControl1.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroTabControl1.UseSelectable = true;
//
// Blocks
//
this.Blocks.BackColor = System.Drawing.SystemColors.WindowFrame;
this.Blocks.Controls.Add(this.treeViewEntity);
this.Blocks.Location = new System.Drawing.Point(4, 38);
this.Blocks.Name = "Blocks";
this.Blocks.Size = new System.Drawing.Size(318, 142);
this.Blocks.TabIndex = 0;
this.Blocks.Text = "Entities";
//
// AddEntry
//
this.AcceptButton = this.acceptBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CancelBtn;
this.ClientSize = new System.Drawing.Size(338, 228);
this.ControlBox = false;
this.Controls.Add(this.metroTextBox1);
this.Controls.Add(this.metroLabel2);
this.Controls.Add(this.metroTabControl1);
this.Controls.Add(this.CancelBtn);
this.Controls.Add(this.acceptBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AddEntry";
this.Resizable = false;
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroTabControl1.ResumeLayout(false);
this.Blocks.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
private void MetroTextBox1_TextChanged(object sender, System.EventArgs e)
{
throw new System.NotImplementedException();
}
#endregion
private System.Windows.Forms.Button CancelBtn;
private System.Windows.Forms.TreeView treeViewEntity;
private MetroFramework.Controls.MetroLabel metroLabel2;
private MetroFramework.Controls.MetroTextBox metroTextBox1;
private MetroFramework.Controls.MetroTabControl metroTabControl1;
private System.Windows.Forms.TabPage Blocks;
public System.Windows.Forms.Button acceptBtn;
}
}

View File

@@ -1,23 +1,26 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using MetroFramework.Forms;
using Newtonsoft.Json.Linq;
using PckStudio.Forms.Additional_Popups.Animation;
using PckStudio.Internal.Json;
namespace PckStudio.Forms.Additional_Popups.EntityForms
{
public partial class AddEntry : MetroForm
/// Wrapper class kept for simplicity
public class AddEntry
{
string selectedEntity = "";
public string SelectedEntity => selectedEntity;
List<TreeNode> treeViewEntityCache = new List<TreeNode>();
private FilterPrompt filterPrompt;
public AddEntry(string dataType, System.Drawing.Image[] entityImages)
{
InitializeComponent();
ImageList entities = new ImageList();
filterPrompt = new FilterPrompt();
filterPrompt.OnSelectedItemChanged += FilterPrompt_OnSelectedItemChanged;
var treeViewEntity = filterPrompt.AddFilterPage("Entities", null, filterPredicate);
ImageList entities = new ImageList();
entities.ColorDepth = ColorDepth.Depth32Bit;
entities.ImageSize = new System.Drawing.Size(32, 32);
entities.Images.AddRange(entityImages);
@@ -42,16 +45,26 @@ namespace PckStudio.Forms.Additional_Popups.EntityForms
SelectedImageIndex = i,
};
i++;
if (!String.IsNullOrEmpty(entity.InternalName))
if (!string.IsNullOrEmpty(entity.InternalName))
{
treeViewEntity.Nodes.Add(entityNode);
treeViewEntityCache.Add(entityNode);
(treeViewEntity.Tag as List<TreeNode>).Add(entityNode);
}
}
treeViewEntity.Sort();
}
private void FilterPrompt_OnSelectedItemChanged(object sender, EventArgs e)
{
selectedEntity = filterPrompt.SelectedItem.ToString();
}
public DialogResult ShowDialog(IWin32Window owner)
{
return filterPrompt.ShowDialog(owner);
}
private void treeViews_AfterSelect(object sender, TreeViewEventArgs e)
{
if (e.Node.Tag is string entityData)
@@ -60,47 +73,9 @@ namespace PckStudio.Forms.Additional_Popups.EntityForms
}
}
void filter_TextChanged(object sender, EventArgs e)
private bool filterPredicate(string filterText, object nodeTag)
{
// Some code in this function is modified code from this StackOverflow answer - MattNL
//https://stackoverflow.com/questions/8260322/filter-a-treeview-with-a-textbox-in-a-c-sharp-winforms-app
//blocks repainting tree until all objects loaded
treeViewEntity.BeginUpdate();
treeViewEntity.Nodes.Clear();
if (!string.IsNullOrEmpty(metroTextBox1.Text))
{
foreach (TreeNode _node in treeViewEntityCache)
{
if (_node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()) ||
(_node.Tag as string).ToLower().Contains(metroTextBox1.Text.ToLower()))
{
treeViewEntity.Nodes.Add((TreeNode)_node.Clone());
}
}
}
else
{
foreach (TreeNode _node in treeViewEntityCache)
{
treeViewEntity.Nodes.Add((TreeNode)_node.Clone());
}
}
//enables redrawing tree after all objects have been added
treeViewEntity.EndUpdate();
}
private void CancelBtn_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void AcceptBtn_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(selectedEntity)) CancelBtn_Click(sender, e);
DialogResult = DialogResult.OK;
Close();
}
return nodeTag is string a && a.ToLower().Contains(filterText.ToLower());
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,157 @@
namespace PckStudio.Forms.Additional_Popups.Animation
{
partial class FilterPrompt
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
MetroFramework.Controls.MetroLabel metroLabel2;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FilterPrompt));
this.acceptButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.filterTextBox = new MetroFramework.Controls.MetroTextBox();
this.tabController = new MetroFramework.Controls.MetroTabControl();
metroLabel2 = new MetroFramework.Controls.MetroLabel();
this.SuspendLayout();
//
// metroLabel2
//
metroLabel2.AutoSize = true;
metroLabel2.Location = new System.Drawing.Point(133, 19);
metroLabel2.Name = "metroLabel2";
metroLabel2.Size = new System.Drawing.Size(46, 19);
metroLabel2.TabIndex = 16;
metroLabel2.Text = "Filter: ";
metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// acceptButton
//
this.acceptButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.acceptButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.acceptButton.ForeColor = System.Drawing.Color.White;
this.acceptButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.acceptButton.Location = new System.Drawing.Point(92, 196);
this.acceptButton.Name = "acceptButton";
this.acceptButton.Size = new System.Drawing.Size(75, 23);
this.acceptButton.TabIndex = 7;
this.acceptButton.Text = "Save";
this.acceptButton.UseVisualStyleBackColor = true;
this.acceptButton.Click += new System.EventHandler(this.AcceptBtn_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelButton.ForeColor = System.Drawing.Color.White;
this.cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.cancelButton.Location = new System.Drawing.Point(172, 196);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 13;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.CancelBtn_Click);
//
// filterTextBox
//
//
//
//
this.filterTextBox.CustomButton.Image = null;
this.filterTextBox.CustomButton.Location = new System.Drawing.Point(134, 1);
this.filterTextBox.CustomButton.Name = "";
this.filterTextBox.CustomButton.Size = new System.Drawing.Size(21, 21);
this.filterTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.filterTextBox.CustomButton.TabIndex = 1;
this.filterTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.filterTextBox.CustomButton.UseSelectable = true;
this.filterTextBox.CustomButton.Visible = false;
this.filterTextBox.Lines = new string[0];
this.filterTextBox.Location = new System.Drawing.Point(173, 18);
this.filterTextBox.MaxLength = 32767;
this.filterTextBox.Name = "filterTextBox";
this.filterTextBox.PasswordChar = '\0';
this.filterTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.filterTextBox.SelectedText = "";
this.filterTextBox.SelectionLength = 0;
this.filterTextBox.SelectionStart = 0;
this.filterTextBox.ShortcutsEnabled = true;
this.filterTextBox.Size = new System.Drawing.Size(156, 23);
this.filterTextBox.TabIndex = 17;
this.filterTextBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.filterTextBox.UseSelectable = true;
this.filterTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.filterTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
this.filterTextBox.TextChanged += new System.EventHandler(this.filter_TextChanged);
//
// tabController
//
this.tabController.Location = new System.Drawing.Point(6, 8);
this.tabController.Name = "tabController";
this.tabController.Size = new System.Drawing.Size(326, 184);
this.tabController.Style = MetroFramework.MetroColorStyle.White;
this.tabController.TabIndex = 18;
this.tabController.Theme = MetroFramework.MetroThemeStyle.Dark;
this.tabController.UseSelectable = true;
//
// FilterPromtp
//
this.AcceptButton = this.acceptButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(338, 228);
this.ControlBox = false;
this.Controls.Add(this.filterTextBox);
this.Controls.Add(metroLabel2);
this.Controls.Add(this.tabController);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.acceptButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FilterPromtp";
this.Resizable = false;
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.ResumeLayout(false);
this.PerformLayout();
}
private void MetroTextBox1_TextChanged(object sender, System.EventArgs e)
{
throw new System.NotImplementedException();
}
#endregion
private System.Windows.Forms.Button acceptButton;
private System.Windows.Forms.Button cancelButton;
private MetroFramework.Controls.MetroTextBox filterTextBox;
private MetroFramework.Controls.MetroTabControl tabController;
}
}

View File

@@ -0,0 +1,118 @@
/* 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;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
using MetroFramework.Forms;
namespace PckStudio.Forms.Additional_Popups.Animation
{
internal partial class FilterPrompt : MetroForm
{
public string AcceptButtonText { get => acceptButton.Text; set => acceptButton.Text = value; }
public string CancelButtonText { get => cancelButton.Text; set => cancelButton.Text = value; }
private object selectedItem;
public object SelectedItem => selectedItem;
public int SelectedTabIndex => tabController.SelectedIndex;
public delegate bool FilterPredicate(string filterText, object nodeTag);
public event EventHandler OnSelectedItemChanged
{
add => Events.AddHandler(nameof(OnSelectedItemChanged), value);
remove => Events.RemoveHandler(nameof(OnSelectedItemChanged), value);
}
public FilterPrompt()
{
InitializeComponent();
}
public TreeView AddFilterPage(string categoryName, string key, FilterPredicate filterPredicate)
{
_ = categoryName ?? throw new ArgumentNullException(nameof(categoryName));
TabPage page = new TabPage(categoryName);
page.Name = key ?? categoryName;
page.Tag = filterPredicate;
var pageView = new TreeView()
{
Dock = DockStyle.Fill,
BackColor = Color.FromArgb(64, 64, 64),
};
pageView.AfterSelect += (sender, e) =>
{
selectedItem = e.Node.Tag;
Events[nameof(OnSelectedItemChanged)]?.DynamicInvoke(this, EventArgs.Empty);
};
pageView.Tag = new List<TreeNode>(4);
page.Controls.Add(pageView);
tabController.TabPages.Add(page);
return pageView;
}
public TreeView GetByKey(string key)
{
return tabController.TabPages[key].Controls[0] is TreeView view ? view : null;
}
private void filter_TextChanged(object sender, EventArgs e)
{
// Some code in this function is modified code from this StackOverflow answer - MattNL
// https://stackoverflow.com/questions/8260322/filter-a-treeview-with-a-textbox-in-a-c-sharp-winforms-app
// block re-painting control until all objects are loaded
foreach (TabPage tabpage in tabController.TabPages)
{
if (tabpage.Tag is not FilterPredicate filerPredicate || tabpage.Controls[0] is not TreeView pageView || pageView.Tag is not List<TreeNode> pageCache)
continue;
if (string.IsNullOrEmpty(filterTextBox.Text))
{
pageView.Nodes.Clear();
pageView.Nodes.AddRange(pageCache.ToArray());
continue;
}
pageView.BeginUpdate();
pageView.Nodes.Clear();
foreach (TreeNode _node in pageCache)
{
if (_node.Text.ToLower().Contains(filterTextBox.Text.ToLower()) || filerPredicate(filterTextBox.Text, _node.Tag))
{
pageView.Nodes.Add((TreeNode)_node.Clone());
}
}
pageView.EndUpdate();
}
}
private void CancelBtn_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void AcceptBtn_Click(object sender, EventArgs e)
{
DialogResult = selectedItem is null ? DialogResult.Cancel : DialogResult.OK;
}
}
}

View File

@@ -117,6 +117,15 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="metroLabel2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="metroLabel2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="filterTextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@@ -29,133 +29,33 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AppSettingsForm));
this.autoSaveCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.SettingToolTip = new MetroFramework.Components.MetroToolTip();
this.endianCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.autoUpdateCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.autoLoadPckCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.showPresenceCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.grf_paramKeyComboBoxCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.usePrereleaseCheckBox = new MetroFramework.Controls.MetroCheckBox();
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.SuspendLayout();
//
// autoSaveCheckBox
//
this.autoSaveCheckBox.AutoSize = true;
this.autoSaveCheckBox.Location = new System.Drawing.Point(23, 63);
this.autoSaveCheckBox.Name = "autoSaveCheckBox";
this.autoSaveCheckBox.Size = new System.Drawing.Size(76, 15);
this.autoSaveCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.autoSaveCheckBox.TabIndex = 0;
this.autoSaveCheckBox.Text = "Auto Save";
this.autoSaveCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.SettingToolTip.SetToolTip(this.autoSaveCheckBox, "Whether to automatically save changes inside of file editor such as the loc edito" +
"r");
this.autoSaveCheckBox.UseSelectable = true;
this.autoSaveCheckBox.CheckedChanged += new System.EventHandler(this.autoSaveCheckBox_CheckedChanged);
//
// SettingToolTip
//
this.SettingToolTip.Style = MetroFramework.MetroColorStyle.White;
this.SettingToolTip.StyleManager = null;
this.SettingToolTip.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// endianCheckBox
// flowLayoutPanel
//
this.endianCheckBox.AutoSize = true;
this.endianCheckBox.Location = new System.Drawing.Point(23, 84);
this.endianCheckBox.Name = "endianCheckBox";
this.endianCheckBox.Size = new System.Drawing.Size(75, 15);
this.endianCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.endianCheckBox.TabIndex = 1;
this.endianCheckBox.Text = "Open Vita";
this.endianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.SettingToolTip.SetToolTip(this.endianCheckBox, "Whether to automatically set the \'Open as Switch/Vita pck\' checkbox");
this.endianCheckBox.UseSelectable = true;
this.endianCheckBox.CheckedChanged += new System.EventHandler(this.endianCheckBox_CheckedChanged);
//
// autoUpdateCheckBox
//
this.autoUpdateCheckBox.AutoSize = true;
this.autoUpdateCheckBox.Location = new System.Drawing.Point(23, 105);
this.autoUpdateCheckBox.Name = "autoUpdateCheckBox";
this.autoUpdateCheckBox.Size = new System.Drawing.Size(90, 15);
this.autoUpdateCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.autoUpdateCheckBox.TabIndex = 2;
this.autoUpdateCheckBox.Text = "Auto Update";
this.autoUpdateCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.SettingToolTip.SetToolTip(this.autoUpdateCheckBox, "Whether to automatically check for updates");
this.autoUpdateCheckBox.UseSelectable = true;
this.autoUpdateCheckBox.CheckedChanged += new System.EventHandler(this.autoUpdateCheckBox_CheckedChanged);
//
// autoLoadPckCheckBox
//
this.autoLoadPckCheckBox.AutoSize = true;
this.autoLoadPckCheckBox.Location = new System.Drawing.Point(23, 126);
this.autoLoadPckCheckBox.Name = "autoLoadPckCheckBox";
this.autoLoadPckCheckBox.Size = new System.Drawing.Size(331, 15);
this.autoLoadPckCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.autoLoadPckCheckBox.TabIndex = 3;
this.autoLoadPckCheckBox.Text = "Auto load additional pck files (also known as SubPCK files)";
this.autoLoadPckCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.SettingToolTip.SetToolTip(this.autoLoadPckCheckBox, "Whether to automatically load files inside that end in .pck");
this.autoLoadPckCheckBox.UseSelectable = true;
this.autoLoadPckCheckBox.CheckedChanged += new System.EventHandler(this.autoLoadPckCheckBox_CheckedChanged);
//
// showPresenceCheckBox
//
this.showPresenceCheckBox.AutoSize = true;
this.showPresenceCheckBox.Location = new System.Drawing.Point(23, 147);
this.showPresenceCheckBox.Name = "showPresenceCheckBox";
this.showPresenceCheckBox.Size = new System.Drawing.Size(171, 15);
this.showPresenceCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.showPresenceCheckBox.TabIndex = 4;
this.showPresenceCheckBox.Text = "Show Discord Rich Presence";
this.showPresenceCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.SettingToolTip.SetToolTip(this.showPresenceCheckBox, "Whether to show a rich presence on discord");
this.showPresenceCheckBox.UseSelectable = true;
this.showPresenceCheckBox.CheckedChanged += new System.EventHandler(this.showPresenceCheckBox_CheckedChanged);
//
// grf_paramKeyComboBoxCheckBox
//
this.grf_paramKeyComboBoxCheckBox.AutoSize = true;
this.grf_paramKeyComboBoxCheckBox.Location = new System.Drawing.Point(23, 169);
this.grf_paramKeyComboBoxCheckBox.Name = "grf_paramKeyComboBoxCheckBox";
this.grf_paramKeyComboBoxCheckBox.Size = new System.Drawing.Size(100, 15);
this.grf_paramKeyComboBoxCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.grf_paramKeyComboBoxCheckBox.TabIndex = 5;
this.grf_paramKeyComboBoxCheckBox.Text = "Select GRF Key";
this.grf_paramKeyComboBoxCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.SettingToolTip.SetToolTip(this.grf_paramKeyComboBoxCheckBox, "Use a combobox instead of typing the parameter key name");
this.grf_paramKeyComboBoxCheckBox.UseSelectable = true;
this.grf_paramKeyComboBoxCheckBox.CheckedChanged += new System.EventHandler(this.grf_paramKeyComboBoxCheckBox_CheckedChanged);
//
// usePrereleaseCheckBox
//
this.usePrereleaseCheckBox.AutoSize = true;
this.usePrereleaseCheckBox.Location = new System.Drawing.Point(119, 105);
this.usePrereleaseCheckBox.Name = "usePrereleaseCheckBox";
this.usePrereleaseCheckBox.Size = new System.Drawing.Size(98, 15);
this.usePrereleaseCheckBox.Style = MetroFramework.MetroColorStyle.White;
this.usePrereleaseCheckBox.TabIndex = 6;
this.usePrereleaseCheckBox.Text = "Use Beta Build";
this.usePrereleaseCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
this.SettingToolTip.SetToolTip(this.usePrereleaseCheckBox, "Whether to automatically check for updates");
this.usePrereleaseCheckBox.UseSelectable = true;
this.usePrereleaseCheckBox.Visible = false;
this.flowLayoutPanel.AutoScroll = true;
this.flowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel.Location = new System.Drawing.Point(20, 60);
this.flowLayoutPanel.Name = "flowLayoutPanel";
this.flowLayoutPanel.Padding = new System.Windows.Forms.Padding(3);
this.flowLayoutPanel.Size = new System.Drawing.Size(487, 190);
this.flowLayoutPanel.TabIndex = 0;
//
// AppSettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(527, 270);
this.Controls.Add(this.usePrereleaseCheckBox);
this.Controls.Add(this.grf_paramKeyComboBoxCheckBox);
this.Controls.Add(this.showPresenceCheckBox);
this.Controls.Add(this.autoLoadPckCheckBox);
this.Controls.Add(this.autoUpdateCheckBox);
this.Controls.Add(this.endianCheckBox);
this.Controls.Add(this.autoSaveCheckBox);
this.Controls.Add(this.flowLayoutPanel);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
@@ -167,19 +67,11 @@
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AppBehaviorSettingsForm_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private MetroFramework.Controls.MetroCheckBox autoSaveCheckBox;
private MetroFramework.Components.MetroToolTip SettingToolTip;
private MetroFramework.Controls.MetroCheckBox endianCheckBox;
private MetroFramework.Controls.MetroCheckBox autoUpdateCheckBox;
private MetroFramework.Controls.MetroCheckBox autoLoadPckCheckBox;
private MetroFramework.Controls.MetroCheckBox showPresenceCheckBox;
private MetroFramework.Controls.MetroCheckBox grf_paramKeyComboBoxCheckBox;
private MetroFramework.Controls.MetroCheckBox usePrereleaseCheckBox;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
}
}

View File

@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using System.Diagnostics;
using System.Windows.Forms;
using MetroFramework.Controls;
using MetroFramework.Forms;
using PckStudio.Properties;
@@ -14,68 +11,65 @@ namespace PckStudio.Forms
{
public partial class AppSettingsForm : MetroForm
{
private ApplicationSettingsBase _applicationSettings;
public AppSettingsForm()
: this(Settings.Default)
{
}
public AppSettingsForm(ApplicationSettingsBase applicationSettings)
{
InitializeComponent();
_applicationSettings = applicationSettings;
LoadSettings();
}
private void autoSaveCheckBox_CheckedChanged(object sender, EventArgs e)
private static Dictionary<string, string> CheckBoxText = new Dictionary<string, string>()
{
Settings.Default.AutoSaveChanges = autoSaveCheckBox.Checked;
}
["ShowRichPresence"] = "Show Rich Presence",
["AutoSaveChanges"] = "Auto Save",
["UseLittleEndianAsDefault"] = "Open as Little Endian",
["AutoUpdate"] = "Auto Update",
["LoadSubPcks"] = "Load Sub Pcks",
["UsePrerelease"] = "Use Prerelease",
["UseComboBoxForGRFParameter"] = "Easy Grf Param",
};
private void endianCheckBox_CheckedChanged(object sender, EventArgs e)
private void CheckBox_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.UseLittleEndianAsDefault = endianCheckBox.Checked;
}
private void autoLoadPckCheckBox_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.LoadSubPcks = autoLoadPckCheckBox.Checked;
}
private void showPresenceCheckBox_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.ShowRichPresence = showPresenceCheckBox.Checked;
}
private void autoUpdateCheckBox_CheckedChanged(object sender, EventArgs e)
{
usePrereleaseCheckBox.Visible = Settings.Default.AutoUpdate = autoUpdateCheckBox.Checked;
}
private void grf_paramKeyComboBoxCheckBox_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.UseComboBoxForGRFParameter = grf_paramKeyComboBoxCheckBox.Checked;
}
private void usePrereleaseCheckBox_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.UsePrerelease = usePrereleaseCheckBox.Checked;
}
private void LoadCheckboxState(CheckBox checkBox, EventHandler eventHandler, bool state)
{
checkBox.CheckedChanged -= eventHandler;
checkBox.Checked = state;
checkBox.CheckedChanged += eventHandler;
if (sender is CheckBox checkBox && checkBox.Tag is string settingsKey && _applicationSettings[settingsKey] is bool)
{
_applicationSettings[settingsKey] = checkBox.Checked;
}
}
private void LoadSettings()
{
LoadCheckboxState(autoSaveCheckBox, autoSaveCheckBox_CheckedChanged, Settings.Default.AutoSaveChanges);
LoadCheckboxState(endianCheckBox, endianCheckBox_CheckedChanged, Settings.Default.UseLittleEndianAsDefault);
LoadCheckboxState(autoLoadPckCheckBox, autoLoadPckCheckBox_CheckedChanged, Settings.Default.LoadSubPcks);
LoadCheckboxState(showPresenceCheckBox, showPresenceCheckBox_CheckedChanged, Settings.Default.ShowRichPresence);
LoadCheckboxState(autoUpdateCheckBox, autoUpdateCheckBox_CheckedChanged, Settings.Default.AutoUpdate);
LoadCheckboxState(usePrereleaseCheckBox, usePrereleaseCheckBox_CheckedChanged, Settings.Default.UsePrerelease);
LoadCheckboxState(grf_paramKeyComboBoxCheckBox, grf_paramKeyComboBoxCheckBox_CheckedChanged, Settings.Default.UseComboBoxForGRFParameter);
foreach (SettingsPropertyValue item in _applicationSettings.PropertyValues)
{
Debug.WriteLine($"{item.Property.Name}: {item.Property.PropertyType}");
if (!item.Property.Attributes.ContainsKey(typeof(UserScopedSettingAttribute)) || item.Property.PropertyType != typeof(bool))
continue;
var checkBox = new MetroCheckBox
{
Name = item.Name,
Tag = item.Name,
Text = CheckBoxText.ContainsKey(item.Name) ? CheckBoxText[item.Name] : item.Name,
Checked = (bool)item.PropertyValue,
AutoSize = true,
Theme = MetroFramework.MetroThemeStyle.Dark,
Style = MetroFramework.MetroColorStyle.White,
};
checkBox.CheckedChanged += CheckBox_CheckedChanged;
flowLayoutPanel.Controls.Add(checkBox);
}
}
private void AppBehaviorSettingsForm_FormClosing(object sender, FormClosingEventArgs e)
{
Settings.Default.Save();
_applicationSettings.Save();
}
}
}

View File

@@ -1,6 +1,6 @@
namespace PckStudio.Forms
{
partial class CreditsForm
partial class ContributorsForm
{
/// <summary>
/// Required designer variable.
@@ -28,88 +28,47 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.PictureBox pictureBox1;
MetroFramework.Controls.MetroLabel metroLabel1;
MetroFramework.Controls.MetroLabel metroLabel2;
MetroFramework.Controls.MetroLabel metroLabel3;
MetroFramework.Controls.MetroLabel metroLabel4;
MetroFramework.Controls.MetroLabel metroLabel5;
MetroFramework.Controls.MetroLabel metroLabel6;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CreditsForm));
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ContributorsForm));
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.buildLabel = new MetroFramework.Controls.MetroLabel();
pictureBox1 = new System.Windows.Forms.PictureBox();
this.contributorsLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
metroLabel1 = new MetroFramework.Controls.MetroLabel();
metroLabel2 = new MetroFramework.Controls.MetroLabel();
metroLabel3 = new MetroFramework.Controls.MetroLabel();
metroLabel4 = new MetroFramework.Controls.MetroLabel();
metroLabel5 = new MetroFramework.Controls.MetroLabel();
metroLabel6 = new MetroFramework.Controls.MetroLabel();
((System.ComponentModel.ISupportInitialize)(pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
pictureBox1.BackColor = System.Drawing.Color.Transparent;
pictureBox1.Enabled = false;
pictureBox1.Image = global::PckStudio.Properties.Resources.Splash;
pictureBox1.Location = new System.Drawing.Point(4, 5);
pictureBox1.Margin = new System.Windows.Forms.Padding(0, 0, 11, 0);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(550, 293);
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
pictureBox1.TabIndex = 0;
pictureBox1.TabStop = false;
//
// metroLabel1
//
metroLabel1.AutoSize = true;
metroLabel1.Enabled = false;
metroLabel1.Location = new System.Drawing.Point(4, 301);
metroLabel1.Location = new System.Drawing.Point(23, 475);
metroLabel1.Name = "metroLabel1";
metroLabel1.Size = new System.Drawing.Size(250, 19);
metroLabel1.Size = new System.Drawing.Size(168, 19);
metroLabel1.TabIndex = 1;
metroLabel1.Text = "Restored and maintained by PhoenixARC";
metroLabel1.Text = "Maintained by PhoenixARC";
metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// metroLabel2
//
metroLabel2.AutoSize = true;
metroLabel2.Enabled = false;
metroLabel2.Location = new System.Drawing.Point(314, 301);
metroLabel2.Location = new System.Drawing.Point(23, 456);
metroLabel2.Name = "metroLabel2";
metroLabel2.Size = new System.Drawing.Size(269, 19);
metroLabel2.Size = new System.Drawing.Size(368, 19);
metroLabel2.TabIndex = 2;
metroLabel2.Text = "Utilizing the Nobledez Website by Newagent";
metroLabel2.Text = "Originally created and developed by jam1garner && Nobledez";
metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// metroLabel3
//
metroLabel3.AutoSize = true;
metroLabel3.Enabled = false;
metroLabel3.Location = new System.Drawing.Point(314, 339);
metroLabel3.Name = "metroLabel3";
metroLabel3.Size = new System.Drawing.Size(212, 19);
metroLabel3.TabIndex = 3;
metroLabel3.Text = "3D skin renderer by Łukasz Rejman";
metroLabel3.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// metroLabel4
//
metroLabel4.AutoSize = true;
metroLabel4.Enabled = false;
metroLabel4.Location = new System.Drawing.Point(314, 320);
metroLabel4.Name = "metroLabel4";
metroLabel4.Size = new System.Drawing.Size(199, 19);
metroLabel4.TabIndex = 4;
metroLabel4.Text = "3D renderer found by Newagent";
metroLabel4.Theme = MetroFramework.MetroThemeStyle.Dark;
//
// metroLabel5
//
metroLabel5.AutoSize = true;
metroLabel5.Enabled = false;
metroLabel5.Location = new System.Drawing.Point(4, 320);
metroLabel5.Location = new System.Drawing.Point(397, 456);
metroLabel5.Name = "metroLabel5";
metroLabel5.Size = new System.Drawing.Size(300, 19);
metroLabel5.TabIndex = 5;
@@ -120,7 +79,7 @@
//
metroLabel6.AutoSize = true;
metroLabel6.Enabled = false;
metroLabel6.Location = new System.Drawing.Point(4, 339);
metroLabel6.Location = new System.Drawing.Point(397, 475);
metroLabel6.Name = "metroLabel6";
metroLabel6.Size = new System.Drawing.Size(203, 19);
metroLabel6.TabIndex = 6;
@@ -132,40 +91,46 @@
this.buildLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(12)))), ((int)(((byte)(34)))), ((int)(((byte)(56)))));
this.buildLabel.Enabled = false;
this.buildLabel.ForeColor = System.Drawing.SystemColors.Control;
this.buildLabel.Location = new System.Drawing.Point(314, 30);
this.buildLabel.Location = new System.Drawing.Point(473, 6);
this.buildLabel.Name = "buildLabel";
this.buildLabel.Size = new System.Drawing.Size(212, 171);
this.buildLabel.Size = new System.Drawing.Size(212, 54);
this.buildLabel.TabIndex = 7;
this.buildLabel.Text = "Build Information";
this.buildLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
this.buildLabel.Theme = MetroFramework.MetroThemeStyle.Dark;
this.buildLabel.WrapToLine = true;
//
// CreditsForm
// contributorsLayoutPanel
//
this.contributorsLayoutPanel.AutoScroll = true;
this.contributorsLayoutPanel.Location = new System.Drawing.Point(23, 63);
this.contributorsLayoutPanel.Name = "contributorsLayoutPanel";
this.contributorsLayoutPanel.Size = new System.Drawing.Size(684, 390);
this.contributorsLayoutPanel.TabIndex = 8;
//
// ContributorsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(585, 364);
this.ClientSize = new System.Drawing.Size(730, 500);
this.Controls.Add(this.contributorsLayoutPanel);
this.Controls.Add(this.buildLabel);
this.Controls.Add(metroLabel6);
this.Controls.Add(metroLabel1);
this.Controls.Add(metroLabel5);
this.Controls.Add(metroLabel4);
this.Controls.Add(metroLabel3);
this.Controls.Add(metroLabel2);
this.Controls.Add(pictureBox1);
this.DisplayHeader = false;
this.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(730, 500);
this.MinimizeBox = false;
this.Name = "CreditsForm";
this.Padding = new System.Windows.Forms.Padding(20, 30, 20, 20);
this.MinimumSize = new System.Drawing.Size(730, 500);
this.Name = "ContributorsForm";
this.Resizable = false;
this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow;
this.Style = MetroFramework.MetroColorStyle.Black;
this.Text = "programInfo";
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Text = "Contributors";
this.Theme = MetroFramework.MetroThemeStyle.Dark;
((System.ComponentModel.ISupportInitialize)(pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -175,5 +140,6 @@
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
private MetroFramework.Controls.MetroLabel buildLabel;
private System.Windows.Forms.FlowLayoutPanel contributorsLayoutPanel;
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using MetroFramework.Forms;
using PckStudio.Internal;
using PckStudio.Internal.App;
using PckStudio.ToolboxItems;
namespace PckStudio.Forms
{
public partial class ContributorsForm : MetroForm
{
public ContributorsForm()
{
InitializeComponent();
#if false
Task.Run(GetContributors);
#endif
string buildConfig = "";
#if BETA
buildConfig = "Beta";
#elif DEBUG
buildConfig = "Debug";
#elif RELEASE
buildConfig = "Release";
#else
buildConfig = "unknown";
#endif
buildLabel.Text = $"Verion: {ApplicationScope.CurrentVersion}\nBuild Config: {buildConfig}\nBranch: {CommitInfo.BranchName}@{CommitInfo.CommitHash}";
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
foreach (var contributorsName in ApplicationScope.Contributors)
{
if (InvokeRequired)
Invoke(() => contributorsLayoutPanel.Controls.Add(new GithubUserPanel(contributorsName)));
else
contributorsLayoutPanel.Controls.Add(new GithubUserPanel(contributorsName));
}
}
}
}

View File

@@ -117,21 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="pictureBox1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="metroLabel1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="metroLabel2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="metroLabel3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="metroLabel4.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="metroLabel5.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>

View File

@@ -1,22 +0,0 @@
using System;
using System.Windows.Forms;
using MetroFramework.Forms;
using PckStudio.Internal;
namespace PckStudio.Forms
{
public partial class CreditsForm : MetroForm
{
public CreditsForm()
{
InitializeComponent();
#if BETA
buildLabel.Text = $"Build Config: Beta\nBuild Version: {ApplicationBuildInfo.BetaBuildVersion}\n Branch: {CommitInfo.BranchName}";
#elif DEBUG
buildLabel.Text = $"Build Config: Debug\nBranch: {CommitInfo.BranchName}\nCommit Id: {CommitInfo.CommitHash}";
#else
buildLabel.Text = string.Empty;
#endif
}
}
}

View File

@@ -70,6 +70,7 @@ namespace PckStudio.Forms.Editor
{
IgnoreAndDo(item.Key, checkbox =>
{
checkbox.Enabled = true; // fix for checkboxes being stuck as disabled
checkbox.Checked = state;
switch(checkBoxLinkage[checkbox])
{
@@ -82,7 +83,8 @@ namespace PckStudio.Forms.Editor
checkbox.Enabled = state;
break;
case SkinAnimFlag.RESOLUTION_64x64:
if (state) checkbox.Checked = false; // Prioritize slim model > classic model, LCE would
checkbox.Enabled = !state;
if(state) checkbox.Checked = false; // Prioritize slim model > classic model, LCE would
break;
}
anim.SetFlag(item.Value, checkbox.Checked);
@@ -96,6 +98,12 @@ namespace PckStudio.Forms.Editor
this.anim = anim;
foreach (var item in checkBoxLinkage)
{
/*
* not the best way to do this but whatever lol
* fix for both model flags being unset when both are set to true, with slim model prioritized of course
*/
if (item.Value == SkinAnimFlag.RESOLUTION_64x64 && anim.GetFlag(SkinAnimFlag.SLIM_MODEL)) continue;
item.Key.Checked = anim.GetFlag(item.Value);
}
}

View File

@@ -43,6 +43,7 @@ namespace PckStudio.Forms.Editor
private Animation _animation;
private bool _isSpecialTile;
private AnimationEditor()
{
InitializeComponent();
@@ -56,6 +57,7 @@ namespace PckStudio.Forms.Editor
_animation = animation;
tileLabel.Text = displayName;
_isSpecialTile = isSpecialTile;
animationPictureBox.Image = animation.CreateAnimationImage();
}
internal AnimationEditor(Animation animation, string displayName, Color blendColor)
@@ -63,7 +65,7 @@ namespace PckStudio.Forms.Editor
{
animationPictureBox.UseBlendColor = true;
animationPictureBox.BlendColor = blendColor;
}
}
private void ValidateToolStrip()
{
@@ -90,12 +92,13 @@ namespace PckStudio.Forms.Editor
InterpolationCheckbox.Checked = _animation.Interpolate;
TextureIcons.Images.Clear();
TextureIcons.Images.AddRange(_animation.GetTextures().ToArray());
UpdateTreeView();
animationPictureBox.Image ??= _animation.CreateAnimationImage();
if (_animation.FrameCount > 0)
{
animationPictureBox.SelectFrame(_animation, 0);
animationPictureBox.Image.SelectActiveFrame(FrameDimension.Page, 0);
}
}
@@ -111,13 +114,15 @@ namespace PckStudio.Forms.Editor
})
.ToArray()
);
}
}
private void frameTreeView_AfterSelect(object sender, TreeViewEventArgs e)
{
if (animationPictureBox.IsPlaying)
AnimationStartStopBtn.Text = "Play Animation";
animationPictureBox.SelectFrame(_animation, frameTreeView.SelectedNode.Index);
{
StopAnimation();
}
animationPictureBox.Image = _animation.GetFrame(frameTreeView.SelectedNode.Index).Texture;
}
private void StopAnimation()
@@ -133,9 +138,11 @@ namespace PckStudio.Forms.Editor
StopAnimation();
return;
}
if (_animation.FrameCount > 1)
{
animationPictureBox.Start(_animation);
animationPictureBox.Image = _animation.CreateAnimationImage();
animationPictureBox.Start();
AnimationStartStopBtn.Text = "Stop Animation";
}
}
@@ -458,14 +465,7 @@ namespace PckStudio.Forms.Editor
};
if (fileDialog.ShowDialog(this) != DialogResult.OK)
return;
using (var gifWriter = AnimatedGif.AnimatedGif.Create(fileDialog.FileName, Animation.GameTickInMilliseconds, repeat: 0))
{
foreach (var frame in _animation.GetInterpolatedFrames())
{
gifWriter.AddFrame(frame.Texture, frame.Ticks * Animation.GameTickInMilliseconds, GifQuality.Bit8);
}
}
_animation.CreateAnimationImage().Save(fileDialog.FileName);
}
private void frameTimeandTicksToolStripMenuItem_Click(object sender, EventArgs e)

View File

@@ -14,12 +14,12 @@ using NAudio.Wave;
using OMI.Formats.Pck;
using PckStudio.FileFormats;
using PckStudio.IO.PckAudio;
using PckStudio.Internal.IO.PckAudio;
using PckStudio.Forms.Additional_Popups;
using PckStudio.Properties;
using PckStudio.API.Miles;
using PckStudio.Internal;
using PckStudio.External.API.Miles;
using PckStudio.Extensions;
using PckStudio.Internal.App;
// Audio Editor by MattNL and Miku-666
@@ -28,8 +28,8 @@ namespace PckStudio.Forms.Editor
public partial class AudioEditor : MetroForm
{
public string defaultType = "yes";
PckAudioFile audioFile = null;
PckAsset audioPCK;
PckAudioFile _audioFile = null;
PckAsset _audioAsset;
bool _isLittleEndian = false;
MainForm parent = null;
@@ -63,7 +63,7 @@ namespace PckStudio.Forms.Editor
return (PckAudioFile.AudioCategory.EAudioType)Categories.IndexOf(category);
}
public AudioEditor(PckAsset file, bool isLittleEndian)
public AudioEditor(PckAsset asset, bool isLittleEndian)
{
InitializeComponent();
@@ -71,11 +71,11 @@ namespace PckStudio.Forms.Editor
_isLittleEndian = isLittleEndian;
audioPCK = file;
using (var stream = new MemoryStream(file.Data))
_audioAsset = asset;
using (var stream = new MemoryStream(asset.Data))
{
var reader = new PckAudioFileReader(isLittleEndian ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
audioFile = reader.FromStream(stream);
_audioFile = reader.FromStream(stream);
}
SetUpTree();
@@ -86,7 +86,7 @@ namespace PckStudio.Forms.Editor
treeView1.BeginUpdate();
treeView1.Nodes.Clear();
foreach (var category in audioFile.Categories)
foreach (var category in _audioFile.Categories)
{
// fix songs with directories using backslash instead of forward slash
// Songs with a backslash instead of a forward slash would not play in RPCS3
@@ -96,7 +96,7 @@ namespace PckStudio.Forms.Editor
if (category.audioType == PckAudioFile.AudioCategory.EAudioType.Creative)
{
if (category.Name == "include_overworld" &&
audioFile.TryGetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld, out PckAudioFile.AudioCategory overworldCategory))
_audioFile.TryGetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld, out PckAudioFile.AudioCategory overworldCategory))
{
foreach (var name in category.SongNames.ToList())
{
@@ -112,7 +112,7 @@ namespace PckStudio.Forms.Editor
treeNode.Tag = category;
treeView1.Nodes.Add(treeNode);
}
playOverworldInCreative.Enabled = audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Creative);
playOverworldInCreative.Enabled = _audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Creative);
treeView1.EndUpdate();
}
@@ -141,15 +141,15 @@ namespace PckStudio.Forms.Editor
private void addCategoryStripMenuItem_Click(object sender, EventArgs e)
{
string[] available = Categories.FindAll(str => !audioFile.HasCategory(GetCategoryId(str))).ToArray();
string[] available = Categories.FindAll(str => !_audioFile.HasCategory(GetCategoryId(str))).ToArray();
if (available.Length > 0)
{
using ItemSelectionPopUp add = new ItemSelectionPopUp(available);
if (add.ShowDialog(this) == DialogResult.OK)
audioFile.AddCategory(GetCategoryId(add.SelectedItem));
_audioFile.AddCategory(GetCategoryId(add.SelectedItem));
else return;
var category = audioFile.GetCategory(GetCategoryId(add.SelectedItem));
var category = _audioFile.GetCategory(GetCategoryId(add.SelectedItem));
if (GetCategoryId(add.SelectedItem) == PckAudioFile.AudioCategory.EAudioType.Creative)
{
@@ -190,7 +190,7 @@ namespace PckStudio.Forms.Editor
private void removeCategoryStripMenuItem_Click(object sender, EventArgs e)
{
if (treeView1.SelectedNode is TreeNode main &&
audioFile.RemoveCategory(GetCategoryId(treeView1.SelectedNode.Text)))
_audioFile.RemoveCategory(GetCategoryId(treeView1.SelectedNode.Text)))
{
if(GetCategoryId(treeView1.SelectedNode.Text) == PckAudioFile.AudioCategory.EAudioType.Creative)
{
@@ -360,18 +360,18 @@ namespace PckStudio.Forms.Editor
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (!audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Overworld) ||
!audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Nether) ||
!audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.End))
if (!_audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Overworld) ||
!_audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Nether) ||
!_audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.End))
{
MessageBox.Show(this, "Your changes were not saved. The game will crash when loading your pack if the Overworld, Nether and End categories don't all exist with at least one valid song.", "Mandatory Categories Missing");
return;
}
PckAudioFile.AudioCategory overworldCategory = audioFile.GetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld);
PckAudioFile.AudioCategory overworldCategory = _audioFile.GetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld);
bool songs_missing = false;
foreach (var category in audioFile.Categories)
foreach (var category in _audioFile.Categories)
{
if (category.SongNames.Count < 1)
{
@@ -410,7 +410,7 @@ namespace PckStudio.Forms.Editor
return;
}
audioPCK.SetData(new PckAudioFileWriter(audioFile, _isLittleEndian ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian));
_audioAsset.SetData(new PckAudioFileWriter(_audioFile, _isLittleEndian ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian));
DialogResult = DialogResult.OK;
}
@@ -433,7 +433,7 @@ namespace PckStudio.Forms.Editor
DialogResult dr = MessageBox.Show(this, "This will delete all unused BINKA songs in the Data directory. This cannot be undone. Are you sure you want to continue?", "Warning", MessageBoxButtons.YesNo);
if (dr != DialogResult.Yes) return;
var totalSongList = new List<string>();
foreach (string song in audioFile.Categories.SelectMany(cat => cat.SongNames))
foreach (string song in _audioFile.Categories.SelectMany(cat => cat.SongNames))
{
Console.WriteLine(song);
totalSongList.Add(song);
@@ -525,7 +525,7 @@ namespace PckStudio.Forms.Editor
if (string.IsNullOrEmpty(ofn.FileName)) return; // Return if name is null or if the user cancels
var totalSongList = new List<string>();
foreach (string song in audioFile.Categories.SelectMany(cat => cat.SongNames))
foreach (string song in _audioFile.Categories.SelectMany(cat => cat.SongNames))
{
totalSongList.Add(song);
}
@@ -573,18 +573,18 @@ namespace PckStudio.Forms.Editor
{
if (!(treeView1.SelectedNode is TreeNode t && t.Tag is PckAudioFile.AudioCategory category)) return;
string[] available = Categories.FindAll(str => !audioFile.HasCategory(GetCategoryId(str))).ToArray();
string[] available = Categories.FindAll(str => !_audioFile.HasCategory(GetCategoryId(str))).ToArray();
if (available.Length > 0)
{
using ItemSelectionPopUp add = new ItemSelectionPopUp(available);
add.ButtonText = "Save";
if (add.ShowDialog(this) != DialogResult.OK) return;
audioFile.RemoveCategory(category.audioType);
_audioFile.RemoveCategory(category.audioType);
audioFile.AddCategory(category.parameterType, GetCategoryId(add.SelectedItem), category.audioType == PckAudioFile.AudioCategory.EAudioType.Overworld && playOverworldInCreative.Checked ? "include_overworld" : "");
_audioFile.AddCategory(category.parameterType, GetCategoryId(add.SelectedItem), category.audioType == PckAudioFile.AudioCategory.EAudioType.Overworld && playOverworldInCreative.Checked ? "include_overworld" : "");
var newCategory = audioFile.GetCategory(GetCategoryId(add.SelectedItem));
var newCategory = _audioFile.GetCategory(GetCategoryId(add.SelectedItem));
category.SongNames.ForEach(c => newCategory.SongNames.Add(c));
@@ -603,7 +603,7 @@ namespace PckStudio.Forms.Editor
if (treeView1.Nodes.Count < 1 || !parent.CreateDataFolder()) return;
string musicdir = Path.Combine(parent.GetDataPath(), "Music");
Directory.CreateDirectory(musicdir);
foreach (var category in audioFile.Categories)
foreach (var category in _audioFile.Categories)
{
for (var i = 0; i < category.SongNames.Count; i++) // using standard for loop so the list can be modified
{

View File

@@ -15,13 +15,14 @@ using PckStudio.Properties;
using PckStudio.Internal;
using PckStudio.Extensions;
using PckStudio.Internal.Json;
using PckStudio.Internal.App;
namespace PckStudio.Forms.Editor
{
public partial class BehaviourEditor : MetroForm
{
// Behaviours File Format research by Miku and MattNL
private readonly PckAsset _file;
private readonly PckAsset _asset;
BehaviourFile behaviourFile;
private readonly List<EntityInfo> BehaviourData = Entities.BehaviourInfos;
@@ -54,15 +55,15 @@ namespace PckStudio.Forms.Editor
treeView1.EndUpdate();
}
public BehaviourEditor(PckAsset file)
public BehaviourEditor(PckAsset asset)
{
InitializeComponent();
saveToolStripMenuItem1.Visible = !Settings.Default.AutoSaveChanges;
_file = file;
_asset = asset;
using (var stream = new MemoryStream(file.Data))
using (var stream = new MemoryStream(asset.Data))
{
var reader = new BehavioursReader();
behaviourFile = reader.FromStream(stream);
@@ -150,7 +151,6 @@ namespace PckStudio.Forms.Editor
if (!(treeView1.SelectedNode.Tag is BehaviourFile.RiderPositionOverride entry)) return;
var diag = new AddEntry("behaviours", ApplicationScope.EntityImages);
diag.acceptBtn.Text = "Save";
if (diag.ShowDialog(this) == DialogResult.OK)
{
@@ -255,7 +255,7 @@ namespace PckStudio.Forms.Editor
}
}
_file.SetData(new BehavioursWriter(behaviourFile));
_asset.SetData(new BehavioursWriter(behaviourFile));
DialogResult = DialogResult.OK;
}

View File

@@ -51,20 +51,8 @@ namespace PckStudio.Forms.Editor
this.menuStrip = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.waterTab = new System.Windows.Forms.TabPage();
this.waterTreeView = new System.Windows.Forms.TreeView();
this.ColorContextMenu = new MetroFramework.Controls.MetroContextMenu(this.components);
this.copyColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restoreOriginalColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.underwaterTreeView = new System.Windows.Forms.TreeView();
this.fogTreeView = new System.Windows.Forms.TreeView();
this.colorsTab = new System.Windows.Forms.TabPage();
this.colorTreeView = new System.Windows.Forms.TreeView();
this.tabControl = new MetroFramework.Controls.MetroTabControl();
this.underwaterTab = new System.Windows.Forms.TabPage();
this.fogTab = new System.Windows.Forms.TabPage();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stripPS4BiomesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.targetUpdateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TU12ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TU13ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -79,7 +67,21 @@ namespace PckStudio.Forms.Editor
this.TU54ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TU69ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._1_9_1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stripPS4BiomesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.waterTab = new System.Windows.Forms.TabPage();
this.waterTreeView = new System.Windows.Forms.TreeView();
this.ColorContextMenu = new MetroFramework.Controls.MetroContextMenu(this.components);
this.copyColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restoreOriginalColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.underwaterTreeView = new System.Windows.Forms.TreeView();
this.fogTreeView = new System.Windows.Forms.TreeView();
this.colorsTab = new System.Windows.Forms.TabPage();
this.colorTreeView = new System.Windows.Forms.TreeView();
this.tabControl = new MetroFramework.Controls.MetroTabControl();
this.underwaterTab = new System.Windows.Forms.TabPage();
this.fogTab = new System.Windows.Forms.TabPage();
this.metroPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.blueUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.greenUpDown)).BeginInit();
@@ -308,114 +310,6 @@ namespace PckStudio.Forms.Editor
this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1";
this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click);
//
// waterTab
//
this.waterTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.waterTab.Controls.Add(this.waterTreeView);
resources.ApplyResources(this.waterTab, "waterTab");
this.waterTab.Name = "waterTab";
//
// waterTreeView
//
this.waterTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.waterTreeView.ContextMenuStrip = this.ColorContextMenu;
resources.ApplyResources(this.waterTreeView, "waterTreeView");
this.waterTreeView.ForeColor = System.Drawing.Color.White;
this.waterTreeView.Name = "waterTreeView";
this.waterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView2_AfterSelect);
this.waterTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown);
//
// ColorContextMenu
//
this.ColorContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyColorToolStripMenuItem,
this.pasteColorToolStripMenuItem,
this.restoreOriginalColorToolStripMenuItem});
this.ColorContextMenu.Name = "ColorContextMenu";
resources.ApplyResources(this.ColorContextMenu, "ColorContextMenu");
//
// copyColorToolStripMenuItem
//
this.copyColorToolStripMenuItem.Name = "copyColorToolStripMenuItem";
resources.ApplyResources(this.copyColorToolStripMenuItem, "copyColorToolStripMenuItem");
this.copyColorToolStripMenuItem.Click += new System.EventHandler(this.copyColorToolStripMenuItem_Click);
//
// pasteColorToolStripMenuItem
//
this.pasteColorToolStripMenuItem.Name = "pasteColorToolStripMenuItem";
resources.ApplyResources(this.pasteColorToolStripMenuItem, "pasteColorToolStripMenuItem");
this.pasteColorToolStripMenuItem.Click += new System.EventHandler(this.pasteColorToolStripMenuItem_Click);
//
// restoreOriginalColorToolStripMenuItem
//
this.restoreOriginalColorToolStripMenuItem.Name = "restoreOriginalColorToolStripMenuItem";
resources.ApplyResources(this.restoreOriginalColorToolStripMenuItem, "restoreOriginalColorToolStripMenuItem");
this.restoreOriginalColorToolStripMenuItem.Click += new System.EventHandler(this.restoreOriginalColorToolStripMenuItem_Click);
//
// underwaterTreeView
//
this.underwaterTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.underwaterTreeView.ContextMenuStrip = this.ColorContextMenu;
this.underwaterTreeView.ForeColor = System.Drawing.Color.White;
resources.ApplyResources(this.underwaterTreeView, "underwaterTreeView");
this.underwaterTreeView.Name = "underwaterTreeView";
this.underwaterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView3_AfterSelect);
this.underwaterTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView3_KeyDown);
//
// fogTreeView
//
this.fogTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.fogTreeView.ContextMenuStrip = this.ColorContextMenu;
this.fogTreeView.ForeColor = System.Drawing.Color.White;
resources.ApplyResources(this.fogTreeView, "fogTreeView");
this.fogTreeView.Name = "fogTreeView";
this.fogTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView4_AfterSelect);
this.fogTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView4_KeyDown);
//
// colorsTab
//
this.colorsTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.colorsTab.Controls.Add(this.colorTreeView);
resources.ApplyResources(this.colorsTab, "colorsTab");
this.colorsTab.Name = "colorsTab";
//
// colorTreeView
//
this.colorTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.colorTreeView.ContextMenuStrip = this.ColorContextMenu;
resources.ApplyResources(this.colorTreeView, "colorTreeView");
this.colorTreeView.ForeColor = System.Drawing.Color.White;
this.colorTreeView.Name = "colorTreeView";
this.colorTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
this.colorTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView1_KeyDown);
//
// tabControl
//
resources.ApplyResources(this.tabControl, "tabControl");
this.tabControl.Controls.Add(this.colorsTab);
this.tabControl.Controls.Add(this.waterTab);
this.tabControl.Controls.Add(this.underwaterTab);
this.tabControl.Controls.Add(this.fogTab);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Style = MetroFramework.MetroColorStyle.White;
this.tabControl.Theme = MetroFramework.MetroThemeStyle.Dark;
this.tabControl.UseSelectable = true;
//
// underwaterTab
//
this.underwaterTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.underwaterTab.Controls.Add(this.underwaterTreeView);
resources.ApplyResources(this.underwaterTab, "underwaterTab");
this.underwaterTab.Name = "underwaterTab";
//
// fogTab
//
this.fogTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.fogTab.Controls.Add(this.fogTreeView);
resources.ApplyResources(this.fogTab, "fogTab");
this.fogTab.Name = "fogTab";
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -425,6 +319,12 @@ namespace PckStudio.Forms.Editor
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
resources.ApplyResources(this.toolsToolStripMenuItem, "toolsToolStripMenuItem");
//
// stripPS4BiomesToolStripMenuItem
//
this.stripPS4BiomesToolStripMenuItem.Name = "stripPS4BiomesToolStripMenuItem";
resources.ApplyResources(this.stripPS4BiomesToolStripMenuItem, "stripPS4BiomesToolStripMenuItem");
this.stripPS4BiomesToolStripMenuItem.Click += new System.EventHandler(this.stripPS4BiomesToolStripMenuItem_Click);
//
// targetUpdateToolStripMenuItem
//
this.targetUpdateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -509,11 +409,132 @@ namespace PckStudio.Forms.Editor
this._1_9_1ToolStripMenuItem.Name = "_1_9_1ToolStripMenuItem";
resources.ApplyResources(this._1_9_1ToolStripMenuItem, "_1_9_1ToolStripMenuItem");
//
// stripPS4BiomesToolStripMenuItem
// waterTab
//
this.stripPS4BiomesToolStripMenuItem.Name = "stripPS4BiomesToolStripMenuItem";
resources.ApplyResources(this.stripPS4BiomesToolStripMenuItem, "stripPS4BiomesToolStripMenuItem");
this.stripPS4BiomesToolStripMenuItem.Click += new System.EventHandler(this.stripPS4BiomesToolStripMenuItem_Click);
this.waterTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.waterTab.Controls.Add(this.waterTreeView);
resources.ApplyResources(this.waterTab, "waterTab");
this.waterTab.Name = "waterTab";
//
// waterTreeView
//
this.waterTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.waterTreeView.ContextMenuStrip = this.ColorContextMenu;
resources.ApplyResources(this.waterTreeView, "waterTreeView");
this.waterTreeView.ForeColor = System.Drawing.Color.White;
this.waterTreeView.Name = "waterTreeView";
this.waterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView2_AfterSelect);
this.waterTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown);
//
// ColorContextMenu
//
this.ColorContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyColorToolStripMenuItem,
this.pasteColorToolStripMenuItem,
this.restoreOriginalColorToolStripMenuItem,
this.addColorToolStripMenuItem,
this.removeColorToolStripMenuItem});
this.ColorContextMenu.Name = "ColorContextMenu";
resources.ApplyResources(this.ColorContextMenu, "ColorContextMenu");
//
// copyColorToolStripMenuItem
//
this.copyColorToolStripMenuItem.Image = global::PckStudio.Properties.Resources.file_copy;
this.copyColorToolStripMenuItem.Name = "copyColorToolStripMenuItem";
resources.ApplyResources(this.copyColorToolStripMenuItem, "copyColorToolStripMenuItem");
this.copyColorToolStripMenuItem.Click += new System.EventHandler(this.copyColorToolStripMenuItem_Click);
//
// pasteColorToolStripMenuItem
//
this.pasteColorToolStripMenuItem.Image = global::PckStudio.Properties.Resources.file_paste;
this.pasteColorToolStripMenuItem.Name = "pasteColorToolStripMenuItem";
resources.ApplyResources(this.pasteColorToolStripMenuItem, "pasteColorToolStripMenuItem");
this.pasteColorToolStripMenuItem.Click += new System.EventHandler(this.pasteColorToolStripMenuItem_Click);
//
// restoreOriginalColorToolStripMenuItem
//
this.restoreOriginalColorToolStripMenuItem.Image = global::PckStudio.Properties.Resources.file_restore;
this.restoreOriginalColorToolStripMenuItem.Name = "restoreOriginalColorToolStripMenuItem";
resources.ApplyResources(this.restoreOriginalColorToolStripMenuItem, "restoreOriginalColorToolStripMenuItem");
this.restoreOriginalColorToolStripMenuItem.Click += new System.EventHandler(this.restoreOriginalColorToolStripMenuItem_Click);
//
// addColorToolStripMenuItem
//
this.addColorToolStripMenuItem.Image = global::PckStudio.Properties.Resources.file_new;
this.addColorToolStripMenuItem.Name = "addColorToolStripMenuItem";
resources.ApplyResources(this.addColorToolStripMenuItem, "addColorToolStripMenuItem");
this.addColorToolStripMenuItem.Click += new System.EventHandler(this.addColorToolStripMenuItem_Click);
//
// removeColorToolStripMenuItem
//
this.removeColorToolStripMenuItem.Image = global::PckStudio.Properties.Resources.file_delete;
this.removeColorToolStripMenuItem.Name = "removeColorToolStripMenuItem";
resources.ApplyResources(this.removeColorToolStripMenuItem, "removeColorToolStripMenuItem");
this.removeColorToolStripMenuItem.Click += new System.EventHandler(this.removeColorToolStripMenuItem_Click);
//
// underwaterTreeView
//
this.underwaterTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.underwaterTreeView.ContextMenuStrip = this.ColorContextMenu;
this.underwaterTreeView.ForeColor = System.Drawing.Color.White;
resources.ApplyResources(this.underwaterTreeView, "underwaterTreeView");
this.underwaterTreeView.Name = "underwaterTreeView";
this.underwaterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView3_AfterSelect);
this.underwaterTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView3_KeyDown);
//
// fogTreeView
//
this.fogTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.fogTreeView.ContextMenuStrip = this.ColorContextMenu;
this.fogTreeView.ForeColor = System.Drawing.Color.White;
resources.ApplyResources(this.fogTreeView, "fogTreeView");
this.fogTreeView.Name = "fogTreeView";
this.fogTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView4_AfterSelect);
this.fogTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView4_KeyDown);
//
// colorsTab
//
this.colorsTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.colorsTab.Controls.Add(this.colorTreeView);
resources.ApplyResources(this.colorsTab, "colorsTab");
this.colorsTab.Name = "colorsTab";
//
// colorTreeView
//
this.colorTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.colorTreeView.ContextMenuStrip = this.ColorContextMenu;
resources.ApplyResources(this.colorTreeView, "colorTreeView");
this.colorTreeView.ForeColor = System.Drawing.Color.White;
this.colorTreeView.Name = "colorTreeView";
this.colorTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
this.colorTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView1_KeyDown);
//
// tabControl
//
resources.ApplyResources(this.tabControl, "tabControl");
this.tabControl.Controls.Add(this.colorsTab);
this.tabControl.Controls.Add(this.waterTab);
this.tabControl.Controls.Add(this.underwaterTab);
this.tabControl.Controls.Add(this.fogTab);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Style = MetroFramework.MetroColorStyle.White;
this.tabControl.Theme = MetroFramework.MetroThemeStyle.Dark;
this.tabControl.UseSelectable = true;
//
// underwaterTab
//
this.underwaterTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.underwaterTab.Controls.Add(this.underwaterTreeView);
resources.ApplyResources(this.underwaterTab, "underwaterTab");
this.underwaterTab.Name = "underwaterTab";
//
// fogTab
//
this.fogTab.BackColor = System.Drawing.SystemColors.WindowFrame;
this.fogTab.Controls.Add(this.fogTreeView);
resources.ApplyResources(this.fogTab, "fogTab");
this.fogTab.Name = "fogTab";
//
// COLEditor
//
@@ -595,5 +616,7 @@ namespace PckStudio.Forms.Editor
private ToolStripMenuItem TU69ToolStripMenuItem;
private ToolStripMenuItem _1_9_1ToolStripMenuItem;
private ToolStripMenuItem stripPS4BiomesToolStripMenuItem;
private ToolStripMenuItem addColorToolStripMenuItem;
private ToolStripMenuItem removeColorToolStripMenuItem;
}
}

View File

@@ -19,22 +19,22 @@ namespace PckStudio.Forms.Editor
ColorContainer colourfile;
string clipboard_color = "#FFFFFF";
private readonly PckAsset _file;
private readonly PckAsset _asset;
List<TreeNode> colorCache = new List<TreeNode>();
List<TreeNode> waterCache = new List<TreeNode>();
List<TreeNode> underwaterCache = new List<TreeNode>();
List<TreeNode> fogCache = new List<TreeNode>();
public COLEditor(PckAsset file)
public COLEditor(PckAsset asset)
{
InitializeComponent();
saveToolStripMenuItem1.Visible = !Settings.Default.AutoSaveChanges;
_file = file;
_asset = asset;
using(var stream = new MemoryStream(file.Data))
using(var stream = new MemoryStream(asset.Data))
{
var reader = new COLFileReader();
colourfile = reader.FromStream(stream);
@@ -98,7 +98,13 @@ namespace PckStudio.Forms.Editor
cache.Add(tn);
}
void SetUpTable(bool targetVersion)
void RemoveEntry(TreeNode entry, List<TreeNode> cache)
{
cache.Remove(entry);
entry.Remove();
}
void SetUpTable(bool targetVersion)
{
colorTreeView.Nodes.Clear();
waterTreeView.Nodes.Clear();
@@ -166,14 +172,12 @@ namespace PckStudio.Forms.Editor
{
if(add)
{
//alphaUpDown.ValueChanged += color_ValueChanged;
redUpDown.ValueChanged += color_ValueChanged;
greenUpDown.ValueChanged += color_ValueChanged;
blueUpDown.ValueChanged += color_ValueChanged;
}
else
{
//alphaUpDown.ValueChanged -= color_ValueChanged;
redUpDown.ValueChanged -= color_ValueChanged;
greenUpDown.ValueChanged -= color_ValueChanged;
blueUpDown.ValueChanged -= color_ValueChanged;
@@ -185,7 +189,10 @@ namespace PckStudio.Forms.Editor
if (colorTreeView.SelectedNode.Tag == null)
return;
waterTreeView.SelectedNode = null;
addColorToolStripMenuItem.Visible = true;
removeColorToolStripMenuItem.Visible = true;
waterTreeView.SelectedNode = null;
underwaterTreeView.SelectedNode = null;
fogTreeView.SelectedNode = null;
@@ -207,6 +214,9 @@ namespace PckStudio.Forms.Editor
if (waterTreeView.SelectedNode.Tag == null)
return;
addColorToolStripMenuItem.Visible = false;
removeColorToolStripMenuItem.Visible = false;
colorTreeView.SelectedNode = null;
underwaterTreeView.SelectedNode = null;
fogTreeView.SelectedNode = null;
@@ -231,7 +241,10 @@ namespace PckStudio.Forms.Editor
if (underwaterTreeView.SelectedNode.Tag == null)
return;
colorTreeView.SelectedNode = null;
addColorToolStripMenuItem.Visible = false;
removeColorToolStripMenuItem.Visible = false;
colorTreeView.SelectedNode = null;
waterTreeView.SelectedNode = null;
fogTreeView.SelectedNode = null;
@@ -253,7 +266,10 @@ namespace PckStudio.Forms.Editor
if (fogTreeView.SelectedNode.Tag == null)
return;
colorTreeView.SelectedNode = null;
addColorToolStripMenuItem.Visible = false;
removeColorToolStripMenuItem.Visible = false;
colorTreeView.SelectedNode = null;
waterTreeView.SelectedNode = null;
underwaterTreeView.SelectedNode = null;
@@ -272,7 +288,7 @@ namespace PckStudio.Forms.Editor
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
_file.SetData(new COLFileWriter(colourfile));
_asset.SetData(new COLFileWriter(colourfile));
DialogResult = DialogResult.OK;
}
@@ -450,15 +466,17 @@ namespace PckStudio.Forms.Editor
if (tab == colorsTab)
{
color = default_colourfile.Colors.Find(color => color.Name == node.Text).ColorPallette;
ColorContainer.Color col_entry = default_colourfile.Colors.Find(color => color.Name == node.Text);
if (color.IsEmpty) return;
if (col_entry == null) return;
color = col_entry.ColorPallette;
colorTextbox.Text = ColorTranslator.ToHtml(color).TrimStart('#');
}
else
{
var WaterEntry = default_colourfile.WaterColors.Find(color => color.Name == node.Text);
ColorContainer.WaterColor WaterEntry = default_colourfile.WaterColors.Find(color => color.Name == node.Text);
if (WaterEntry == null) return;
@@ -596,5 +614,43 @@ namespace PckStudio.Forms.Editor
SetUpTable(false);
}
}
private void addColorToolStripMenuItem_Click(object sender, EventArgs e)
{
if(tabControl.SelectedTab == colorsTab)
{
using (TextPrompt prompt = new TextPrompt())
{
prompt.OKButtonText = "Add";
prompt.contextLabel.Text = "Insert the name of the color you would like to add";
if(prompt.ShowDialog(this) == DialogResult.OK)
{
ColorContainer.Color entry = new ColorContainer.Color();
entry.Name = prompt.NewText;
entry.ColorPallette = Color.FromArgb(0xFFFFFF);
if(colourfile.Colors.Find(c => c.Name == entry.Name) != null)
{
MessageBox.Show(this, $"\"{entry.Name}\" already exists in this color table", "Color not added");
}
colourfile.Colors.Add(entry);
AddEntry(colorTreeView, colorCache, entry.Name, entry);
}
}
}
}
private void removeColorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (tabControl.SelectedTab == colorsTab
&& colorTreeView.SelectedNode is TreeNode entry
&& entry != null
&& entry.Tag is ColorContainer.Color color)
{
colourfile.Colors.Remove(color);
RemoveEntry(entry, colorCache);
}
}
}
}

View File

@@ -117,210 +117,18 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="&gt;&gt;metroTextBox1.Name" xml:space="preserve">
<value>metroTextBox1</value>
</data>
<data name="&gt;&gt;metroTextBox1.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroTextBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;metroTextBox1.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroTextBox1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;metroLabel2.Name" xml:space="preserve">
<value>metroLabel2</value>
</data>
<data name="&gt;&gt;metroLabel2.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;metroLabel2.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroLabel2.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;setColorBtn.Name" xml:space="preserve">
<value>setColorBtn</value>
</data>
<data name="&gt;&gt;setColorBtn.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;setColorBtn.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;setColorBtn.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;blueUpDown.Name" xml:space="preserve">
<value>blueUpDown</value>
</data>
<data name="&gt;&gt;blueUpDown.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;blueUpDown.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;blueUpDown.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;greenUpDown.Name" xml:space="preserve">
<value>greenUpDown</value>
</data>
<data name="&gt;&gt;greenUpDown.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;greenUpDown.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;greenUpDown.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;redUpDown.Name" xml:space="preserve">
<value>redUpDown</value>
</data>
<data name="&gt;&gt;redUpDown.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;redUpDown.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;redUpDown.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="&gt;&gt;alphaUpDown.Name" xml:space="preserve">
<value>alphaUpDown</value>
</data>
<data name="&gt;&gt;alphaUpDown.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;alphaUpDown.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;alphaUpDown.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="&gt;&gt;alphaLabel.Name" xml:space="preserve">
<value>alphaLabel</value>
</data>
<data name="&gt;&gt;alphaLabel.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;alphaLabel.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;alphaLabel.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="&gt;&gt;blueLabel.Name" xml:space="preserve">
<value>blueLabel</value>
</data>
<data name="&gt;&gt;blueLabel.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;blueLabel.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;blueLabel.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="&gt;&gt;greenLabel.Name" xml:space="preserve">
<value>greenLabel</value>
</data>
<data name="&gt;&gt;greenLabel.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;greenLabel.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;greenLabel.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="&gt;&gt;redLabel.Name" xml:space="preserve">
<value>redLabel</value>
</data>
<data name="&gt;&gt;redLabel.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;redLabel.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;redLabel.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="&gt;&gt;colorTextbox.Name" xml:space="preserve">
<value>colorTextbox</value>
</data>
<data name="&gt;&gt;colorTextbox.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroTextBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;colorTextbox.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;colorTextbox.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="&gt;&gt;metroLabel1.Name" xml:space="preserve">
<value>metroLabel1</value>
</data>
<data name="&gt;&gt;metroLabel1.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroLabel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;metroLabel1.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroLabel1.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="&gt;&gt;pictureBox1.Name" xml:space="preserve">
<value>pictureBox1</value>
</data>
<data name="&gt;&gt;pictureBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox1.Parent" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;pictureBox1.ZOrder" xml:space="preserve">
<value>15</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="metroPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="metroPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 60</value>
</data>
<data name="metroPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>612, 523</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="metroPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;metroPanel1.Name" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroPanel1.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroPanel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;metroPanel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;metroPanel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="resource.Image" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="resource.Location" type="System.Drawing.Point, System.Drawing">
<value>113, 1</value>
</data>
<data name="resource.Size" type="System.Drawing.Size, System.Drawing">
<value>21, 21</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="resource.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
@@ -684,12 +492,154 @@
<data name="&gt;&gt;pictureBox1.ZOrder" xml:space="preserve">
<value>15</value>
</data>
<data name="metroPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="metroPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 60</value>
</data>
<data name="metroPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>612, 523</value>
</data>
<data name="metroPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;metroPanel1.Name" xml:space="preserve">
<value>metroPanel1</value>
</data>
<data name="&gt;&gt;metroPanel1.Type" xml:space="preserve">
<value>MetroFramework.Controls.MetroPanel, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a</value>
</data>
<data name="&gt;&gt;metroPanel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;metroPanel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="menuStrip.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="saveToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADdSURBVDhPzZJB
CoJQEIa9jy0iPFAnCDpAtG3ZooUE4b6oVtIuClpJIAgqZEVlKpqEHUAm5pGPmhTbRA18G//5P5iHgvA3
I7ZniiQ7aVM9QZzcOKYbwVDbw8I6A2YAICBvg2VJdtjSs2Cse1Dt6tCYbliGO0UCFlLBxAj590yA0D4X
1Ec7CK8JF9j+lUmWzoVlpYJaz4JKZ5ULZqWCT6F9Jhhowcv9eeBOoQBvPXoBrA0zF8yyR6V9LvCjGLYH
NxfMvipIMaQ3Ux6ClPYFsaUq/bmd0rspuIO/Pe3/bu5p+sr3gTvFEQAAAABJRU5ErkJggg==
</value>
</data>
<data name="saveToolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>98, 22</value>
</data>
<data name="saveToolStripMenuItem1.Text" xml:space="preserve">
<value>Save</value>
</data>
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 20</value>
</data>
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
<value>File</value>
</data>
<data name="stripPS4BiomesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>213, 22</value>
</data>
<data name="stripPS4BiomesToolStripMenuItem.Text" xml:space="preserve">
<value>Remove PS4 Biome Colors</value>
</data>
<data name="TU12ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU12ToolStripMenuItem.Text" xml:space="preserve">
<value>TU12 (360)</value>
</data>
<data name="TU13ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU13ToolStripMenuItem.Text" xml:space="preserve">
<value>TU13/1.00 (360/PS3)</value>
</data>
<data name="TU14ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU14ToolStripMenuItem.Text" xml:space="preserve">
<value>TU14/1.04 (360/PS3)</value>
</data>
<data name="TU19ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU19ToolStripMenuItem.Text" xml:space="preserve">
<value>TU19/1.12/CU7 (360/PS3-4-Vita/XONE)</value>
</data>
<data name="TU31ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU31ToolStripMenuItem.Text" xml:space="preserve">
<value>TU31/1.22/CU19 (360/PS3-4-Vita/XONE)</value>
</data>
<data name="TU32ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU32ToolStripMenuItem.Text" xml:space="preserve">
<value>TU32/1.24/CU20/P3 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU43ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU43ToolStripMenuItem.Text" xml:space="preserve">
<value>TU43/1.35/CU32/P12 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU46ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU46ToolStripMenuItem.Text" xml:space="preserve">
<value>TU46/1.38/CU36/P15 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU51ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU51ToolStripMenuItem.Text" xml:space="preserve">
<value>TU51/1.44/CU41/P20 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU53ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU53ToolStripMenuItem.Text" xml:space="preserve">
<value>TU53/1.49/CU43/P23/1.0.3 (360/PS3-4-Vita/XONE/WIIU/SWITCH)</value>
</data>
<data name="TU54ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU54ToolStripMenuItem.Text" xml:space="preserve">
<value>TU54/1.52/CU44/P24/1.0.4 (360/PS3-4-Vita/XONE/WIIU/SWITCH)</value>
</data>
<data name="TU69ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU69ToolStripMenuItem.Text" xml:space="preserve">
<value>TU69/1.76/P38 (360/PS3-4-Vita/WIIU)</value>
</data>
<data name="_1_9_1ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="_1_9_1ToolStripMenuItem.Text" xml:space="preserve">
<value>1.91 (PS4)</value>
</data>
<data name="targetUpdateToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>213, 22</value>
</data>
<data name="targetUpdateToolStripMenuItem.Text" xml:space="preserve">
<value>Target Update</value>
</data>
<data name="toolsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 20</value>
</data>
<data name="toolsToolStripMenuItem.Text" xml:space="preserve">
<value>Tools</value>
</data>
<data name="menuStrip.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 60</value>
</data>
@@ -714,33 +664,41 @@
<data name="&gt;&gt;menuStrip.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 20</value>
</data>
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
<value>File</value>
</data>
<data name="saveToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADdSURBVDhPzZJB
CoJQEIa9jy0iPFAnCDpAtG3ZooUE4b6oVtIuClpJIAgqZEVlKpqEHUAm5pGPmhTbRA18G//5P5iHgvA3
I7ZniiQ7aVM9QZzcOKYbwVDbw8I6A2YAICBvg2VJdtjSs2Cse1Dt6tCYbliGO0UCFlLBxAj590yA0D4X
1Ec7CK8JF9j+lUmWzoVlpYJaz4JKZ5ULZqWCT6F9Jhhowcv9eeBOoQBvPXoBrA0zF8yyR6V9LvCjGLYH
NxfMvipIMaQ3Ux6ClPYFsaUq/bmd0rspuIO/Pe3/bu5p+sr3gTvFEQAAAABJRU5ErkJggg==
</value>
</data>
<data name="saveToolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="saveToolStripMenuItem1.Text" xml:space="preserve">
<value>Save</value>
</data>
<metadata name="ColorContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>125, 17</value>
</metadata>
<data name="copyColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 22</value>
</data>
<data name="copyColorToolStripMenuItem.Text" xml:space="preserve">
<value>Copy Color</value>
</data>
<data name="pasteColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 22</value>
</data>
<data name="pasteColorToolStripMenuItem.Text" xml:space="preserve">
<value>Paste Color</value>
</data>
<data name="restoreOriginalColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 22</value>
</data>
<data name="restoreOriginalColorToolStripMenuItem.Text" xml:space="preserve">
<value>Restore Color</value>
</data>
<data name="addColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 22</value>
</data>
<data name="addColorToolStripMenuItem.Text" xml:space="preserve">
<value>Add Color</value>
</data>
<data name="removeColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 22</value>
</data>
<data name="removeColorToolStripMenuItem.Text" xml:space="preserve">
<value>Remove Color</value>
</data>
<data name="ColorContextMenu.Size" type="System.Drawing.Size, System.Drawing">
<value>146, 70</value>
<value>150, 114</value>
</data>
<data name="&gt;&gt;ColorContextMenu.Name" xml:space="preserve">
<value>ColorContextMenu</value>
@@ -799,24 +757,6 @@
<data name="&gt;&gt;waterTab.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="copyColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>134, 22</value>
</data>
<data name="copyColorToolStripMenuItem.Text" xml:space="preserve">
<value>Copy Color</value>
</data>
<data name="pasteColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>134, 22</value>
</data>
<data name="pasteColorToolStripMenuItem.Text" xml:space="preserve">
<value>Paste Color</value>
</data>
<data name="restoreOriginalColorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>145, 22</value>
</data>
<data name="restoreOriginalColorToolStripMenuItem.Text" xml:space="preserve">
<value>Restore Color</value>
</data>
<data name="underwaterTreeView.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
@@ -979,102 +919,6 @@
<data name="&gt;&gt;tabControl.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="toolsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 20</value>
</data>
<data name="toolsToolStripMenuItem.Text" xml:space="preserve">
<value>Tools</value>
</data>
<data name="targetUpdateToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="targetUpdateToolStripMenuItem.Text" xml:space="preserve">
<value>Target Update</value>
</data>
<data name="TU12ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU12ToolStripMenuItem.Text" xml:space="preserve">
<value>TU12 (360)</value>
</data>
<data name="TU13ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU13ToolStripMenuItem.Text" xml:space="preserve">
<value>TU13/1.00 (360/PS3)</value>
</data>
<data name="TU14ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU14ToolStripMenuItem.Text" xml:space="preserve">
<value>TU14/1.04 (360/PS3)</value>
</data>
<data name="TU19ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU19ToolStripMenuItem.Text" xml:space="preserve">
<value>TU19/1.12/CU7 (360/PS3-4-Vita/XONE)</value>
</data>
<data name="TU31ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU31ToolStripMenuItem.Text" xml:space="preserve">
<value>TU31/1.22/CU19 (360/PS3-4-Vita/XONE)</value>
</data>
<data name="TU32ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU32ToolStripMenuItem.Text" xml:space="preserve">
<value>TU32/1.24/CU20/P3 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU43ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU43ToolStripMenuItem.Text" xml:space="preserve">
<value>TU43/1.35/CU32/P12 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU46ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU46ToolStripMenuItem.Text" xml:space="preserve">
<value>TU46/1.38/CU36/P15 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU51ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU51ToolStripMenuItem.Text" xml:space="preserve">
<value>TU51/1.44/CU41/P20 (360/PS3-4-Vita/XONE/WIIU)</value>
</data>
<data name="TU53ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU53ToolStripMenuItem.Text" xml:space="preserve">
<value>TU53/1.49/CU43/P23/1.0.3 (360/PS3-4-Vita/XONE/WIIU/SWITCH)</value>
</data>
<data name="TU54ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU54ToolStripMenuItem.Text" xml:space="preserve">
<value>TU54/1.52/CU44/P24/1.0.4 (360/PS3-4-Vita/XONE/WIIU/SWITCH)</value>
</data>
<data name="TU69ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="TU69ToolStripMenuItem.Text" xml:space="preserve">
<value>TU69/1.76/P38 (360/PS3-4-Vita/WIIU)</value>
</data>
<data name="_1_9_1ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>416, 22</value>
</data>
<data name="_1_9_1ToolStripMenuItem.Text" xml:space="preserve">
<value>1.91 (PS4)</value>
</data>
<data name="stripPS4BiomesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>213, 22</value>
</data>
<data name="stripPS4BiomesToolStripMenuItem.Text" xml:space="preserve">
<value>Remove PS4 Biome Colors</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -3611,30 +3455,18 @@
<data name="&gt;&gt;saveToolStripMenuItem1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;copyColorToolStripMenuItem.Name" xml:space="preserve">
<value>copyColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;copyColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pasteColorToolStripMenuItem.Name" xml:space="preserve">
<value>pasteColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;pasteColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;restoreOriginalColorToolStripMenuItem.Name" xml:space="preserve">
<value>restoreOriginalColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;restoreOriginalColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolsToolStripMenuItem.Name" xml:space="preserve">
<value>toolsToolStripMenuItem</value>
</data>
<data name="&gt;&gt;toolsToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;stripPS4BiomesToolStripMenuItem.Name" xml:space="preserve">
<value>stripPS4BiomesToolStripMenuItem</value>
</data>
<data name="&gt;&gt;stripPS4BiomesToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;targetUpdateToolStripMenuItem.Name" xml:space="preserve">
<value>targetUpdateToolStripMenuItem</value>
</data>
@@ -3719,10 +3551,34 @@
<data name="&gt;&gt;_1_9_1ToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;stripPS4BiomesToolStripMenuItem.Name" xml:space="preserve">
<value>stripPS4BiomesToolStripMenuItem</value>
<data name="&gt;&gt;copyColorToolStripMenuItem.Name" xml:space="preserve">
<value>copyColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;stripPS4BiomesToolStripMenuItem.Type" xml:space="preserve">
<data name="&gt;&gt;copyColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pasteColorToolStripMenuItem.Name" xml:space="preserve">
<value>pasteColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;pasteColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;restoreOriginalColorToolStripMenuItem.Name" xml:space="preserve">
<value>restoreOriginalColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;restoreOriginalColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;addColorToolStripMenuItem.Name" xml:space="preserve">
<value>addColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;addColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;removeColorToolStripMenuItem.Name" xml:space="preserve">
<value>removeColorToolStripMenuItem</value>
</data>
<data name="&gt;&gt;removeColorToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">

View File

@@ -21,7 +21,7 @@ using System.IO;
using System.Linq;
using System.Windows.Forms;
using PckStudio.Forms.Additional_Popups.Grf;
using PckStudio.Classes.Misc;
using PckStudio.Internal.Misc;
using OMI.Formats.GameRule;
using OMI.Workers.GameRule;
using System.Diagnostics;

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Collections.Generic;
using System.Windows.Forms;
using MetroFramework.Forms;
using PckStudio.Classes.Misc;
using PckStudio.Internal.Misc;
using PckStudio.Forms.Additional_Popups.Loc;
using OMI.Formats.Languages;
using OMI.Workers.Language;
@@ -19,13 +19,13 @@ namespace PckStudio.Forms.Editor
{
DataTable tbl;
LOCFile currentLoc;
PckAsset _file;
PckAsset _asset;
public LOCEditor(PckAsset file)
public LOCEditor(PckAsset asset)
{
InitializeComponent();
_file = file;
using (var ms = new MemoryStream(file.Data))
_asset = asset;
using (var ms = new MemoryStream(asset.Data))
{
var reader = new LOCFileReader();
currentLoc = reader.FromStream(ms);
@@ -145,7 +145,7 @@ namespace PckStudio.Forms.Editor
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
_file.SetData(new LOCFileWriter(currentLoc, 2));
_asset.SetData(new LOCFileWriter(currentLoc, 2));
DialogResult = DialogResult.OK;
}

View File

@@ -13,13 +13,14 @@ using OMI.Workers.Material;
using PckStudio.Internal;
using PckStudio.Extensions;
using PckStudio.Internal.Json;
using PckStudio.Internal.App;
namespace PckStudio.Forms.Editor
{
public partial class MaterialsEditor : MetroForm
{
// Materials File Format research by PhoenixARC
private readonly PckAsset _file;
private readonly PckAsset _asset;
MaterialContainer materialFile;
private readonly List<EntityInfo> MaterialData = Entities.BehaviourInfos;
@@ -64,12 +65,12 @@ namespace PckStudio.Forms.Editor
treeView1.EndUpdate();
}
public MaterialsEditor(PckAsset file)
public MaterialsEditor(PckAsset asset)
{
InitializeComponent();
_file = file;
_asset = asset;
using (var stream = new MemoryStream(file.Data))
using (var stream = new MemoryStream(asset.Data))
{
var reader = new MaterialFileReader();
materialFile = reader.FromStream(stream);
@@ -136,7 +137,7 @@ namespace PckStudio.Forms.Editor
materialFile.Add(mat);
}
_file.SetData(new MaterialFileWriter(materialFile));
_asset.SetData(new MaterialFileWriter(materialFile));
DialogResult = DialogResult.OK;
}

View File

@@ -17,6 +17,7 @@
**/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
@@ -30,7 +31,6 @@ using OMI.Formats.Pck;
using OMI.Workers.Color;
using PckStudio.Extensions;
using PckStudio.Helper;
using PckStudio.Internal;
using PckStudio.Internal.Deserializer;
using PckStudio.Internal.Json;
@@ -40,28 +40,21 @@ namespace PckStudio.Forms.Editor
{
internal partial class TextureAtlasEditor : MetroForm
{
private Image _workingTexture;
public Image FinalTexture
{
get
{
if (DialogResult != DialogResult.OK)
return null;
return _workingTexture;
}
}
private Image _atlasTexture;
public Image FinalTexture => DialogResult == DialogResult.OK ? _atlasTexture : null;
private readonly PckFile _pckFile;
private ColorContainer _colourTable;
private readonly Size _areaSize;
private readonly Size _tileAreaSize;
private readonly int _rowCount;
private readonly int _columnCount;
private readonly string _atlasType;
private readonly ResourceLocation _resourceLocation;
private readonly List<AtlasTile> _tiles;
private AtlasTile _selectedTile;
// the "parent" tile for tiles that share name; i.e. parts of water_flow
private AtlasTile dataTile;
private sealed class AtlasTile
{
internal readonly int Index;
@@ -83,11 +76,11 @@ namespace PckStudio.Forms.Editor
set {
if (value < 0)
{
value = _tiles.Count + value;
value += _tiles.Count;
}
else if (value >= _tiles.Count)
{
value = value - _tiles.Count;
value -= _tiles.Count;
}
SetImageDisplayed(value);
}
@@ -95,85 +88,90 @@ namespace PckStudio.Forms.Editor
private const ImageLayoutDirection _imageLayout = ImageLayoutDirection.Horizontal;
public TextureAtlasEditor(PckFile pckFile, string path, Image atlas, Size areaSize)
private readonly GraphicsConfig _graphicsConfig = new GraphicsConfig()
{
InterpolationMode = InterpolationMode.NearestNeighbor,
PixelOffsetMode = PixelOffsetMode.HighQuality
};
public TextureAtlasEditor(PckFile pckFile, ResourceLocation resourceLocation, Image atlas)
{
InitializeComponent();
AcquireColorTable(pckFile);
_workingTexture = atlas;
_areaSize = areaSize;
_pckFile = pckFile;
_rowCount = atlas.Width / areaSize.Width;
_columnCount = atlas.Height / areaSize.Height;
(var tileInfos, _atlasType) = Path.GetFileNameWithoutExtension(path) switch
if (!AcquireColorTable(pckFile))
{
"terrain" => (Tiles.BlockTileInfos, "blocks"),
"items" => (Tiles.ItemTileInfos, "items"),
"particles" => (Tiles.ParticleTileInfos, "particles"),
"mapicons" => (Tiles.MapIconTileInfos, "map_icons"),
"additionalmapicons" => (Tiles.AdditionalMapIconTileInfos, "additional_map_icons"),
"moon_phases" => (Tiles.MoonPhaseTileInfos, "moon_phases"),
"xporb" => (Tiles.ExperienceOrbTileInfos, "experience_orbs"),
"explosion" => (Tiles.ExplosionTileInfos, "explosions"),
"kz" => (Tiles.PaintingTileInfos, "paintings"),
"Banner_Atlas" => (Tiles.BannerTileInfos, "banners"),
_ => (null, null),
MessageBox.Show("Failed to acquire color information", "Acquire failure", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
return;
}
_atlasTexture = atlas;
_tileAreaSize = resourceLocation.GetTileArea(atlas.Size);
_pckFile = pckFile;
_rowCount = atlas.Width / _tileAreaSize.Width;
_columnCount = atlas.Height / _tileAreaSize.Height;
_resourceLocation = resourceLocation;
var tileInfos = resourceLocation.Category switch
{
ResourceCategory.BlockAtlas => Tiles.BlockTileInfos,
ResourceCategory.ItemAtlas => Tiles.ItemTileInfos,
ResourceCategory.ParticleAtlas => Tiles.ParticleTileInfos,
ResourceCategory.MapIconAtlas => Tiles.MapIconTileInfos,
ResourceCategory.AdditionalMapIconsAtlas => Tiles.AdditionalMapIconTileInfos,
ResourceCategory.MoonPhaseAtlas => Tiles.MoonPhaseTileInfos,
ResourceCategory.ExperienceOrbAtlas => Tiles.ExperienceOrbTileInfos,
ResourceCategory.ExplosionAtlas => Tiles.ExplosionTileInfos,
ResourceCategory.PaintingAtlas => Tiles.PaintingTileInfos,
ResourceCategory.BannerAtlas => Tiles.BannerTileInfos,
_ => null,
};
originalPictureBox.Image = atlas.GetArea(new Rectangle(0, 0, atlas.Width, atlas.Height));
originalPictureBox.Image = new Bitmap(atlas);
var images = atlas.Split(_areaSize, _imageLayout);
var images = atlas.Split(_tileAreaSize, _imageLayout);
var tiles = images.enumerate().Select(
p => new AtlasTile(
p.index,
AtlasTile MakeTile((int index, Image value) p)
{
int i = p.index;
JsonTileInfo tileInfo = tileInfos.IndexInRange(i) ? tileInfos[i] : null;
Rectangle atlasArea = GetAtlasArea(i, tileInfo?.TileWidth ?? 1, tileInfo?.TileHeight ?? 1, _rowCount, _columnCount, _tileAreaSize, _imageLayout);
// get texture for tiles that are not 1x1 tiles
Point selectedPoint = GetSelectedPoint(i, _rowCount, _columnCount, _imageLayout);
var textureLocation = new Point(selectedPoint.X * _tileAreaSize.Width, selectedPoint.Y * _tileAreaSize.Height);
var textureSize = new Size(tileInfos[i].TileWidth * _tileAreaSize.Width, tileInfos[i].TileHeight * _tileAreaSize.Height);
var textureArea = new Rectangle(textureLocation, textureSize);
Image texture = tileInfos.IndexInRange(i) ? atlas.GetArea(textureArea) : p.value;
return new AtlasTile(i, atlasArea, tileInfo, texture);
}
GetAtlasArea(
p.index,
tileInfos.IndexInRange(p.index)
? tileInfos[p.index].Width : 1,
tileInfos.IndexInRange(p.index)
? tileInfos[p.index].Height : 1,
_rowCount,
_columnCount,
_areaSize,
_imageLayout),
tileInfos.IndexInRange(p.index)
? tileInfos[p.index] : null,
// get texture for tiles that are not 1x1 tiles
tileInfos.IndexInRange(p.index)
? atlas.GetArea(
new Rectangle(
GetSelectedPoint(p.index, _rowCount, _columnCount, _imageLayout).X * _areaSize.Width,
GetSelectedPoint(p.index, _rowCount, _columnCount, _imageLayout).Y * _areaSize.Height,
tileInfos[p.index].Width * _areaSize.Width,
tileInfos[p.index].Height * _areaSize.Height))
: p.value)
);
_tiles = new List<AtlasTile>(tiles);
_tiles = new List<AtlasTile>(images.enumerate().Select(MakeTile));
SelectedIndex = 0;
bool isParticles = _atlasType == "particles";
animationButton.Enabled =
_resourceLocation.Category == ResourceCategory.BlockAtlas ||
_resourceLocation.Category == ResourceCategory.ItemAtlas;
// this is directly based on Java's source code for handling enchanted hits
// the particle is assigned a random grayscale color between roughly 154 and 230
// since critical hit is the only particle with this distinction, we just need to check the atlas type
colorSlider.Maximum = isParticles ? 230 : 255;
colorSlider.Minimum = isParticles ? 154 : 0;
colorSlider.Value = isParticles ? colorSlider.Maximum : colorSlider.Minimum;
if (_resourceLocation.Category == ResourceCategory.ParticleAtlas)
{
colorSlider.Minimum = 154;
colorSlider.Maximum = 230;
colorSlider.Value = colorSlider.Maximum;
}
}
private bool AcquireColorTable(PckFile pckFile)
{
if (pckFile.TryGetFile("colours.col", PckAssetType.ColourTableFile, out var colFile) &&
colFile.Size > 0)
if (pckFile.TryGetAsset("colours.col", PckAssetType.ColourTableFile, out var colAsset) &&
colAsset.Size > 0)
{
using var ms = new MemoryStream(colFile.Data);
using var ms = new MemoryStream(colAsset.Data);
var reader = new COLFileReader();
_colourTable = reader.FromStream(ms);
return true;
@@ -184,23 +182,14 @@ namespace PckStudio.Forms.Editor
private void UpdateAtlasDisplay()
{
var graphicsConfig = new GraphicsConfig()
{
InterpolationMode = selectTilePictureBox.InterpolationMode,
PixelOffsetMode = PixelOffsetMode.HighQuality
};
using (var g = Graphics.FromImage(originalPictureBox.Image))
{
g.ApplyConfig(graphicsConfig);
g.ApplyConfig(_graphicsConfig);
g.Clear(Color.Transparent);
g.DrawImage(_workingTexture, 0, 0, _workingTexture.Width, _workingTexture.Height);
g.DrawImage(_atlasTexture, 0, 0, _atlasTexture.Width, _atlasTexture.Height);
SolidBrush brush = new SolidBrush(Color.FromArgb(127, 255, 255, 255));
var rect = new Rectangle(_selectedTile.Area.X, _selectedTile.Area.Y,
_areaSize.Width, _areaSize.Height);
g.FillRectangle(brush, rect);
SolidBrush brush = new SolidBrush(Color.FromArgb(127, Color.White));
g.FillRectangle(brush, _selectedTile.Area);
}
originalPictureBox.Invalidate();
@@ -214,9 +203,11 @@ namespace PckStudio.Forms.Editor
colorSlider.Visible = false;
colorSliderLabel.Visible = false;
variantComboBox.Visible = false;
variantComboBox.Items.Clear();
variantComboBox.SelectedItem = null;
variantComboBox.Enabled = false;
variantComboBox.Items.Clear();
clearColorButton.Enabled = false;
if (selectTilePictureBox.IsPlaying)
selectTilePictureBox.Stop();
@@ -226,60 +217,60 @@ namespace PckStudio.Forms.Editor
if (_tiles is null || !_tiles.IndexInRange(index) || (_selectedTile = _tiles[index]) is null)
return;
dataTile = _selectedTile;
UpdateAtlasDisplay();
dataTile = _selectedTile;
if (string.IsNullOrEmpty(dataTile.Tile.DisplayName) && !string.IsNullOrEmpty(dataTile.Tile.InternalName))
{
dataTile = _tiles.Find(t => t.Tile.InternalName == _selectedTile.Tile.InternalName);
}
selectTilePictureBox.Image = dataTile.Texture;
tileNameLabel.Text = $"{dataTile.Tile.DisplayName}";
internalTileNameLabel.Text = $"{dataTile.Tile.InternalName}";
selectTilePictureBox.BlendColor = GetBlendColor();
selectTilePictureBox.UseBlendColor = applyColorMaskToolStripMenuItem.Checked;
if (animationButton.Enabled = _atlasType == "blocks" || _atlasType == "items")
{
PckAsset animationFile;
tileNameLabel.Text = $"{dataTile.Tile.DisplayName}";
internalTileNameLabel.Text = $"{dataTile.Tile.InternalName}";
if (animationButton.Enabled)
{
PckAsset animationAsset;
ResourceCategory animationResourceCategory = _resourceLocation.Category == ResourceCategory.ItemAtlas ? ResourceCategory.ItemAnimation : ResourceCategory.BlockAnimation;
string animationAssetPath = $"{ResourceLocation.GetPathFromCategory(animationResourceCategory)}/{dataTile.Tile.InternalName}";
bool hasAnimation =
_pckFile.TryGetValue($"res/textures/{_atlasType}/{dataTile.Tile.InternalName}.png", PckAssetType.TextureFile, out animationFile) ||
_pckFile.TryGetValue($"res/textures/{_atlasType}/{dataTile.Tile.InternalName}.tga", PckAssetType.TextureFile, out animationFile);
_pckFile.TryGetValue($"{animationAssetPath}.png", PckAssetType.TextureFile, out animationAsset) ||
_pckFile.TryGetValue($"{animationAssetPath}.tga", PckAssetType.TextureFile, out animationAsset);
animationButton.Text = hasAnimation ? "Edit Animation" : "Create Animation";
if (playAnimationsToolStripMenuItem.Checked &&
hasAnimation &&
animationFile.Size > 0)
// asset size check dont have to be done here the deserializer handles it. -Miku
if (playAnimationsToolStripMenuItem.Checked && hasAnimation)
{
var animation = animationFile.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
selectTilePictureBox.Start(animation);
var animation = animationAsset.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
selectTilePictureBox.Image = animation.CreateAnimationImage();
selectTilePictureBox.Start();
}
}
if (setColorButton.Enabled = clearColorButton.Enabled = dataTile.Tile.HasColourEntry)
setColorButton.Enabled = dataTile.Tile.AllowCustomColour;
variantComboBox.Enabled = variantComboBox.Visible = dataTile.Tile.HasColourEntry && dataTile.Tile.ColourEntry?.Variants?.Length > 1;
if (variantComboBox.Enabled)
{
setColorButton.Enabled = clearColorButton.Enabled = dataTile.Tile.ColourEntry.HasCustomColour;
clearColorButton.Enabled = false;
variantComboBox.Enabled = variantComboBox.Visible = dataTile.Tile.ColourEntry.Variants.Length > 1;
if (dataTile.Tile.ColourEntry.IsWaterColour && _colourTable.WaterColors.Count > 0)
if (dataTile.Tile.ColourEntry.IsWaterColour)
{
foreach (var col in _colourTable.WaterColors)
foreach (ColorContainer.WaterColor col in _colourTable.WaterColors)
{
if(!variantComboBox.Items.Contains(col.Name))
variantComboBox.Items.Add(col.Name);
}
dataTile.Tile.ColourEntry.DefaultName = _colourTable.WaterColors[0].Name;
}
// TODO: only add variants that are available in the color table
variantComboBox.Items.AddRange(dataTile.Tile.ColourEntry.Variants);
variantComboBox.SelectedItem = dataTile.Tile.ColourEntry.DefaultName;
if (variantComboBox.Items.Count > 0)
variantComboBox.SelectedIndex = 0;
}
}
@@ -366,11 +357,11 @@ namespace PckStudio.Forms.Editor
};
}
private static Rectangle GetAtlasArea(int index, int width, int height, int rowCount, int columnCount, Size size, ImageLayoutDirection imageLayout)
private static Rectangle GetAtlasArea(int index, int tileWidth, int tileHeight, int rowCount, int columnCount, Size size, ImageLayoutDirection imageLayout)
{
var p = GetSelectedPoint(index, rowCount, columnCount, imageLayout);
var ap = new Point(p.X * size.Width, p.Y * size.Height);
return new Rectangle(ap, new Size(size.Width * width, size.Height * height));
return new Rectangle(ap, new Size(size.Width * tileWidth, size.Height * tileHeight));
}
private static Point GetSelectedPoint(int index, int rowCount, int columnCount, ImageLayoutDirection imageLayout)
@@ -383,28 +374,19 @@ namespace PckStudio.Forms.Editor
private void SetTile(Image texture)
{
var graphicsConfig = new GraphicsConfig()
if (texture.Size != _tileAreaSize)
texture = texture.Resize(_tileAreaSize, _graphicsConfig);
using (var g = Graphics.FromImage(_atlasTexture))
{
InterpolationMode = selectTilePictureBox.InterpolationMode,
PixelOffsetMode = PixelOffsetMode.HighQuality
};
if (texture.Size != _areaSize)
texture = texture.Resize(_areaSize, graphicsConfig);
using (var g = Graphics.FromImage(_workingTexture))
{
g.ApplyConfig(graphicsConfig);
g.ApplyConfig(_graphicsConfig);
g.Fill(dataTile.Area, Color.Transparent);
g.DrawImage(texture, dataTile.Area);
}
var _finalTexture = _workingTexture.GetArea(new Rectangle(dataTile.Area.X, dataTile.Area.Y, dataTile.Area.Width, dataTile.Area.Height));
if(_selectedTile != dataTile)
_tiles[dataTile.Index] = new AtlasTile(dataTile.Index, dataTile.Area, dataTile.Tile, _finalTexture);
else
_tiles[_selectedTile.Index] = new AtlasTile(_selectedTile.Index, _selectedTile.Area, _selectedTile.Tile, _finalTexture);
selectTilePictureBox.Image = _finalTexture;
var tile = _selectedTile != dataTile ? dataTile : _selectedTile;
_tiles[tile.Index] = new AtlasTile(tile.Index, tile.Area, tile.Tile, texture);
selectTilePictureBox.Image = texture;
UpdateAtlasDisplay();
}
@@ -419,22 +401,24 @@ namespace PckStudio.Forms.Editor
return Color.White;
}
private Color HandleSpecialTiles(string colorKey)
private Color GetSpecificBlendColor(string colorKey)
{
colorSlider.Visible = colorSliderLabel.Visible = true;
// Simply, Experience orbs red value is just sliding between 255 and 0
if (colorKey == "experience_orb") return Color.FromArgb(colorSlider.Value, 255, 0);
if (colorKey == "experience_orb")
return Color.FromArgb(colorSlider.Value, 255, 0);
//similar story for critical hits, but for all values
// Similar story for critical hits, but for all values
var final_color = Color.FromArgb(colorSlider.Value, colorSlider.Value, colorSlider.Value);
// enchanted hits are modified critical hit particles
// Enchanted hits are modified critical hit particles
if (dataTile.Tile.InternalName == "enchanted_hit")
// this is directly based on Java's source code for handling enchanted hits
{
// This is directly based on Java's source code for handling enchanted hits
// it just multiplies the red by 0.3 and green by .8 of the color assigned to the critical hit particle
final_color = Color.FromArgb((int)(final_color.R * 0.3f), (int)(final_color.R * 0.8f), final_color.B);
}
return final_color;
}
@@ -442,11 +426,9 @@ namespace PckStudio.Forms.Editor
{
// The following tiles are hardcoded within a range and do not have color table entries
if (colorKey == "experience_orb" || colorKey == "critical_hit")
return HandleSpecialTiles(colorKey);
return GetSpecificBlendColor(colorKey);
if (_colourTable is not null &&
dataTile.Tile.HasColourEntry &&
dataTile.Tile.ColourEntry is not null)
if (dataTile.Tile.HasColourEntry && dataTile.Tile.ColourEntry is not null)
{
// basic way to check for classic water colors
if(!dataTile.Tile.ColourEntry.IsWaterColour || colorKey.StartsWith("Water_"))
@@ -462,6 +444,7 @@ namespace PckStudio.Forms.Editor
}
}
Debug.WriteLine("Could not find: " + colorKey);
return Color.White;
}
@@ -499,8 +482,8 @@ namespace PckStudio.Forms.Editor
int index = GetSelectedImageIndex(
originalPictureBox.Size,
_workingTexture.Size,
_areaSize,
_atlasTexture.Size,
_tileAreaSize,
e.Location,
originalPictureBox.SizeMode,
_imageLayout);
@@ -515,7 +498,7 @@ namespace PckStudio.Forms.Editor
{
OpenFileDialog fileDialog = new OpenFileDialog()
{
Filter = "PNG Image|*.png",
Filter = "Tile Texture(*.png)|*.png",
Title = "Select Texture"
};
@@ -533,22 +516,19 @@ namespace PckStudio.Forms.Editor
private void animationButton_Click(object sender, EventArgs e)
{
var file = _pckFile.GetOrCreate(
$"res/textures/{_atlasType}/{_selectedTile.Tile.InternalName}.png",
PckAssetType.TextureFile
);
ResourceCategory animationResourceCategory = _resourceLocation.Category == ResourceCategory.ItemAtlas ? ResourceCategory.ItemAnimation : ResourceCategory.BlockAnimation;
string animationAssetPath = $"{ResourceLocation.GetPathFromCategory(animationResourceCategory)}/{_selectedTile.Tile.InternalName}.png";
var file = _pckFile.GetOrCreate(animationAssetPath, PckAssetType.TextureFile);
var animation = file.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
var animationEditor = new AnimationEditor(animation, _selectedTile.Tile.InternalName, GetBlendColor());
if (animationEditor.ShowDialog(this) != DialogResult.OK)
var animationEditor = new AnimationEditor(animation, _selectedTile.Tile.DisplayName);
if (animationEditor.ShowDialog(this) == DialogResult.OK)
{
return;
file.SetSerializedData(animationEditor.Result, AnimationSerializer.DefaultSerializer);
// so animations can automatically update upon saving
SelectedIndex = _selectedTile.Index;
}
file.SetSerializedData(animationEditor.Result, AnimationSerializer.DefaultSerializer);
// so animations can automatically update upon saving
SelectedIndex = _selectedTile.Index;
}
private void extractTileToolStripMenuItem_Click(object sender, EventArgs e)
@@ -566,7 +546,7 @@ namespace PckStudio.Forms.Editor
private void variantComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (dataTile.Tile.ColourEntry is not null)
if (dataTile.Tile.ColourEntry is not null && variantComboBox.SelectedItem is not null)
{
string colorKey = variantComboBox.SelectedItem.ToString();
@@ -598,27 +578,24 @@ namespace PckStudio.Forms.Editor
colorPick.AnyColor = true;
colorPick.SolidColorOnly = true;
// custom colors are read as BGR for some reason, so hex values are "backwards"
// values below are the default Minecraft dyed leather armor values for convenience
//Debug.Assert(Color.FromArgb(0xf9fffe).ToBGR() == 0xfefff9); // White
//Debug.Assert(Color.FromArgb(0xf9801d).ToBGR() == 0x1d80f9); // Orange
//Debug.Assert(Color.FromArgb(0xc74ebd).ToBGR() == 0xbd4ec7); // Magenta
//Debug.Assert(Color.FromArgb(0x3ab3da).ToBGR() == 0xdab33a); // Light Blue
//Debug.Assert(Color.FromArgb(0xfed83d).ToBGR() == 0x3dd8fe); // Yellow
//Debug.Assert(Color.FromArgb(0x80c71f).ToBGR() == 0x1fc780); // Lime
//Debug.Assert(Color.FromArgb(0xf38baa).ToBGR() == 0xaa8bf3); // Pink
//Debug.Assert(Color.FromArgb(0x474f52).ToBGR() == 0x524f47); // Gray
//Debug.Assert(Color.FromArgb(0x9d9d97).ToBGR() == 0x979d9d); // Light Gray
//Debug.Assert(Color.FromArgb(0x169c9c).ToBGR() == 0x9c9c16); // Cyan
//Debug.Assert(Color.FromArgb(0x8932b8).ToBGR() == 0xb83289); // Purple
//Debug.Assert(Color.FromArgb(0x3c44aa).ToBGR() == 0xaa443c); // Blue
//Debug.Assert(Color.FromArgb(0x835432).ToBGR() == 0x325483); // Brown
//Debug.Assert(Color.FromArgb(0x5e7c16).ToBGR() == 0x167c5e); // Green
//Debug.Assert(Color.FromArgb(0xb02e26).ToBGR() == 0x262eb0); // Red
//Debug.Assert(Color.FromArgb(0x1d1d21).ToBGR() == 0x211d1d); // Black
colorPick.CustomColors = new int[] {
0xfefff9, // White
0x1d80f9, // Orange
0xbd4ec7, // Magenta
0xdab33a, // Light Blue
0x3dd8fe, // Yellow
0x1fc780, // Lime
0xaa8bf3, // Pink
0x524f47, // Gray
0x979d9d, // Light Gray
0x9c9c16, // Cyan
0xb83289, // Purple
0xaa443c, // Blue
0x325483, // Brown
0x167c5e, // Green
0x262eb0, // Red
0x211d1d // Black
};
colorPick.CustomColors = GameConstants.DyeColors.Select(c => c.ToBGR()).ToArray();
if (colorPick.ShowDialog(this) != DialogResult.OK) return;

View File

@@ -1,4 +1,4 @@
namespace PckStudio.Features
namespace PckStudio.Forms.Features
{
partial class CemuPanel
{

View File

@@ -21,10 +21,10 @@ using System.IO;
using System.Linq;
using System.Windows.Forms;
using PckStudio.Extensions;
using PckStudio.Classes.Misc;
using PckStudio.Internal.Misc;
using System.Diagnostics;
namespace PckStudio.Features
namespace PckStudio.Forms.Features
{
/// <summary>
/// Wishlist:

View File

@@ -1,4 +1,4 @@
namespace PckStudio.Features
namespace PckStudio.Forms.Features
{
partial class PckManager
{

View File

@@ -18,7 +18,7 @@
using System;
using System.Windows.Forms;
namespace PckStudio.Features
namespace PckStudio.Forms.Features
{
public partial class PckManager : MetroFramework.Forms.MetroForm
{

View File

@@ -1,4 +1,5 @@
using OMI;
using DiscordRPC;
using OMI;
using OMI.Formats.Pck;
using OMI.Workers.Pck;
using PckStudio.Extensions;
@@ -37,27 +38,27 @@ namespace PckStudio.Popups
{
if (fileTypeComboBox.SelectedIndex >= 0 && fileTypeComboBox.SelectedIndex <= 13)
{
applyBulkProperties(_pckFile.GetFiles(), fileTypeComboBox.SelectedIndex - 1);
applyBulkProperties(_pckFile.GetAssets(), fileTypeComboBox.SelectedIndex - 1);
DialogResult = DialogResult.OK;
return;
}
MessageBox.Show(this, "Please select a filetype before applying");
}
private void applyBulkProperties(IReadOnlyCollection<PckAsset> files, int index)
private void applyBulkProperties(IReadOnlyCollection<PckAsset> assets, int index)
{
foreach (PckAsset file in files)
foreach (PckAsset asset in assets)
{
if (file.Type == PckAssetType.TexturePackInfoFile ||
file.Type == PckAssetType.SkinDataFile)
if (asset.Type == PckAssetType.TexturePackInfoFile ||
asset.Type == PckAssetType.SkinDataFile)
{
try
{
var reader = new PckFileReader(_endianness);
using var ms = new MemoryStream(file.Data);
using var ms = new MemoryStream(asset.Data);
PckFile subPCK = reader.FromStream(ms);
applyBulkProperties(subPCK.GetFiles(), index);
file.SetData(new PckFileWriter(subPCK, _endianness));
applyBulkProperties(subPCK.GetAssets(), index);
asset.SetData(new PckFileWriter(subPCK, _endianness));
}
catch (OverflowException ex)
{
@@ -65,9 +66,9 @@ namespace PckStudio.Popups
}
}
if (index == -1 || (Enum.IsDefined(typeof(PckAssetType), index) && (int)file.Type == index))
if (index == -1 || (Enum.IsDefined(typeof(PckAssetType), index) && (int)asset.Type == index))
{
file.AddProperty(propertyKeyTextBox.Text, propertyValueTextBox.Text);
asset.AddProperty(propertyKeyTextBox.Text, propertyValueTextBox.Text);
}
}

View File

@@ -39,7 +39,7 @@ namespace PckStudio.Forms
left,
}
private PckAsset _file;
private PckAsset _asset;
private SkinANIM _ANIM;
private static Color _backgroundColor = Color.FromArgb(0xff, 0x50, 0x50, 0x50);
@@ -126,22 +126,22 @@ namespace PckStudio.Forms
}
}
public generateModel(PckAsset file)
public generateModel(PckAsset asset)
{
MessageBox.Show(this, "This feature is now considered deprecated and will no longer recieve updates. A better alternative is currently under development. Use at your own risk.", "Deprecated Feature", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
InitializeComponent();
_file = file;
if (file.Size > 0)
_asset = asset;
if (asset.Size > 0)
{
using (var ms = new MemoryStream(file.Data))
using (var ms = new MemoryStream(asset.Data))
{
uvPictureBox.Image = Image.FromStream(ms);
}
}
comboParent.Items.Clear();
comboParent.Items.AddRange(ValidModelBoxTypes);
LoadData(file);
LoadData(asset);
}
private static readonly Regex sWhitespace = new Regex(@"\s+");
public static string ReplaceWhitespace(string input, string replacement)
@@ -149,9 +149,9 @@ namespace PckStudio.Forms
return sWhitespace.Replace(input, replacement);
}
private void LoadData(PckAsset file)
private void LoadData(PckAsset asset)
{
comboParent.Enabled = file.GetMultipleProperties("BOX").All(kv => {
comboParent.Enabled = asset.GetMultipleProperties("BOX").All(kv => {
var box = SkinBOX.FromString(kv.Value);
if (ValidModelBoxTypes.Contains(box.Type))
{
@@ -160,7 +160,7 @@ namespace PckStudio.Forms
}
return false;
});
file.GetMultipleProperties("OFFSET").All(kv => {
asset.GetMultipleProperties("OFFSET").All(kv => {
string[] offset = ReplaceWhitespace(kv.Value, ",").TrimEnd('\n', '\r', ' ').Split(',');
if (offset.Length < 3)
return false;
@@ -176,7 +176,7 @@ namespace PckStudio.Forms
return false;
});
_ANIM = file.GetProperty("ANIM", SkinANIM.FromString);
_ANIM = asset.GetProperty("ANIM", SkinANIM.FromString);
UpdateListView();
Rerender();
}
@@ -1094,7 +1094,7 @@ namespace PckStudio.Forms
{
foreach (var part in modelBoxes)
{
_file.AddProperty("BOX", part);
_asset.AddProperty("BOX", part);
}
//Bitmap bitmap2 = new Bitmap(64, 64);

View File

@@ -1,18 +0,0 @@
using System.IO;
using OMI.Formats.Behaviour;
using OMI.Workers.Behaviour;
namespace PckStudio.Helper
{
public static class BehaviourResources
{
internal static byte[] BehaviourFileInitializer()
{
using var stream = new MemoryStream();
var writer = new BehavioursWriter(new BehaviourFile());
writer.WriteToStream(stream);
return stream.ToArray();
}
}
}

View File

@@ -9,6 +9,6 @@ namespace PckStudio.Interfaces
{
internal interface IPckAssetDeserializer<T>
{
public T Deserialize(PckAsset file);
public T Deserialize(PckAsset asset);
}
}

View File

@@ -9,6 +9,6 @@ namespace PckStudio.Interfaces
{
internal interface IPckAssetSerializer<T>
{
public void Serialize(T obj, ref PckAsset file);
public void Serialize(T obj, ref PckAsset asset);
}
}

View File

@@ -29,8 +29,6 @@ namespace PckStudio.Internal
{
public const int MinimumFrameTime = 1;
public const int GameTickInMilliseconds = 50;
public int FrameCount => frames.Count;
public int TextureCount => textures.Count;

View File

@@ -19,7 +19,7 @@ using System;
using System.IO;
using System.Reflection;
namespace PckStudio.Internal
namespace PckStudio.Internal.App
{
static internal class ApplicationBuildInfo
{

View File

@@ -2,21 +2,27 @@
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using PckStudio.Classes.Misc;
using PckStudio.Properties;
using PckStudio.Extensions;
using System.Globalization;
using PckStudio.Internal.Json;
using PckStudio.Internal.Misc;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PckStudio.Internal
namespace PckStudio.Internal.App
{
internal static class ApplicationScope
{
public static FileCacher DataCacher { get; private set; }
public static Octokit.RepositoryContributor[] Contributors { get; private set; }
private static Image[] _entityImages;
public static Image[] EntityImages => _entityImages;
public static Version CurrentVersion { get; } = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
internal static void Initialize()
{
Profiler.Start();
@@ -41,8 +47,17 @@ namespace PckStudio.Internal
_ = Tiles.PaintingImageList;
SettingsManager.Initialize();
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
Task.Run(GetContributors);
}
Profiler.Stop();
}
internal static void GetContributors()
{
var ghClient = new Octokit.GitHubClient(new Octokit.ProductHeaderValue(Application.ProductName + "Credits"));
var allContributorsAct = ghClient.Repository.GetAllContributors("PhoenixARC", "-PCK-Studio");
allContributorsAct.Wait();
Contributors = allContributorsAct.Result.ToArray();
}
}
}

View File

@@ -18,7 +18,7 @@
using System.Linq;
using System.Reflection;
namespace PckStudio.Internal
namespace PckStudio.Internal.App
{
static internal class CommitInfo
{

View File

@@ -23,7 +23,7 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace PckStudio.Internal
namespace PckStudio.Internal.App
{
internal static class Profiler
{

View File

@@ -21,7 +21,7 @@ using System.ComponentModel;
using System.Configuration;
using PckStudio.Properties;
namespace PckStudio.Internal
namespace PckStudio.Internal.App
{
internal static class SettingsManager
{

View File

@@ -16,14 +16,14 @@ namespace PckStudio.Internal.Deserializer
{
public static readonly AnimationDeserializer DefaultDeserializer = new AnimationDeserializer();
public Animation Deserialize(PckAsset file)
public Animation Deserialize(PckAsset asset)
{
_ = file ?? throw new ArgumentNullException(nameof(file));
if (file.Size > 0)
_ = asset ?? throw new ArgumentNullException(nameof(asset));
if (asset.Size > 0)
{
var texture = file.GetTexture();
var texture = asset.GetTexture();
var frameTextures = texture.Split(ImageLayoutDirection.Vertical);
var _animation = new Animation(frameTextures, file.GetProperty("ANIM"));
var _animation = new Animation(frameTextures, asset.GetProperty("ANIM"));
return _animation;
}
return Animation.CreateEmpty();

View File

@@ -9,28 +9,33 @@ using System.Text;
using System.Threading.Tasks;
using OMI.Formats.Pck;
using PckStudio.Interfaces;
using PckStudio.IO.TGA;
using PckStudio.Internal.IO.TGA;
namespace PckStudio.Internal.Deserializer
{
internal sealed class ImageDeserializer : IPckAssetDeserializer<Image>
{
public static readonly ImageDeserializer DefaultDeserializer = new ImageDeserializer();
// TODO: replace empty image with image displaying something went wrong
private static Image EmptyImage = new Bitmap(1, 1, PixelFormat.Format32bppArgb);
public Image Deserialize(PckAsset file)
public Image Deserialize(PckAsset asset)
{
using var stream = new MemoryStream(file.Data);
_ = asset ?? throw new ArgumentNullException(nameof(asset));
if (asset.Size == 0)
return EmptyImage;
using var stream = new MemoryStream(asset.Data);
try
{
if (Path.GetExtension(file.Filename) == ".tga")
if (Path.GetExtension(asset.Filename) == ".tga")
return TGADeserializer.DeserializeFromStream(stream);
else
return Image.FromStream(stream);
}
catch (Exception ex)
{
Trace.TraceError($"Failed to read image from pck file data({file.Filename}).");
Trace.TraceError($"Failed to read image from pck file data({asset.Filename}).");
Debug.WriteLine(ex.Message);
return EmptyImage;
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PckStudio.Internal
{
internal static class GameConstants
{
public const int GameTickInMilliseconds = 50;
// See: https://minecraft.fandom.com/wiki/Dye#Color_values for more information.
public static readonly Color[] DyeColors = [
Color.FromArgb(0xf9fffe), // White
Color.FromArgb(0xf9801d), // Orange
Color.FromArgb(0xc74ebd), // Magenta
Color.FromArgb(0x3ab3da), // Light Blue
Color.FromArgb(0xfed83d), // Yellow
Color.FromArgb(0x80c71f), // Lime
Color.FromArgb(0xf38baa), // Pink
Color.FromArgb(0x474f52), // Gray
Color.FromArgb(0x9d9d97), // Light Gray
Color.FromArgb(0x169c9c), // Cyan
Color.FromArgb(0x8932b8), // Purple
Color.FromArgb(0x3c44aa), // Blue
Color.FromArgb(0x835432), // Brown
Color.FromArgb(0x5e7c16), // Green
Color.FromArgb(0xb02e26), // Red
Color.FromArgb(0x1d1d21), // Black
];
}
}

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
using OMI.Workers;
using OMI;
namespace PckStudio.IO._3DST
namespace PckStudio.Internal.IO._3DST
{
internal class _3DSTextureReader : IDataFormatReader<Image>, IDataFormatReader
{

View File

@@ -5,7 +5,7 @@ using System.Text;
using OMI;
using OMI.Workers;
namespace PckStudio.IO._3DST
namespace PckStudio.Internal.IO._3DST
{
internal class _3DSTextureWriter : IDataFormatWriter
{

View File

@@ -3,7 +3,7 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace PckStudio.IO._3DST
namespace PckStudio.Internal.IO._3DST
{
/// <summary>
/// Format of the texture used on the PICA200.

View File

@@ -4,7 +4,7 @@ using OMI;
using OMI.Workers;
using PckStudio.FileFormats;
namespace PckStudio.IO.CSMB
namespace PckStudio.Internal.IO.CSMB
{
internal class CSMBFileReader : IDataFormatReader<CSMBFile>, IDataFormatReader
{

View File

@@ -4,7 +4,7 @@ using PckStudio.FileFormats;
using OMI.Workers;
using OMI;
namespace PckStudio.IO.CSMB
namespace PckStudio.Internal.IO.CSMB
{
internal class CSMBFileWriter : IDataFormatWriter
{

View File

@@ -8,7 +8,7 @@ using System.IO;
using System.Linq;
using System.Text;
namespace PckStudio.IO.PckAudio
namespace PckStudio.Internal.IO.PckAudio
{
public class InvalidAudioPckException : Exception

View File

@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
namespace PckStudio.IO.PckAudio
namespace PckStudio.Internal.IO.PckAudio
{
internal class PckAudioFileWriter : IDataFormatWriter
{

View File

@@ -16,7 +16,7 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal enum TGADataTypeCode : byte
{

View File

@@ -18,7 +18,7 @@
using System.IO;
using System.Drawing;
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal static class TGADeserializer
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Runtime.Serialization;
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
[Serializable]
internal class TGAException : Exception

View File

@@ -18,7 +18,7 @@
using System;
using System.Windows.Forms;
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal struct TGAExtentionData
{

View File

@@ -19,7 +19,7 @@ using System.IO;
using System.Drawing;
using System;
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal class TGAFileData
{

View File

@@ -16,7 +16,7 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal struct TGAFooter
{

View File

@@ -16,7 +16,7 @@
* 3. This notice may not be removed or altered from any source distribution.
**/
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
/// <summary>
/// Resources:

View File

@@ -26,7 +26,7 @@ using System.Collections.Generic;
using OMI.Workers;
using OMI;
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal class TGAReader : IDataFormatReader<TGAFileData>, IDataFormatReader
{

View File

@@ -18,7 +18,7 @@
using System.IO;
using System.Drawing;
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal static class TGASerializer
{

View File

@@ -26,7 +26,7 @@ using OMI;
using System.Windows.Forms;
using DiscordRPC;
namespace PckStudio.IO.TGA
namespace PckStudio.Internal.IO.TGA
{
internal class TGAWriter
{

View File

@@ -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; }
}

View File

@@ -16,10 +16,10 @@ namespace PckStudio.Internal.Json
public string InternalName { get; set; }
[JsonProperty("width")]
public int Width { get; set; } = 1;
public int TileWidth { get; set; } = 1;
[JsonProperty("height")]
public int Height { get; set; } = 1;
public int TileHeight { get; set; } = 1;
[JsonProperty("hasColourEntry", DefaultValueHandling = DefaultValueHandling.Populate)]
public bool HasColourEntry { get; set; }
@@ -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;

View File

@@ -18,7 +18,7 @@
using System;
using System.IO;
namespace PckStudio.Classes.Misc
namespace PckStudio.Internal.Misc
{
internal class FileCacher
{

View File

@@ -2,7 +2,7 @@
* Source by: Simon Mourier(https://stackoverflow.com/users/403671/simon-mourier)
*/
namespace PckStudio.Classes.Misc
namespace PckStudio.Internal.Misc
{
using System;
using System.Diagnostics;

Some files were not shown because too many files have changed in this diff Show More