Implement Dialog packet and add MP.ConfirmationDialog #427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a new lua function and packet used for sends dialogs to the client.
Example:
BeamNG.drive.x64_kX4w6Kaly9.mp4
Example serverside code:
Details:
Each dialog can have multiple buttons, each button having it's own callback event (
key
).Each dialog can also have one button with
isCancel
being true, settings this property to true causes the button's event to be called when the users pressedesc
to exit out of the dialog. If a dialog is created without any button being the cancel button then the user will only be able to exit the dialog by restarting the session or pressing one of the buttons.interaction_id
will be sent as the event data with a button press event, to track from which dialog the button press came. As when multiple dialogs are opened they will stack and it will become difficult to track what button on which dialog was pressed without having multiple event handlers.Waiting on BeamMP/BeamMP#715 to be merged.
By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion.
I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.