Skip to content

Commit d0bf1aa

Browse files
committed
Add map issue check for a difficulty-specific trigger enabling a trigger of a different difficulty level
1 parent 55b8a7a commit d0bf1aa

File tree

5 files changed

+580
-456
lines changed

5 files changed

+580
-456
lines changed

src/TSMapEditor/Config/Translations/en/Translation_en.ini

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,37 @@ Map.CheckForIssues.DuplicateHouseININame=The map has multiple houses named "{0}"
113113
Map.CheckForIssues.TeamTypeWithoutTaskForce=TeamType "{0}" has no TaskForce set!
114114
Map.CheckForIssues.TeamTypeWithoutScript=TeamType "{0}" has no Script set!
115115
Map.CheckForIssues.ScriptTooManyActions="Script '{0}' has more than {1} actions, which is not supported by the game. Consider organizing your script actions or splitting it to multiple scripts."
116-
CheckForIssues.TriggerDisabled=Trigger "{0}" ({1}) is disabled and never enabled by another trigger.@Did you forget to enable it? If the trigger exists for debugging purposes, add DEBUG or OBSOLETE to its name to skip this warning.
117-
CheckForIssues.TriggerEnabledByOtherTriggers=Trigger "{0}" ({1}) is enabled by another trigger, but it is never in a disabled state@(it is neither disabled by default nor disabled by other triggers). Did you forget to disable it?
118-
CheckForIssues.TriggerEnableSelf=Trigger "{0}" ({1}) has an action for enabling itself. Is it supposed to enable something else instead?
119-
CheckForIssues.PlayerHouseNotFound=A nonexistent house has been specified in [Basic] Player= .
120-
CheckForIssues.PlayerHouseNotPlayerControlled=The human player's house does not have the "Player-Controlled" flag checked.
121-
CheckForIssues.MaxTubesExceeded=The map has more than {0} tunnel tubes. This might cause issues when units cross the tunnels.
122-
CheckForIssues.UnitFollowsMultipleUnits=Multiple units are configured to make unit {0} at {1} to follow them!@This can cause strange behaviour in the game. {2} at {3} is one of the followed units.
123-
CheckForIssues.NegativeFollowerID=Unit {0} at {1} has a follower ID below -1. It is unknown how the game reacts to this.
124-
CheckForIssues.UnitFollowSelf=Unit {0} at {1} follows itself! This can cause the game to crash or freeze!
125-
CheckForIssues.NoTriggerConditions=Trigger '{0}' has 0 events specified. It will never be fired. Did you forget to give it events?
126-
CheckForIssues.NoTriggerActions=Trigger '{0}' has 0 actions specified. It will not do anything. Did you forget to give it actions?
127-
CheckForIssues.TriggerEnteredByNoObjects=Trigger '{0}' is using the "Entered by..." event without being attached to any object, cell, or team. Did you forget to attach it?
128-
CheckForIssues.TriggerBridgeDestroyedNoCellTags=Trigger '{0}' is using the "Bridge destroyed" event, but it is not attached to any CellTag. Did you forget to place a celltag for it?
129-
CheckForIssues.TriggerEventNoObjectAttached=Trigger '{0}' is using the {1} event without being attached to any object or team. Did you forget to attach it?
130-
CheckForIssues.TriggerAttachedToSelf=Trigger '{0}' is attached to itself (potentially through other triggers). This will cause the game to crash!
131-
CheckForIssues.InvalidTriggerActionTeamType=Trigger '{0}' has a nonexistent TeamType specified as a parameter for one or more of its actions.
132-
CheckForIssues.InvalidTriggerActionHouse=Trigger '{0}' has a nonexistent HouseType specified as a parameter for one or more of its actions.
133-
CheckForIssues.InvalidTriggerOwner=Trigger '{0}' has a nonexistent HouseType '{1}' specified as its owner.
134-
CheckForIssues.TriggerTooManyActions=Trigger '{0}' has more than {1} actions! This can cause the game to crash! Consider splitting it up to multiple triggers.
135-
CheckForIssues.SpecialWaypointUsed=The map makes use of waypoint #{0}. In Tiberian Sun, this waypoint is reserved for special use cases (WAYPT_SPECIAL). Using it as a normal waypoint may cause issues as it may be dynamically moved by game events.
136-
CheckForAITriggerTeamWithMaxZeroIssue.TeamTypeMax=Team '{0}', linked to AITrigger '{1}', has Max=0. This prevents the AI from building the team.
116+
Map.CheckForIssues.TriggerDisabled=Trigger "{0}" ({1}) is disabled and never enabled by another trigger.@Did you forget to enable it? If the trigger exists for debugging purposes, add DEBUG or OBSOLETE to its name to skip this warning.
117+
Map.CheckForIssues.TriggerEnabledByOtherTriggers=Trigger "{0}" ({1}) is enabled by another trigger, but it is never in a disabled state@(it is neither disabled by default nor disabled by other triggers). Did you forget to disable it?
118+
Map.CheckForIssues.TriggerEnableSelf=Trigger "{0}" ({1}) has an action for enabling itself. Is it supposed to enable something else instead?
119+
Map.CheckForIssues.PlayerHouseNotFound=A nonexistent house has been specified in [Basic] Player= .
120+
Map.CheckForIssues.PlayerHouseNotPlayerControlled=The human player's house does not have the "Player-Controlled" flag checked.
121+
Map.CheckForIssues.MaxTubesExceeded=The map has more than {0} tunnel tubes. This might cause issues when units cross the tunnels.
122+
Map.CheckForIssues.UnitFollowsMultipleUnits=Multiple units are configured to make unit {0} at {1} to follow them!@This can cause strange behaviour in the game. {2} at {3} is one of the followed units.
123+
Map.CheckForIssues.NegativeFollowerID=Unit {0} at {1} has a follower ID below -1. It is unknown how the game reacts to this.
124+
Map.CheckForIssues.UnitFollowSelf=Unit {0} at {1} follows itself! This can cause the game to crash or freeze!
125+
Map.CheckForIssues.NoTriggerConditions=Trigger '{0}' has 0 events specified. It will never be fired. Did you forget to give it events?
126+
Map.CheckForIssues.NoTriggerActions=Trigger '{0}' has 0 actions specified. It will not do anything. Did you forget to give it actions?
127+
Map.CheckForIssues.TriggerEnteredByNoObjects=Trigger '{0}' is using the "Entered by..." event without being attached to any object, cell, or team. Did you forget to attach it?
128+
Map.CheckForIssues.TriggerBridgeDestroyedNoCellTags=Trigger '{0}' is using the "Bridge destroyed" event, but it is not attached to any CellTag. Did you forget to place a celltag for it?
129+
Map.CheckForIssues.TriggerEventNoObjectAttached=Trigger '{0}' is using the {1} event without being attached to any object or team. Did you forget to attach it?
130+
Map.CheckForIssues.TriggerAttachedToSelf=Trigger '{0}' is attached to itself (potentially through other triggers). This will cause the game to crash!
131+
Map.CheckForIssues.InvalidTriggerActionTeamType=Trigger '{0}' has a nonexistent TeamType specified as a parameter for one or more of its actions.
132+
Map.CheckForIssues.InvalidTriggerActionHouse=Trigger '{0}' has a nonexistent HouseType specified as a parameter for one or more of its actions.
133+
Map.CheckForIssues.InvalidTriggerOwner=Trigger '{0}' has a nonexistent HouseType '{1}' specified as its owner.
134+
Map.CheckForIssues.TriggerTooManyActions=Trigger '{0}' has more than {1} actions! This can cause the game to crash! Consider splitting it up to multiple triggers.
135+
Map.CheckForIssues.SpecialWaypointUsed=The map makes use of waypoint #{0}. In Tiberian Sun, this waypoint is reserved for special use cases (WAYPT_SPECIAL). Using it as a normal waypoint may cause issues as it may be dynamically moved by game events.
136+
Map.CheckForAITriggerTeamWithMaxZeroIssue.TeamTypeMax=Team '{0}', linked to AITrigger '{1}', has Max=0. This prevents the AI from building the team.
137+
Map.CheckForIssues.MismatchedDifficultyForEnableTrigger=The trigger "{0}" has "{1}" as its difficulty level, but it enables a trigger "{2}" which has "{3}" as its difficulty.
138+
139+
; *************************************************
140+
; Difficulty
141+
; *************************************************
142+
143+
Difficulty.None=None
144+
Difficulty.Easy=Easy
145+
Difficulty.Medium=Medium
146+
Difficulty.Hard=Hard
137147

138148
; *************************************************
139149
; EditorMessageBox

src/TSMapEditor/Helpers.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,5 +782,22 @@ public static IniFileEx ReadConfigINIEx(string path, CCFileManager fileManager)
782782

783783
return new IniFileEx(defaultPath, fileManager);
784784
}
785+
786+
public static string DifficultyToTranslatedString(Difficulty difficulty)
787+
{
788+
switch (difficulty)
789+
{
790+
case Difficulty.None:
791+
return Translate("Difficulty.None", "None");
792+
case Difficulty.Easy:
793+
return Translate("Difficulty.Easy", "Easy");
794+
case Difficulty.Medium:
795+
return Translate("Difficulty.Medium", "Medium");
796+
case Difficulty.Hard:
797+
return Translate("Difficulty.Hard", "Hard");
798+
default:
799+
throw new NotImplementedException(nameof(DifficultyToTranslatedString) + ": Unknown difficulty level " + difficulty);
800+
}
801+
}
785802
}
786803
}

0 commit comments

Comments
 (0)