Skip to content

Commit

Permalink
Update upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
bagusnl committed Mar 6, 2024
2 parents 56dba5b + 9352f38 commit 4ef7fe9
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 75 deletions.
11 changes: 3 additions & 8 deletions CollapseLauncher.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<wpf:ResourceDictionary
xml:space="preserve"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.microsoft.com/winfx/2006/xaml">
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/winfx/2006/xaml">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AA/@EntryIndexedValue">AA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CDN/@EntryIndexedValue">CDN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CDNURL/@EntryIndexedValue">CDNURL</s:String>
Expand All @@ -20,13 +13,15 @@
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=API/@EntryIndexedValue">API</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=BG/@EntryIndexedValue">BG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=BGM/@EntryIndexedValue">BGM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=CDN/@EntryIndexedValue">CDN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=CV/@EntryIndexedValue">CV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=FG/@EntryIndexedValue">FG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=FPS/@EntryIndexedValue">FPS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=FX/@EntryIndexedValue">FX</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=FXFXAA/@EntryIndexedValue">FXFXAA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=FXHDR/@EntryIndexedValue">FXHDR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=HDR/@EntryIndexedValue">HDR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=RPC/@EntryIndexedValue">RPC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=SFX/@EntryIndexedValue">SFX</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=VO/@EntryIndexedValue">VO</s:String>
Expand Down
8 changes: 7 additions & 1 deletion CollapseLauncher/Classes/Helper/Image/ImageLoaderHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal static class ImageLoaderHelper

private static Waifu2X _waifu2X;

public static Waifu2XStatus Waifu2XStatus => _waifu2X.Status;
public static Waifu2XStatus Waifu2XStatus => _waifu2X?.Status ?? Waifu2XStatus.NotAvailable;

public static bool IsWaifu2XEnabled
{
Expand All @@ -52,6 +52,12 @@ public static void InitWaifu2X()
Path.Combine(AppFolder, @"Assets\Waifu2X_Models\scale2.0x_model.bin"));
}

public static void DestroyWaifu2X()
{
_waifu2X?.Dispose();
_waifu2X = null;
}

internal static async Task<FileStream> LoadImage(string path, bool isUseImageCropper = false, bool overwriteCachedImage = false)
{
if (string.IsNullOrEmpty(path) || !File.Exists(path)) return null;
Expand Down
5 changes: 4 additions & 1 deletion CollapseLauncher/Classes/Helper/Image/Waifu2X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ private bool Test()
var outData = new byte[2 * 2 * 3];
Process(1, 1, 3, inData, outData);
_testPassed = outData[0] != 0;
Logger.LogWriteLine("Waifu2X self test failed, got an empty output image.", LogType.Error, true);
if (!_testPassed)
{
Logger.LogWriteLine("Waifu2X self test failed, got an empty output image.", LogType.Error, true);
}
}
return _testPassed;
}
Expand Down
Binary file modified CollapseLauncher/Lib/waifu2x-ncnn-vulkan.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CollapseLauncher.Dialogs;
using CollapseLauncher.Helper.Image;
using CollapseLauncher.Pages;
using CollapseLauncher.Statics;
using Hi3Helper;
Expand Down Expand Up @@ -84,6 +85,7 @@ private void Page_Unloaded(object sender, RoutedEventArgs e)
#if !DISABLEDISCORD
AppDiscordPresence.Dispose();
#endif
ImageLoaderHelper.DestroyWaifu2X();
}

private async void StartRoutine(object sender, RoutedEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- ReSharper disable IdentifierTypo -->
<!-- ReSharper restore IdentifierTypo -->
<!-- ReSharper disable UnusedMember.Local -->
<!-- ReSharper disable Xaml.ConstructorWarning -->
<Page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- ReSharper disable IdentifierTypo -->
<!-- ReSharper restore IdentifierTypo -->
<!-- ReSharper disable UnusedMember.Local -->
<!-- ReSharper disable Xaml.ConstructorWarning -->
<Page
Expand Down
7 changes: 5 additions & 2 deletions CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,13 @@ private async void StartLoadedRoutine(object sender, RoutedEventArgs e)
CheckRunningGameInstance(PageToken.Token);
UpdatePlaytime();

if (m_arguments.StartGame != null && m_arguments.StartGame.Play)
if (m_arguments.StartGame?.Play == true)
{
if (CurrentGameProperty._GameVersion.IsGameInstalled())
if (CurrentGameProperty._GameVersion.GetGameState() is
GameInstallStateEnum.Installed or GameInstallStateEnum.InstalledHavePreload)
{
StartGame(null, null);
}
m_arguments.StartGame.Play = false;
}

Expand Down
10 changes: 5 additions & 5 deletions CollapseLauncher/XAMLs/MainApp/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<!-- ReSharper disable IdentifierTypo -->
<!-- ReSharper disable UnusedMember.Local -->
<!-- ReSharper disable Xaml.ConstructorWarning -->
<Page
x:Class="CollapseLauncher.Pages.SettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand All @@ -6,7 +9,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helper="using:Hi3Helper"
xmlns:innerConfig="using:Hi3Helper.Shared.Region"
xmlns:local="using:CollapseLauncher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
CacheMode="BitmapCache"
Loaded="Page_Loaded"
Expand Down Expand Up @@ -237,7 +239,6 @@
Orientation="Horizontal"
Visibility="Collapsed">
<Button
Grid.Column="0"
Height="40"
Margin="0,0,12,0"
Click="ShowKbScList_Click"
Expand All @@ -256,7 +257,6 @@
</StackPanel>
</Button>
<Button
Grid.Column="1"
Height="40"
Click="ResetKeylist_Click"
CornerRadius="20"
Expand Down Expand Up @@ -493,7 +493,7 @@
Style="{ThemeResource SubtitleTextBlockStyle}"
Text="{x:Bind helper:Locale.Lang._SettingsPage.About}" />
<Grid>
<StackPanel Grid.Column="1">
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal">
<TextBlock
Style="{ThemeResource BodyStrongTextBlockStyle}"
Expand All @@ -513,7 +513,7 @@
<TextBlock
Style="{ThemeResource BodyStrongTextBlockStyle}"
Text="{x:Bind helper:Locale.Lang._SettingsPage.About_Copyright2}"
TextWrapping="Wrap" />
TextWrapping="WrapWholeWords" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap">
Expand Down
31 changes: 19 additions & 12 deletions CollapseLauncher/XAMLs/MainApp/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
using static Hi3Helper.Locale;
using static Hi3Helper.Logger;
using static Hi3Helper.Shared.Region.LauncherConfig;
// ReSharper disable PossibleNullReferenceException
// ReSharper disable AssignNullToNotNullAttribute

namespace CollapseLauncher.Pages
{
// ReSharper disable once RedundantExtendsListEntry
public sealed partial class SettingsPage : Page
{
#region Properties
Expand Down Expand Up @@ -95,9 +98,13 @@ private async void RelocateFolder(object sender, RoutedEventArgs e)
File.Delete(AppNotifIgnoreFile);
Directory.Delete(AppGameConfigMetadataFolder, true);
}
catch { }
catch
{
// Pipe error
}
MainFrameChanger.ChangeWindowFrame(typeof(OOBEStartUpMenu));
break;
// ReSharper disable once RedundantEmptySwitchSection
default:
break;
}
Expand All @@ -115,7 +122,7 @@ private async void ClearMetadataFolder(object sender, RoutedEventArgs e)
if (collapsePath == null || AppGameConfigMetadataFolder == null) return;
Directory.Delete(AppGameConfigMetadataFolder, true);
Process.Start(collapsePath);
App.Current.Exit();
Application.Current.Exit();
}
catch (Exception ex)
{
Expand All @@ -124,6 +131,7 @@ private async void ClearMetadataFolder(object sender, RoutedEventArgs e)
LogWriteLine(msg, LogType.Error, true);
}
break;
// ReSharper disable once RedundantEmptySwitchSection
default:
break;
}
Expand Down Expand Up @@ -216,11 +224,11 @@ private void LaunchUpdater(string ChannelName)
Verb = "runas"
}
}.Start();
App.Current.Exit();
Application.Current.Exit();
}
catch
{
return;
// Pipe error
}
}

