mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-08-05 19:40:27 +08:00
refactor: centralize localization keys and remove runtime Chinese literals
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
@@ -147,12 +147,12 @@ public static class CombatSettingsPatch
|
||||
};
|
||||
text = (int)(__instance.aggresiveSlider.value + 0.5f) switch
|
||||
{
|
||||
0 => "活靶子".Translate(),
|
||||
1 => "被动".Translate(),
|
||||
2 => "消极".Translate(),
|
||||
3 => "正常".Translate(),
|
||||
4 => "积极".Translate(),
|
||||
5 => "狂暴".Translate(),
|
||||
0 => Localization.AggressivenessSittingDuck.Translate(),
|
||||
1 => Localization.AggressivenessPassive.Translate(),
|
||||
2 => Localization.AggressivenessNegative.Translate(),
|
||||
3 => Localization.AggressivenessNormal.Translate(),
|
||||
4 => Localization.AggressivenessAggressive.Translate(),
|
||||
5 => Localization.AggressivenessRampage.Translate(),
|
||||
_ => text
|
||||
};
|
||||
__instance.aggresiveText.text = text;
|
||||
@@ -305,11 +305,11 @@ public static class CombatSettingsPatch
|
||||
var gameDesc = new GameDesc();
|
||||
var difficulty = __instance.combatSettings.difficulty;
|
||||
var text2 = difficulty >= 9.9999f ? difficulty.ToString("0.00") : difficulty.ToString("0.000");
|
||||
__instance.difficultyText.text = string.Format("难度系数值".Translate(), text2);
|
||||
__instance.difficultyText.text = string.Format(Localization.DifficultyValueFormat.Translate(), text2);
|
||||
__instance.difficultTipGroupDF.SetActive((__instance.combatSettings.aggressiveLevel == EAggressiveLevel.Rampage && difficulty > 4.5f) || difficulty > 6f);
|
||||
__instance.gameDesc.CopyTo(gameDesc);
|
||||
gameDesc.combatSettings = __instance.combatSettings;
|
||||
__instance.propertyMultiplierText.text = "元数据生成倍率".Translate() + " " + gameDesc.propertyMultiplier.ToString("0%");
|
||||
__instance.propertyMultiplierText.text = Localization.PropertyMultiplier.Translate() + " " + gameDesc.propertyMultiplier.ToString("0%");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UXAssist.Common;
|
||||
@@ -27,11 +27,6 @@ public static class GalaxySelectUIPatch
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
I18N.Add("恒星最小距离", "Star Distance Min", "恒星最小距离");
|
||||
I18N.Add("步进最小距离", "Step Distance Min", "步进最小距离");
|
||||
I18N.Add("步进最大距离", "Step Distance Max", "步进最大距离");
|
||||
I18N.Add("扁平度", "Flatness", "扁平度");
|
||||
I18N.Apply();
|
||||
MoreSettings.Enabled.SettingChanged += OnEnabledChanged;
|
||||
Enable(MoreSettings.Enabled.Value);
|
||||
}
|
||||
@@ -70,10 +65,10 @@ public static class GalaxySelectUIPatch
|
||||
CreateSliderWithText(__instance.starCountSlider, out _minStepTitle, out _minStepSlider, out _minStepText, out var minStepLocalizer);
|
||||
CreateSliderWithText(__instance.starCountSlider, out _maxStepTitle, out _maxStepSlider, out _maxStepText, out var maxStepLocalizer);
|
||||
CreateSliderWithText(__instance.starCountSlider, out _flattenTitle, out _flattenSlider, out _flattenText, out var flattenLocalizer);
|
||||
minDistLocalizer.stringKey = "恒星最小距离";
|
||||
minStepLocalizer.stringKey = "步进最小距离";
|
||||
maxStepLocalizer.stringKey = "步进最大距离";
|
||||
flattenLocalizer.stringKey = "扁平度";
|
||||
minDistLocalizer.stringKey = Localization.StarDistanceMin;
|
||||
minStepLocalizer.stringKey = Localization.StepDistanceMin;
|
||||
maxStepLocalizer.stringKey = Localization.StepDistanceMax;
|
||||
flattenLocalizer.stringKey = Localization.Flatness;
|
||||
|
||||
_minDistTitle.name = "min-dist";
|
||||
_minStepTitle.name = "min-step";
|
||||
|
||||
Reference in New Issue
Block a user