From d4300a1659d6d815dc4b0b50f90a21fa0f976f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=99=E6=81=A9?= <2383759126@qq.com> Date: Sat, 8 Aug 2026 17:53:43 +0800 Subject: [PATCH] =?UTF-8?q?update:worldedit=E7=9A=84i18n=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WorldEdit/README.md | 7 +- src/WorldEdit/WorldEdit.Commands/Activate.cs | 24 +- src/WorldEdit/WorldEdit.Commands/Actuator.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Biome.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Copy.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Cut.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Drain.cs | 2 +- src/WorldEdit/WorldEdit.Commands/FixGhosts.cs | 24 +- src/WorldEdit/WorldEdit.Commands/FixGrass.cs | 2 +- src/WorldEdit/WorldEdit.Commands/FixHalves.cs | 2 +- src/WorldEdit/WorldEdit.Commands/FixSlopes.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Flip.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Flood.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Inactive.cs | 6 +- src/WorldEdit/WorldEdit.Commands/KillEmpty.cs | 4 +- src/WorldEdit/WorldEdit.Commands/Move.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Mow.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Outline.cs | 2 +- .../WorldEdit.Commands/OutlineWall.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Paint.cs | 2 +- src/WorldEdit/WorldEdit.Commands/PaintWall.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Paste.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Redo.cs | 6 +- src/WorldEdit/WorldEdit.Commands/Replace.cs | 2 +- .../WorldEdit.Commands/ReplaceWall.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Rotate.cs | 2 +- src/WorldEdit/WorldEdit.Commands/SPaste.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Scale.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Set.cs | 2 +- src/WorldEdit/WorldEdit.Commands/SetGrass.cs | 2 +- src/WorldEdit/WorldEdit.Commands/SetWall.cs | 4 +- src/WorldEdit/WorldEdit.Commands/SetWire.cs | 8 +- src/WorldEdit/WorldEdit.Commands/Shape.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Slope.cs | 2 +- .../WorldEdit.Commands/SlopeDelete.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Smooth.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Text.cs | 2 +- src/WorldEdit/WorldEdit.Commands/Undo.cs | 6 +- src/WorldEdit/WorldEdit.Commands/WECommand.cs | 6 +- src/WorldEdit/WorldEdit.Expressions/Parser.cs | 2 +- src/WorldEdit/WorldEdit/Config.cs | 30 +- src/WorldEdit/WorldEdit/MagicWand.cs | 4 +- src/WorldEdit/WorldEdit/Tools.cs | 9 +- src/WorldEdit/WorldEdit/WorldEdit.cs | 660 +++++++++--------- 44 files changed, 429 insertions(+), 429 deletions(-) diff --git a/src/WorldEdit/README.md b/src/WorldEdit/README.md index d8d190a96..4aa85fb0b 100644 --- a/src/WorldEdit/README.md +++ b/src/WorldEdit/README.md @@ -154,11 +154,12 @@ ## 更新日志 -``` -v2026.07.20 +### v2026.08.08 +- i18n预备 + +### v2026.07.20 - 适配 TShock 6.1.0 与 Terraria 1.4.5.6 - 完善 WorldEdit 指令、权限和配置文档 -``` ## 反馈 diff --git a/src/WorldEdit/WorldEdit.Commands/Activate.cs b/src/WorldEdit/WorldEdit.Commands/Activate.cs index 4e19dfdcb..94cc08808 100644 --- a/src/WorldEdit/WorldEdit.Commands/Activate.cs +++ b/src/WorldEdit/WorldEdit.Commands/Activate.cs @@ -47,7 +47,7 @@ public override void Execute() } } } - emptyObjectTypes += ReportActivation("signs", activatedCount, failedCount); + emptyObjectTypes += ReportActivation(GetString("signs"), activatedCount, failedCount); } if (_action == 255 || _action == 1) @@ -72,7 +72,7 @@ public override void Execute() } } } - emptyObjectTypes += ReportActivation("chests", activatedCount, failedCount); + emptyObjectTypes += ReportActivation(GetString("chests"), activatedCount, failedCount); } if (_action == 255 || _action == 2) @@ -97,7 +97,7 @@ public override void Execute() } } } - emptyObjectTypes += ReportActivation("item frames", activatedCount, failedCount); + emptyObjectTypes += ReportActivation(GetString("item frames"), activatedCount, failedCount); } if (_action == 255 || _action == 3) @@ -124,19 +124,19 @@ public override void Execute() activatedCount++; } } - emptyObjectTypes += ReportActivation("logic sensors", activatedCount, failedCount); + emptyObjectTypes += ReportActivation(GetString("logic sensors"), activatedCount, failedCount); } - emptyObjectTypes += ActivateTileEntities(4, 378, 36, TETrainingDummy.Find, TETrainingDummy.Place, "target dummies"); - emptyObjectTypes += ActivateTileEntities(5, 471, 54, TEWeaponsRack.Find, TEWeaponsRack.Place, "weapon racks"); - emptyObjectTypes += ActivateTileEntities(6, 597, 54, TETeleportationPylon.Find, TETeleportationPylon.Place, "pylons"); - emptyObjectTypes += ActivateTileEntities(7, 470, 36, TEDisplayDoll.Find, TEDisplayDoll.Place, "mannequins"); - emptyObjectTypes += ActivateTileEntities(8, 475, 54, TEHatRack.Find, TEHatRack.Place, "hat racks"); - emptyObjectTypes += ActivateTileEntities(9, 520, null, TEFoodPlatter.Find, TEFoodPlatter.Place, "food plates"); + emptyObjectTypes += ActivateTileEntities(4, 378, 36, TETrainingDummy.Find, TETrainingDummy.Place, GetString("target dummies")); + emptyObjectTypes += ActivateTileEntities(5, 471, 54, TEWeaponsRack.Find, TEWeaponsRack.Place, GetString("weapon racks")); + emptyObjectTypes += ActivateTileEntities(6, 597, 54, TETeleportationPylon.Find, TETeleportationPylon.Place, GetString("pylons")); + emptyObjectTypes += ActivateTileEntities(7, 470, 36, TEDisplayDoll.Find, TEDisplayDoll.Place, GetString("mannequins")); + emptyObjectTypes += ActivateTileEntities(8, 475, 54, TEHatRack.Find, TEHatRack.Place, GetString("hat racks")); + emptyObjectTypes += ActivateTileEntities(9, 520, null, TEFoodPlatter.Find, TEFoodPlatter.Place, GetString("food plates")); if (emptyObjectTypes == 10) { - plr.SendSuccessMessage("There are no objects to activate in this area."); + plr.SendSuccessMessage(GetString("There are no objects to activate in this area.")); } ResetSection(); @@ -182,7 +182,7 @@ private int ReportActivation(string objectName, int activatedCount, int failedCo return 1; } - plr.SendSuccessMessage("Activated {0}. ({1}){2}", objectName, activatedCount, failedCount > 0 ? $" Failed to activate {objectName}. ({failedCount})" : string.Empty); + plr.SendSuccessMessage(GetString("Activated {0}. ({1}){2}"), objectName, activatedCount, failedCount > 0 ? GetString(" Failed to activate {0}. ({1})", objectName, failedCount) : string.Empty); return 0; } } diff --git a/src/WorldEdit/WorldEdit.Commands/Actuator.cs b/src/WorldEdit/WorldEdit.Commands/Actuator.cs index ca1ed64c0..0e72699e2 100644 --- a/src/WorldEdit/WorldEdit.Commands/Actuator.cs +++ b/src/WorldEdit/WorldEdit.Commands/Actuator.cs @@ -38,6 +38,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("{0} actuators. ({1})", _remove ? "Removed" : "Set", changedActuatorCount); + plr.SendSuccessMessage(GetString("{0} actuators. ({1})"), _remove ? GetString("Removed") : GetString("Set"), changedActuatorCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Biome.cs b/src/WorldEdit/WorldEdit.Commands/Biome.cs index eb55eabc4..e655e5ba2 100644 --- a/src/WorldEdit/WorldEdit.Commands/Biome.cs +++ b/src/WorldEdit/WorldEdit.Commands/Biome.cs @@ -38,6 +38,6 @@ public override void Execute() } ResetSection(); } - plr.SendSuccessMessage("Converted biomes. ({0})", convertedTileCount); + plr.SendSuccessMessage(GetString("Converted biomes. ({0})"), convertedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Copy.cs b/src/WorldEdit/WorldEdit.Commands/Copy.cs index d04450c14..6d17a61c8 100644 --- a/src/WorldEdit/WorldEdit.Commands/Copy.cs +++ b/src/WorldEdit/WorldEdit.Commands/Copy.cs @@ -16,6 +16,6 @@ public override void Execute() { string clipboardPath = Tools.GetClipboardPath(plr.Account.ID); Tools.SaveWorldSection(x, y, x2, y2, save ?? clipboardPath); - plr.SendSuccessMessage("Copied selection to {0}.", (save == null) ? "clipboard" : "schematic"); + plr.SendSuccessMessage(GetString("Copied selection to {0}."), save == null ? GetString("clipboard") : GetString("schematic")); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Cut.cs b/src/WorldEdit/WorldEdit.Commands/Cut.cs index 1284835be..c48263ecd 100644 --- a/src/WorldEdit/WorldEdit.Commands/Cut.cs +++ b/src/WorldEdit/WorldEdit.Commands/Cut.cs @@ -53,6 +53,6 @@ public override void Execute() } File.Copy(undoPath, clipboardPath); ResetSection(); - plr.SendSuccessMessage("Cut selection. ({0})", (x2 - x + 1) * (y2 - y + 1)); + plr.SendSuccessMessage(GetString("Cut selection. ({0})"), (x2 - x + 1) * (y2 - y + 1)); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Drain.cs b/src/WorldEdit/WorldEdit.Commands/Drain.cs index 362c581a3..f07bc4001 100644 --- a/src/WorldEdit/WorldEdit.Commands/Drain.cs +++ b/src/WorldEdit/WorldEdit.Commands/Drain.cs @@ -32,6 +32,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Drained area. ({0})", drainedTileCount); + plr.SendSuccessMessage(GetString("Drained area. ({0})"), drainedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/FixGhosts.cs b/src/WorldEdit/WorldEdit.Commands/FixGhosts.cs index f8884441a..38f00662f 100644 --- a/src/WorldEdit/WorldEdit.Commands/FixGhosts.cs +++ b/src/WorldEdit/WorldEdit.Commands/FixGhosts.cs @@ -124,51 +124,51 @@ public override void Execute() List removedObjects = new List(); if (removedSignCount > 0) { - removedObjects.Add($"signs ({removedSignCount})"); + removedObjects.Add(GetString("signs ({0})", removedSignCount)); } if (removedItemFrameCount > 0) { - removedObjects.Add($"item frames ({removedItemFrameCount})"); + removedObjects.Add(GetString("item frames ({0})", removedItemFrameCount)); } if (removedChestCount > 0) { - removedObjects.Add($"chests ({removedChestCount})"); + removedObjects.Add(GetString("chests ({0})", removedChestCount)); } if (removedLogicSensorCount > 0) { - removedObjects.Add($"logic sensors ({removedLogicSensorCount})"); + removedObjects.Add(GetString("logic sensors ({0})", removedLogicSensorCount)); } if (removedTrainingDummyCount > 0) { - removedObjects.Add($"target dummies ({removedTrainingDummyCount})"); + removedObjects.Add(GetString("target dummies ({0})", removedTrainingDummyCount)); } if (removedWeaponRackCount > 0) { - removedObjects.Add($"weapon racks ({removedWeaponRackCount})"); + removedObjects.Add(GetString("weapon racks ({0})", removedWeaponRackCount)); } if (removedPylonCount > 0) { - removedObjects.Add($"pylons ({removedPylonCount})"); + removedObjects.Add(GetString("pylons ({0})", removedPylonCount)); } if (removedDisplayDollCount > 0) { - removedObjects.Add($"mannequins ({removedDisplayDollCount})"); + removedObjects.Add(GetString("mannequins ({0})", removedDisplayDollCount)); } if (removedHatRackCount > 0) { - removedObjects.Add($"hat racks ({removedHatRackCount})"); + removedObjects.Add(GetString("hat racks ({0})", removedHatRackCount)); } if (removedFoodPlatterCount > 0) { - removedObjects.Add($"food plates ({removedFoodPlatterCount})"); + removedObjects.Add(GetString("food plates ({0})", removedFoodPlatterCount)); } if (removedObjects.Count > 0) { - plr.SendSuccessMessage("Fixed ghost " + string.Join(", ", removedObjects) + "."); + plr.SendSuccessMessage(GetString("Fixed ghost {0}.", string.Join(", ", removedObjects))); } else { - plr.SendSuccessMessage("There are no ghost objects in this area."); + plr.SendSuccessMessage(GetString("There are no ghost objects in this area.")); } } } diff --git a/src/WorldEdit/WorldEdit.Commands/FixGrass.cs b/src/WorldEdit/WorldEdit.Commands/FixGrass.cs index d5a8babf5..0f9665515 100644 --- a/src/WorldEdit/WorldEdit.Commands/FixGrass.cs +++ b/src/WorldEdit/WorldEdit.Commands/FixGrass.cs @@ -34,6 +34,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Fixed grass. ({0})", fixedGrassCount); + plr.SendSuccessMessage(GetString("Fixed grass. ({0})"), fixedGrassCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/FixHalves.cs b/src/WorldEdit/WorldEdit.Commands/FixHalves.cs index e8b39c010..a5083dab7 100644 --- a/src/WorldEdit/WorldEdit.Commands/FixHalves.cs +++ b/src/WorldEdit/WorldEdit.Commands/FixHalves.cs @@ -31,6 +31,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Fixed half blocks. ({0})", fixedHalfBlockCount); + plr.SendSuccessMessage(GetString("Fixed half blocks. ({0})"), fixedHalfBlockCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/FixSlopes.cs b/src/WorldEdit/WorldEdit.Commands/FixSlopes.cs index 71230d950..d0af1c9c9 100644 --- a/src/WorldEdit/WorldEdit.Commands/FixSlopes.cs +++ b/src/WorldEdit/WorldEdit.Commands/FixSlopes.cs @@ -31,6 +31,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Fixed slopes. ({0})", fixedSlopeCount); + plr.SendSuccessMessage(GetString("Fixed slopes. ({0})"), fixedSlopeCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Flip.cs b/src/WorldEdit/WorldEdit.Commands/Flip.cs index 294553e87..3f76d26d8 100644 --- a/src/WorldEdit/WorldEdit.Commands/Flip.cs +++ b/src/WorldEdit/WorldEdit.Commands/Flip.cs @@ -93,6 +93,6 @@ public override void Execute() } } } - plr.SendSuccessMessage("Flipped clipboard."); + plr.SendSuccessMessage(GetString("Flipped clipboard.")); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Flood.cs b/src/WorldEdit/WorldEdit.Commands/Flood.cs index 4daa3d9a4..309cc832d 100644 --- a/src/WorldEdit/WorldEdit.Commands/Flood.cs +++ b/src/WorldEdit/WorldEdit.Commands/Flood.cs @@ -35,6 +35,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Flooded area. ({0})", floodedTileCount); + plr.SendSuccessMessage(GetString("Flooded area. ({0})"), floodedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Inactive.cs b/src/WorldEdit/WorldEdit.Commands/Inactive.cs index a9c7fc0b1..9856ed6d5 100644 --- a/src/WorldEdit/WorldEdit.Commands/Inactive.cs +++ b/src/WorldEdit/WorldEdit.Commands/Inactive.cs @@ -42,7 +42,7 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Made tiles inactive. ({0})", changedTileCount); + plr.SendSuccessMessage(GetString("Made tiles inactive. ({0})"), changedTileCount); break; } case 1: @@ -60,7 +60,7 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set\ttiles' inactive\tstatus off.\t({0})", changedTileCount); + plr.SendSuccessMessage(GetString("Set\ttiles' inactive\tstatus off.\t({0})"), changedTileCount); break; } case 2: @@ -78,7 +78,7 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Reversed tiles'\tinactive status. ({0})", changedTileCount); + plr.SendSuccessMessage(GetString("Reversed tiles'\tinactive status. ({0})"), changedTileCount); break; } } diff --git a/src/WorldEdit/WorldEdit.Commands/KillEmpty.cs b/src/WorldEdit/WorldEdit.Commands/KillEmpty.cs index 0b921f452..6731f180d 100644 --- a/src/WorldEdit/WorldEdit.Commands/KillEmpty.cs +++ b/src/WorldEdit/WorldEdit.Commands/KillEmpty.cs @@ -19,11 +19,11 @@ public override void Execute() Tools.PrepareUndo(x, y, x2, y2, plr); if (_action == 255 || _action == 0) { - plr.SendSuccessMessage("Cleared {0} empty signs.", Tools.ClearSigns(x, y, x2, y2, emptyOnly: true)); + plr.SendSuccessMessage(GetString("Cleared {0} empty signs."), Tools.ClearSigns(x, y, x2, y2, emptyOnly: true)); } if (_action == 255 || _action == 1) { - plr.SendSuccessMessage("Cleared {0} empty chests.", Tools.ClearChests(x, y, x2, y2, emptyOnly: true)); + plr.SendSuccessMessage(GetString("Cleared {0} empty chests."), Tools.ClearChests(x, y, x2, y2, emptyOnly: true)); } ResetSection(); } diff --git a/src/WorldEdit/WorldEdit.Commands/Move.cs b/src/WorldEdit/WorldEdit.Commands/Move.cs index 8d1c61002..28408dbc5 100644 --- a/src/WorldEdit/WorldEdit.Commands/Move.cs +++ b/src/WorldEdit/WorldEdit.Commands/Move.cs @@ -85,6 +85,6 @@ public override void Execute() playerInfo.Y = destinationY; playerInfo.X2 = destinationX2; playerInfo.Y2 = destinationY2; - plr.SendInfoMessage("Moved tiles ({0}).", movedTileCount); + plr.SendInfoMessage(GetString("Moved tiles ({0})."), movedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Mow.cs b/src/WorldEdit/WorldEdit.Commands/Mow.cs index 5cb07a660..a315cd292 100644 --- a/src/WorldEdit/WorldEdit.Commands/Mow.cs +++ b/src/WorldEdit/WorldEdit.Commands/Mow.cs @@ -39,6 +39,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Mowed grass, thorns, and vines. ({0})", removedTileCount); + plr.SendSuccessMessage(GetString("Mowed grass, thorns, and vines. ({0})"), removedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Outline.cs b/src/WorldEdit/WorldEdit.Commands/Outline.cs index 98890e964..20594f52c 100644 --- a/src/WorldEdit/WorldEdit.Commands/Outline.cs +++ b/src/WorldEdit/WorldEdit.Commands/Outline.cs @@ -74,6 +74,6 @@ public override void Execute() } ResetSection(); - plr.SendSuccessMessage("Set outline. ({0})", outlinedTileCount); + plr.SendSuccessMessage(GetString("Set outline. ({0})"), outlinedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/OutlineWall.cs b/src/WorldEdit/WorldEdit.Commands/OutlineWall.cs index f34dcf198..f86665802 100644 --- a/src/WorldEdit/WorldEdit.Commands/OutlineWall.cs +++ b/src/WorldEdit/WorldEdit.Commands/OutlineWall.cs @@ -71,6 +71,6 @@ public override void Execute() } ResetSection(); - plr.SendSuccessMessage("Set wall outline. ({0})", outlinedWallCount); + plr.SendSuccessMessage(GetString("Set wall outline. ({0})"), outlinedWallCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Paint.cs b/src/WorldEdit/WorldEdit.Commands/Paint.cs index d10f5c192..ff8f4a0e5 100644 --- a/src/WorldEdit/WorldEdit.Commands/Paint.cs +++ b/src/WorldEdit/WorldEdit.Commands/Paint.cs @@ -38,6 +38,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Painted tiles. ({0})", paintedTileCount); + plr.SendSuccessMessage(GetString("Painted tiles. ({0})"), paintedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/PaintWall.cs b/src/WorldEdit/WorldEdit.Commands/PaintWall.cs index e1f6724db..84d922ae1 100644 --- a/src/WorldEdit/WorldEdit.Commands/PaintWall.cs +++ b/src/WorldEdit/WorldEdit.Commands/PaintWall.cs @@ -38,6 +38,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Painted walls. ({0})", paintedWallCount); + plr.SendSuccessMessage(GetString("Painted walls. ({0})"), paintedWallCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Paste.cs b/src/WorldEdit/WorldEdit.Commands/Paste.cs index d91a0dcf7..38fdf8503 100644 --- a/src/WorldEdit/WorldEdit.Commands/Paste.cs +++ b/src/WorldEdit/WorldEdit.Commands/Paste.cs @@ -103,6 +103,6 @@ public override void Execute() } Tools.LoadWorldSection(worldSectionData, x, y, Tiles: false); ResetSection(); - plr.SendSuccessMessage("Pasted clipboard to selection."); + plr.SendSuccessMessage(GetString("Pasted clipboard to selection.")); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Redo.cs b/src/WorldEdit/WorldEdit.Commands/Redo.cs index 67069c19e..6decf839d 100644 --- a/src/WorldEdit/WorldEdit.Commands/Redo.cs +++ b/src/WorldEdit/WorldEdit.Commands/Redo.cs @@ -19,7 +19,7 @@ public override void Execute() { if (WorldEdit.Config.DisableUndoSystemForUnrealPlayers && (!plr.RealPlayer || accountID == 0)) { - plr.SendErrorMessage("Undo system is disabled for unreal players."); + plr.SendErrorMessage(GetString("Undo system is disabled for unreal players.")); return; } int completedStepCount = -1; @@ -28,9 +28,9 @@ public override void Execute() } if (completedStepCount == 0) { - plr.SendErrorMessage("Failed to redo any actions."); + plr.SendErrorMessage(GetString("Failed to redo any actions.")); return; } - plr.SendSuccessMessage("Redid {0}'s last {1}action{2}.", (accountID == 0) ? "ServerConsole" : TShock.UserAccounts.GetUserAccountByID(accountID).Name, (completedStepCount == 1) ? "" : (completedStepCount + " "), (completedStepCount == 1) ? "" : "s"); + plr.SendSuccessMessage(GetString("Redid {0}'s last {1}action{2}."), (accountID == 0) ? "ServerConsole" : TShock.UserAccounts.GetUserAccountByID(accountID).Name, (completedStepCount == 1) ? "" : (completedStepCount + " "), (completedStepCount == 1) ? "" : "s"); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Replace.cs b/src/WorldEdit/WorldEdit.Commands/Replace.cs index 11bccc431..be4a07c1e 100644 --- a/src/WorldEdit/WorldEdit.Commands/Replace.cs +++ b/src/WorldEdit/WorldEdit.Commands/Replace.cs @@ -41,6 +41,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Replaced tiles. ({0})", replacedTileCount); + plr.SendSuccessMessage(GetString("Replaced tiles. ({0})"), replacedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/ReplaceWall.cs b/src/WorldEdit/WorldEdit.Commands/ReplaceWall.cs index 5658fec5e..836b4a9a8 100644 --- a/src/WorldEdit/WorldEdit.Commands/ReplaceWall.cs +++ b/src/WorldEdit/WorldEdit.Commands/ReplaceWall.cs @@ -41,6 +41,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Replaced walls. ({0})", replacedWallCount); + plr.SendSuccessMessage(GetString("Replaced walls. ({0})"), replacedWallCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Rotate.cs b/src/WorldEdit/WorldEdit.Commands/Rotate.cs index 384297326..ea2913d98 100644 --- a/src/WorldEdit/WorldEdit.Commands/Rotate.cs +++ b/src/WorldEdit/WorldEdit.Commands/Rotate.cs @@ -115,6 +115,6 @@ public override void Execute() } } writer?.Close(); - plr.SendSuccessMessage("Rotated clipboard {0} degrees.", _degrees); + plr.SendSuccessMessage(GetString("Rotated clipboard {0} degrees."), _degrees); } } diff --git a/src/WorldEdit/WorldEdit.Commands/SPaste.cs b/src/WorldEdit/WorldEdit.Commands/SPaste.cs index 6b6eec242..9ee057653 100644 --- a/src/WorldEdit/WorldEdit.Commands/SPaste.cs +++ b/src/WorldEdit/WorldEdit.Commands/SPaste.cs @@ -162,6 +162,6 @@ public override void Execute() } Tools.LoadWorldSection(worldSectionData, x, y, Tiles: false); ResetSection(); - plr.SendSuccessMessage("Pasted clipboard to selection."); + plr.SendSuccessMessage(GetString("Pasted clipboard to selection.")); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Scale.cs b/src/WorldEdit/WorldEdit.Commands/Scale.cs index f194bfc61..199019bbd 100644 --- a/src/WorldEdit/WorldEdit.Commands/Scale.cs +++ b/src/WorldEdit/WorldEdit.Commands/Scale.cs @@ -100,6 +100,6 @@ public override void Execute() } } } - plr.SendSuccessMessage("Clipboard {0}creased by {1} times.", _addition ? "in" : "de", _scale); + plr.SendSuccessMessage(GetString(_addition ? "Clipboard increased by {0} times." : "Clipboard decreased by {0} times."), _scale); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Set.cs b/src/WorldEdit/WorldEdit.Commands/Set.cs index 97671f937..989ca05af 100644 --- a/src/WorldEdit/WorldEdit.Commands/Set.cs +++ b/src/WorldEdit/WorldEdit.Commands/Set.cs @@ -37,6 +37,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set tiles. ({0})", changedTileCount); + plr.SendSuccessMessage(GetString("Set tiles. ({0})"), changedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/SetGrass.cs b/src/WorldEdit/WorldEdit.Commands/SetGrass.cs index 89bb89d2a..db2d579c4 100644 --- a/src/WorldEdit/WorldEdit.Commands/SetGrass.cs +++ b/src/WorldEdit/WorldEdit.Commands/SetGrass.cs @@ -75,6 +75,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set {1} grass. ({0})", changedGrassCount, _grass); + plr.SendSuccessMessage(GetString("Set {0} grass. ({1})"), _grass, changedGrassCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/SetWall.cs b/src/WorldEdit/WorldEdit.Commands/SetWall.cs index 194a27216..40e28f36c 100644 --- a/src/WorldEdit/WorldEdit.Commands/SetWall.cs +++ b/src/WorldEdit/WorldEdit.Commands/SetWall.cs @@ -37,7 +37,7 @@ public override void Execute() } } ResetSection(); - string wallDescription = _wallType == 0 ? "air" : "wall " + _wallType; - plr.SendSuccessMessage("Set walls to {0}. ({1})", wallDescription, changedWallCount); + string wallDescription = _wallType == 0 ? GetString("air") : GetString("wall {0}", _wallType); + plr.SendSuccessMessage(GetString("Set walls to {0}. ({1})"), wallDescription, changedWallCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/SetWire.cs b/src/WorldEdit/WorldEdit.Commands/SetWire.cs index c58519960..78944a7a4 100644 --- a/src/WorldEdit/WorldEdit.Commands/SetWire.cs +++ b/src/WorldEdit/WorldEdit.Commands/SetWire.cs @@ -45,7 +45,7 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set wire. ({0})", changedWireCount); + plr.SendSuccessMessage(GetString("Set wire. ({0})"), changedWireCount); break; } case 2: @@ -63,7 +63,7 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set wire 2. ({0})", changedWireCount); + plr.SendSuccessMessage(GetString("Set wire 2. ({0})"), changedWireCount); break; } case 3: @@ -81,7 +81,7 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set wire 3. ({0})", changedWireCount); + plr.SendSuccessMessage(GetString("Set wire 3. ({0})"), changedWireCount); break; } case 4: @@ -99,7 +99,7 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set wire 4. ({0})", changedWireCount); + plr.SendSuccessMessage(GetString("Set wire 4. ({0})"), changedWireCount); break; } } diff --git a/src/WorldEdit/WorldEdit.Commands/Shape.cs b/src/WorldEdit/WorldEdit.Commands/Shape.cs index 25ad5bbd3..5653fffd2 100644 --- a/src/WorldEdit/WorldEdit.Commands/Shape.cs +++ b/src/WorldEdit/WorldEdit.Commands/Shape.cs @@ -537,6 +537,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set {0}{1} shape. ({2})", filled ? "filled " : "", wall ? "wall" : "tile", changedTileCount); + plr.SendSuccessMessage(GetString("Set {0}{1} shape. ({2})"), filled ? GetString("filled ") : "", wall ? GetString("wall") : GetString("tile"), changedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Slope.cs b/src/WorldEdit/WorldEdit.Commands/Slope.cs index 4a05447dc..c856c69a5 100644 --- a/src/WorldEdit/WorldEdit.Commands/Slope.cs +++ b/src/WorldEdit/WorldEdit.Commands/Slope.cs @@ -64,6 +64,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Sloped tiles. ({0})", changedTileCount); + plr.SendSuccessMessage(GetString("Sloped tiles. ({0})"), changedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/SlopeDelete.cs b/src/WorldEdit/WorldEdit.Commands/SlopeDelete.cs index 2f55d7307..d188dd44a 100644 --- a/src/WorldEdit/WorldEdit.Commands/SlopeDelete.cs +++ b/src/WorldEdit/WorldEdit.Commands/SlopeDelete.cs @@ -77,6 +77,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Removed slopes. ({0})", removedSlopeCount); + plr.SendSuccessMessage(GetString("Removed slopes. ({0})"), removedSlopeCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Smooth.cs b/src/WorldEdit/WorldEdit.Commands/Smooth.cs index b431ec2a7..ac272e868 100644 --- a/src/WorldEdit/WorldEdit.Commands/Smooth.cs +++ b/src/WorldEdit/WorldEdit.Commands/Smooth.cs @@ -89,6 +89,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Smoothed area. ({0})", smoothedTileCount); + plr.SendSuccessMessage(GetString("Smoothed area. ({0})"), smoothedTileCount); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Text.cs b/src/WorldEdit/WorldEdit.Commands/Text.cs index ecb8ea47c..ece326bda 100644 --- a/src/WorldEdit/WorldEdit.Commands/Text.cs +++ b/src/WorldEdit/WorldEdit.Commands/Text.cs @@ -38,6 +38,6 @@ public override void Execute() } } ResetSection(); - plr.SendSuccessMessage("Set text."); + plr.SendSuccessMessage(GetString("Set text.")); } } diff --git a/src/WorldEdit/WorldEdit.Commands/Undo.cs b/src/WorldEdit/WorldEdit.Commands/Undo.cs index 131fe80d4..8fd769d0a 100644 --- a/src/WorldEdit/WorldEdit.Commands/Undo.cs +++ b/src/WorldEdit/WorldEdit.Commands/Undo.cs @@ -19,7 +19,7 @@ public override void Execute() { if (WorldEdit.Config.DisableUndoSystemForUnrealPlayers && (!plr.RealPlayer || accountID == 0)) { - plr.SendErrorMessage("Undo system is disabled for unreal players."); + plr.SendErrorMessage(GetString("Undo system is disabled for unreal players.")); return; } int completedStepCount = -1; @@ -28,9 +28,9 @@ public override void Execute() } if (completedStepCount == 0) { - plr.SendErrorMessage("Failed to undo any actions."); + plr.SendErrorMessage(GetString("Failed to undo any actions.")); return; } - plr.SendSuccessMessage("Undid {0}'s last {1}action{2}.", (accountID == 0) ? "ServerConsole" : TShock.UserAccounts.GetUserAccountByID(accountID).Name, (completedStepCount == 1) ? "" : (completedStepCount + " "), (completedStepCount == 1) ? "" : "s"); + plr.SendSuccessMessage(GetString("Undid {0}'s last {1}action{2}."), (accountID == 0) ? "ServerConsole" : TShock.UserAccounts.GetUserAccountByID(accountID).Name, (completedStepCount == 1) ? "" : (completedStepCount + " "), (completedStepCount == 1) ? "" : "s"); } } diff --git a/src/WorldEdit/WorldEdit.Commands/WECommand.cs b/src/WorldEdit/WorldEdit.Commands/WECommand.cs index 4ca32c65a..2fad9e5cc 100644 --- a/src/WorldEdit/WorldEdit.Commands/WECommand.cs +++ b/src/WorldEdit/WorldEdit.Commands/WECommand.cs @@ -162,7 +162,7 @@ public bool CanUseCommand(int x, int y, int x2, int y2) { if (!canEditEventArgs.CanEdit.Value) { - plr.SendErrorMessage("You do not have permission to use this command in this area."); + plr.SendErrorMessage(GetString("You do not have permission to use this command in this area.")); } return canEditEventArgs.CanEdit.Value; } @@ -173,7 +173,7 @@ public bool CanUseCommand(int x, int y, int x2, int y2) bool bypassRegionPermission = plr.HasPermission("worldedit.usage.noregion"); if (!bypassRegionPermission && !plr.IsLoggedIn) { - plr.SendErrorMessage("You have to be logged in to use this command."); + plr.SendErrorMessage(GetString("You have to be logged in to use this command.")); return false; } Rectangle area = new Rectangle(x, y, x2 - x, y2 - y); @@ -183,7 +183,7 @@ public bool CanUseCommand(int x, int y, int x2, int y2) !TShock.Regions.CanBuild(x2, y2, plr) || !TShock.Regions.CanBuild(x, y2, plr)) { - plr.SendErrorMessage("You do not have permission to use this command outside of your regions."); + plr.SendErrorMessage(GetString("You do not have permission to use this command outside of your regions.")); return false; } return true; diff --git a/src/WorldEdit/WorldEdit.Expressions/Parser.cs b/src/WorldEdit/WorldEdit.Expressions/Parser.cs index 49d8e32fd..93dc7777a 100644 --- a/src/WorldEdit/WorldEdit.Expressions/Parser.cs +++ b/src/WorldEdit/WorldEdit.Expressions/Parser.cs @@ -413,7 +413,7 @@ public static Test ParseTest(string lhs, string rhs, bool negated) return test = (ITile t) => !t.actuator(); } default: - throw new ArgumentException("Invalid test."); + throw new ArgumentException(GetString("Invalid test.")); } } diff --git a/src/WorldEdit/WorldEdit/Config.cs b/src/WorldEdit/WorldEdit/Config.cs index 20c0c3a27..45361e031 100644 --- a/src/WorldEdit/WorldEdit/Config.cs +++ b/src/WorldEdit/WorldEdit/Config.cs @@ -4,40 +4,40 @@ namespace WorldEdit { /// - /// ༭࣬ͳ־ûϵͳ + /// 世界编辑配置类,负责管理和持久化系统设置 /// public class Config { /// - /// ħ߿ɲ󷽿 + /// 魔法棒工具可操作的最大方块数量限制 /// public int MagicWandTileLimit { get; set; } = 10000; /// - /// ʷ¼ + /// 最大撤销操作历史记录数量 /// public int MaxUndoCount { get; set; } = 50; /// - /// Ƿδ֤ҽóϵͳ + /// 是否对未认证玩家禁用撤销系统 /// public bool DisableUndoSystemForUnrealPlayers { get; set; } = false; /// - /// ǷԭͼļǰӴûID + /// 是否在原理图文件名前添加创建者用户ID /// public bool StartSchematicNamesWithCreatorUserID { get; set; } = false; /// - /// ԭͼļ洢ļ· + /// 原理图文件存储文件夹路径 /// public string SchematicFolderPath { get; set; } = "schematics"; /// - /// ָļ·ȡ + /// 从指定文件路径读取配置 /// - /// ļ· - /// ʵ + /// 配置文件路径 + /// 配置实例 public static Config Read(string configFilePath) { try @@ -52,21 +52,21 @@ public static Config Read(string configFilePath) } catch (Exception ex) { - Console.WriteLine($"ȡļʧ: {ex.Message}"); + Console.WriteLine(GetString("读取配置文件失败: {0}", ex.Message)); return new Config(); } } /// - /// ǰдָļ + /// 将当前配置写入指定文件 /// - /// ļ· - /// ǰʵ + /// 配置文件路径 + /// 当前配置实例 public Config Write(string configFilePath) { try { - // ȷĿ¼ + // 确保目录存在 string directory = Path.GetDirectoryName(configFilePath); if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory)) { @@ -88,7 +88,7 @@ public Config Write(string configFilePath) } catch (Exception ex) { - Console.WriteLine($"дļʧ: {ex.Message}"); + Console.WriteLine(GetString("写入配置文件失败: {0}", ex.Message)); return this; } } diff --git a/src/WorldEdit/WorldEdit/MagicWand.cs b/src/WorldEdit/WorldEdit/MagicWand.cs index 65fa2b1f2..c8e21457b 100644 --- a/src/WorldEdit/WorldEdit/MagicWand.cs +++ b/src/WorldEdit/WorldEdit/MagicWand.cs @@ -71,7 +71,7 @@ public static bool GetMagicWandSelection(int X, int Y, Expression Expression, TS count++; if (count >= MaxPointCount) { - Player.SendErrorMessage("Hard selection tile limit " + $"({MaxPointCount}) has been reached."); + Player.SendErrorMessage(GetString("Hard selection tile limit ({0}) has been reached.", MaxPointCount)); return false; } } @@ -82,4 +82,4 @@ public static bool GetMagicWandSelection(int X, int Y, Expression Expression, TS MagicWand = new MagicWand(points.ToArray()); return true; } -} \ No newline at end of file +} diff --git a/src/WorldEdit/WorldEdit/Tools.cs b/src/WorldEdit/WorldEdit/Tools.cs index d39a2d226..eefc598b4 100644 --- a/src/WorldEdit/WorldEdit/Tools.cs +++ b/src/WorldEdit/WorldEdit/Tools.cs @@ -28,27 +28,26 @@ public static class Tools public static bool Translate(string path, bool logError, string tempCopyPath = null) { - // 移除无意义变量 `text`,直接使用临时路径 string tempPath = tempCopyPath ?? Path.Combine("worldedit", $"temp-{rnd.Next()}-{Interlocked.Increment(ref TranslateTempCounter)}.dat"); - File.Copy(path, tempPath, true); // 简化参数名 + File.Copy(path, tempPath, true); bool conversionSucceeded = true; try { LoadWorldDataOld(path).Write(path); } - catch (Exception ex) // 修复变量名 `value` 为更通用的 `ex` + catch (Exception ex) { if (logError) { - TShock.Log.ConsoleError($"[WorldEdit] File '{path}' could not be converted to Terraria v1.4:\n{ex}"); + TShock.Log.ConsoleError(GetString("[WorldEdit] File '{0}' could not be converted to Terraria v1.4:\n{1}", path, ex)); } conversionSucceeded = false; } if (!conversionSucceeded) { - File.Copy(tempPath, path, true); // 简化参数名 + File.Copy(tempPath, path, true); } File.Delete(tempPath); // 直接使用临时路径变量 diff --git a/src/WorldEdit/WorldEdit/WorldEdit.cs b/src/WorldEdit/WorldEdit/WorldEdit.cs index 7a62ef696..ef9de3de9 100644 --- a/src/WorldEdit/WorldEdit/WorldEdit.cs +++ b/src/WorldEdit/WorldEdit/WorldEdit.cs @@ -51,11 +51,11 @@ public class WorldEdit : TerrariaPlugin public override string Author => "Nyx Studios, massive upgrade by Anzhelika,肝帝熙恩适配1456"; - public override string Description => "Adds commands for mass editing of blocks."; + public override string Description => GetString("Adds commands for mass editing of blocks."); public override string Name => System.Reflection.Assembly.GetExecutingAssembly().GetName().Name!; - public override Version Version => new Version(2026, 07, 21); + public override Version Version => new Version(2026, 08, 08); static WorldEdit() { @@ -100,7 +100,7 @@ private static void OnReload(ReloadEventArgs e) Config = Config.Read(ConfigPath); Tools.MAX_UNDOS = Config.MaxUndoCount; MagicWand.MaxPointCount = Config.MagicWandTileLimit; - e?.Player?.SendSuccessMessage("[WorldEdit] Successfully reloaded config."); + e?.Player?.SendSuccessMessage(GetString("[WorldEdit] Successfully reloaded config.")); if (!Directory.Exists(Config.SchematicFolderPath)) { Directory.CreateDirectory(Config.SchematicFolderPath); @@ -136,20 +136,20 @@ private static bool TrySetSelectionPoint(TSPlayer player, int x, int y) { playerInfo.X = x; playerInfo.Y = y; - player.SendInfoMessage("Set point 1."); + player.SendInfoMessage(GetString("Set point 1.")); } else if (playerInfo.Point == 2) { playerInfo.X2 = x; playerInfo.Y2 = y; - player.SendInfoMessage("Set point 2."); + player.SendInfoMessage(GetString("Set point 2.")); } else if (playerInfo.Point == 3) { var regionNames = TShock.Regions.InAreaRegionName(x, y).ToList(); if (regionNames.Count == 0) { - player.SendErrorMessage("No region exists there."); + player.SendErrorMessage(GetString("No region exists there.")); } else { @@ -159,7 +159,7 @@ private static bool TrySetSelectionPoint(TSPlayer player, int x, int y) playerInfo.Y = rect.Top; playerInfo.X2 = rect.Right; playerInfo.Y2 = rect.Bottom; - player.SendInfoMessage("Set region."); + player.SendInfoMessage(GetString("Set region.")); } } else if (playerInfo.Point == 4 && playerInfo.SavedExpression != null) @@ -167,12 +167,12 @@ private static bool TrySetSelectionPoint(TSPlayer player, int x, int y) if (MagicWand.GetMagicWandSelection(x, y, playerInfo.SavedExpression, player, out var magicWand)) { playerInfo.MagicWand = magicWand; - player.SendSuccessMessage("Set magic wand selection."); + player.SendSuccessMessage(GetString("Set magic wand selection.")); playerInfo.SavedExpression = null; } else { - player.SendErrorMessage("Can't start counting magic wand selection from this tile."); + player.SendErrorMessage(GetString("Can't start counting magic wand selection from this tile.")); } } @@ -192,220 +192,220 @@ private void OnInitialize(EventArgs e) OnReload(null); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.admin", EditConfig, "/worldedit", "/wedit") { - HelpText = "Edits config options." + HelpText = GetString("Edits config options.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.activate", Activate, "/activate") { - HelpText = "Activates non-working signs, chests or item frames." + HelpText = GetString("Activates non-working signs, chests or item frames.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.all", All, "/all") { - HelpText = "Sets the worldedit selection to the entire world." + HelpText = GetString("Sets the worldedit selection to the entire world.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.biome", Biome, "/biome") { - HelpText = "Converts biomes in the worldedit selection." + HelpText = GetString("Converts biomes in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.clipboard.copy", Copy, "/copy", "/c") { - HelpText = "Copies the worldedit selection to the clipboard." + HelpText = GetString("Copies the worldedit selection to the clipboard.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.clipboard.cut", Cut, "/cut") { - HelpText = "Copies the worldedit selection to the clipboard, then deletes it." + HelpText = GetString("Copies the worldedit selection to the clipboard, then deletes it.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.drain", Drain, "/drain") { - HelpText = "Drains liquids in the worldedit selection." + HelpText = GetString("Drains liquids in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.fill", Fill, "/fill") { - HelpText = "Fills the worldedit selection." + HelpText = GetString("Fills the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.fillwall", FillWall, "/fillwall", "/fillw") { - HelpText = "Fills the worldedit selection." + HelpText = GetString("Fills the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.fixghosts", FixGhosts, "/fixghosts") { - HelpText = "Fixes invisible signs, chests and item frames." + HelpText = GetString("Fixes invisible signs, chests and item frames.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.fixgrass", FixGrass, "/fixgrass") { - HelpText = "Fixes suffocated grass in the worldedit selection." + HelpText = GetString("Fixes suffocated grass in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.fixhalves", FixHalves, "/fixhalves") { - HelpText = "Fixes half blocks in the worldedit selection." + HelpText = GetString("Fixes half blocks in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.fixslopes", FixSlopes, "/fixslopes") { - HelpText = "Fixes covered slopes in the worldedit selection." + HelpText = GetString("Fixes covered slopes in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.clipboard.flip", Flip, "/flip") { - HelpText = "Flips the worldedit clipboard." + HelpText = GetString("Flips the worldedit clipboard.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.flood", Flood, "/flood") { - HelpText = "Floods liquids in the worldedit selection." + HelpText = GetString("Floods liquids in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.magic.wand", MagicWandTool, "/magicwand", "/mwand") { - HelpText = "Creates worldedit selection from contiguous tiles that are matching boolean expression." + HelpText = GetString("Creates worldedit selection from contiguous tiles that are matching boolean expression.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.killempty", KillEmpty, "/killempty") { - HelpText = "Deletes empty signs and/or chests (only entities, doesn't remove tiles)." + HelpText = GetString("Deletes empty signs and/or chests (only entities, doesn't remove tiles).") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.move", Move, "/move") { - HelpText = "Moves tiles from the worldedit selection to new area." + HelpText = GetString("Moves tiles from the worldedit selection to new area.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.mow", Mow, "/mow") { - HelpText = "Mows grass, thorns, and vines in the worldedit selection." + HelpText = GetString("Mows grass, thorns, and vines in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.near", Near, "/near") { AllowServer = false, - HelpText = "Sets the worldedit selection to a radius around you." + HelpText = GetString("Sets the worldedit selection to a radius around you.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.outline", Outline, "/outline", "/ol") { - HelpText = "Sets block outline around blocks in area." + HelpText = GetString("Sets block outline around blocks in area.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.outlinewall", OutlineWall, "/outlinewall", "/olw") { - HelpText = "Sets wall outline around walls in area." + HelpText = GetString("Sets wall outline around walls in area.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.paint", Paint, "/paint", "/pa") { - HelpText = "Paints tiles in the worldedit selection." + HelpText = GetString("Paints tiles in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.paintwall", PaintWall, "/paintwall", "/paw") { - HelpText = "Paints walls in the worldedit selection." + HelpText = GetString("Paints walls in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.clipboard.paste", Paste, "/paste", "/p") { - HelpText = "Pastes the clipboard to the worldedit selection." + HelpText = GetString("Pastes the clipboard to the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.clipboard.spaste", SPaste, "/spaste", "/sp") { - HelpText = "Pastes the clipboard to the worldedit selection with certain conditions." + HelpText = GetString("Pastes the clipboard to the worldedit selection with certain conditions.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.point", Point1, "/point1", "/p1", "p1") { - HelpText = "Sets the positions of the worldedit selection's first point." + HelpText = GetString("Sets the positions of the worldedit selection's first point.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.point", Point2, "/point2", "/p2", "p2") { - HelpText = "Sets the positions of the worldedit selection's second point." + HelpText = GetString("Sets the positions of the worldedit selection's second point.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.history.redo", Redo, "/redo") { - HelpText = "Redoes a number of worldedit actions." + HelpText = GetString("Redoes a number of worldedit actions.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.region", RegionCmd, "/region") { - HelpText = "Selects a region as a worldedit selection." + HelpText = GetString("Selects a region as a worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.replace", Replace, "/replace", "/rep") { - HelpText = "Replaces tiles in the worldedit selection." + HelpText = GetString("Replaces tiles in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.replacewall", ReplaceWall, "/replacewall", "/repw") { - HelpText = "Replaces walls in the worldedit selection." + HelpText = GetString("Replaces walls in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.resize", Resize, "/resize") { - HelpText = "Resizes the worldedit selection in a direction." + HelpText = GetString("Resizes the worldedit selection in a direction.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.clipboard.rotate", Rotate, "/rotate") { - HelpText = "Rotates the worldedit clipboard." + HelpText = GetString("Rotates the worldedit clipboard.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.schematic", Schematic, "/schematic", "/schem", "/sc", "sc") { - HelpText = "Manages worldedit schematics." + HelpText = GetString("Manages worldedit schematics.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.selecttype", Select, "/select") { - HelpText = "Sets the worldedit selection function." + HelpText = GetString("Sets the worldedit selection function.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.set", Set, "/set") { - HelpText = "Sets tiles in the worldedit selection." + HelpText = GetString("Sets tiles in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.setgrass", SetGrass, "/setgrass") { - HelpText = "Sets certain grass in the worldedit selection." + HelpText = GetString("Sets certain grass in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.setwall", SetWall, "/setwall", "/swa") { - HelpText = "Sets walls in the worldedit selection." + HelpText = GetString("Sets walls in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.setwire", SetWire, "/setwire", "/swi") { - HelpText = "Sets wires in the worldedit selection." + HelpText = GetString("Sets wires in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.shape", Shape, "/shape") { - HelpText = "Draws line/rectangle/ellipse/triangle in the worldedit selection." + HelpText = GetString("Draws line/rectangle/ellipse/triangle in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.shape", Shape, "/shapefill", "/shapef") { - HelpText = "Draws line/rectangle/ellipse/triangle in the worldedit selection." + HelpText = GetString("Draws line/rectangle/ellipse/triangle in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.shape", Shape, "/shapewall", "/shapew") { - HelpText = "Draws line/rectangle/ellipse/triangle in the worldedit selection." + HelpText = GetString("Draws line/rectangle/ellipse/triangle in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.shape", Shape, "/shapewallfill", "/shapewf") { - HelpText = "Draws line/rectangle/ellipse/triangle in the worldedit selection." + HelpText = GetString("Draws line/rectangle/ellipse/triangle in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.utils.size", Size, "/size") { - HelpText = "Shows size of clipboard or schematic." + HelpText = GetString("Shows size of clipboard or schematic.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.slope", Slope, "/slope") { - HelpText = "Slopes tiles in the worldedit selection." + HelpText = GetString("Slopes tiles in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.delslope", SlopeDelete, "/delslope", "/delslopes", "/dslope", "/dslopes") { - HelpText = "Removes slopes in the worldedit selection." + HelpText = GetString("Removes slopes in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.smooth", Smooth, "/smooth") { - HelpText = "Smooths blocks in the worldedit selection." + HelpText = GetString("Smooths blocks in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.inactive", Inactive, "/inactive", "/ia") { - HelpText = "Sets the inactive status in the worldedit selection." + HelpText = GetString("Sets the inactive status in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.shift", Shift, "/shift") { - HelpText = "Shifts the worldedit selection in a direction." + HelpText = GetString("Shifts the worldedit selection in a direction.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.selection.text", Text, "/text") { - HelpText = "Creates text with alphabet statues in the worldedit selection." + HelpText = GetString("Creates text with alphabet statues in the worldedit selection.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.history.undo", Undo, "/undo") { - HelpText = "Undoes a number of worldedit actions." + HelpText = GetString("Undoes a number of worldedit actions.") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.clipboard.scale", Scale, "/scale") { - HelpText = "Scale the clipboard" + HelpText = GetString("Scale the clipboard") }); TShockAPI.Commands.ChatCommands.Add(new Command("worldedit.region.actuator", Actuator, "/actuator") { - HelpText = "Sets actuators in the worldedit selection." + HelpText = GetString("Sets actuators in the worldedit selection.") }); try { @@ -449,9 +449,9 @@ private void OnInitialize(EventArgs e) File.Delete(clipboardPath); } File.Create(path).Close(); - TShock.Log.ConsoleInfo("WorldEdit doesn't support undo/redo/clipboard files that were saved by plugin below version 1.7."); - TShock.Log.ConsoleInfo("These files had been deleted. However, we still support old schematic files (*.dat)"); - TShock.Log.ConsoleInfo("Do not delete deteted.lock inside worldedit folder; this message will only show once."); + TShock.Log.ConsoleInfo(GetString("WorldEdit doesn't support undo/redo/clipboard files that were saved by plugin below version 1.7.")); + TShock.Log.ConsoleInfo(GetString("These files had been deleted. However, we still support old schematic files (*.dat)")); + TShock.Log.ConsoleInfo(GetString("Do not delete deteted.lock inside worldedit folder; this message will only show once.")); } IDbConnection database = Database; SqlTableCreator sqlTableCreator = new SqlTableCreator(database, Database.GetSqlQueryBuilder()); @@ -486,7 +486,7 @@ private void OnInitialize(EventArgs e) } catch (Exception ex) { - TShock.Log.ConsoleError($"WorldEdit initialization error (database/biomes/colors): {ex}"); + TShock.Log.ConsoleError(GetString("WorldEdit initialization error (database/biomes/colors): {0}", ex)); } Selections.Add("altcheckers", (int i, int j, TSPlayer plr) => ((i + j) & 1) == 0); Selections.Add("checkers", (int i, int j, TSPlayer plr) => ((i + j) & 1) == 1); @@ -593,7 +593,7 @@ private void QueueCallback(object context) TSPlayer tSPlayer = item?.plr; if (tSPlayer != null && tSPlayer.Active) { - tSPlayer.SendErrorMessage("WorldEdit command failed, check logs for more details."); + tSPlayer.SendErrorMessage(GetString("WorldEdit command failed, check logs for more details.")); } } } @@ -603,8 +603,8 @@ private void EditConfig(CommandArgs e) { if (e.Parameters.Count < 1 || e.Parameters.Count > 2) { - e.Player.SendErrorMessage("Invalid syntax! Proper syntax: //worldedit