Skip to content

Commit f916577

Browse files
committed
Separate encoding from game option, bump to v3.1
1 parent 91ad1fc commit f916577

File tree

5 files changed

+293
-167
lines changed

5 files changed

+293
-167
lines changed

Config.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace AtlusScriptGUI
1010
{
1111
public class Config
1212
{
13-
public string Game { get; set; } = "Persona 5 Royal (EFIGS)";
13+
public string Game { get; set; } = "Persona 5 Royal (PC/Switch)";
14+
public string Encoding { get; set; } = "P5R_EFIGS";
1415
public string CompilerPath { get; set; } = "./AtlusScriptCompiler.exe";
1516
public bool DarkMode { get; set; } = true;
1617
public bool Hook { get; set; } = true;

Events.cs

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
using MetroSet_UI.Forms;
2+
using ShrineFox.IO;
3+
using System;
4+
using System.Collections;
5+
using System.Collections.Generic;
6+
using System.Diagnostics;
7+
using System.IO;
8+
using System.Linq;
9+
using System.Net.NetworkInformation;
10+
using System.Reflection;
11+
using System.Text;
12+
using System.Threading;
13+
using System.Threading.Tasks;
14+
using System.Windows.Forms;
15+
16+
namespace AtlusScriptGUI
17+
{
18+
public partial class MainForm : MetroSetForm
19+
{
20+
private void Btn_Click(object sender, EventArgs e)
21+
{
22+
var btn = (Button)sender;
23+
bool decompile = btn.Name.Contains("Decompile");
24+
25+
string browseWindowTitle = "Choose .MSG/.FLOW to Compile";
26+
if (decompile)
27+
browseWindowTitle = "Choose .BMD/.BF to Decompile";
28+
29+
var files = WinFormsDialogs.SelectFile(browseWindowTitle, true);
30+
Compile(files.ToArray(), decompile);
31+
}
32+
33+
private void Btn_DragDrop(object sender, DragEventArgs e)
34+
{
35+
var btn = (Button)sender;
36+
37+
string[] fileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
38+
if (File.Exists(settings.CompilerPath))
39+
Compile(fileList, btn.Name.Contains("Decompile"));
40+
else
41+
MessageBox.Show("Could not find AtlusScriptCompiler.exe. " +
42+
"Put this program in the same folder and try running it again!",
43+
"Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
44+
45+
}
46+
47+
private void Btn_DragEnter(object sender, DragEventArgs e)
48+
{
49+
e.Effect = DragDropEffects.Move;
50+
}
51+
52+
private void OpenLog_Click(object sender, EventArgs e)
53+
{
54+
OpenLog();
55+
}
56+
57+
private void Game_Changed(object sender, EventArgs e)
58+
{
59+
settings.Game = comboBox_Game.SelectedItem.ToString();
60+
settings.SaveJson(settings);
61+
62+
SetEncodingDropDown();
63+
}
64+
65+
private void Encoding_Changed(object sender, EventArgs e)
66+
{
67+
if (!comboBox_Encoding.Enabled)
68+
return;
69+
70+
settings.Encoding = comboBox_Encoding.SelectedItem.ToString();
71+
settings.SaveJson(settings);
72+
}
73+
74+
private void VanillaText_Changed(object sender, EventArgs e)
75+
{
76+
try
77+
{
78+
string result = ConvertVanillaFlag(txtBox_Vanilla.Text);
79+
if (result != "-1")
80+
txtBox_Royal.Text = result;
81+
else
82+
txtBox_Royal.Text = txtBox_Vanilla.Text;
83+
}
84+
catch
85+
{
86+
txtBox_Royal.Text = "Out of Range";
87+
}
88+
}
89+
90+
private void RoyalText_Changed(object sender, EventArgs e)
91+
{
92+
try
93+
{
94+
string result = ConvertRoyalFlag(txtBox_Royal.Text);
95+
if (result != "-1")
96+
txtBox_Vanilla.Text = result;
97+
else
98+
txtBox_Vanilla.Text = txtBox_Royal.Text;
99+
}
100+
catch
101+
{
102+
txtBox_Vanilla.Text = "Out of Range";
103+
}
104+
}
105+
106+
private void Check_Changed(object sender, EventArgs e)
107+
{
108+
var item = (ToolStripMenuItem)sender;
109+
if (!item.Enabled)
110+
return;
111+
112+
settings.DeleteHeader = chk_DeleteHeader.Checked;
113+
settings.Disassemble = chk_Disassemble.Checked;
114+
settings.Hook = chk_Hook.Checked;
115+
settings.Overwrite = chk_Overwrite.Checked;
116+
settings.SumBits = chk_SumBits.Checked;
117+
118+
settings.SaveJson(settings);
119+
}
120+
121+
private void ToggleTheme_Click(object sender, EventArgs e)
122+
{
123+
ToggleTheme();
124+
ApplyTheme();
125+
}
126+
}
127+
}

Forms/MainForm.Designer.cs

+36-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)