Tixx add0b86b37
Implement Dialog packet and add MP.ConfirmationDialog (#427)
This PR implements a new lua function and packet used for sends dialogs
to the client.

## Example:


https://github.com/user-attachments/assets/97bb5813-ea12-4b1d-a049-2f7ebf6b6da3

Example serverside code:
```lua
--MP.ConfirmationDialog(player_id: number, title: string, body: string, buttons: object, interaction_id: string, warning: boolean = false, reportToServer: boolean = true, reportToExtensions: boolean = true)

function onChatMessage(player_id, player_name, message)
    MP.ConfirmationDialog(player_id, "Warning", "Watch your tone buddy!!", 
        {
            {
                label = "OK",
                key = "dialogOK",
                isCancel = true
            }
        }, "interactionID", true)
end

MP.RegisterEvent("onChatMessage", "onChatMessage")


function dialogOK(player_id, interaction_id)
    MP.SendChatMessage(-1, MP.GetPlayerName(player_id) .. " clicked OK")
end

MP.RegisterEvent("dialogOK", "dialogOK")
```

### 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 pressed `esc` 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 https://github.com/BeamMP/BeamMP/pull/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.
2025-06-26 06:52:18 +02:00
..
2024-01-23 21:00:11 +01:00
2024-01-23 21:00:11 +01:00
2024-06-26 14:06:06 +02:00
2025-01-25 22:16:06 +01:00
2025-06-21 20:32:25 +02:00
2024-01-23 21:00:11 +01:00
2024-01-23 21:00:11 +01:00
2024-05-15 12:54:50 +02:00
2024-01-23 21:00:11 +01:00
2025-05-17 01:04:55 +02:00
2024-01-23 21:00:11 +01:00
2025-01-11 22:18:50 +01:00
2024-01-23 21:00:11 +01:00
2024-06-26 14:06:06 +02:00
2025-01-11 22:18:19 +01:00
2024-06-26 14:06:06 +02:00
2025-03-15 20:45:48 +01:00
2024-01-23 21:00:11 +01:00
2024-05-15 12:57:08 +02:00
2024-05-21 13:40:33 +02:00
2025-06-21 20:32:25 +02:00
2024-01-23 21:00:11 +01:00
2024-01-23 21:00:11 +01:00
2024-06-26 14:06:06 +02:00
2025-04-01 09:43:49 +02:00
2024-01-23 21:00:11 +01:00
2024-01-23 21:00:11 +01:00
2025-01-25 22:16:06 +01:00