From 5d356706f88a87a755dd8cad6f331706de107fae Mon Sep 17 00:00:00 2001 From: Dudekahedron <49531350+StanleyDudek@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:15:57 -0400 Subject: [PATCH] add picture examples to guihooks snippets --- docs/en/beamng/snippets.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/en/beamng/snippets.md b/docs/en/beamng/snippets.md index 502a66f5..46acc315 100644 --- a/docs/en/beamng/snippets.md +++ b/docs/en/beamng/snippets.md @@ -84,13 +84,21 @@ Here is a custom marker example from [BeamNG-FuelStations](https://github.com/Be ``` ### guihooks examples +#### Toast Notifications, Top right of screen +![image](https://github.com/StanleyDudek/Docs/assets/49531350/c8a87842-b95a-4eca-84dc-93072ecc9158) + ```lua --guihooks.trigger('toastrMsg', {type, title, msg, config = {timeOut}}) guihooks.trigger('toastrMsg', {type = "info", title = "Info Message:", msg = "Info Message Text Here", config = {timeOut = 5000}}) guihooks.trigger('toastrMsg', {type = "warning", title = "Warning Message:", msg = "Warning Message Text Here", config = {timeOut = 5000}}) guihooks.trigger('toastrMsg', {type = "error", title = "Error Message:", msg = "Error Message Text Here", config = {timeOut = 5000}}) +``` ---guihooks.trigger('Message', {msg, ttl, category, icon}) +#### Message notifications, top left of screen by default in Messages app +![image](https://github.com/StanleyDudek/Docs/assets/49531350/6baef813-50cb-43c3-9c59-0de550b014b6) + +```lua +--guihooks.trigger('Message', {msg, ttl, category, icon}) --requires Messages app guihooks.trigger('Message', {msg = "Message Text Here", ttl = 5.0, category = "arrow_upward", icon = "arrow_upward"}) guihooks.trigger('Message', {msg = "Message Text Here", ttl = 5.0, category = "arrow_downward", icon = "arrow_downward"}) guihooks.trigger('Message', {msg = "Message Text Here", ttl = 5.0, category = "flag", icon = "flag"}) @@ -103,7 +111,12 @@ guihooks.trigger('Message', {msg = "Message Text Here", ttl = 5.0, category = "s guihooks.trigger('Message', {msg = "Message Text Here", ttl = 5.0, category = "timeline", icon = "timeline"}) guihooks.trigger('Message', {msg = "Message Text Here", ttl = 5.0, category = "save", icon = "save"}) guihooks.trigger('Message', {msg = "Message Text Here", ttl = 5.0, category = "settings", icon = "settings"}) +``` +#### Center large or small display flash +![image](https://github.com/StanleyDudek/Docs/assets/49531350/d0cf754f-83f8-4d15-9159-27350da127de) +![image](https://github.com/StanleyDudek/Docs/assets/49531350/1df6fc9b-756f-484e-b8d9-5df346dc4c26) +```lua --guihooks.trigger('ScenarioFlashMessage', {{msg, ttl, sound, big}} ) -- requires RaceCountdown ui app guihooks.trigger('ScenarioFlashMessage', {{"Message", 5.0, 0, true}} ) guihooks.trigger('ScenarioFlashMessage', {{"Message Text Here", 5.0, 0, false}} ) @@ -116,7 +129,11 @@ guihooks.trigger('ScenarioFlashMessage', {{"GO!", 3.0, "Engine.Audio.playOnce('A --another sound example guihooks.trigger('ScenarioFlashMessage', {{"Teleported!", 3.0, "Engine.Audio.playOnce('AudioGui', 'event:UI_Checkpoint')", false}}) +``` +#### Center mid-size persistent display +![image](https://github.com/StanleyDudek/Docs/assets/49531350/6290e018-6b3d-4674-98f2-34282a723258) +```lua --guihooks.trigger('ScenarioRealtimeDisplay', {msg = msg} ) -- requires Race Realtime Display ui app guihooks.trigger('ScenarioRealtimeDisplay', {msg = "Message Text Here"} ) --these messages persist, clear with a blank string