Skip to content

Add clone handling for clone-able entities#309

Merged
Rampastring merged 2 commits intoCnCNet:masterfrom
JoyfulShush:clone-naming-convention-increment-number
Apr 10, 2026
Merged

Add clone handling for clone-able entities#309
Rampastring merged 2 commits intoCnCNet:masterfrom
JoyfulShush:clone-naming-convention-increment-number

Conversation

@JoyfulShush
Copy link
Copy Markdown
Contributor

Introduce Helpers.HandleCloneNaming to centralize clone naming behavior: if a name contains a number, the first numeric part is incremented. Otherwise a localized " (Clone)" suffix is appended.

Update AITriggerType, Script, TaskForce, TeamType, and Trigger to use the new helper instead of hardcoded string for each entity.

Add/update the CloneName translation key in English and zh-Hans (consolidating previous per-type entries) to support localization.

Introduce Helpers.HandleCloneNaming to centralize clone naming behavior: if a name contains a number the first numeric part is incremented; otherwise a localized " (Clone)" suffix is appended. Replace ad-hoc Name + Translate(...) usages in AITriggerType, Script, TaskForce, TeamType, and Trigger to use the new helper. Add/update the "CloneName" translation key in English and zh-Hans (consolidating previous per-type entries) to support localization.
Copy link
Copy Markdown
Member

@Rampastring Rampastring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, needs a couple small changes.

@Rampastring Rampastring merged commit 1078690 into CnCNet:master Apr 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants