-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom statuses from mods for units #322
Comments
Maybe a new |
The intend of my initial idea was to not confuse other mods and game systems which may attempt to look for the current covert op. However thinking about this more, maybe we should take this a step further? Make something like
Pretty sure there can be other uses. As for how it can be implemented, we can take inspiration from Firaxis:
|
For the record: I spoke to robo on discord and he gave a very good reason to keep using |
Further to an earlier pull request, this change adds two extra events that allow mods to customise unit status strings. The first is 'OverridePersonnelStatus', which can override the status strings determined by `GetPersonnelStatusSeparate()`. The event takes the form: { ID: OverridePersonnelStatus, Data: [out string Status, out string TimeLabel, out int TimeNum, out int State, out bool HideTime], Source: Unit } The second event is 'OverridePersonnelStatusTime', which can override the time parts of the status, for example by converting days to hours or vice versa. The event takes the form: { ID: OverridePersonnelStatusTime, Data: [out string TimeLabel, out int TimeNum], Source: Unit } This commit also introduces a new config variable - CHHelpers.UseNewPersonnelStatusBehavior - that, when set, makes GetPersonnelStatus() go through GetPersonnelStatusSeparate(). This is to help ensure consistency between the two methods. Finally, GetStatusStringsSeparate() and GetMentalStateStringsSeparate() in XComGameState_Unit now trigger the 'OverridePersonnelStatusTime' event so that listeners can override how times are displayed in those cases.
Further to an earlier pull request, this change adds two extra events that allow mods to customise unit status strings. The first is 'OverridePersonnelStatus', which can override the status strings determined by `GetPersonnelStatusSeparate()`. The event takes the form: { ID: OverridePersonnelStatus, Data: [out string Status, out string TimeLabel, out int TimeNum, out int State, out bool HideTime], Source: Unit } The second event is 'OverridePersonnelStatusTime', which can override the time parts of the status, for example by converting days to hours or vice versa. The event takes the form: { ID: OverridePersonnelStatusTime, Data: [out string TimeLabel, out int TimeNum], Source: Unit } This commit also introduces a new config variable - CHHelpers.UseNewPersonnelStatusBehavior - that, when set, makes GetPersonnelStatus() go through GetPersonnelStatusSeparate(). This is to help ensure consistency between the two methods. Finally, GetStatusStringsSeparate() and GetMentalStateStringsSeparate() in XComGameState_Unit now trigger the 'OverridePersonnelStatusTime' event so that listeners can override how times are displayed in those cases.
Further to an earlier pull request, this change adds two extra events that allow mods to customise unit status strings. The first is 'OverridePersonnelStatus', which can override the status strings determined by `GetPersonnelStatusSeparate()`. The event takes the form: { ID: OverridePersonnelStatus, Data: [out string Status, out string TimeLabel, out int TimeNum, out int State, out bool HideTime], Source: Unit } The second event is 'OverridePersonnelStatusTime', which can override the time parts of the status, for example by converting days to hours or vice versa. The event takes the form: { ID: OverridePersonnelStatusTime, Data: [out string TimeLabel, out int TimeNum], Source: Unit } This commit also introduces a new config variable - CHHelpers.UseNewPersonnelStatusBehavior - that, when set, makes GetPersonnelStatus() go through GetPersonnelStatusSeparate(). This is to help ensure consistency between the two methods. Finally, GetStatusStringsSeparate() and GetMentalStateStringsSeparate() in XComGameState_Unit now trigger the 'OverridePersonnelStatusTime' event so that listeners can override how times are displayed in those cases.
Reopening because this needed bit of a redesign and the rewrite PR ended up more intrusive than initially expected. |
Further to an earlier pull request, this change adds two extra events that allow mods to customise unit status strings. The first is 'OverridePersonnelStatus', which can override the status strings determined by `GetPersonnelStatusSeparate()`. The event takes the form: { ID: OverridePersonnelStatus, Data: [out string Status, out string TimeLabel, out int TimeNum, out int State, out bool HideTime], Source: Unit } The second event is 'OverridePersonnelStatusTime', which can override the time parts of the status, for example by converting days to hours or vice versa. The event takes the form: { ID: OverridePersonnelStatusTime, Data: [out string TimeLabel, out int TimeNum], Source: Unit } This commit also introduces a new config variable - CHHelpers.UseNewPersonnelStatusBehavior - that, when set, makes GetPersonnelStatus() go through GetPersonnelStatusSeparate(). This is to help ensure consistency between the two methods. Finally, GetStatusStringsSeparate() and GetMentalStateStringsSeparate() in XComGameState_Unit now trigger the 'OverridePersonnelStatusTime' event so that listeners can override how times are displayed in those cases.
This change allows listeners more flexibility in what is displayed for the time value of a unit's status. For example, a percentage can be used in place of a time duration.
This change allows listeners more flexibility in what is displayed for the time value of a unit's status. For example, a percentage can be used in place of a time duration.
This change allows listeners more flexibility in what is displayed for the time value of a unit's status. For example, a percentage can be used in place of a time duration.
Implemented in 1.19 |
The specific function to change would be
GetStatusStringsSeparate
inXComGameState_Unit
, which conveniently is the one stop place the game has for knowing what kind of status string to deliver.By default it just checks projects and covert actions, but an event trigger for a tuple to come back with a string when applicable would allow for mods with unique strategy functions for units to give proper statuses of units interacting with them.
The text was updated successfully, but these errors were encountered: