-
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
Implement new override event for starting region eligibility hook #1304
Implement new override event for starting region eligibility hook #1304
Conversation
e5e5a02
to
9a3d6ab
Compare
X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_RegionLink.uc
Outdated
Show resolved
Hide resolved
X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_RegionLink.uc
Outdated
Show resolved
Hide resolved
/// NewGameState: none | ||
/// ``` | ||
// | ||
// **NOTE** This function is public so that it can be called from `XComGameState_WorldRegion`. |
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.
You can still make it final
.
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.
done
54b90dd
to
fdb2876
Compare
b3d556e
to
cbb869a
Compare
@@ -228,10 +228,13 @@ static function RandomizeLinks(XComGameState StartState) | |||
} | |||
|
|||
//--------------------------------------------------------------------------------------- | |||
static function bool IsEligibleStartRegion(XComGameState StartState, XComGameState_WorldRegion RegionState) | |||
static final function bool IsEligibleStartRegion(XComGameState StartState, XComGameState_WorldRegion RegionState) |
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.
Sorry, I wasn't clear enough. You can't change the function definition of a function that already exists, especially one that's not a private Highlander API. I meant making the TriggerOverrideEligibleStartingRegion()
final.
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.
Fixed
|
||
// Start Issue #1303 | ||
/// HL-Docs: feature:OverrideEligibleStartingRegion; issue:1303; tags:strategy | ||
// |
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.
Missing a third /
? Or just remove the line.
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.
Removed
Fix review comments Fix doc errors Implement new override event for starting region eligibility hook Fixes issue X2CommunityCore#1303 Mark function final
cbb869a
to
678fcec
Compare
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 119ff6b..03d8f1b 100644
--- a/target/CHL_Event_Compiletest.uc
+++ b/target/CHL_Event_Compiletest.uc
@@ -506,6 +506,24 @@ static function EventListenerReturn OnOverrideDisableReinforcementsFlare(Object
return ELR_NoInterrupt;
}
+static function EventListenerReturn OnOverrideEligibleStartingRegion(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
+{
+ local XComGameState_WorldRegion PotentialStartRegion;
+ local XComLWTuple Tuple;
+ local bool ValidStartRegion;
+
+ PotentialStartRegion = XComGameState_WorldRegion(EventSource);
+ Tuple = XComLWTuple(EventData);
+
+ ValidStartRegion = Tuple.Data[0].b;
+
+ // Your code here
+
+ Tuple.Data[0].b = ValidStartRegion;
+
+ return ELR_NoInterrupt;
+}
+
static function EventListenerReturn OnOverrideEncounterZoneAnchorPoint(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
local XComGameState_AIGroup AIGroup;
What? (click to expand)The Highlander documentation tool generates event listener examples from event specifications. |
// public API. Backwards compatibility is not guaranteed. | ||
|
||
static final function bool TriggerOverrideEligibleStartingRegion( | ||
XComGameState StartState, |
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.
Any particular reason you have StartState as a function argument but don't use it?
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.
Removed the cargo cult
Fix review comments Fix doc errors Implement new override event for starting region eligibility hook Fixes issue X2CommunityCore#1303 Mark function final
…Tedster59/X2WOTCCommunityHighlander into 1303-improved-geoscape-creation
Closing this and re-opening with a different branch in #1309 to fix github commit issues |
Fixes issue #1303 using option #1 of an override event to allow mods to override the behavior of this function.