Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
clvrk committed Jul 4, 2019
1 parent 59cedb0 commit 803efb9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
1 change: 0 additions & 1 deletion Forms/FormConfigure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace papyrus_gui
public partial class FormConfigure : Form
{
public static string pathExeCS, pathExeJS;
private int limitX, limitY, limitZ;

public FormConfigure()
{
Expand Down
31 changes: 16 additions & 15 deletions Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ public partial class FormMain: Form
public ConsoleHandler updateConsole;
public FormConfigure formConfigure;
public static Settings settings;
public static string AppVersion = String.Format("{0}.{1}.{2}", Assembly.GetExecutingAssembly().GetName().Version.Major, Assembly.GetExecutingAssembly().GetName().Version.Minor, Assembly.GetExecutingAssembly().GetName().Version.Build);

public FormMain()
{
InitializeComponent();
this.Text = this.Text + " v" + AppVersion;
comboBoxVersion.SelectedIndex = 0;
textBoxWorld.Text = @":\Users\%username%\AppData\Local\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang\minecraftWorlds\";
Application.ApplicationExit += new EventHandler(CloseApplication);
Expand All @@ -28,8 +30,9 @@ public FormMain()
if (File.Exists(configProfile))
{
settings = JsonConvert.DeserializeObject<Settings>(File.ReadAllText(configProfile));
textBoxWorld.Text = settings.paths["world"];
textBoxOutput.Text = settings.paths["output"];
comboBoxVersion.SelectedIndex = (int)settings.config["variant"];
textBoxWorld.Text = settings.config["world"];
textBoxOutput.Text = settings.config["output"];
} else
{
settings = new Settings();
Expand All @@ -39,6 +42,7 @@ public FormMain()

private void CloseApplication(object sender, EventArgs e)
{
settings.config["variant"] = comboBoxVersion.SelectedIndex;
using (StreamWriter streamWriter = new StreamWriter(@".\configuration.json", false))
{
streamWriter.Write(JsonConvert.SerializeObject(settings));
Expand All @@ -56,28 +60,24 @@ private void ButtonSelect1_Click(object sender, EventArgs e)
if ( folderBrowserInput.ShowDialog() == DialogResult.OK )
{
textBoxWorld.Text = folderBrowserInput.SelectedPath;
settings.paths["world"] = textBoxWorld.Text;
//settings.config["world"] = textBoxWorld.Text;
}
}
private void ButtonSelect2_Click(object sender, EventArgs e)
{
FolderBrowserDialog folderBrowserOutput = new FolderBrowserDialog();

if (textBoxOutput.Text != "")
{
folderBrowserOutput.SelectedPath = textBoxOutput.Text;
} else {
folderBrowserOutput.SelectedPath = "";
}

if (folderBrowserOutput.ShowDialog() == DialogResult.OK)
{
textBoxOutput.Text = folderBrowserOutput.SelectedPath;
settings.paths["output"] = textBoxOutput.Text;
//settings.config["output"] = textBoxOutput.Text;
}
}
private void ButtonRender_Click(object sender, EventArgs e)
{
settings.config["world"] = textBoxWorld.Text;
settings.config["output"] = textBoxOutput.Text;

if (Directory.Exists(textBoxWorld.Text.ToString()) && Directory.Exists(textBoxOutput.Text.ToString()))
{
switch (comboBoxVersion.SelectedIndex)
Expand Down Expand Up @@ -115,7 +115,7 @@ private void DiscordToolStripMenuItem_Click(object sender, EventArgs e)
}
private void AboutToolStripMenuItem1_Click(object sender, EventArgs e)
{
MessageBox.Show(String.Format("papyrus.gui version {0} by clarkx86 & DeepBlue4200", Assembly.GetExecutingAssembly().GetName().Version), "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(String.Format("papyrus.gui version {0} by clarkx86 & DeepBlue4200", AppVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information));
}
private void renderCS()
{
Expand Down Expand Up @@ -166,13 +166,14 @@ private void InvokeUpdate(object sender, DataReceivedEventArgs e)

public class Settings
{
public Dictionary<string, string> paths = new Dictionary<string, string>();
public Dictionary<string, dynamic> config = new Dictionary<string, dynamic>();
public Dictionary<string, dynamic> config_cs = new Dictionary<string, dynamic>();

public Settings()
{
this.paths["world"] = @"C:/Users/%username%/AppData/Local/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/minecraftWorlds/";
this.paths["output"] = "";
this.config["variant"] = 0;
this.config["world"] = @"C:/Users/%username%/AppData/Local/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/minecraftWorlds/";
this.config["output"] = "";
//
this.config_cs["executable"] = "";
this.config_cs["limitXZ_enable"] = false;
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("papyrus.gui")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyCopyright("Copyright © clarkx86 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// 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")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/clarkx86/papyrus-gui.svg?branch=master)](https://travis-ci.org/clarkx86/papyrus-gui) [![Discord](https://img.shields.io/discord/569841820092203011.svg?logo=discord&logoColor=white)](https://discord.gg/J2sBaXa)
[![Build status](https://ci.appveyor.com/api/projects/status/1d0o9pkci9c37esa?svg=true)](https://ci.appveyor.com/project/clarkx86/papyrus-gui) [![Discord](https://img.shields.io/discord/569841820092203011.svg?logo=discord&logoColor=white)](https://discord.gg/J2sBaXa)
# papyrus.gui
A graphical user interface for papyrus, made for those who fear the terminal.

Expand All @@ -8,4 +8,7 @@ Since papyrus is a command line tool, some end-users just don't want to fiddle w
The graphical user interface is as easy as it gets. Choose an input path for your world, an output path where you want your rendered map to be created and press "Render!". That's all there is to it!

## Installation
You can grab pre-build binaries for Windows and Linux in the [releases-tab](https://github.com/clarkx86/papyrus-gui/releases).
You can grab pre-build binaries for Windows in the [releases-tab](https://github.com/clarkx86/papyrus-gui/releases).

## Dependencies
In order to use papyrus.gui, you'll need to grab the latest [papyrus.cs binaries](https://github.com/mjungnickel18/papyruscs/releases) (.js is not supported as of now).

0 comments on commit 803efb9

Please sign in to comment.