Extract editor brush texts.
This commit is contained in:
committed by
abcdefg30
parent
8433bc0948
commit
c9dddc342c
@@ -81,6 +81,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
{
|
{
|
||||||
public string Text { get; private set; }
|
public string Text { get; private set; }
|
||||||
|
|
||||||
|
[TranslationReference("name", "id")]
|
||||||
|
const string AddedActor = "notification-added-actor";
|
||||||
|
|
||||||
readonly EditorActorLayer editorLayer;
|
readonly EditorActorLayer editorLayer;
|
||||||
readonly ActorReference actor;
|
readonly ActorReference actor;
|
||||||
|
|
||||||
@@ -102,7 +105,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public void Do()
|
public void Do()
|
||||||
{
|
{
|
||||||
editorActorPreview = editorLayer.Add(actor);
|
editorActorPreview = editorLayer.Add(actor);
|
||||||
Text = $"Added {editorActorPreview.Info.Name} ({editorActorPreview.ID})";
|
Text = TranslationProvider.GetString(AddedActor,
|
||||||
|
Translation.Arguments("name", editorActorPreview.Info.Name, "id", editorActorPreview.ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Undo()
|
public void Undo()
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
class CopyPasteEditorAction : IEditorAction
|
class CopyPasteEditorAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference("amount")]
|
||||||
|
const string CopiedTiles = "notification-copied-tiles";
|
||||||
|
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
|
|
||||||
readonly MapCopyFilters copyFilters;
|
readonly MapCopyFilters copyFilters;
|
||||||
@@ -205,7 +208,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
mapHeight = map.Height;
|
mapHeight = map.Height;
|
||||||
mapResources = map.Resources;
|
mapResources = map.Resources;
|
||||||
|
|
||||||
Text = $"Copied {tiles.Count} tiles";
|
Text = TranslationProvider.GetString(CopiedTiles, Translation.Arguments("amount", tiles.Count));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
class RemoveActorAction : IEditorAction
|
class RemoveActorAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference("name", "id")]
|
||||||
|
const string RemovedActor = "notification-removed-actor";
|
||||||
|
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
|
|
||||||
readonly EditorActorLayer editorActorLayer;
|
readonly EditorActorLayer editorActorLayer;
|
||||||
@@ -120,7 +123,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
this.editorActorLayer = editorActorLayer;
|
this.editorActorLayer = editorActorLayer;
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
|
|
||||||
Text = $"Removed {actor.Info.Name} ({actor.ID})";
|
Text = TranslationProvider.GetString(RemovedActor,
|
||||||
|
Translation.Arguments("name", actor.Info.Name, "id", actor.ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -141,6 +145,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
class RemoveResourceAction : IEditorAction
|
class RemoveResourceAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference("type")]
|
||||||
|
const string RemovedResource = "notification-removed-resource";
|
||||||
|
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
|
|
||||||
readonly IResourceLayer resourceLayer;
|
readonly IResourceLayer resourceLayer;
|
||||||
@@ -153,7 +160,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
this.resourceLayer = resourceLayer;
|
this.resourceLayer = resourceLayer;
|
||||||
this.cell = cell;
|
this.cell = cell;
|
||||||
|
|
||||||
Text = $"Removed {resourceType}";
|
Text = TranslationProvider.GetString(RemovedResource, Translation.Arguments("type", resourceType));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -105,6 +105,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
class AddResourcesEditorAction : IEditorAction
|
class AddResourcesEditorAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference("amount", "type")]
|
||||||
|
const string AddedResource = "notification-added-resource";
|
||||||
|
|
||||||
public string Text { get; private set; }
|
public string Text { get; private set; }
|
||||||
|
|
||||||
readonly IResourceLayer resourceLayer;
|
readonly IResourceLayer resourceLayer;
|
||||||
@@ -145,9 +148,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
resourceLayer.ClearResources(resourceCell.Cell);
|
resourceLayer.ClearResources(resourceCell.Cell);
|
||||||
resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType));
|
resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType));
|
||||||
cellResources.Add(resourceCell);
|
cellResources.Add(resourceCell);
|
||||||
|
Text = TranslationProvider.GetString(AddedResource, Translation.Arguments("amount", cellResources.Count, "type", resourceType));
|
||||||
var cellText = cellResources.Count != 1 ? "cells" : "cell";
|
|
||||||
Text = $"Added {cellResources.Count} {cellText} of {resourceType}";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,6 +155,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
class PaintTileEditorAction : IEditorAction
|
class PaintTileEditorAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference("id")]
|
||||||
|
const string AddedTile = "notification-added-tile";
|
||||||
|
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
|
|
||||||
readonly ushort template;
|
readonly ushort template;
|
||||||
@@ -172,7 +175,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
||||||
terrainTemplate = terrainInfo.Templates[template];
|
terrainTemplate = terrainInfo.Templates[template];
|
||||||
Text = $"Added tile {terrainTemplate.Id}";
|
Text = TranslationProvider.GetString(AddedTile, Translation.Arguments("id", terrainTemplate.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -224,6 +227,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
class FloodFillEditorAction : IEditorAction
|
class FloodFillEditorAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference("id")]
|
||||||
|
const string FilledTile = "notification-filled-tile";
|
||||||
|
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
|
|
||||||
readonly ushort template;
|
readonly ushort template;
|
||||||
@@ -241,7 +247,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
||||||
terrainTemplate = terrainInfo.Templates[template];
|
terrainTemplate = terrainInfo.Templates[template];
|
||||||
Text = $"Filled with tile {terrainTemplate.Id}";
|
Text = TranslationProvider.GetString(FilledTile, Translation.Arguments("id", terrainTemplate.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -146,9 +146,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
class OpenMapAction : IEditorAction
|
class OpenMapAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference]
|
||||||
|
const string Opened = "notification-opened";
|
||||||
|
|
||||||
public OpenMapAction()
|
public OpenMapAction()
|
||||||
{
|
{
|
||||||
Text = "Opened";
|
Text = TranslationProvider.GetString(Opened);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -463,6 +463,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
class EditActorEditorAction : IEditorAction
|
class EditActorEditorAction : IEditorAction
|
||||||
{
|
{
|
||||||
|
[TranslationReference("name", "id")]
|
||||||
|
const string EditedActor = "notification-edited-actor";
|
||||||
|
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
|
|
||||||
readonly IEnumerable<IEditActorHandle> handles;
|
readonly IEnumerable<IEditActorHandle> handles;
|
||||||
@@ -476,7 +479,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
actorId = actor.ID;
|
actorId = actor.ID;
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
this.handles = handles;
|
this.handles = handles;
|
||||||
Text = $"Edited {actor.Info.Name} ({actor.ID})";
|
Text = TranslationProvider.GetString(EditedActor, Translation.Arguments("name", actor.Info.Name, "id", actor.ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -717,3 +717,34 @@ options-time-limit =
|
|||||||
}
|
}
|
||||||
|
|
||||||
notification-time-limit-expired = Time limit has expired.
|
notification-time-limit-expired = Time limit has expired.
|
||||||
|
|
||||||
|
## EditorActorBrush
|
||||||
|
notification-added-actor = Added { $name } ({ $id })
|
||||||
|
|
||||||
|
## EditorCopyPasteBrush
|
||||||
|
notification-copied-tiles =
|
||||||
|
{ $amount ->
|
||||||
|
[one] Copied one tile
|
||||||
|
*[other] Copied { $amount } tiles
|
||||||
|
}
|
||||||
|
|
||||||
|
## EditorDefaultBrush
|
||||||
|
notification-removed-actor = Removed { $name } ({ $id })
|
||||||
|
notification-removed-resource = Removed { $type }
|
||||||
|
|
||||||
|
## EditorResourceBrush
|
||||||
|
notification-added-resource =
|
||||||
|
{ $amount ->
|
||||||
|
[one] Added one cell of { $type }
|
||||||
|
*[other] Added { $amount } cells of { $type }
|
||||||
|
}
|
||||||
|
|
||||||
|
## EditorTileBrush
|
||||||
|
notification-added-tile = Added tile { $id }
|
||||||
|
notification-filled-tile = Filled with tile { $id }
|
||||||
|
|
||||||
|
## EditorActionManager
|
||||||
|
notification-opened = Opened
|
||||||
|
|
||||||
|
## ActorEditLogic
|
||||||
|
notification-edited-actor = Edited { $name } ({ $id })
|
||||||
|
|||||||
Reference in New Issue
Block a user