Skip to content

Commit

Permalink
Preview 1.73.5 release (#420)
Browse files Browse the repository at this point in the history
* [skip ci] Update README.md

* Clamp column width if there is no space left

This to fix the DataTable component causing a crash due to negative value if small window mode is used.

* Enable Rich Presence only after the activated region is set

might fix #402

* Fix blurry console icon

Also, get the icon from exe rather than a separate ico file

* (CodeQA) Theme xaml

* Move RPC dispose

Adjusted to be in the same file where it is initialized (448ff77)

* Change default value displayed for ```Download Threads``` to match the real default value

* Auto resize DataTable column width using star

L.CRC and R.CRC are hidden in small window mode before this commit.

* [skip ci] Update LICENSE and its references

* [skip ci] Update SECURITY.md
- Added @shatyuka and @gablm to the active maintainers list
- Update supported version section

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* HI3 Senadina Game Settings Adjustments (#417)

* (GSP) HI3: Adjust to new version

* [skip ci] Add more abbreviation list

* Use ShouldComputeInputPris on build
To try mitigate resource not found error

* (GSP) More Hi3 Senadina backend changes

* (GSP) Force GraphicsGrade to 6 on Save

* (GSP) Docs

* (GSP) Senadina frontends

and localization

* (GSP) Disable preset

* CodeQA stuff

* Fix crash due to value not exist for ``GraphicsReflectionQuality``

* Move and change Physics toggle to ``ToggleSwitch``

* review adjustments

* Review adjustment
- Use comparedTo instead of TypeExtensions for Equals() in PhysicsSimulation.cs
- Adjustment on comparedTo in GraphicsGrade.cs
- Remove unnecessary int declaration in Honkai\RegistryClass\Enums.cs

---------

Co-authored-by: Kemal Setya Adhi <[email protected]>
Co-authored-by: Ron Friedman <[email protected]>

* Add delay for GameBoost

Adding 10 seconds before changing the priority to allow for the process to initialize.
Also move to its own method to avoid error mixed up with main game launching method error(s).
Also also, fix some code QA problems on the changed section because might as well :ahuehue:

* Update WindowsAppSDK to 1.5.0

Related #418

* (DiscordRPC) Reset `_firstTimeConnect` for new client

* Use Waifu2X to enlarge background image (#412)

* Use Waifu2X to enlarge background image

* More checks

* Resize to window size

We will not get pixelated image using MagicScaler

* Code cleanup

* Rename models folder name

* Add some useful logs

* Auto detect GPU

discrete > integrated > others

* Enable OpenMP for speed

* [skip ci] Add WAIFU2X.LICENSE and OPENMP.LICENSE

* Minor fixes

---------

Co-authored-by: Bagus Nur Listiyono <[email protected]>

* [skip ci] Use ex variable on GameBoost_Invoke

oops...

* (CodeQA) SettingsPage

- Change copyright year
- Sync maintainers
- Suppress null scans (take it ReSharper!)
- Suppress unrelated Xaml warnings

* Stop "open -p" from starting a game when not updated

* (Waifu2X) Fix failed test log

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* (Waifu2X) Fix crash on exit

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Fix CustomBG checkbox logic

:derp:

* Fix Level of Detail setting order for Hi3

* Read the cache reference from stream for Hi3

* Keyboard Shortcut improvements (#416)

* Revamp how shortcuts are saved and fix UI margins

* Convert old shortcut list

* Minor refactor + Fix KbShortcut related flyout crash

* Allow localization of VirtualKeyModifiers

* Remove invalid shortcuts and save if the dictionary is altered

* Qodana

* Parse kbshortcuts .ini only when enabling the shortcuts

* Turn DefaultShortcutList into a readonly field

* (KbShortcuts) Get GameCount and MaxRegions from Metadata

* Remove Equals/HashCode and directly compare values

* Update KeyboardShortcuts.cs

* No possible multiple enumerations while loading shortcuts

* Fix validity check for new shortcut combinations

* (KeyboardShortcut) CodeQA

- Suppress null warnings
- Wrap long lines
- Remove unnecessary statement

* (KeyboardShortcut) CodeQA part 2

Bc no save :(

* (Keyboard Shortcut) Fix opacity animation

---------

Co-authored-by: Bagus Nur Listiyono <[email protected]>

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* [skip ci] Bump version

* Add function to launch game in alt (legacy Collapse) launch mode

* Update NuGet(s)
- MagicScaler 0.14.0 -> 0.14.2
https://github.com/saucecontrol/PhotoSauce/releases/tag/v0.14.1
https://github.com/saucecontrol/PhotoSauce/releases/tag/v0.14.2

- BuildSDK

* Small refactor on HomePage.StartGame
- Avoid multiple call on the same parameter
- Avoid unnecessary call on unused parameter
- Use async overload when disposing ResizableWindowHookToken
- Avoid NRE if WatchOutputLog is unexpectedly cancelled before the time
- Suppress some NRE

---------

Co-authored-by: Ron Friedman <[email protected]>
Co-authored-by: Kemal Setya Adhi <[email protected]>
Co-authored-by: Gabriel Lima <[email protected]>
Co-authored-by: Shatyuka <[email protected]>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Ron Friedman <[email protected]>
  • Loading branch information
7 people authored Mar 9, 2024
2 parents a3228c4 + 42ad076 commit fe6d5a9
Show file tree
Hide file tree
Showing 62 changed files with 2,489 additions and 786 deletions.
12 changes: 10 additions & 2 deletions CollapseLauncher.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
<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">
<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>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FX/@EntryIndexedValue">FX</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FXAA/@EntryIndexedValue">FXAA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HD/@EntryIndexedValue">HD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HDR/@EntryIndexedValue">HDR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=AA/@EntryIndexedValue">AA</s:String>
<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></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=VO/@EntryIndexedValue">VO</s:String>
</wpf:ResourceDictionary>
6 changes: 6 additions & 0 deletions CollapseLauncher/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using CollapseLauncher.Helper.Image;
using H.NotifyIcon;
using Hi3Helper;
using Hi3Helper.Shared.Region;
Expand Down Expand Up @@ -79,6 +80,11 @@ public App()
LoggerConsole.DisposeConsole();
}
}

if (m_appMode != AppMode.Updater)
{
ImageLoaderHelper.InitWaifu2X();
}
}
catch (Exception ex)
{
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,8 @@ private static T[] EnsureLengthCopyLast<T>(T[] array, int toLength)

private async Task ApplyBackground(bool _isFirstStartup)
{
uint _width = (uint)(m_actualMainFrameSize.Width * 1.5 * m_appDPIScale);
uint _height = (uint)(m_actualMainFrameSize.Height * 1.5 * m_appDPIScale);

BitmapImage ReplacementBitmap;
(PaletteBitmap, ReplacementBitmap) = await ImageLoaderHelper.GetResizedBitmapNew(regionBackgroundProp.imgLocalPath, _width, _height);
(PaletteBitmap, ReplacementBitmap) = await ImageLoaderHelper.GetResizedBitmapNew(regionBackgroundProp.imgLocalPath);
if (PaletteBitmap == null || ReplacementBitmap == null) return;

ApplyAccentColor(this, PaletteBitmap, regionBackgroundProp.imgLocalPath);
Expand Down Expand Up @@ -334,4 +331,4 @@ private void HideBackgroundImage(bool hideImage = true)
}
}
}
}
}
23 changes: 6 additions & 17 deletions CollapseLauncher/Classes/CachesManagement/Honkai/Fetch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,15 @@ private async Task BuildGameRepoURL(CancellationToken token)
// Get the asset index properties
string baseURL = string.Format(_gameRepoURL!, type.ToString().ToLowerInvariant());
string assetIndexURL = string.Format(CombineURLFromString(baseURL, "{0}Version.unity3d")!, type == CacheAssetType.Data ? "Data" : "Resource");
MemoryStream stream = new MemoryStream();
XORStream xorStream = new XORStream(stream);

