Skip to content

Commit

Permalink
Release 1.1.20210513.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BuIlDaLiBlE committed May 12, 2021
1 parent 0fce332 commit e7440a0
Show file tree
Hide file tree
Showing 14 changed files with 408 additions and 233 deletions.
1 change: 1 addition & 0 deletions BetterHI3Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
<Compile Include="TextStrings_pt.cs" />
<Compile Include="TextStrings_ru.cs" />
<Compile Include="TextStrings_sr.cs" />
<Compile Include="TextStrings_th.cs" />
<Compile Include="TextStrings_vi.cs" />
<Compile Include="Utility\PartialZip\Exceptions\PartialZipFileNotFoundException.cs" />
<Compile Include="Utility\PartialZip\Exceptions\PartialZipNotSupportedException.cs" />
Expand Down
8 changes: 5 additions & 3 deletions DialogWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@
</Style>
</Window.Resources>
<Grid Width="576" Height="307">
<Image Source="Assets/Images/Window_Dialog.png" Stretch="None"/>
<TextBlock Name="DialogTitle" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="29" MaxWidth="500" Foreground="White" FontFamily="{DynamicResource Font}" FontSize="18"/>
<TextBlock Name="DialogMessage" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,25" MaxWidth="500" MaxHeight="147" Foreground="White" FontFamily="{DynamicResource Font}" FontSize="16" TextAlignment="Center" TextWrapping="Wrap"/>
<Image Source="Assets/Images/Window_Dialog.png"/>
<TextBlock Name="DialogTitle" VerticalAlignment="Top" Margin="85,29,85,0" Foreground="White" FontFamily="{DynamicResource Font}" FontSize="18" TextAlignment="Center"/>
<ScrollViewer VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,25" Width="500" Height="135" ScrollViewer.VerticalScrollBarVisibility="Hidden">
<TextBlock Name="DialogMessage" VerticalAlignment="Center" HorizontalAlignment="Center" MaxWidth="500" MaxHeight="147" Foreground="White" FontFamily="{DynamicResource Font}" FontSize="16" TextAlignment="Center" TextWrapping="Wrap"/>
</ScrollViewer>
<Button Name="CloseButton" Style="{DynamicResource CloseButtonStyle}" Margin="0,23,33,0" Click="CloseButton_Click"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="36">
<Button Name="ConfirmButton" Style="{DynamicResource LaunchButtonStyle}" Click="ConfirmButton_Click"/>
Expand Down
5 changes: 5 additions & 0 deletions DialogWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.ComponentModel;
using System.Windows;
using System.Windows.Media;

namespace BetterHI3Launcher
{
Expand All @@ -24,6 +25,10 @@ public DialogWindow(string title, string message, bool question = false)
ConfirmButton.Content = MainWindow.textStrings["button_yes"];
CancelButton.Content = MainWindow.textStrings["button_no"];
}
if(MainWindow.LauncherLanguage != "en")
{
Resources["Font"] = new FontFamily("Segoe UI Bold");
}
Application.Current.MainWindow.WindowState = WindowState.Normal;
BpUtility.PlaySound(Properties.Resources.Window_Open);
}
Expand Down
209 changes: 96 additions & 113 deletions MainWindow.xaml

Large diffs are not rendered by default.

127 changes: 58 additions & 69 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enum HI3Mirror

