Mercurial > repos > snowblizz-super-API-ideas
diff api/Commands/SetUnitSizeCommand.cs @ 289:650bbe79b884 WarFoundry_v0.1
Fixes #336: Command descriptions don't refresh on language change
* Remove cached string values and just return the text each time
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 02 Jan 2011 21:01:20 +0000 |
parents | 391446c9b250 |
children |
line wrap: on
line diff
--- a/api/Commands/SetUnitSizeCommand.cs Sun Jan 02 16:04:49 2011 +0000 +++ b/api/Commands/SetUnitSizeCommand.cs Sun Jan 02 21:01:20 2011 +0000 @@ -16,8 +16,6 @@ { private Unit unit; private int newSize, oldSize; - private string description; - private string undoDescription; public SetUnitSizeCommand(Unit toResize, int size) { @@ -28,19 +26,14 @@ public override bool CanExecute() { - return (unit!=null && newSize >0 && oldSize > 0); + return (unit != null && newSize > 0 && oldSize > 0); } public override string Description { get { - if (description == null) - { - description = Translation.GetTranslation("setUnitSizeCommandDescription", "set size of {0} to {1}", unit.Name, newSize); - } - - return description; + return Translation.GetTranslation("setUnitSizeCommandDescription", "set size of {0} to {1}", unit.Name, newSize); } } @@ -48,12 +41,7 @@ { get { - if (undoDescription == null) - { - undoDescription = Translation.GetTranslation("setUnitSizeCommandUndoDescription", "set size of {0} to {1}", unit.Name, oldSize); - } - - return undoDescription; + return Translation.GetTranslation("setUnitSizeCommandUndoDescription", "set size of {0} to {1}", unit.Name, oldSize); } }