Skip to content

Commit

Permalink
added fr, de, pl translations
Browse files Browse the repository at this point in the history
fixed longest search lvl check
reworked ui
  • Loading branch information
fedorovvl committed Aug 14, 2022
1 parent b4f6105 commit cb1c112
Show file tree
Hide file tree
Showing 16 changed files with 173 additions and 128 deletions.
16 changes: 10 additions & 6 deletions client/Main.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TSO Game Client" Height="401" Icon="files/icon.ico" Width="256" MouseLeftButtonDown="titleBar_MouseLeftButtonDown" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="true">
<Window.Background>
<ImageBrush x:Name="mainback" ImageSource="files/back.png" />
<ImageBrush ImageSource="files/back.png" />
</Window.Background>
<Window.Resources>
<SolidColorBrush x:Key="NormalBrushScrollBar" Color="#ccc"/>
Expand Down Expand Up @@ -247,8 +247,10 @@
<TextBox Height="20" HorizontalAlignment="Left" Margin="38,162,0,0" GotFocus="login_GotFocus" Text="{Binding langLogin, Mode=OneWay}" TextAlignment="Center" LostFocus="login_LostFocus" PreviewMouseDown="password_MouseDown" Name="login" VerticalAlignment="Top" Width="171" Background="#00000000" BorderBrush="#00000000" Foreground="White" Visibility="Visible" BorderThickness="0" />
<PasswordBox Background="#00000000" BorderBrush="#00000000" KeyUp="password_KeyUp" BorderThickness="0" LostFocus="password_LostFocus" GotFocus="password_GotFocus" HorizontalContentAlignment="Center" Foreground="White" Height="20" HorizontalAlignment="Left" Margin="38,209,0,0" Name="password" VerticalAlignment="Top" Visibility="Visible" Width="170" />
<TextBox Background="#00000000" BorderBrush="#00000000" BorderThickness="0" TextAlignment="Center" Text="{Binding langPass, Mode=OneWay}" PreviewMouseDown="pwd_PreviewMouseDown" Foreground="White" Height="20" HorizontalAlignment="Left" Margin="38,209,0,0" Name="pwd" VerticalAlignment="Top" Visibility="Visible" Width="170" />
<Label Content="{Binding langRun, Mode=OneWay}" HorizontalAlignment="Left" Margin="29,269,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Top" Height="47" Width="196" Foreground="#FF635221" FontSize="24" FontFamily="Times New Roman" FontWeight="Bold"/>
<Button Height="44" Focusable="False" BorderBrush="#00000000" Cursor="Hand" Click="butt_Click_1" Name="butt" HorizontalAlignment="Left" Margin="29,272,0,0" VerticalAlignment="Top" Width="196" Background="#00000000" Foreground="White" BorderThickness="0" />
<Button Height="10" HorizontalAlignment="Left" Margin="176,330,0,0" Name="button1" VerticalAlignment="Top" Width="38" Focusable="False" BorderBrush="#00000000" Cursor="Hand" Click="butt_Click" Background="#00000000" Foreground="White" BorderThickness="0" />
<TextBlock HorizontalAlignment="Left" Margin="176,330,0,0" TextWrapping="Wrap" Padding="0" Text="{Binding langExit, Mode=OneWay}" TextAlignment="Center" VerticalAlignment="Top" Height="14" Width="49" FontFamily="Global Sans Serif" FontSize="11" TextDecorations="Underline" Foreground="#FF857647"/>
<Button Height="14" HorizontalAlignment="Left" Margin="176,330,0,0" Name="button1" VerticalAlignment="Top" Width="42" Focusable="False" BorderBrush="#00000000" Cursor="Hand" Click="butt_Click" Background="#00000000" Foreground="White" BorderThickness="0" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="32,326,0,0" Name="error" FontWeight="Bold" Foreground="WhiteSmoke" Text="" VerticalAlignment="Top" Width="139" />
<CheckBox Width="24" Height="25" Margin="25,90,180,240" Name="SaveLogin" IsChecked="True">
<CheckBox.Template>
Expand Down Expand Up @@ -278,7 +280,7 @@
</ControlTemplate>
</CheckBox.Template>
</CheckBox>
<ComboBox Height="20" MaxDropDownHeight="200" SelectedIndex="0" HorizontalAlignment="Left" Margin="127.768,114.9,0,0" Foreground="AliceBlue" x:Name="region_list" BorderThickness="0" BorderBrush="#00000000" VerticalAlignment="Top" Width="89.732" SelectionChanged="Region_list_SelectionChanged">
<ComboBox Height="22" MaxDropDownHeight="200" SelectedIndex="0" HorizontalAlignment="Left" Margin="72,245,0,0" Foreground="AliceBlue" x:Name="region_list" BorderThickness="0" BorderBrush="#00000000" VerticalAlignment="Top" Width="146" SelectionChanged="Region_list_SelectionChanged">
<ComboBox.Background>
<ImageBrush ImageSource="files/input.png" />
</ComboBox.Background>
Expand All @@ -297,16 +299,18 @@
<ComboBoxItem Tag="it" Uid="12" Content="Italia"/>
<ComboBoxItem Tag="es" Uid="13" Content="México"/>
<ComboBoxItem Tag="nl" Uid="14" Content="Nederland"/>
<ComboBoxItem Tag="es" Uid="15" Content="Perú" IsSelected="True"/>
<ComboBoxItem Tag="es" Uid="15" Content="Perú"/>
<ComboBoxItem Tag="ru" Uid="16" Content="Российская Федерация"/>
<ComboBoxItem Tag="pl" Uid="17" Content="Polska"/>
<ComboBoxItem Tag="ro" Uid="18" Content="România"/>
<ComboBoxItem Tag="us" Uid="19" Content="United States"/>
<ComboBoxItem Tag="es" Uid="20" Content="Uruguay"/>
<ComboBoxItem Tag="es" Uid="21" Content="Venezuela"/>
<ComboBoxItem Tag="en" Uid="22" Content="United Kingdom"/>
<ComboBoxItem Tag="en" Uid="23" Content="European English"/>
<ComboBoxItem Tag="en" Uid="23" Content="European English" IsSelected="True"/>
</ComboBox>
<Label Content="{Binding appversion, Mode=OneWay}" HorizontalAlignment="Left" Margin="170,129,0,0" HorizontalContentAlignment="Right" VerticalAlignment="Top" Height="23" Width="51" FontSize="9" Foreground="#FF9E8B56" FontWeight="Bold"/>
<Label Content="{Binding appversion, Mode=OneWay}" HorizontalAlignment="Left" Margin="174,114,0,0" HorizontalContentAlignment="Left" VerticalAlignment="Top" Height="23" Width="51" FontSize="9" Foreground="#FF9E8B56" FontWeight="Bold"/>
<Image HorizontalAlignment="Left" Height="102" Margin="10,0,0,0" VerticalAlignment="Top" Width="236" Source="files/logo.png"/>
<Label Content="{Binding langRemember, Mode=OneWay}" Padding="0" HorizontalAlignment="Left" Margin="65,117,0,0" VerticalAlignment="Top" Height="15" Width="60" Foreground="#FFD1BC7E" FontSize="11"/>
</Grid>
</Window>
72 changes: 40 additions & 32 deletions client/Main.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
using System.Threading;
using System.Net;
using System.Web;
using System.Drawing;
using System.Windows.Media.Imaging;
using System.ComponentModel;
using AutoUpdaterDotNET;
using System.Reflection;

