Skip to content

Commit

Permalink
Merge pull request #4 from kemo14331/main
Browse files Browse the repository at this point in the history
1.0.3
  • Loading branch information
kemo14331 committed Feb 2, 2021
2 parents faf38e0 + 6df08f6 commit a4564ac
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 108 deletions.
2 changes: 2 additions & 0 deletions ParticleConverter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Publish|Any CPU = Publish|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B5006587-6179-4CBD-80E0-DD423E9690AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5006587-6179-4CBD-80E0-DD423E9690AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5006587-6179-4CBD-80E0-DD423E9690AE}.Publish|Any CPU.ActiveCfg = Release|Any CPU
{B5006587-6179-4CBD-80E0-DD423E9690AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5006587-6179-4CBD-80E0-DD423E9690AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
1 change: 1 addition & 0 deletions ParticleConverter/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:local="clr-namespace:ParticleConverter"
xmlns:local1="clr-namespace:ParticleConverter.util"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
DispatcherUnhandledException="App_DispatcherUnhandledException"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
Expand Down
16 changes: 15 additions & 1 deletion ParticleConverter/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System.Windows;
using ParticleConverter.util;
using System;
using System.IO;
using System.Windows;
using System.Windows.Threading;

namespace ParticleConverter
{
Expand All @@ -7,5 +11,15 @@ namespace ParticleConverter
/// </summary>
public partial class App : Application
{

public App()
{
}

void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show(e.Exception.ToString());
Logger.WriteExceptionLog(e.Exception);
}
}
}
24 changes: 21 additions & 3 deletions ParticleConverter/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,32 @@
Margin="5,0"
Checked="UsePreviewBox_Checked"
Content="{DynamicResource UsePreview}" />
<TextBlock
Name="ParticleCounter"
<StackPanel
Grid.Row="1"
Grid.Column="1"
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="Particles: 0" />
Orientation="Horizontal">
<Label
Name="CounterAlert"
Foreground="Red"
Visibility="Hidden">
<Label.ToolTip>
<TextBlock
Width="250"
Text="{DynamicResource ParticleCounterAlert}"
TextWrapping="Wrap" />
</Label.ToolTip>
<materialDesign:PackIcon Kind="AlertOutline" />
</Label>
<TextBlock
Name="ParticleCounter"
Margin="0,0,5,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="Particles: 0" />
</StackPanel>
<Grid
Grid.Row="2"
Grid.RowSpan="2"
Expand Down
228 changes: 131 additions & 97 deletions ParticleConverter/MainWindow.xaml.cs

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions ParticleConverter/ParticleConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,36 @@
<UseWPF>true</UseWPF>
<StartupObject>ParticleConverter.App</StartupObject>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Kemo431.pfx</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>kemo14331.pfx</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Copyright>Kemo431</Copyright>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Authors>Kemo431</Authors>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Deterministic>false</Deterministic>
<RepositoryUrl>https://github.com/kemo14331/Particle-Converter</RepositoryUrl>
<PackageIcon>icon.png</PackageIcon>
<ApplicationIcon>icon.ico</ApplicationIcon>
<AssemblyVersion>1.0.3.*</AssemblyVersion>
<Version>1.0.3</Version>
<FileVersion>1.0.2</FileVersion>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HelixToolkit.SharpDX.Core.Wpf" Version="2.12.0" />
<PackageReference Include="MahApps.Metro" Version="2.2.0" />
<PackageReference Include="HelixToolkit.SharpDX.Core.Wpf" Version="2.13.0" />
<PackageReference Include="MaterialDesignThemes" Version="3.2.0" />
<PackageReference Include="OpenCV" Version="2.4.11" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.4.0.20200915" />
<PackageReference Include="OpenCvSharp4" Version="4.4.0.20200915" />
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
</ItemGroup>

Expand Down Expand Up @@ -71,4 +76,8 @@
</Page>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(ProjectDir)\lang&quot; $(TargetDir) /Y" />
</Target>

</Project>
6 changes: 5 additions & 1 deletion ParticleConverter/dialogs/About.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Diagnostics;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

Expand All @@ -12,9 +14,11 @@ public partial class About : UserControl
public About()
{
InitializeComponent();
Assembly assembly = Assembly.GetExecutingAssembly();

var fullname = typeof(App).Assembly.Location;
var info = System.Diagnostics.FileVersionInfo.GetVersionInfo(fullname);
var ver = info.FileVersion;
var ver = assembly.GetName().Version.ToString();
Version.Text = ver;
}

Expand Down
11 changes: 10 additions & 1 deletion ParticleConverter/lang/en-US.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<system:String x:Key="BugReport">Bug Report</system:String>
<system:String x:Key="About">About</system:String>

