-
Notifications
You must be signed in to change notification settings - Fork 3
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 autosplitters to set LiveSplit CustomVariables #16
base: master
Are you sure you want to change the base?
Conversation
@@ -55,6 +55,7 @@ public Runtime( | |||
SetGameTimeDelegate setGameTime, | |||
Action pauseGameTime, | |||
Action resumeGameTime, | |||
SetCustomVariableDelegate setCustomVariable, |
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.
This constructor is a public API. Adding this parameter is a breaking change.
@@ -667,6 +669,7 @@ internal Widgets(IntPtr ptr) : base(ptr) { } | |||
|
|||
public delegate int StateDelegate(); | |||
public delegate void SetGameTimeDelegate(long gameTime); | |||
public delegate void SetCustomVariableDelegate(IntPtr namePtr, UIntPtr nameLen, IntPtr valuePtr, UIntPtr valueLen); |
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.
Do not place delegates inside classes.
Is passing a Func<IntPtr, UIntPtr, IntPtr, UIntPtr>
as set_custom_variable
not possible?
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.
Now that the other delegates have been moved outside, I've moved SetCustomVariableDelegate
outside as well, next to them.
@@ -684,6 +687,7 @@ public static extern IntPtr Runtime_new( | |||
SetGameTimeDelegate set_game_time, | |||
Action pause_game_time, | |||
Action resume_game_time, | |||
SetCustomVariableDelegate set_custom_variable, |
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.
This method is a public API. Adding this parameter is a breaking change.
e6e9586
to
087050c
Compare
ed75f2b
to
1ed23b5
Compare
true is more correct, C# should support those just fine
1ed23b5
to
2aaa4dc
Compare
2aaa4dc
to
54e8d03
Compare
By the way, is the |
Not as of now... but it is formulaic for similar ffi bridge reasons. It's possible parts of it could be made to be generated in the future, but I don't know whether it would be worth the effort. |
A companion PR to LiveSplit/LiveSplit#2528. Depends on #15. Allows autosplitters to set the LiveSplit CustomVariables.