发包版本

This commit is contained in:
SoulliesOfficial
2026-07-26 09:32:51 -04:00
parent a00046128d
commit 923fc5359f
124 changed files with 1252 additions and 387 deletions

View File

@@ -1,4 +1,5 @@
using Ichni.Menu;
using Ichni.UI;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
@@ -112,6 +113,7 @@ namespace Ichni
{
string savePath = Application.persistentDataPath + "/GameData/" + SettingsSaveFileName;
bool migratedLegacyLanguageIndex = false;
bool migratedUiEffectsSetting = false;
if (ES3.FileExists(savePath))
{
// 保留原有 ES3 Key确保本次数据模型重命名不会让已有本地设置失效。
@@ -123,12 +125,13 @@ namespace Ichni
}
migratedLegacyLanguageIndex = MigrateLanguageCodeIfNeeded();
migratedUiEffectsSetting = MigrateUiEffectsSettingIfNeeded();
ApplyAudioSettings();
ApplyGraphicSettings();
ApplyLanguageSettings();
// 旧语言索引只应参与一次迁移;立刻写回稳定 Code避免每次启动都重复依赖旧字段。
if (migratedLegacyLanguageIndex)
if (migratedLegacyLanguageIndex || migratedUiEffectsSetting)
{
SaveGameSettings();
}
@@ -176,6 +179,7 @@ namespace Ichni
currentUrpAsset.renderScale = 0.5f + 0.1f * settingsSaveData.renderScaleLevel;
ApplyDisplaySettings();
ApplyPostProcessingSettings();
ApplyUiEffectsSettings();
}
/// <summary>
@@ -206,6 +210,33 @@ namespace Ichni
}
}
/// <summary>
/// 应用 UI 特效总开关。
/// <para>
/// 仅处理显式挂载 <see cref="UiExpandingContoursEffect"/> 的装饰性 UI Image而不修改共享材质本身。
/// 这样关闭特效时会移除对应 Shader 的绘制开销,同时保留页面布局和其它 UI 元素。
/// </para>
/// <para>
/// 使用 Include 是为了让当前处于隐藏状态的 SongSelectionPage、SettingsPage 也同步保存目标状态;
/// 它们下次显示时无需再经过一帧特效可见的过渡。
/// </para>
/// </summary>
public void ApplyUiEffectsSettings()
{
if (settingsSaveData == null)
{
return;
}
UiExpandingContoursEffect[] effectTargets =
FindObjectsByType<UiExpandingContoursEffect>(FindObjectsInactive.Include, FindObjectsSortMode.None);
foreach (UiExpandingContoursEffect effectTarget in effectTargets)
{
effectTarget.ApplyEnabledState(settingsSaveData.enableUiEffects);
}
}
/// <summary>
/// 处理场景切换后新加载的相机与 Global Volume。SettingsManager 会跨场景保留,
/// 因此不能只在首次读取存档时应用一次图形设置。
@@ -215,6 +246,7 @@ namespace Ichni
if (settingsSaveData != null)
{
ApplyPostProcessingSettings();
ApplyUiEffectsSettings();
}
}
@@ -266,6 +298,7 @@ namespace Ichni
private SettingsSaveData CreateDefaultSettingsSaveData()
{
SettingsSaveData defaultSettings = new SettingsSaveData();
defaultSettings.uiEffectsSettingInitialized = true;
defaultSettings.languageCode = DefaultLocaleCode;
defaultSettings.languageIndex = GetLanguageDropdownIndex(DefaultLocaleCode);
defaultSettings.graphicsQualityPreset = GetGraphicsQualityPreset(QualitySettings.GetQualityLevel());
@@ -277,6 +310,25 @@ namespace Ichni
return defaultSettings;
}
/// <summary>
/// 将旧版 SettingsSave 中不存在的 UI 特效开关迁移为默认开启。
/// <para>
/// 不提升 Schema Version项目尚未发布且本字段只补齐一个布尔默认值。迁移标记会随即写回 ES3
/// 之后玩家主动关闭 UI 效果时不会被再次覆盖。
/// </para>
/// </summary>
private bool MigrateUiEffectsSettingIfNeeded()
{
if (settingsSaveData.uiEffectsSettingInitialized)
{
return false;
}
settingsSaveData.enableUiEffects = true;
settingsSaveData.uiEffectsSettingInitialized = true;
return true;
}
private FullScreenMode GetFullScreenMode(GraphicsDisplayMode displayMode)
{
return displayMode switch