<system:String x:Key="SettingTitle">Converting Settings</system:String>
<system:String x:Key="SettingTitle">Convertion Settings</system:String>
<system:String x:Key="ImageFileName">ImageFile</system:String>
<system:String x:Key="Brows">Brows</system:String>

Expand Down Expand Up @@ -61,4 +61,13 @@
<system:String x:Key="ExportSettings">Export Settings</system:String>
<system:String x:Key="ExportFolder">ExportFolder</system:String>
<system:String x:Key="Export">Export!!</system:String>

<system:String x:Key="ParticleCounterAlert">
There are too many particles.
It may not be displayed normally depending on the performance of the computer.
Consider changing the resolution.
</system:String>

<system:String x:Key="UpdateNotification">Update Notification</system:String>
<system:String x:Key="UpdateNotificationMsg">A new version is available. \ n Do you want to download it?</system:String>
</ResourceDictionary>
9 changes: 9 additions & 0 deletions ParticleConverter/lang/ja-JP.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@
<system:String x:Key="ExportSettings">出力設定</system:String>
<system:String x:Key="ExportFolder">出力先フォルダ</system:String>
<system:String x:Key="Export">出力!</system:String>

<system:String x:Key="ParticleCounterAlert">
パーティクルの量が多すぎます。
コンピュータの性能によっては正常に表示できない可能性があります。
解像度の変更を検討してください。
</system:String>

<system:String x:Key="UpdateNotification">アップデート通知</system:String>
<system:String x:Key="UpdateNotificationMsg">新しいバージョンが公開されています。\nダウンロードしますか?</system:String>
</ResourceDictionary>
29 changes: 29 additions & 0 deletions ParticleConverter/util/Logger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace ParticleConverter.util
{
public static class Logger
{
public static void WriteExceptionLog(Exception e)
{
DateTime dt = DateTime.Now;
string result = dt.ToString("yyyy-MM-dd_HH.mm.ss");
StreamWriter streamWriter = null;
try
{
Directory.CreateDirectory(@".\exceptionLog");
string path = $@".\exceptionLog\{result}.txt";
streamWriter = new StreamWriter(path);
streamWriter.WriteLine(e.Data);
streamWriter.WriteLine(e.ToString());
}
finally
{
if (streamWriter != null) streamWriter.Close();
}
}
}
}
14 changes: 14 additions & 0 deletions ParticleConverter/util/UpdateUtil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace ParticleConverter.util
{
public static class UpdateUtil
{
static void CheckUpdate(string url)
{

}
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
**日本語** / [English](https://github.com/kemo14331/Particle-Converter/blob/main/README_EN.md)
# Particle Converter
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/kemo14331/Particle-Converter) [![GitHub license](https://img.shields.io/github/license/kemo14331/Particle-Converter)](https://github.com/kemo14331/Particle-Converter/blob/main/LICENSE)
画像ファイルをmcfunctionに変換するツール

## ScreenShot
Expand Down
43 changes: 43 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Particle Converter
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/kemo14331/Particle-Converter) [![GitHub license](https://img.shields.io/github/license/kemo14331/Particle-Converter)](https://github.com/kemo14331/Particle-Converter/blob/main/LICENSE)
Particle Converter is an application to convert image files into particle commands.

## ScreenShot
![screenshot0](https://imgur.com/HvnhBgF.jpg,"screenshot")
<details>
<summary>and more</summary><div>
<img src="https://imgur.com/Ld544Cx.jpg", "screenshot1">
<img src="https://imgur.com/hdSbSkc.jpg" alt="screenshot2" />
</div></details>

## Feature
* Convert the image file (.jpg|.png) into a particle command that can be displayed in Minecraft and output as a mcfunction format
* Correspond to world relative coordinates(~) and local relative coordinates(^).
* Real-time preview of parameter changes.
* Display size can be specified by block.
* Support for changing resolution.
* Supports the color specification of dust.
* Compatible with particles other than dust.
* Multi-language support for the app.

Translated with www.DeepL.com/Translator (free version)

## Downloads
[Particle-Converter/Release](https://github.com/kemo14331/Particle-Converter/releases/latest)

## Requirement

* .NETCore 3.1

## Library
* [Material Design In Xaml](http://materialdesigninxaml.net/)
* [OpenCVSharp4](https://github.com/shimat/opencvsharp)
* [HelixToolkit.SharpDX.Core.Wpf](https://github.com/helix-toolkit/helix-toolkit)

## Author

* Kemo431
* Twitter: [@newkemo431](https://twitter.com/newkemo431)

## License
This app is under the [MIT license](https://en.wikipedia.org/wiki/MIT_License).

0 comments on commit a4564ac

Please sign in to comment.