namespace client
{
Expand All @@ -23,7 +22,6 @@ public partial class Main : Window, INotifyPropertyChanged
public static bool logging = true;
public static bool debug = false;
public static string version = string.Empty;
public static bool staticFiles = false;
public static bool collect = false;
public static bool skipCheck = false;
public static string lang = string.Empty;
Expand All @@ -34,9 +32,12 @@ public partial class Main : Window, INotifyPropertyChanged
public static Arguments cmd;
private string _langLogin;
private string _langPass;
private string _langRun;
private string _langExit;
private string _langRemember;
public string appversion
{
get { return "1.4.7.0"; }
get { return "1.4.8.0"; }
}
public string langLogin
{
Expand All @@ -48,6 +49,21 @@ public string langPass
get { return _langPass; }
set { _langPass = value; OnPropertyChanged("langPass"); }
}
public string langRun
{
get { return _langRun; }
set { _langRun = value; OnPropertyChanged("langRun"); }
}
public string langExit
{
get { return _langExit; }
set { _langExit = value; OnPropertyChanged("langExit"); }
}
public string langRemember
{
get { return _langRemember; }
set { _langRemember = value; OnPropertyChanged("langRemember"); }
}
public event PropertyChangedEventHandler PropertyChanged;

protected void OnPropertyChanged(string propertyName)
Expand All @@ -59,15 +75,30 @@ public Main()
{

AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(AssemblyResolve);
System.Net.ServicePointManager.Expect100Continue = false;
InitializeComponent();
this.DataContext = this;
Loaded += Main_Loaded;
}

Assembly AssemblyResolve(object sender, ResolveEventArgs args)
{
if (args.Name.Contains("AutoUpdater"))
{
Assembly assembly = null;
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("client.AutoUpdater.NET.dll"))
{
byte[] buffer = new BinaryReader(stream).ReadBytes((int)stream.Length);
assembly = Assembly.Load(buffer);
return assembly;
}
}
return null;
}
private void Main_Loaded(object sender, RoutedEventArgs e)
{
cmd = new Arguments(Environment.GetCommandLineArgs());

ReadSettings();
if (cmd["collect"] != null)
collect = true;
Expand Down Expand Up @@ -196,10 +227,6 @@ public byte[] DownloadFile(string remoteFilename)
List<byte> resultArray = new List<byte>();
try
{
var webProxy = WebProxy.GetDefaultProxy();
webProxy.UseDefaultCredentials = true;
WebRequest.DefaultWebProxy = webProxy;
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
WebRequest request = WebRequest.Create(remoteFilename);
request.Method = "GET";
if (request != null)
Expand Down Expand Up @@ -325,7 +352,7 @@ private void butt_Click_1(object sender, RoutedEventArgs e)
bool collections = false;
if (!auto)
{
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(" " + Servers.getTrans("collecttip"), Servers.getTrans("collect"), System.Windows.MessageBoxButton.YesNo);
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Servers.getTrans("collecttip"), Servers.getTrans("collect"), System.Windows.MessageBoxButton.YesNo);
if (messageBoxResult == MessageBoxResult.Yes)
{
collections = true;
Expand Down Expand Up @@ -359,10 +386,6 @@ private void butt_Click_1(object sender, RoutedEventArgs e)
App.Current.Shutdown(1);
}
catch { }
}
else
{

}
this.Visibility = System.Windows.Visibility.Visible;
}
Expand Down Expand Up @@ -406,26 +429,11 @@ private void Region_list_SelectionChanged(object sender, SelectionChangedEventAr
{
_region = ((sender as ComboBox).SelectedItem as ComboBoxItem).Tag.ToString();
_regionUid = int.Parse(((sender as ComboBox).SelectedItem as ComboBoxItem).Uid);
if (_regionUid != 16)
{
mainback.ImageSource = Convert(Properties.Resources.back_en);
} else
{
mainback.ImageSource = Convert(Properties.Resources.back);
}
langLogin = Servers.getTrans("login");
langPass = Servers.getTrans("password");
}
public static BitmapImage Convert(Bitmap src)
{
MemoryStream ms = new MemoryStream();
((System.Drawing.Bitmap)src).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
BitmapImage image = new BitmapImage();
image.BeginInit();
ms.Seek(0, SeekOrigin.Begin);
image.StreamSource = ms;
image.EndInit();
return image;
langRun = Servers.getTrans("run");
langExit = Servers.getTrans("exit");
langRemember = Servers.getTrans("remember");
}
}
}
40 changes: 0 additions & 40 deletions client/Properties/Resources.Designer.cs

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

12 changes: 0 additions & 12 deletions client/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,7 @@
<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="back" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\files\back.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="back_en" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\files\back_en.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="content" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\files\content.zip;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="login" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\files\login.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="login_en" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\files\login_en.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Loading

0 comments on commit cb1c112

Please sign in to comment.