Skip to content

Commit

Permalink
Merge branch 'main' into steamshortcut-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gablm authored Feb 6, 2024
2 parents c09dc6f + afc7343 commit 44631f0
Show file tree
Hide file tree
Showing 28 changed files with 320 additions and 99 deletions.
2 changes: 1 addition & 1 deletion CollapseLauncher/Classes/CachesManagement/Honkai/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private async Task UpdateCacheAsset(CacheAsset asset, Http httpClient, Cancellat
if (asset.CS >= _sizeForMultiDownload)
{
await httpClient.Download(asset.ConcatURL, asset.ConcatPath, _downloadThreadCount, true, token);
await httpClient.Merge();
await httpClient.Merge(token);
}
// Do single-session download for others
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private async Task UpdateCacheAsset(SRAsset asset, Http httpClient, Cancellation
if (asset.Size >= _sizeForMultiDownload)
{
await httpClient.Download(asset.RemoteURL, asset.LocalName, _downloadThreadCount, true, token);
await httpClient.Merge();
await httpClient.Merge(token);
}
// Do single-session download for others
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,10 @@ enum GlobalIlluminationOption
High,
Extreme
}

enum DynamicCharacterResolutionOption
{
Off,
On
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ internal class GlobalPerfData
AnisotropicFiltering = AnisotropicFilteringOption.x1,
GraphicsQuality = GraphicsQualityOption.Lowest,
GlobalIllumination = GlobalIlluminationOption.Off,
DynamicCharacterResolution = DynamicCharacterResolutionOption.On,
};

private static GlobalPerfData _LowPreset = new()
Expand All @@ -87,6 +88,7 @@ internal class GlobalPerfData
AnisotropicFiltering = AnisotropicFilteringOption.x2,
GraphicsQuality = GraphicsQualityOption.Low,
GlobalIllumination = GlobalIlluminationOption.Off,
DynamicCharacterResolution = DynamicCharacterResolutionOption.On,
};

private static GlobalPerfData _MediumPreset = new()
Expand All @@ -109,6 +111,7 @@ internal class GlobalPerfData
AnisotropicFiltering = AnisotropicFilteringOption.x4,
GraphicsQuality = GraphicsQualityOption.Medium,
GlobalIllumination = GlobalIlluminationOption.Medium,
DynamicCharacterResolution = DynamicCharacterResolutionOption.On,
};
#endregion

Expand Down Expand Up @@ -261,12 +264,21 @@ private static int GetFPSOptionNumber(FPSOption value)

/// <summary>
/// This defines "<c>Global Illumination</c>" combobox In-game settings. <br/>
/// Options: Off, Medium, High, Extreme
/// Default: High [2] <br/>
/// Notes: Only work for PC who meet the specs for Global Illumination, specified by HYV <br/>
/// Options: Off, Medium, High, Extreme <br/>
/// Default: High [2] <br/>
/// Notes: Only work for PC who meet the specs for Global Illumination, specified by HYV <br/>
/// Further information: https://genshin.hoyoverse.com/en/news/detail/112690#:~:text=Minimum%20Specifications%20for%20Global%20Illumination
/// </summary>
public GlobalIlluminationOption GlobalIllumination = GlobalIlluminationOption.High;

/// <summary>
/// This defines "<c>Dynamic Character Resolution</c>" combobox In-game settings. <br/>
/// Options: Off, On <br/>
/// Default: On [1] <br/>
/// Notes: Only work for PC who meet the specs for Dynamic Character Resolution, specified by HYV <br/>
/// Further information: https://genshin.hoyoverse.com/en/news/detail/122141#:~:text=Dynamic%20Character%20Resolution
/// </summary>
public DynamicCharacterResolutionOption DynamicCharacterResolution = DynamicCharacterResolutionOption.On;
#endregion

#region Methods
Expand Down Expand Up @@ -442,6 +454,13 @@ public static GlobalPerfData Load(string globalPerfJson, GraphicsData graphics)
#endif
globalPerf.GlobalIllumination = (GlobalIlluminationOption)setting.index;
break;

case 21:
#if DEBUG
LogWriteLine($"Loaded Genshin Settings: Graphics - Dynamic Character Resolution: {setting.index}", LogType.Debug, true);
#endif
globalPerf.DynamicCharacterResolution = (DynamicCharacterResolutionOption)setting.index;
break;
}
}
return globalPerf;
Expand All @@ -468,7 +487,8 @@ public string Save()
new PerfDataItem(15, (int)SubsurfaceScattering, portedVersion),
new PerfDataItem(17, (int)AnisotropicFiltering, portedVersion),
new PerfDataItem(18, (int)GraphicsQuality, portedVersion),
new PerfDataItem(19, (int)GlobalIllumination, portedVersion)
new PerfDataItem(19, (int)GlobalIllumination, portedVersion),
new PerfDataItem(21, (int)DynamicCharacterResolution, portedVersion),
};
string data = this.Serialize(GenshinSettingsJSONContext.Default, false);
#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public string Create(GlobalPerfData globalPerf)
new GenshinKeyValuePair(15, (int)globalPerf.SubsurfaceScattering + 1),
new GenshinKeyValuePair(17, (int)globalPerf.AnisotropicFiltering + 1),
new GenshinKeyValuePair(19, (int)globalPerf.GlobalIllumination + 1),
new GenshinKeyValuePair(21, (int)globalPerf.DynamicCharacterResolution + 1),
};

string data = this.Serialize(GenshinSettingsJSONContext.Default, false);
Expand Down
Loading

0 comments on commit 44631f0

Please sign in to comment.