Implement Dialog packet and add MP.ConfirmationDialog#427
Merged
Conversation
SaltySnail
approved these changes
Apr 12, 2025
Collaborator
SaltySnail
left a comment
There was a problem hiding this comment.
Cool feature, lgtm. Be sure to add the example code to the docs so people know how the format the packet
WiserTixx
added a commit
to BeamMP/BeamMP
that referenced
this pull request
Jun 26, 2025
# Dialog packet   This PR adds a new `D`ialog packet which takes json information to open BeamNG's confirmation dialog. HTML can be used to format the body and there are 2 styles available, `experimental` (warning) ` and ` (none/default). Server side PR BeamMP/BeamMP-Server#427
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
isCancelbeing true, settings this property to true causes the button's event to be called when the users pressedescto 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_idwill 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.