Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 63 additions & 88 deletions MetalMaxViewer/Form1.Designer.cs

Large diffs are not rendered by default.

54 changes: 34 additions & 20 deletions MetalMaxViewer/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ private bool LoadFont()
return false;
}

variables.font = new NftrFont(fontPath);
NftrFont.CustomPalette = new Colour[2] { Colour.FromColor(Color.White), new Colour(254, 254, 254) };
variables.FontWhite = new NftrFont(fontPath);

NftrFont.CustomPalette = new Colour[2] { Colour.FromColor(Color.White), new Colour(0, 0, 0) };
variables.FontBlack = new NftrFont(fontPath);

return true;
}
Expand All @@ -73,6 +77,7 @@ public void ImportPO(string poFileName)
inputPO.Dispose();
int contador = 0;
listBox1.Items.Clear();
variables.indice = 0;
Array.Clear(variables.textoOriginal, 0, variables.textoOriginal.Length);
Array.Clear(variables.textoTraducido, 0, variables.textoTraducido.Length);
Array.Clear(variables.contexto, 0, variables.contexto.Length);
Expand Down Expand Up @@ -101,26 +106,32 @@ public static class variables
public static string textoAuxiliar = "";
public static int posAuxiliar = -1;
public static int indice = -1;
public static NftrFont font;

public static NftrFont FontWhite { get; set; }

public static NftrFont FontBlack { get; set; }
}
public void cambioImagen(string contenido)

public void UpdateBackground(string poFile)
{
if (contenido.Contains(".MSG."))
if (poFile.Contains(".MSG."))
{
pictureBox1.BackgroundImage = Properties.Resources.bocadillo2;
pictureBox1.BackgroundImageLayout=ImageLayout.Stretch;
pictureBox2.BackgroundImage = Properties.Resources.bocadillo2;
pictureBox2.BackgroundImageLayout = ImageLayout.Stretch;
var image = Image.FromFile(Path.Combine("Resources", "bocadillo.jpg"));
pictureBox1.BackgroundImage = image;
pictureBox1.BackgroundImageLayout = ImageLayout.None;
pictureBox2.BackgroundImage = image;
pictureBox2.BackgroundImageLayout = ImageLayout.None;
}
else if (contenido.Contains(".SET."))
else if (poFile.Contains(".SET."))
{
pictureBox1.BackgroundImage = Properties.Resources.objetos;
pictureBox1.BackgroundImageLayout = ImageLayout.Stretch;
pictureBox2.BackgroundImage = Properties.Resources.objetos;
pictureBox2.BackgroundImageLayout = ImageLayout.Stretch;
var image = Image.FromFile(Path.Combine("Resources", "objetos.jpg"));
pictureBox1.BackgroundImage = image;
pictureBox1.BackgroundImageLayout = ImageLayout.None;
pictureBox2.BackgroundImage = image;
pictureBox2.BackgroundImageLayout = ImageLayout.None;
}
}

public void colocarText(string texto1, string texto2, int x, int y)
{
int posJap = int.Parse(label1.Text);
Expand All @@ -130,11 +141,15 @@ public void colocarText(string texto1, string texto2, int x, int y)
splitText(texto1, texto2);
var image = new Bitmap(this.pictureBox1.Width, this.pictureBox1.Height);
var graphics = Graphics.FromImage(image);
variables.font.Painter.DrawString(variables.splittedOr[posJap], graphics, x, y);
variables.FontBlack.Painter.DrawString(variables.splittedOr[posJap], graphics, x + 1, y + 1, null, 4, 1);
variables.FontWhite.Painter.DrawString(variables.splittedOr[posJap], graphics, x, y, null, 4, 1);

this.pictureBox1.Image = image;
var image2 = new Bitmap(this.pictureBox2.Width, this.pictureBox2.Height);
var graphics2 = Graphics.FromImage(image2);
variables.font.Painter.DrawString(variables.splittedMod[posEn], graphics2, x, y);
variables.FontBlack.Painter.DrawString(variables.splittedMod[posEn], graphics2, x + 1, y + 1, null, 4, 1);
variables.FontWhite.Painter.DrawString(variables.splittedMod[posEn], graphics2, x, y, null, 4, 1);

this.pictureBox2.Image = image2;
}

Expand Down Expand Up @@ -165,11 +180,11 @@ public void cambioPosicion(int pos, int posText)
{
if (pos == 0)
{
colocarText(variables.textoOriginal[posText], richTextBox2.Text, 10, 175);
colocarText(variables.textoOriginal[posText], richTextBox2.Text, 12, 144);
}
else if (pos == 1)
{
int textSize = variables.font.Painter.GetStringLength(richTextBox2.Text);
int textSize = variables.FontWhite.Painter.GetStringLength(richTextBox2.Text, 1);
colocarText(variables.textoOriginal[posText], richTextBox2.Text, pictureBox1.Width - textSize - 15, 110);
}
else if (pos == 2)
Expand Down Expand Up @@ -227,9 +242,8 @@ void OpenPoFile()

string filePath = openFileDialog.FileName;
ImportPO(filePath);
cambioImagen(filePath);
UpdateBackground(filePath);
}

}

