Skip to content

Commit

Permalink
Change "Clone of..." prefix to "... (Clone)" suffix when cloning objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Apr 29, 2024
1 parent d840408 commit c2d56bd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/TSMapEditor/Models/AITriggerType.cs
Expand Up @@ -92,7 +92,7 @@ public AITriggerType(string iniName)
public AITriggerType Clone(string newUniqueId)
{
var clonedAITrigger = (AITriggerType)MemberwiseClone();
clonedAITrigger.Name = "Clone of " + Name;
clonedAITrigger.Name = Name + " (Clone)";
clonedAITrigger.ININame = newUniqueId;
return clonedAITrigger;
}
Expand Down
3 changes: 2 additions & 1 deletion src/TSMapEditor/Models/Script.cs
Expand Up @@ -63,7 +63,8 @@ public Script(string iniName)
public Script Clone(string iniName)
{
var script = new Script(iniName);
script.Name = "Clone of " + Name;
script.Name = Name + " (Clone)";

foreach (var action in Actions)
{
script.Actions.Add(new ScriptActionEntry()
Expand Down
2 changes: 1 addition & 1 deletion src/TSMapEditor/Models/TaskForce.cs
Expand Up @@ -153,7 +153,7 @@ public string GetHintText()
public TaskForce Clone(string iniName)
{
var newTaskForce = new TaskForce(iniName);
newTaskForce.Name = "Clone of " + Name;
newTaskForce.Name = Name + " (Clone)";
newTaskForce.Group = Group;

for (int i = 0; i < TechnoTypes.Length; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/TSMapEditor/Models/TeamType.cs
Expand Up @@ -128,7 +128,7 @@ public TeamType Clone(string iniName)
{
var clone = MemberwiseClone() as TeamType;
clone.ININame = iniName;
clone.Name = "Clone of " + Name;
clone.Name = Name + " (Clone)";

clone.EnabledTeamTypeFlags = new List<string>(EnabledTeamTypeFlags);

Expand Down
2 changes: 1 addition & 1 deletion src/TSMapEditor/Models/Trigger.cs
Expand Up @@ -105,7 +105,7 @@ public Trigger Clone(string uniqueId)
{
Trigger clone = (Trigger)MemberwiseClone();
clone.ID = uniqueId;
clone.Name = "Clone of " + Name;
clone.Name = Name + " (Clone)";

// Deep clone the events and actions

Expand Down

0 comments on commit c2d56bd

Please sign in to comment.