Skip to content

Commit

Permalink
ONGOING
Browse files Browse the repository at this point in the history
  • Loading branch information
CatmanFan committed Feb 27, 2024
1 parent 1dcdbfa commit b86798d
Show file tree
Hide file tree
Showing 21 changed files with 209 additions and 160 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ legacy/
/FriishProduce/Database_Test.xml
/FriishProduce/Strings/Original
/FriishProduce/_classes/LanguageRESX.cs
/FriishProduce/LanguageEditor.cs
/FriishProduce/LanguageEditor.Designer.cs
/FriishProduce/LanguageEditor.resx
9 changes: 9 additions & 0 deletions FriishProduce/FriishProduce.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@
<Compile Include="BannerPreviewForm.Designer.cs">
<DependentUpon>BannerPreviewForm.cs</DependentUpon>
</Compile>
<Compile Include="LanguageEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LanguageEditor.Designer.cs">
<DependentUpon>LanguageEditor.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
Expand All @@ -154,6 +160,9 @@
<EmbeddedResource Include="BannerPreviewForm.resx">
<DependentUpon>BannerPreviewForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LanguageEditor.resx">
<DependentUpon>LanguageEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
Expand Down
25 changes: 14 additions & 11 deletions FriishProduce/InjectorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ public partial class InjectorForm : Form

public void RefreshForm()
{
// ----------------------------
if (DesignMode) return;
// ----------------------------
Language.Localize(this);

// Change title text to untitled string
Untitled = string.Format(Language.Get("Untitled"), Language.Get($"Platform_{Enum.GetName(typeof(Console), Console)}"));
Untitled = string.Format(Language.Get("Untitled"), Language.Get(Enum.GetName(typeof(Console), Console), "Platforms"));
Text = string.IsNullOrWhiteSpace(ChannelTitle.Text) ? Untitled : ChannelTitle.Text;

SetROMDataText();
Expand All @@ -72,7 +75,7 @@ public void RefreshForm()
// Selected index properties
imageintpl.Items.Clear();
imageintpl.Items.Add(Language.Get("ByDefault"));
imageintpl.Items.AddRange(Language.GetArray("List_ImageInterpolation"));
imageintpl.Items.AddRange(Language.GetArray("List.ImageInterpolation"));
imageintpl.SelectedIndex = Properties.Settings.Default.ImageInterpolation;

if (Properties.Settings.Default.ImageFitAspectRatio) radioButton2.Checked = true; else radioButton1.Checked = true;
Expand Down Expand Up @@ -222,7 +225,7 @@ private void isClosing(object sender, FormClosingEventArgs e)
public bool CheckUnsaved()
{
if (Tag != null && Tag.ToString() == "dirty")
if (MessageBox.Show(Text, Language.Get("Message001"), MessageBoxButtons.YesNo, 0, true) == DialogResult.No)
if (MessageBox.Show(Text, Language.Get("Message.001"), MessageBoxButtons.YesNo, 0, true) == DialogResult.No)
return false;
return true;
}
Expand Down Expand Up @@ -365,7 +368,7 @@ public bool LoadWAD(string path)

Failed:
System.Media.SystemSounds.Beep.Play();
MessageBox.Show(string.Format(Language.Get("Message005"), Reader.UpperTitleID));
MessageBox.Show(string.Format(Language.Get("Message.005"), Reader.UpperTitleID));
return false;
}

Expand Down Expand Up @@ -393,7 +396,7 @@ public void LoadManual(string path)

if (validFiles < 2)
{
MessageBox.Show(Language.Get("Message007"), MessageBoxButtons.OK, Ookii.Dialogs.WinForms.TaskDialogIcon.Warning);
MessageBox.Show(Language.Get("Message.007"), MessageBoxButtons.OK, Ookii.Dialogs.WinForms.TaskDialogIcon.Warning);
Manual = null;
return;
}
Expand Down Expand Up @@ -466,7 +469,7 @@ public bool LoadImage(Bitmap src)
}
catch
{
MessageBox.Show(Language.Get("Error001"));
MessageBox.Show(Language.Get("Error.001"));
return false;
}
}
Expand All @@ -486,7 +489,7 @@ public void LoadROM(string ROMpath, bool UseLibRetro = true)
case Console.PCE:
if (!ROM.CheckValidity(File.ReadAllBytes(ROMpath)))
{
MessageBox.Show(Language.Get("Message008"), 0, Ookii.Dialogs.WinForms.TaskDialogIcon.Warning);
MessageBox.Show(Language.Get("Message.008"), 0, Ookii.Dialogs.WinForms.TaskDialogIcon.Warning);
return;
}
break;
Expand All @@ -496,7 +499,7 @@ public void LoadROM(string ROMpath, bool UseLibRetro = true)
// ****************
if (!ROM.CheckZIPValidity(ROMpath, new string[] { "c1", "c2", "m1", "p1", "s1", "v1" }, true, true))
{
MessageBox.Show(Language.Get("Message008"), 0, Ookii.Dialogs.WinForms.TaskDialogIcon.Warning);
MessageBox.Show(Language.Get("Message.008"), 0, Ookii.Dialogs.WinForms.TaskDialogIcon.Warning);
return;
}
break;
Expand Down Expand Up @@ -565,7 +568,7 @@ public async void LoadLibRetroData()

// Show message if partially failed to retrieve data
if (Retrieved && (LibRetro.GetTitle() == null || LibRetro.GetPlayers() == null || LibRetro.GetYear() == null || LibRetro.GetImgURL() == null))
MessageBox.Show(Language.Get("Message004"));
MessageBox.Show(Language.Get("Message.004"));
else if (!Retrieved) System.Media.SystemSounds.Beep.Play();

}
Expand Down Expand Up @@ -609,11 +612,11 @@ public bool CreateInject()
if (Properties.Settings.Default.AutoOpenFolder)
System.Diagnostics.Process.Start("explorer.exe", $"/select, \"{Creator.Out}\"");
else
MessageBox.Show(string.Format(Language.Get("Message003"), Creator.Out), MessageBoxButtons.OK, Ookii.Dialogs.WinForms.TaskDialogIcon.Information);
MessageBox.Show(string.Format(Language.Get("Message.003"), Creator.Out), MessageBoxButtons.OK, Ookii.Dialogs.WinForms.TaskDialogIcon.Information);

return true;
}
else throw new Exception(Language.Get("Error006"));
else throw new Exception(Language.Get("Error.006"));
}

catch (Exception ex)
Expand Down
9 changes: 9 additions & 0 deletions FriishProduce/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions FriishProduce/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,5 +340,10 @@ private void TabContextMenu_Opening(object sender, CancelEventArgs e)
private void About_Click(object sender, EventArgs e) => new About().ShowDialog();

private void MenuItem_Exit_Click(object sender, EventArgs e) => Application.Exit();

private void languageEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
new LanguageEditor().Show();
}
}
}
Loading

0 comments on commit b86798d

Please sign in to comment.