refactor: use localization constants at remaining call sites

This commit is contained in:
2026-06-23 21:41:24 +08:00
parent 51fc080ff2
commit 8d70ce8862
11 changed files with 30 additions and 30 deletions
@@ -28,7 +28,7 @@ public static class DysonSphereResolver
var star = GameMain.localStar;
if (star == null)
{
UIMessageBox.Show(Localization.CheatEnabler.Translate(), "You are not in any system.".Translate(), Localization.OK.Translate(), UIMessageBox.ERROR, null);
UIMessageBox.Show(Localization.CheatEnabler.Translate(), Localization.YouAreNotInAnySystem.Translate(), Localization.OK.Translate(), UIMessageBox.ERROR, null);
}
return star;
}
@@ -40,12 +40,12 @@ public static class DysonSphereResolver
var sphere = GameMain.data?.dysonSpheres[star.index];
if (sphere == null)
{
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format("There is no Dyson Sphere data on \"{0}\".".Translate(), star.displayName), Localization.OK.Translate(), UIMessageBox.ERROR, null);
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThereIsNoDysonSphereDataOn0.Translate(), star.displayName), Localization.OK.Translate(), UIMessageBox.ERROR, null);
return null;
}
if (requireLayer && sphere.layerCount == 0)
{
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format("There is no Dyson Sphere shell on \"{0}\".".Translate(), star.displayName), Localization.OK.Translate(), UIMessageBox.ERROR, null);
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThereIsNoDysonSphereShellOn0.Translate(), star.displayName), Localization.OK.Translate(), UIMessageBox.ERROR, null);
return null;
}
return (sphere, star);
@@ -17,7 +17,7 @@ public static class FrameRemovalFunctions
if (resolved == null) return;
var (dysonSphere, star) = resolved.Value;
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format("This will remove all frames on \"{0}\". Are you sure?".Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThisWillRemoveAllFramesOn0AreYouSure.Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
{
var totalFrameSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");
@@ -17,7 +17,7 @@ public static class ShellCompletionFunctions
if (resolved == null) return;
var (dysonSphere, star) = resolved.Value;
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format("This will complete all Dyson Sphere shells on \"{0}\". Are you sure?".Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThisWillCompleteAllDysonSphereShellsOn0InstantlyAreYouSure.Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
{
var totalNodeSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalNodeSP");
var totalFrameSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");