-
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
Add event for overriding resistance faction icon #1134 #1136
Add event for overriding resistance faction icon #1134 #1136
Conversation
Pull request modifies event listener templates Difference (click to expand)diff --git a/target/CHL_Event_Compiletest.uc b/target/CHL_Event_Compiletest.uc
index 6a129ae..c229218 100644
--- a/target/CHL_Event_Compiletest.uc
+++ b/target/CHL_Event_Compiletest.uc
@@ -919,6 +919,27 @@ static function EventListenerReturn OnOverrideShowPromoteIcon(Object EventData,
return ELR_NoInterrupt;
}
+static function EventListenerReturn OnOverrideStackedClassIcon(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
+{
+ local XComGameState_Unit UnitState;
+ local XComLWTuple Tuple;
+ local array<string> Images;
+ local bool bInvertImage;
+
+ UnitState = XComGameState_Unit(EventSource);
+ Tuple = XComLWTuple(EventData);
+
+ Images = Tuple.Data[0].as;
+ bInvertImage = Tuple.Data[1].b;
+
+ // Your code here
+
+ Tuple.Data[0].as = Images;
+ Tuple.Data[1].b = bInvertImage;
+
+ return ELR_NoInterrupt;
+}
+
static function EventListenerReturn OnOverrideTotalNumKills(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
local XComGameState_Unit UnitState;
What? (click to expand)The Highlander documentation tool generates event listener examples from event specifications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In many places where you changed FactionState.GetFactionIcon()
to UnitState.GetResistanceFactionIcon()
, said code is wrapped into if (FactionState != none)
- rending the feature useless for non-faction soldiers.
Instead, you should store the result of UnitState.GetResistanceFactionIcon()
and change the checks to if (FactionIcon.Images.Length > 0)
X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Unit.uc
Outdated
Show resolved
Hide resolved
X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Unit.uc
Outdated
Show resolved
Hide resolved
Not opposed to changing the check, but was curious your thoughts on it. Originally that icon was only related to faction heroes, so this change would be expanding the functionality and I am wanting to make sure we're good with that. |
While I understand the history behind the current setup, I think it's a disservice to the overall flexibility of the system - IMO they should've just converted all icons to stacked (albeit with a single item for traditional class icons). As such, I think it's a good idea to allow the stacked icons to be usable for normal soldiers |
Updated the logic to make the event more generic so that non-hero soldiers can get the same benefit for having a stacked class icon instead of a flat class icon if a class author so wishes it. Also cleaned up the other couple of small asks. |
X2WOTCCommunityHighlander/Src/XComGame/Classes/UIAfterAction_ListItem.uc
Show resolved
Hide resolved
X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Unit.uc
Outdated
Show resolved
Hide resolved
Please force push this branch so that there is 1 commit for adding game files and 1 commit for all the changes |
b27c02b
to
20eac22
Compare
Flattened the commit and fixed documentation. |
This is for issue #1134 which will allow mods to override the resistance faction icon when using custom hero classes.