public partial class MainWindow : Window
{
public static readonly Version LocalLauncherVersion = new Version("1.1.20210511.0");
public static readonly Version LocalLauncherVersion = new Version("1.1.20210513.0");
public static readonly string RootPath = Directory.GetCurrentDirectory();
public static readonly string LocalLowPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}Low";
public static readonly string LauncherDataPath = Path.Combine(LocalLowPath, @"Bp\Better HI3 Launcher");
Expand Down Expand Up @@ -349,6 +349,9 @@ public MainWindow()
case "sr-Latn-RS":
LauncherLanguage = "sr";
break;
case "th-TH":
LauncherLanguage = "th";
break;
case "vi-VN":
LauncherLanguage = "vi";
break;
Expand Down Expand Up @@ -507,6 +510,9 @@ public MainWindow()
var CMLanguageSerbian = new MenuItem{Header = textStrings["contextmenu_language_serbian"]};
CMLanguageSerbian.Click += (sender, e) => CM_Language_Click(sender, e);
CMLanguage.Items.Add(CMLanguageSerbian);
var CMLanguageThai = new MenuItem {Header = textStrings["contextmenu_language_thai"]};
CMLanguageThai.Click += (sender, e) => CM_Language_Click(sender, e);
CMLanguage.Items.Add(CMLanguageThai);
CMLanguage.Items.Add(new Separator());
var CMLanguageContribute = new MenuItem{Header = textStrings["contextmenu_language_contribute"]};
CMLanguageContribute.Click += (sender, e) => BpUtility.StartProcess("https://github.com/BuIlDaLiBlE/BetterHI3Launcher#contibuting-translations", null, RootPath, true);
Expand Down Expand Up @@ -544,6 +550,9 @@ public MainWindow()
case "sr":
CMLanguageSerbian.IsChecked = true;
break;
case "th":
CMLanguageThai.IsChecked = true;
break;
default:
CMLanguageEnglish.IsChecked = true;
break;
Expand Down Expand Up @@ -1829,7 +1838,6 @@ await Task.Run(() =>
{
ChangelogBox.Visibility = Visibility.Visible;
ChangelogBoxMessageTextBlock.Visibility = Visibility.Visible;
ChangelogBoxScrollViewer.Height -= 20;
FetchChangelog();
}
try
Expand Down Expand Up @@ -2061,9 +2069,12 @@ string SelectGameInstallDirectory()

private void OptionsButton_Click(object sender, RoutedEventArgs e)
{
BpUtility.PlaySound(Properties.Resources.Click);
OptionsContextMenu.PlacementTarget = sender as Button;
var button = sender as Button;
OptionsContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Relative;
OptionsContextMenu.PlacementTarget = button;
OptionsContextMenu.VerticalOffset = button.Height;
OptionsContextMenu.IsOpen = true;
BpUtility.PlaySound(Properties.Resources.Click);
}

private async Task CM_DownloadCache_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -2882,52 +2893,47 @@ private void CM_Language_Click(object sender, RoutedEventArgs e)
{
try{LauncherRegKey.DeleteValue("Language");}catch{}
}
else if(lang == textStrings["contextmenu_language_english"])
{
LauncherLanguage = "en";
}
else if(lang == textStrings["contextmenu_language_russian"])
{
LauncherLanguage = "ru";
}
else if(lang == textStrings["contextmenu_language_spanish"])
{
LauncherLanguage = "es";
}
else if(lang == textStrings["contextmenu_language_portuguese"])
{
LauncherLanguage = "pt";
}
else if(lang == textStrings["contextmenu_language_german"])
{
LauncherLanguage = "de";
}
else if(lang == textStrings["contextmenu_language_vietnamese"])
{
LauncherLanguage = "vi";
}
else if(lang == textStrings["contextmenu_language_serbian"])
{
LauncherLanguage = "sr";
}
else
{
Log($"ERROR: Translation for {lang} doesn't exist", true, 1);
return;
}
if(lang != textStrings["contextmenu_language_system"])
{
SetLanguage(LauncherLanguage);
if(lang == textStrings["contextmenu_language_english"])
{
LauncherLanguage = "en";
}
else if(lang == textStrings["contextmenu_language_russian"])
{
LauncherLanguage = "ru";
}
else if(lang == textStrings["contextmenu_language_spanish"])
{
LauncherLanguage = "es";
}
else if(lang == textStrings["contextmenu_language_portuguese"])
{
LauncherLanguage = "pt";
}
else if(lang == textStrings["contextmenu_language_german"])
{
LauncherLanguage = "de";
}
else if(lang == textStrings["contextmenu_language_vietnamese"])
{
LauncherLanguage = "vi";
}
else if(lang == textStrings["contextmenu_language_serbian"])
{
LauncherLanguage = "sr";
}
else if(lang == textStrings["contextmenu_language_thai"])
{
LauncherLanguage = "th";
}
else
{
Log($"ERROR: Translation for {lang} doesn't exist", true, 1);
return;
}
LauncherRegKey.SetValue("Language", LauncherLanguage);
}
var parent = (MenuItem)item.Parent;
foreach(dynamic i in parent.Items)
{
if(i.GetType() != typeof(MenuItem) || i == item)
continue;
i.IsChecked = false;
}
item.IsChecked = true;
Log($"Set language to {lang}");
BpUtility.StartProcess(LauncherExeName, string.Join(" ", CommandLineArgs), RootPath, true);
Application.Current.Shutdown();
Expand Down Expand Up @@ -3091,7 +3097,9 @@ private void IntroBoxCloseButton_Click(object sender, RoutedEventArgs e)
{
IntroBox.Visibility = Visibility.Collapsed;
if(FirstLaunch)
{
GameUpdateCheck();
}
}

private void DownloadCacheBoxFullCacheButton_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -3526,7 +3534,6 @@ private void ChangelogBoxCloseButton_Click(object sender, RoutedEventArgs e)
{
ChangelogBox.Visibility = Visibility.Collapsed;
ChangelogBoxMessageTextBlock.Visibility = Visibility.Collapsed;
ChangelogBoxScrollViewer.Height = 325;
}

private void ShowLogCheckBox_Checked(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -3749,6 +3756,10 @@ public void SetLanguage(string lang)
LauncherLanguage = lang;
TextStrings_Serbian();
break;
case "th":
LauncherLanguage = lang;
TextStrings_Thai();
break;
case "vi":
LauncherLanguage = lang;
TextStrings_Vietnamese();
Expand All @@ -3760,29 +3771,7 @@ public void SetLanguage(string lang)
}
if(LauncherLanguage != "en")
{
var IntroBoxGrid = VisualTreeHelper.GetChild(IntroBox, 1) as Grid;
var ChangelogBoxGrid = VisualTreeHelper.GetChild(ChangelogBox, 1) as Grid;
var AboutBoxGrid = VisualTreeHelper.GetChild(AboutBox, 1) as Grid;
IntroBoxGrid.Height += 8;
ChangelogBoxGrid.Height += 8;
AboutBoxGrid.Height += 8;
DownloadCacheBoxMessageTextBlock.Height -= 5;
Resources["Font"] = new FontFamily("Segoe UI Bold");
if(LauncherLanguage == "de")
{
AboutBoxGrid.Height -= 10;
AboutBoxMessageTextBlock.Height -= 10;
}
else if(LauncherLanguage == "es" || LauncherLanguage == "pt" || LauncherLanguage == "sr" || LauncherLanguage == "vi")
{
RepairBoxMessageTextBlock.Height -= 5;
}
else if(LauncherLanguage == "ru")
{
RepairBoxMessageTextBlock.Height -= 5;
AboutBoxGrid.Height -= 10;
AboutBoxMessageTextBlock.Height -= 10;
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion TextStrings_de.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private void TextStrings_German()
textStrings["contextmenu_language_german"] = "Deutsch";
textStrings["contextmenu_language_vietnamese"] = "Vietnamesisch";
textStrings["contextmenu_language_serbian"] = "Serbisch";
textStrings["contextmenu_language_thai"] = "Thailändisch";
textStrings["contextmenu_language_contribute"] = "Willst du helfen?";
textStrings["contextmenu_about"] = "Über";
textStrings["progresstext_error"] = "Ein Fehler ist aufgetreten :^(";
Expand Down Expand Up @@ -79,7 +80,7 @@ private void TextStrings_German()
textStrings["changelogbox_1_msg"] = "Better Honkai Impact 3rd Launcher wurde aktualisiert, hier siehst du die letzten Änderungen:";
textStrings["changelogbox_2_msg"] = "Lade Changelog...";
textStrings["changelogbox_3_msg"] = "Fehler beim Laden der Changelog.";
textStrings["aboutbox_msg"] = "Es hat sich einiges verbessert oder nicht? :^)\nDieses Projekt ist entstanden, um euch Captains eine bessere Spielerfahrung zu bieten.\nDieser Launcher steht in keinem Zusammenhang mit miHoYo und ist ein OpenSource Projekt.\nJedes Feedback wird freundlich begrüßt.\nBesonderen Dank gehen an diese GitHub-Contributors:\nSinsOfSeven - Beitrag zur benutzerdefinierten Auflösung\nProxy-E23 - Beitrag der spanischen Sprache\nSpookyKisuy - Beitrag der portugiesischen Sprache\nbulawin1, Vrontis - Beitrag der deutscher Sprache\nKorewaLidesu - Beitrag der vietnamesischen Sprache";
textStrings["aboutbox_msg"] = "Es hat sich einiges verbessert oder nicht? :^)\nDieses Projekt ist entstanden, um euch Captains eine bessere Spielerfahrung zu bieten.\nDieser Launcher steht in keinem Zusammenhang mit miHoYo und ist ein OpenSource Projekt.\nJedes Feedback wird freundlich begrüßt.\nBesonderen Dank gehen an diese GitHub-Contributors:\nSinsOfSeven - Beitrag zur benutzerdefinierten Auflösung\nProxy-E23 - Beitrag der spanischen Sprache\nSpookyKisuy - Beitrag der portugiesischen Sprache\nbulawin1, Vrontis - Beitrag der deutscher Sprache\nKorewaLidesu - Beitrag der vietnamesischen Sprache\nVoRTeXStarz - Beitrag der thailändischen Sprache";
textStrings["msgbox_genericerror_title"] = "Fehler";
textStrings["msgbox_genericerror_msg"] = "Ein Fehler ist aufgetreten.\nFür mehr Informationen schaue im Log nach.";
textStrings["msgbox_neterror_title"] = "Netzwerkfehler";
Expand Down
3 changes: 2 additions & 1 deletion TextStrings_en.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private void TextStrings_English()
textStrings.Add("contextmenu_language_german", "German");
textStrings.Add("contextmenu_language_vietnamese", "Vietnamese");
textStrings.Add("contextmenu_language_serbian", "Serbian");
textStrings.Add("contextmenu_language_thai", "Thai");
textStrings.Add("contextmenu_language_contribute", "Want to help?");
textStrings.Add("contextmenu_sounds", "Sounds");
textStrings.Add("contextmenu_about", "About");
Expand Down Expand Up @@ -99,7 +100,7 @@ private void TextStrings_English()
textStrings.Add("changelogbox_1_msg", "Better Honkai Impact 3rd Launcher has just become even better. Here's what happened:");
textStrings.Add("changelogbox_2_msg", "Loading changelog...");
textStrings.Add("changelogbox_3_msg", "Failed to load the changelog.");
textStrings.Add("aboutbox_msg", "Well it is much more advanced, isn't it? :^)\nThis project was made with hope for many captains to have a better experience with the game.\nIt is not affiliated with miHoYo and is completely open source.\nAny feedback is greatly appreciated.\nSpecial thanks to these GitHub contributors:\nSinsOfSeven - Custom resolution contribution\nProxy-E23 - Spanish language translation\nSpookyKisuy - Portuguese language translation\nbulawin1, Vrontis - German language translation\nKorewaLidesu - Vietnamese language translation\nSm1leAway - Serbian language translation");
textStrings.Add("aboutbox_msg", "Well it is much more advanced, isn't it? :^)\nThis project was made with hope for many captains to have a better experience with the game.\nIt is not affiliated with miHoYo and is completely open source.\nAny feedback is greatly appreciated.\nSpecial thanks to these GitHub contributors:\nSinsOfSeven - Custom resolution contribution\nProxy-E23 - Spanish language translation\nSpookyKisuy - Portuguese language translation\nbulawin1, Vrontis - German language translation\nKorewaLidesu - Vietnamese language translation\nSm1leAway - Serbian language translation\nVoRTeXStarz - Thai language translation");
textStrings.Add("msgbox_genericerror_title", "Error");
textStrings.Add("msgbox_genericerror_msg", "An error occurred.\nFor more information take a look at the log.");
textStrings.Add("msgbox_neterror_title", "Network error");
Expand Down
3 changes: 2 additions & 1 deletion TextStrings_es.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private void TextStrings_Spanish()
textStrings["contextmenu_language_german"] = "Alemán";
textStrings["contextmenu_language_vietnamese"] = "Vietnamita";
textStrings["contextmenu_language_serbian"] = "Serbio";
textStrings["contextmenu_language_thai"] = "Tailandés";
textStrings["contextmenu_language_contribute"] = "¿Quieres ayudar?";
textStrings["contextmenu_sounds"] = "Sonidos";
textStrings["contextmenu_about"] = "Acerca de";
Expand Down Expand Up @@ -87,7 +88,7 @@ private void TextStrings_Spanish()
textStrings["changelogbox_1_msg"] = "Better Honkai Impact 3rd Launcher se ha vuelto mejor. Esto es lo que paso:";
textStrings["changelogbox_2_msg"] = "Cargando el changelog...";
textStrings["changelogbox_3_msg"] = "No se pudo cargar el changelog.";
textStrings["aboutbox_msg"] = "Bueno, es mucho más avanzado, ¿no?:^)\nEste proyecto se creo con la intención de que los capitanes tuvieran una mejor experiencia con el juego..\nBetterHI3Launcher no está afiliado a miHoYo y es completamente de código abierto..\nAgradecemos mucho todo el feedback.\nUn agradecimiento especial a los contribuidores de GitHub:\nSinsOfSeven - Contribución de resolución personalizada\nProxy-E23 - Traducción al idioma español\nSpookyKisuy - Traducción al idioma portugués\nbulawin1, Vrontis - Traducción al idioma alemán\nKorewaLidesu - Traducción al idioma vietnamita\nSm1leAway - Traducción al idioma sérvia";
textStrings["aboutbox_msg"] = "Bueno, es mucho más avanzado, ¿no?:^)\nEste proyecto se creo con la intención de que los capitanes tuvieran una mejor experiencia con el juego..\nBetterHI3Launcher no está afiliado a miHoYo y es completamente de código abierto..\nAgradecemos mucho todo el feedback.\nUn agradecimiento especial a los contribuidores de GitHub:\nSinsOfSeven - Contribución de resolución personalizada\nProxy-E23 - Traducción al idioma español\nSpookyKisuy - Traducción al idioma portugués\nbulawin1, Vrontis - Traducción al idioma alemán\nKorewaLidesu - Traducción al idioma vietnamita\nSm1leAway - Traducción al idioma sérvia\nVoRTeXStarz - Traducción al idioma tailandés";
textStrings["msgbox_genericerror_msg"] = "Ha ocurrido un error.\nPara mas informacion, consultar el log.";
textStrings["msgbox_neterror_title"] = "Error de red";
textStrings["msgbox_neterror_msg"] = "Error al conectarse al servidor:\n{0}";
Expand Down
Loading

0 comments on commit e7440a0

Please sign in to comment.