Expand Down Expand Up @@ -269,7 +277,6 @@ private void LauncherUpdateInvoker_UpdateEvent(object sender, LauncherUpdateProp
UpToDateStatus.Visibility = Visibility.Collapsed;
UpdateAvailableLabel.Text = e.NewVersionName.VersionString + (ChannelName);
LauncherUpdateInvoker.UpdateEvent -= LauncherUpdateInvoker_UpdateEvent;
return;
}
else
{
Expand Down Expand Up @@ -359,14 +366,14 @@ private bool IsBGCustom
{
get
{
bool IsEnabled = GetAppConfigValue("UseCustomBG").ToBool();
bool isEnabled = GetAppConfigValue("UseCustomBG").ToBool();
string BGPath = GetAppConfigValue("CustomBGPath").ToString();
if (!string.IsNullOrEmpty(BGPath))
BGPathDisplay.Text = BGPath;
else
BGPathDisplay.Text = Lang._Misc.NotSelected;

if (IsEnabled)
if (isEnabled)
{
AppBGCustomizer.Visibility = Visibility.Visible;
AppBGCustomizerNote.Visibility = Visibility.Visible;
Expand All @@ -377,8 +384,8 @@ private bool IsBGCustom
AppBGCustomizerNote.Visibility = Visibility.Collapsed;
}

BGSelector.IsEnabled = IsEnabled;
return IsEnabled;
BGSelector.IsEnabled = isEnabled;
return isEnabled;
}
set
{
Expand Down Expand Up @@ -461,9 +468,9 @@ private bool IsDiscordRPCEnabled
{
get
{
bool IsEnabled = GetAppConfigValue("EnableDiscordRPC").ToBool();
bool isEnabled = GetAppConfigValue("EnableDiscordRPC").ToBool();
ToggleDiscordGameStatus.IsEnabled = IsEnabled;
if (IsEnabled)
if (isEnabled)
{
ToggleDiscordGameStatus.Visibility = Visibility.Visible;
ToggleDiscordIdleStatus.Visibility = Visibility.Visible;
Expand All @@ -473,7 +480,7 @@ private bool IsDiscordRPCEnabled
ToggleDiscordGameStatus.Visibility = Visibility.Collapsed;
ToggleDiscordIdleStatus.Visibility = Visibility.Collapsed;
}
return IsEnabled;
return isEnabled;
}
set
{
Expand Down
4 changes: 2 additions & 2 deletions Hi3Helper.Core/Lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@
"HelpLocalizeBtn": "Help Us Translate Collapse!",

"About": "About",
"About_Copyright1": "© 2022-2023",
"About_Copyright2": " neon-nyan, Cry0, bagusnl & Kuro",
"About_Copyright1": "© 2022-2024",
"About_Copyright2": " neon-nyan, Cry0, bagusnl,\r\n shatyuka, gablm",
"About_Copyright3": "Under",
"About_Copyright4": ". All rights reserved.",

Expand Down
27 changes: 22 additions & 5 deletions Hi3Helper.Core/Lang/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,23 @@
"Graphics_APHO2AO": "Oclusión Ambiental",
"Graphics_APHO2LOD": "Nivel de Detalle",

"Graphics_ParticleQuality": "Calidad de Partículas",
"Graphics_LightingQuality": "Calidad de Iluminación",
"Graphics_PostFXQuality": "Calidad de Post-FX",
"Graphics_AAMode": "Modo de Anti-Aliasing",
"Graphics_CharacterQuality": "Calidad de Personajes",
"Graphics_WeatherQuality": "Calidad del Clima",

"Graphics_Legacy_Title": "Ajustes de Legado",
"Graphics_Legacy_Subtitle": "Estos ajustes no están presentes en el juego y puede que no tengan ningún efecto.",

"SpecDisabled": "Deshabilitado",
"SpecLow": "Bajo",
"SpecMedium": "Medio",
"SpecHigh": "Alto",
"SpecVeryHigh": "Muy Alto",
"SpecMaximum": "Máximo",
"SpecUltra": "Ultra",

"Audio_Title": "Ajustes de Audio",
"Audio_Master": "Volumen Global",
Expand Down Expand Up @@ -338,7 +349,7 @@
"Advanced_Subtitle1": "¡El equipo de Collapse Launcher",
"Advanced_Subtitle2": "NO ES RESPONSABLE",
"Advanced_Subtitle3": "de lo que pueda ocurrir con tu juego, cuenta o sistema mientras estos ajustes están en uso! Úselo bajo su propio riesgo",
"Advanced_GLC_WarningAdmin": "Advertencia: Los Comandos proporcionados se ejecutaran como Administrador! ",
"Advanced_GLC_WarningAdmin": "ADVERTENCIA: Los Comandos proporcionados se ejecutaran como Administrador! ",
"Advanced_GLC_PreLaunch_Title": "Comandos de Pre-lanzamiento",
"Advanced_GLC_PreLaunch_Subtitle": "Comandos que serán ejecutados antes de que se inicie el juego",
"Advanced_GLC_PreLaunch_Exit": "Forzar salida del proceso cuando el juego es cerrado/detenido",
Expand Down Expand Up @@ -416,8 +427,8 @@
"HelpLocalizeBtn": "¡Ayúdanos a traducir Collapse!",

"About": "Acerca de",
"About_Copyright1": "© 2022-2023",
"About_Copyright2": " neon-nyan, Cry0, bagusnl & Kuro",
"About_Copyright1": "© 2022-2024",
"About_Copyright2": " neon-nyan, Cry0, bagusnl,\r\n shatyuka, gablm",
"About_Copyright3": "Bajo",
"About_Copyright4": ". Todos los derechos reservados.",

Expand Down Expand Up @@ -450,7 +461,13 @@
"AppBehavior_PostGameLaunch_Nothing": "No hacer nada",
"AppBehavior_MinimizeToTray": "Minimizar a la bandeja",
"AppBehavior_LaunchOnStartup": "Iniciar automáticamente Collapse cuando se inicie tu computadora.",
"AppBehavior_StartupToTray": "Ocultar ventana de Collapse cuando se inicie automáticamente."
"AppBehavior_StartupToTray": "Ocultar ventana de Collapse cuando se inicie automáticamente.",

"Waifu2X_Toggle": "Usar Waifu2X [Experimental]",
"Waifu2X_Help": "Usa Waifu2X para escalar imágenes de fondo.\nCuando está activado, la calidad de la imagen mejora significativamente, pero tardará en cargar la imagen la primera vez.",
"Waifu2X_Warning_CpuMode": "ADVERTENCIA: No se encontró un dispositivo Vulkan GPU disponible, se usara el modo CPU. Esto aumentara considerablemente el tiempo de procesamiento de la imagen.",
"Waifu2X_Error_Loader": "ERROR: Fallo al inicializar el Vulkan Loader. Asegúrate de que tienes una GPU compatible con Vulkan y su respetivo Driver instalado.",
"Waifu2X_Error_Output": "ERROR: Fallo al realizar la comprobación de Waifu2X, se obtuvo un output vacío."
},

"_Misc": {
Expand Down Expand Up @@ -648,7 +665,7 @@
"MigrationTitle": "Ubicando Carpeta de Destino",
"MigrationSubtitle": "Antes de migrar, ¿deseas especificar la ubicación del juego?",
"NeedInstallMediaPackTitle": "¡El Paquete de Características Multimedia no se puede encontrar!",
"NeedInstallMediaPackSubtitle1": "AVISO: A partir de la actualización v5.8, Honkai Impact 3rd necesita el \"Paquete de Caracteristicas Multimedia\" para poder funcionar correctamente. Esto solucionará el error \"Error al cargar DLL 'cri_ware_unity'\" dentro del juego.\n\n",
"NeedInstallMediaPackSubtitle1": "ADVERTENCIA: A partir de la actualización v5.8, Honkai Impact 3rd necesita el \"Paquete de Caracteristicas Multimedia\" para poder funcionar correctamente. Esto solucionará el error \"Error al cargar DLL 'cri_ware_unity'\" dentro del juego.\n\n",
"NeedInstallMediaPackSubtitle2": "Puede que necesite reiniciar su PC después de haber instalado el \"Paquete de Características Multimedia\". Puedes ignorar esta advertencia si ya la tienes instalada o deseas intentar jugar Honkai Impact 3rd, pero existe la posibilidad de que recibas el error mientras ejecutas el juego.",
"InstallMediaPackCompleteTitle": "¡El Paquete de Características Multimedia ha sido instalado!",
"InstallMediaPackCompleteSubtitle": "El Paquete de Características Multimedia se ha instalado a tu computadora.\n¡Por favor reiniciala para aplicar el parche!",
Expand Down
Loading

0 comments on commit 4ef7fe9

Please sign in to comment.