Only show the full template run name + template name if they're different.
The campaign screen currently shows both the name of the run (selected by the user) and the name of the campaign. This is, by default, the same, and thus looks weird. Reported by: langbart, marder Tested by: marder Differential Revision: https://code.wildfiregames.com/D4158 This was SVN commit r25780.
This commit is contained in:
parent
956b3f96db
commit
7e423fe20e
@ -11,7 +11,7 @@ class NewCampaignModal
|
||||
|
||||
Engine.GetGUIObjectByName('cancelButton').onPress = () => Engine.PopGuiPage();
|
||||
Engine.GetGUIObjectByName('startButton').onPress = () => this.createAndStartCampaign();
|
||||
Engine.GetGUIObjectByName('runDescription').caption = translate(this.template.Name);
|
||||
Engine.GetGUIObjectByName('runDescription').caption = translateWithContext("Campaign Template", this.template.Name);
|
||||
Engine.GetGUIObjectByName('runDescription').onTextEdit = () => {
|
||||
Engine.GetGUIObjectByName('startButton').enabled = Engine.GetGUIObjectByName('runDescription').caption.length > 0;
|
||||
};
|
||||
|
@ -107,15 +107,16 @@ class CampaignRun
|
||||
}
|
||||
|
||||
/**
|
||||
* @param forlist - if true, generate a label for listing all runs.
|
||||
* Otherwise, just return a short human readable name.
|
||||
* (not currently used for regular runs).
|
||||
* Return a readable name for this campaign.
|
||||
* @param full - if true, include both user description and template name. Otherwise, skip one if they're identical.
|
||||
*/
|
||||
getLabel(forList)
|
||||
getLabel(full)
|
||||
{
|
||||
if (!full && this.meta.userDescription === translateWithContext("Campaign Template", this.template.Name))
|
||||
return this.meta.userDescription;
|
||||
return sprintf(translate("%(userDesc)s - %(templateName)s"), {
|
||||
"userDesc": this.meta.userDescription,
|
||||
"templateName": this.template.Name
|
||||
"templateName": translateWithContext("Campaign Template", this.template.Name)
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user