Make copy paste message more accurate
This commit is contained in:
committed by
Gustas Kažukauskas
parent
62e692063a
commit
93602c7c95
@@ -322,5 +322,10 @@ namespace OpenRA.Mods.Common.EditorBrushes
|
||||
{
|
||||
return commitBlitSource.Tiles.Count;
|
||||
}
|
||||
|
||||
public int ActorCount()
|
||||
{
|
||||
return commitBlitSource.Actors.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +120,15 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
sealed class CopyPasteEditorAction : IEditorAction
|
||||
{
|
||||
[FluentReference("count")]
|
||||
[FluentReference("tiles")]
|
||||
const string CopiedTiles = "notification-copied-tiles";
|
||||
|
||||
[FluentReference("actors")]
|
||||
const string CopiedActors = "notification-copied-actors";
|
||||
|
||||
[FluentReference("tiles", "actors")]
|
||||
const string CopiedTilesAndActors = "notification-copied-tiles-actors";
|
||||
|
||||
public string Text { get; }
|
||||
|
||||
readonly EditorBlit editorBlit;
|
||||
@@ -131,7 +137,15 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
this.editorBlit = editorBlit;
|
||||
|
||||
Text = FluentProvider.GetMessage(CopiedTiles, "count", editorBlit.TileCount());
|
||||
var actors = editorBlit.ActorCount();
|
||||
var tiles = editorBlit.TileCount();
|
||||
|
||||
if (tiles > 0 && actors == 0)
|
||||
Text = FluentProvider.GetMessage(CopiedTiles, "tiles", tiles);
|
||||
else if (tiles == 0 && actors > 0)
|
||||
Text = FluentProvider.GetMessage(CopiedActors, "actors", actors);
|
||||
else
|
||||
Text = FluentProvider.GetMessage(CopiedTilesAndActors, "tiles", tiles, "actors", actors);
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
|
||||
@@ -784,11 +784,9 @@ notification-time-limit-expired = Time limit has expired.
|
||||
notification-added-actor = Added { $name } ({ $id })
|
||||
|
||||
## EditorCopyPasteBrush
|
||||
notification-copied-tiles =
|
||||
{ $count ->
|
||||
[one] Copied one tile
|
||||
*[other] Copied { $count } tiles
|
||||
}
|
||||
notification-copied-tiles = Copied { $tiles } tiles
|
||||
notification-copied-actors = Copied { $actors } actors
|
||||
notification-copied-tiles-actors = Copied { $tiles } tiles and { $actors } actors
|
||||
|
||||
## EditorDefaultBrush
|
||||
notification-selected-area = Selected area { $x },{ $y } ({ $width },{ $height })
|
||||
|
||||
Reference in New Issue
Block a user