Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Implement Unofficial Language Support
Browse files Browse the repository at this point in the history
  • Loading branch information
neatodev committed Apr 20, 2022
1 parent f087c6b commit f274f38
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 20 deletions.
5 changes: 5 additions & 0 deletions data/GraphicsInterpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public string interpretGraphics(string lineToCheck, bool read, int switchCase)
}
else
{
if (Graphics.getLanguage() == "nochange")
{
return lineToCheck;
}

lineToCheck = "Language=" + Graphics.getLanguage();
}

Expand Down
4 changes: 4 additions & 0 deletions data/GraphicsWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ private static void setLang()
case 4:
Graphics.setLanguage("esn");
break;

default:
Graphics.setLanguage("nochange");
break;
}

logger.Debug("setLang - set language to {0}", Graphics.getLanguage());
Expand Down
37 changes: 19 additions & 18 deletions data/GuiInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,29 +96,30 @@ public void init()

private static void initLang()
{
if (Graphics.getLanguage().Equals("int"))
switch (Graphics.getLanguage())
{
Program.Client.langBox.SelectedIndex = 0;
}
case "int":
Program.Client.langBox.SelectedIndex = 0;
break;

if (Graphics.getLanguage().Equals("deu"))
{
Program.Client.langBox.SelectedIndex = 1;
}
case "deu":
Program.Client.langBox.SelectedIndex = 1;
break;

if (Graphics.getLanguage().Equals("fra"))
{
Program.Client.langBox.SelectedIndex = 2;
}
case "fra":
Program.Client.langBox.SelectedIndex = 2;
break;

if (Graphics.getLanguage().Equals("ita"))
{
Program.Client.langBox.SelectedIndex = 3;
}
case "ita":
Program.Client.langBox.SelectedIndex = 3;
break;

if (Graphics.getLanguage().Equals("esn"))
{
Program.Client.langBox.SelectedIndex = 4;
case "esn":
Program.Client.langBox.SelectedIndex = 4;
break;
default:
Program.Client.langBox.SelectedIndex = Program.Client.langBox.Items.Add("Unofficial");
break;
}

logger.Debug("initLang - initialized language as {0}", Graphics.getLanguage());
Expand Down
8 changes: 6 additions & 2 deletions ui/BmLauncherForm.Designer.cs

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

11 changes: 11 additions & 0 deletions ui/BmLauncherForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ private void keyButton_Click(object sender, EventArgs e)
private void applyButton_Click(object sender, EventArgs e)
{
Program.MyFactory.writeGraphFile();
if (langBox.SelectedIndex != 5)
{
try
{
langBox.Items.RemoveAt(5);
}
catch (ArgumentOutOfRangeException)
{
}
}

applyButton.Enabled = false;
ChangedConfig = false;
}
Expand Down
12 changes: 12 additions & 0 deletions ui/BmLauncherForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<metadata name="basicToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>14, 19</value>
</metadata>
<metadata name="basicToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>14, 19</value>
</metadata>
<data name="maxSmoothTextBox.ToolTip" xml:space="preserve">
<value>Works like a framerate limiter. The value should be the refresh rate of your screen.

Expand Down Expand Up @@ -182,6 +185,15 @@ Breakable tiles, realistic paper simulation, advanced smoke effects.

</value>
</data>
<metadata name="nvidiaToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>119, 22</value>
</metadata>
<metadata name="amdToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>238, 25</value>
</metadata>
<metadata name="criticalTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>354, 25</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>79</value>
</metadata>
Expand Down

0 comments on commit f274f38

Please sign in to comment.