private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down
10 changes: 5 additions & 5 deletions MetalMaxViewer/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<data name="abrirToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAHYcAAB2HAY/l8WUAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp
olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdNKMwr7kApFItTUkWZqVhSVYmao5Nevvy7UoYR3HXh4
4XCe33nOKyy3lAY7l9RWMo0O/raWXxEyo5spVYTNvOGyfIRPfW+ptOkXqaPl6T83hcRmExSdgzAz3NVm
YWyoYla/B+1M9JtxWLPpaH22JORIjI6gKAMB0jyEimIdo4OlbuaprwVMOOMovammpDADc34qppwUrmnl
Expand All @@ -140,7 +140,7 @@
<data name="guardarToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAHYcAAB2HAY/l8WUAAAIySURBVDhPrZLfS5NRGMfff6H7boIuuq2pMZyL1eAt11CW
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIySURBVDhPrZLfS5NRGMfff6H7boIuuq2pMZyL1eAt11CW
DcOKsB9vpFmaLtNExco0av6CbIVLJ61Wk3BSkT/AFCkRZSpZmrmiJQ41xSaCwdfznL15XEUX0Reem5f3
8znnec4j/Zc8fxYGla91CS3eRTx0z6OpMYS7jmnU1X6B/VYA18snUVoyjsKCt8jLHcH5c36ouCQR2NUJ
1Nas4G9ZXlmFKbULh1Kf8lJxSfI+WeCCyopv6q+/h+DQ/DJ2WV5Ao1FgPegRAveDOS4oLfmq/h6dn/DH
Expand All @@ -156,7 +156,7 @@
<data name="cortarToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAHYcAAB2HAY/l8WUAAAGDSURBVDhPrZFNSwJRGIX9NYGbFoUlFElY1EJQKEYhCJsi
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGDSURBVDhPrZFNSwJRGIX9NYGbFoUlFElY1EJQKEYhCJsi
LaVsERnRF5iCaSZJO1toCDVGFkgoFpWQWWRR2aIvUxm1BKN1wSnHCFw4TOCzue+9nPNw4eVVnav4Izzb
QfxeGZ5TWaxT/rK3irzmC7CsusvC1G4IkbNLboIiDieF4GGUKeTeClDpppF8eeEu2PIfwfrzizSdw3Hk
EnKlFpkMzV2wH77AosOFTV8A+vkl9CiHuJeLJNNZjM8tYWB0FkTvMAwmy/8ERTR6CwjlGAi1Ccence6C
Expand All @@ -169,7 +169,7 @@
<data name="copiarToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAHYcAAB2HAY/l8WUAAAHkSURBVDhPvZHfS1NhHIf3p5QypLr2D4goMwoMCi/qIugH
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHkSURBVDhPvZHfS1NhHIf3p5QypLr2D4goMwoMCi/qIugH
Xe1Cr7qKDIMkZixwNhfWLGWbnuki0kXKzLU023KubBNPJrbRdOzocm6e2dPOO21mMS+CHvjcvOf9PF++
79H9M+7RT2iRRsIi9sEAXe43yAvf2LpSHq28G9uAnytNT4jMLewtcQ2Ht2pF8ps/aOt+gccX5lxD694S
+1BQFD1RkN5DSFa4Z3uONKbgHE3h8KZ4OJTC1J8UiSzmfhd2uf1CoJHbyKOsZokl0kKwm+aeJaov+wjO
Expand All @@ -183,7 +183,7 @@
<data name="pegarToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAHYcAAB2HAY/l8WUAAAJSSURBVDhPtZJrSJNRGMdf6IN9KbpQn/pUEH2JIoLqQ0Zh
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJSSURBVDhPtZJrSJNRGMdf6IN9KbpQn/pUEH2JIoLqQ0Zh
FqYZRmJG1iKmUqKyLB2pqSm6vC1Nm5GXoeatEsVJ0RASR3eNzegikRq5lrV3857Fr/d9ddlICoL+8OfA
Oef/e57zcIT/os7WLMw302muSGJ2689qqi7A44q8IzjtNYzarzHQm8tZtT8FmRqu6LToMxN+B8qhCbGR
KVcDE85ajKUaxoaryEuL4UVXIudPB5Ko2oy98xjDptXERuz3hsgAOTzlqqMk6yjdllzE90UM9Wp5azlB
Expand Down
20 changes: 6 additions & 14 deletions MetalMaxViewer/MetalMaxViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,11 @@
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand All @@ -90,13 +81,14 @@
<None Include="Resources\LC12.NFTR">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\objetos.jpg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\bocadillo.jpg" />
<None Include="Resources\objetos.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="Resources\bocadillo2.jpg" />
<None Include="Resources\bocadillo.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ThirdParties\NerdFontTerminatoR\NerdFontTerminatoR\NerdFontTerminatoR.csproj">
Expand Down
30 changes: 0 additions & 30 deletions MetalMaxViewer/Properties/Resources.Designer.cs

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

10 changes: 0 additions & 10 deletions MetalMaxViewer/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="bocadillo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bocadillo.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bocadillo2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bocadillo2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="objetos" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\objetos.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
26 changes: 0 additions & 26 deletions MetalMaxViewer/Properties/Settings.Designer.cs

This file was deleted.

7 changes: 0 additions & 7 deletions MetalMaxViewer/Properties/Settings.settings

This file was deleted.

Binary file modified MetalMaxViewer/Resources/LC12.NFTR
Binary file not shown.
Binary file modified MetalMaxViewer/Resources/bocadillo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed MetalMaxViewer/Resources/bocadillo2.jpg
Binary file not shown.