try
{
// Start downloading the asset index
await _httpClient!.Download(assetIndexURL, stream, null, null, token);
// Get a direct HTTP Stream
using HttpResponseInputStream remoteStream = await HttpResponseInputStream.CreateStreamAsync(_httpClient.GetHttpClient(), assetIndexURL, null, null, token);
using XORStream xorStream = new XORStream(remoteStream);

// Build the asset index and return the count and size of each type
(int, long) returnValue = BuildAssetIndex(type, baseURL, xorStream, assetIndex);
// Build the asset index and return the count and size of each type
(int, long) returnValue = BuildAssetIndex(type, baseURL, xorStream, assetIndex);

return returnValue;
}
finally
{
// Dispose the streams
stream.Dispose();
xorStream.Dispose();
}
return returnValue;
}

/*
Expand Down Expand Up @@ -179,7 +169,6 @@ private void BuildDataPatchConfig(MemoryStream stream, List<CacheAsset> assetInd
bool isNeedReadLuckyNumber = type == CacheAssetType.Data;

// Parse asset index file from UABT
stream!.Position = 0;
BundleFile bundleFile = new BundleFile(stream);
SerializedFile serializeFile = new SerializedFile(bundleFile.fileList!.FirstOrDefault()!.stream);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private async Task<bool> CheckRoutine()
_updateAssetIndex = new List<CacheAsset>();

// Reset status and progress
ResetStatusAndProgress();
// ResetStatusAndProgress();

// Step 1: Fetch asset indexes
_assetIndex = await Fetch(_token!.Token);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,89 @@
using System.Text.Json.Serialization;

// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming
namespace CollapseLauncher.GameSettings.Honkai.Enums
{
/// <summary>
/// This selection has 4 name types: Low (0), Middle (1), High (2), VHigh (3)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectResolutionQuality>))]
internal enum SelectResolutionQuality : int { Low, Middle, High, VHigh }
internal enum SelectResolutionQuality { Low, Middle, High, VHigh }

/// <summary>
/// This selection has 5 name types: DISABLED (0), LOW (1), MIDDLE (2), HIGH (3), ULTRA (4)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectShadowLevel>))]
internal enum SelectShadowLevel : int { DISABLED, LOW, MIDDLE, HIGH, ULTRA }
internal enum SelectShadowLevel { DISABLED, LOW, MIDDLE, HIGH, ULTRA }

/// <summary>
/// This selection has 3 name types: DISABLED (0), LOW (1), HIGH (2)<br/>
/// This selection has 4 name types: DISABLED (0), LOW (1), MIDDLE (2), HIGH (3)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectReflectionQuality>))]
internal enum SelectReflectionQuality : int { DISABLED, LOW, HIGH }
internal enum SelectReflectionQuality { DISABLED, LOW, MIDDLE, HIGH }

/// <summary>
/// This selection has 5 name types: Off (0), Low (1), Middle (2), High (3), Ultra (4)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectLightningQuality>))]
internal enum SelectLightningQuality { Off, Low, Middle, High, Ultra }

/// <summary>
/// This selection has 4 name types: Off, Low, Middle, High
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectPostFXQuality>))]
internal enum SelectPostFXQuality { Off, Low, Middle, High }

/// <summary>
/// This selection has 3 name types: Off, FXAA, TAA
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectAAType>))]
internal enum SelectAAType { Off, FXAA, TAA }

/// <summary>
/// This selection has 3 name tupes: Low, Middle, High
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectCharacterQuality>))]
internal enum SelectCharacterQuality { Low, Middle, High }

/// <summary>
/// This selection has 3 name tupes: Low, Middle, High
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectWeatherQuality>))]
internal enum SelectWeatherQuality { Low, Middle, High }

/// <summary>
/// This selection has 2 name types: Low (0), High (1)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectGlobalIllumination>))]
internal enum SelectGlobalIllumination : int { Low, High }
internal enum SelectGlobalIllumination { Low, High }

/// <summary>
/// This selection has 3 name types: OFF (0), LOW (1), HIGH (2)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectAmbientOcclusion>))]
internal enum SelectAmbientOcclusion : int { OFF, LOW, HIGH }
internal enum SelectAmbientOcclusion { OFF, LOW, HIGH }

/// <summary>
/// This selection has 3 name types: Low (0), Medium (1), High (2)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectVolumetricLight>))]
internal enum SelectVolumetricLight : int { Low, Medium, High }
internal enum SelectVolumetricLight { Low, Medium, High }

/// <summary>
/// This selection has 2 name types: Low (0), High (1)<br/>
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectPostFXGrade>))]
internal enum SelectPostFXGrade : int { Low, High }
internal enum SelectPostFXGrade { Low, High }

/// <summary>
/// This selection has 3 name types: Low (2), Medium (1), High (0)<br/>
/// </summary>
internal enum SelectLodGrade : int { Low = 2, Medium = 1, High = 0 }
internal enum SelectLodGrade { Low = 2, Medium = 1, High = 0 }

/// <summary>
/// This selection has 3 name tupes: Low, Middle, High
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<SelectParticleEmitLevel>))]
internal enum SelectParticleEmitLevel { Low, Middle, High }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using CollapseLauncher.Interfaces;
using Hi3Helper;
using System;
using static CollapseLauncher.GameSettings.Base.SettingsBase;
using static Hi3Helper.Logger;

namespace CollapseLauncher.GameSettings.Honkai
{
internal class GraphicsGrade : IGameSettingsValue<GraphicsGrade>
{
#region Fields
private const string _ValueName = "GENERAL_DATA_V2_GraphicsGrade_h1073342808";
#endregion

#region Enum
// ReSharper disable once UnusedMember.Global
public enum SelectGraphicsGrade {Performance = 1, Normal, HD, Quality, Max, Custom}
#endregion

#region Properties
/// <summary>
/// This defines the "<c>Video -> Graphics</c>" Quality preset Combobox <br/><br/>
/// Value is int with possible value of 1 - 6
///
/// </summary>
public SelectGraphicsGrade GraphicsGradeInt { get; set; } = SelectGraphicsGrade.Custom;
#endregion

#region Methods
#nullable enable
public static GraphicsGrade Load()
{
try
{
if (RegistryRoot == null) throw new NullReferenceException($"Cannot load {_ValueName} RegistryKey is unexpectedly not initialized!");

object? value = RegistryRoot.GetValue(_ValueName, null);
if (value != null)
{
SelectGraphicsGrade graphicsGrade = (SelectGraphicsGrade)value;
#if DEBUG
LogWriteLine($"Loaded HI3 Settings: {_ValueName} : {value}", LogType.Debug, true);
#endif

return new GraphicsGrade { GraphicsGradeInt = graphicsGrade };
}
}
catch ( Exception ex )
{
LogWriteLine($"Failed while reading {_ValueName}" +
$"\r\n Please open the game and change any Graphics Settings, then close normally. After that you can use this feature." +
$"\r\n If the issue persist, please report it on GitHub" +
$"\r\n{ex}", LogType.Error, true);
ErrorSender.SendException(new Exception(
$"Failed when reading game settings {_ValueName}\r\n" +
$"Please open the game and change any graphics settings, then safely close the game. If the problem persist, report the issue on our GitHub\r\n" +
$"{ex}", ex));
}

return new GraphicsGrade();
}

public void Save()
{
try
{
if (RegistryRoot == null) throw new NullReferenceException($"Cannot save {_ValueName} since RegistryKey is unexpectedly not initialized!");
LogWriteLine("(HI3 GSP) Forcing GraphicsGrade to Custom!", LogType.Warning, true);
GraphicsGradeInt = SelectGraphicsGrade.Custom;
RegistryRoot.SetValue(_ValueName, GraphicsGradeInt, Microsoft.Win32.RegistryValueKind.DWord);
#if DEBUG
LogWriteLine($"Saved HI3 Settings: {_ValueName} : {GraphicsGradeInt}", LogType.Debug, true);
#endif
}
catch (Exception ex)
{
LogWriteLine($"Failed to save {_ValueName}!\r\n{ex}", LogType.Error, true);
}
}

public bool Equals(GraphicsGrade? comparedTo) => GraphicsGradeInt == comparedTo?.GraphicsGradeInt;
#endregion
}
}
Loading

0 comments on commit fe6d5a9

Please sign in to comment.