Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/TSMapEditor/CCEngine/BuildingWithPropertyType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public static string ToDescription(this BuildingWithPropertyType value)
{
return value switch
{
BuildingWithPropertyType.LeastThreat => "Least threat",
BuildingWithPropertyType.HighestThreat => "Highest threat",
BuildingWithPropertyType.Nearest => "Nearest",
BuildingWithPropertyType.Farthest => "Farthest",
BuildingWithPropertyType.LeastThreat => Translate("BuildingWithPropertyTypeExtension.LeastThreat", "Least threat"),
BuildingWithPropertyType.HighestThreat => Translate("BuildingWithPropertyTypeExtension.HighestThreat", "Highest threat"),
BuildingWithPropertyType.Nearest => Translate("BuildingWithPropertyTypeExtension.Nearest", "Nearest"),
BuildingWithPropertyType.Farthest => Translate("BuildingWithPropertyTypeExtension.Farthest", "Farthest"),
_ => string.Empty,
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/TSMapEditor/CCEngine/ScriptAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public ScriptAction(int id)
}

public int ID { get; set; }
public string Name { get; set; } = "Unknown action";
public string Description { get; set; } = "No description";
public string ParamDescription { get; set; } = "Use 0";
public string Name { get; set; } = Translate("ScriptAction.UnknownAction", "Unknown action");
public string Description { get; set; } = Translate("ScriptAction.NoDescription", "No description");
public string ParamDescription { get; set; } = Translate("ScriptAction.Use0", "Use 0");
public string OptionsSectionName { get; set; } = string.Empty;
public TriggerParamType ParamType { get; set; } = TriggerParamType.Unknown;
public List<ScriptActionPresetOption> PresetOptions { get; } = new List<ScriptActionPresetOption>(0);
Expand Down
4 changes: 2 additions & 2 deletions src/TSMapEditor/Config/Default/UI/EditorControlsPanel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $Height=getBottom(btnPlaceWaypoint) + EMPTY_SPACE_BOTTOM
[lblBrushSize]
$X=EMPTY_SPACE_SIDES
$Y=VERTICAL_SPACING
Text=Brush size:
$Text=translate(Brush size:)

[ddBrushSize]
$X=getRight(lblBrushSize) + (HORIZONTAL_SPACING * 2)
Expand All @@ -40,7 +40,7 @@ DrawBorders=no
[chkAutoLAT]
$X=getRight(LATPanel) + EMPTY_SPACE_SIDES
$Y=VERTICAL_SPACING
Text=Auto-LAT
$Text=translate(Auto-LAT)

[chkOnlyPaintOnClearGround]
$X=getX(chkAutoLAT)
Expand Down
42 changes: 21 additions & 21 deletions src/TSMapEditor/Config/Default/UI/Windows/TeamTypesWindow.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,38 @@ HasCloseButton=true
[lblDescription]
$X=EMPTY_SPACE_SIDES
$Y=EMPTY_SPACE_TOP
Text=TeamTypes connect a Trigger with a TaskForce and Script and define how the units behave.
$Text=translate(TeamTypes connect a Trigger with a TaskForce and Script and define how the units behave.)

[lblTeamTypes]
$X=EMPTY_SPACE_SIDES
$Y=getBottom(lblDescription) + EMPTY_SPACE_TOP
FontIndex=1
Text=TeamTypes:
$Text=translate(TeamTypes:)

[btnNewTeamType]
$X=getX(lblTeamTypes)
$Y=getBottom(lblTeamTypes) + VERTICAL_SPACING
$Width=200
Text=New
$Text=translate(New)

[btnDeleteTeamType]
$X=getX(lblTeamTypes)
$Y=getBottom(btnNewTeamType) + VERTICAL_SPACING
$Width=getWidth(btnNewTeamType)
Text=Delete
$Text=translate(Delete)

[btnCloneTeamType]
$X=getX(lblTeamTypes)
$Y=getBottom(btnDeleteTeamType) + VERTICAL_SPACING
$Width=getWidth(btnNewTeamType)
Text=Clone
$Text=translate(Clone)

[tbFilter]
$X=getX(lblTeamTypes)
$Y=getBottom(btnCloneTeamType) + VERTICAL_SPACING
$Width=getWidth(btnCloneTeamType) - BUTTON_HEIGHT
$Height=BUTTON_HEIGHT
Suggestion=Search team types...
$Suggestion=translate(Search team types...)

[btnSortOptions]
$X=getRight(tbFilter)
Expand All @@ -96,7 +96,7 @@ $Height=getHeight(TeamTypesWindow) - getY(lbTeamTypes) - EMPTY_SPACE_BOTTOM
$X=getRight(btnNewTeamType) + (HORIZONTAL_SPACING * 2)
$Y=getY(lblTeamTypes)
FontIndex=1
Text=Selected TeamType:
$Text=translate(Selected TeamType:)

[tbName]
$X=getX(lblSelectedTeamType) + 100
Expand All @@ -106,7 +106,7 @@ $Width=150
[lblName]
$X=getX(lblSelectedTeamType)
$Y=getY(tbName) + 1
Text=Name:
$Text=translate(Name:)

[ddVeteranLevel]
$X=getX(tbName)
Expand All @@ -119,7 +119,7 @@ Option2=Elite
[lblVeteranLevel]
$X=getX(lblName)
$Y=getY(ddVeteranLevel) + 1
Text=Veteran Level:
$Text=translate(Veteran Level:)

[ddHouse]
$X=getX(tbName)
Expand All @@ -129,7 +129,7 @@ $Y=getBottom(ddVeteranLevel) + VERTICAL_SPACING
[lblHouse]
$X=getX(lblName)
$Y=getY(ddHouse) + 1
Text=House:
$Text=translate(House:)

[tbPriority]
$X=getX(tbName)
Expand All @@ -139,7 +139,7 @@ $Y=getBottom(ddHouse) + VERTICAL_SPACING
[lblPriority]
$X=getX(lblName)
$Y=getY(tbPriority) + 1
Text=Priority:
$Text=translate(Priority:)

[tbMax]
$X=getX(tbName)
Expand All @@ -149,7 +149,7 @@ $Y=getBottom(tbPriority) + VERTICAL_SPACING
[lblMax]
$X=getX(lblName)
$Y=getY(tbMax) + 1
Text=Max:
$Text=translate(Max:)

[tbTechLevel]
$X=getX(tbName)
Expand All @@ -159,7 +159,7 @@ $Y=getBottom(tbMax) + VERTICAL_SPACING
[lblTechLevel]
$X=getX(lblName)
$Y=getY(tbTechLevel) + 1
Text=Tech Level:
$Text=translate(Tech Level:)

[ddMindControlDecision]
$X=getX(tbName)
Expand All @@ -176,7 +176,7 @@ Option5=Do Nothing
[lblMindControlDecision]
$X=getX(lblName)
$Y=getY(ddMindControlDecision) + 1
Text=On Mind Control:
$Text=translate(On Mind Control:)
$Enabled=IS_RA2YR

; *************
Expand All @@ -191,7 +191,7 @@ $Y=getY(tbName)
[lblTeamTypeColor]
$X=getX(ddTeamTypeColor) - 100
$Y=getY(lblName)
Text=Color:
$Text=translate(Color:)

[tbGroup]
$X=getX(ddTeamTypeColor)
Expand All @@ -201,7 +201,7 @@ $Y=getY(ddVeteranLevel)
[lblGroup]
$X=getX(lblTeamTypeColor)
$Y=getY(lblVeteranLevel)
Text=Group:
$Text=translate(Group:)

[tbWaypoint]
$X=getX(ddTeamTypeColor)
Expand All @@ -211,7 +211,7 @@ $Y=getY(ddHouse)
[lblWaypoint]
$X=getX(lblTeamTypeColor)
$Y=getY(lblHouse)
Text=Waypoint:
$Text=translate(Waypoint:)

[selTaskForce]
$X=getX(ddTeamTypeColor)
Expand All @@ -228,7 +228,7 @@ Text=->
[lblTaskForce]
$X=getX(lblTeamTypeColor)
$Y=getY(lblPriority)
Text=TaskForce:
$Text=translate(TaskForce:)

[selScript]
$X=getX(ddTeamTypeColor)
Expand All @@ -245,7 +245,7 @@ Text=->
[lblScript]
$X=getX(lblTeamTypeColor)
$Y=getY(lblMax)
Text=Script:
$Text=translate(Script:)

[selTag]
$X=getX(ddTeamTypeColor)
Expand All @@ -262,7 +262,7 @@ Text=->
[lblTag]
$X=getX(lblTeamTypeColor)
$Y=getY(lblTechLevel)
Text=Tag:
$Text=translate(Tag:)

[tbTransportWaypoint]
$X=getX(ddTeamTypeColor)
Expand All @@ -273,7 +273,7 @@ $Enabled=IS_RA2YR
[lblTransportWaypoint]
$X=getX(lblTeamTypeColor)
$Y=getY(lblMindControlDecision)
Text=Transport Wpt:
$Text=translate(Transport Wpt:)
$Enabled=IS_RA2YR

; **************
Expand Down
11 changes: 7 additions & 4 deletions src/TSMapEditor/Config/Scripts/Add Map Reveal Trigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using TSMapEditor.Rendering;
using TSMapEditor.GameMath;
using TSMapEditor.UI.Windows;
using TSMapEditor.Misc;

namespace WAEScript
{
Expand All @@ -19,7 +20,7 @@
/// Returns the description of this script.
/// All scripts must contain this function.
/// </summary>
public string GetDescription() => "This script will create a new map reveal trigger. Continue?";
public string GetDescription() => Translator.Translate("MapScripts.AddMapRevealTrigger.Description", "This script will create a new map reveal trigger. Continue?");

/// <summary>
/// Returns the message that is presented to the user if running this script succeeded.
Expand All @@ -28,14 +29,16 @@
public string GetSuccessMessage()
{
if (error == null)
return $"Successfully created a map reveal trigger with name \"{mapRevealTriggerName}\". You can locate it in the Triggers window.";
return string.Format(Translator.Translate("MapScripts.AddMapRevealTrigger.SuccessMessage",
"Successfully created a map reveal trigger with name \"{0}\". You can locate it in the Triggers window."),
mapRevealTriggerName);

return error;
}

private string error;

Check warning on line 39 in src/TSMapEditor/Config/Scripts/Add Map Reveal Trigger.cs

View workflow job for this annotation

GitHub Actions / build-editor

Field 'AddMapRevealTrigger.error' is never assigned to, and will always have its default value null

private const string mapRevealTriggerName = "Map Reveal Trigger";
private string mapRevealTriggerName = Translator.Translate("MapScripts.AddMapRevealTrigger.TriggerName", "Map Reveal Trigger");

/// <summary>
/// The function that actually does the magic.
Expand All @@ -62,7 +65,7 @@
map.AddTag(new Tag()
{
ID = map.GetNewUniqueInternalId(),
Name = trigger.Name + " (tag)",
Name = trigger.Name + Translator.Translate("MapScripts.AddMapRevealTrigger.Tag", " (tag)"),
Trigger = trigger,
Repeating = 0
});
Expand Down
9 changes: 5 additions & 4 deletions src/TSMapEditor/Config/Scripts/Apply Animated Water.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using TSMapEditor.CCEngine;
using TSMapEditor.Rendering;
using TSMapEditor.GameMath;
using TSMapEditor.Misc;

namespace WAEScript
{
Expand All @@ -19,7 +20,7 @@ public class ApplyAnimatedWaterScript
/// Returns the description of this script.
/// All scripts must contain this function.
/// </summary>
public string GetDescription() => "This script will replace all water on the map with animated water. Continue?";
public string GetDescription() => Translator.Translate("MapScripts.ApplyAnimatedWater.Description", "This script will replace all water on the map with animated water. Continue?");

/// <summary>
/// Returns the message that is presented to the user if running this script succeeded.
Expand All @@ -28,7 +29,7 @@ public class ApplyAnimatedWaterScript
public string GetSuccessMessage()
{
if (error == null)
return "Successfully replaced water with animated water.";
return Translator.Translate("MapScripts.ApplyAnimatedWater.SuccessMessage", "Successfully replaced water with animated water.");

return error;
}
Expand All @@ -49,14 +50,14 @@ public void Perform(Map map)
var animatedWaterTileSet = map.TheaterInstance.Theater.FindTileSet(AnimatedWaterTileSetName);
if (animatedWaterTileSet == null)
{
error = "TileSet for animated water not found!";
error = Translator.Translate("MapScripts.ApplyAnimatedWater.Errors.AnimatedWaterTileSetNotFound", "TileSet for animated water not found!");
return;
}

waterTileSet = map.TheaterInstance.Theater.FindTileSet(WaterTileSetName);
if (waterTileSet == null)
{
error = "TileSet for regular (non-animated) water not found!";
error = Translator.Translate("MapScripts.ApplyAnimatedWater.Errors.RegularWaterTileSetNotFound", "TileSet for regular (non-animated) water not found!");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using TSMapEditor.Scripts;
using TSMapEditor.UI;
using TSMapEditor.UI.Windows;
using TSMapEditor.Misc;

namespace WAEScript
{
Expand All @@ -37,7 +38,7 @@ public AssignMissionCursorAction(ICursorActionTarget cursorActionTarget) : base(
/// </summary>
private string missionName = "Area Guard";

public override string GetName() => $"Apply '{missionName}' Mission To Units";
public override string GetName() => Translator.Translate("MapScripts.AreaGuardMissionCursorAction.Name", "Apply Area Guard Mission To Units");

public override void LeftClick(Point2D cellCoords)
{
Expand Down Expand Up @@ -89,7 +90,7 @@ public override void DrawPreview(Point2D cellCoords, Point2D cameraTopLeftPoint)

cellCenterPoint = cellCenterPoint.ScaleBy(CursorActionTarget.Camera.ZoomLevel);

const string text = "Assign Mission";
string text = Translator.Translate("MapScripts.AreaGuardMissionCursorAction.CursorActionText", "Assign Mission");
var textDimensions = Renderer.GetTextDimensions(text, Constants.UIBoldFont);
int x = cellCenterPoint.X - (int)(textDimensions.X / 2);
int y = cellCenterPoint.Y - (int)(textDimensions.Y / 2);
Expand Down
6 changes: 4 additions & 2 deletions src/TSMapEditor/Config/Scripts/Count Credits On Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using TSMapEditor.CCEngine;
using TSMapEditor.Rendering;
using TSMapEditor.GameMath;
using TSMapEditor.Misc;

namespace WAEScript
{
Expand All @@ -18,15 +19,16 @@ public class CountCreditsOnMapScript
/// Returns the description of this script.
/// All scripts must contain this function.
/// </summary>
public string GetDescription() => "This script will count credit value of all Tiberium and ore overlays. Continue?";
public string GetDescription() => Translator.Translate("MapScripts.CountCreditsOnMap.Description", "This script will count credit value of all Tiberium and ore overlays. Continue?");

/// <summary>
/// Returns the message that is presented to the user if running this script succeeded.
/// All scripts must contain this function.
/// </summary>
public string GetSuccessMessage()
{
return $"There are {count} credits' worth of resources present.";
return string.Format(Translator.Translate("MapScripts.CountCreditsOnMap.SuccessMessage",
"There are {0} credits' worth of resources present."), count);
}

int count = 0;
Expand Down
Loading
Loading