Page 2 of 2

Re: Notifications (368)

Posted: 24 May 2018, 04:27
by Bearbear76
How to make your notifications into a question

To make a notification into a question add the following code to your JSON

Code: Select all

"question":true,
Default is false

Next add a function for what will happen depending on the response
For example:

Code: Select all

"ok fun":[{"actions":[{"type":"toast", "id":"I'm a toast!"}]
"cancel fun":[]
Ok fun is activated when the user pressed ok
cancel fun is activated when the user pressed cancel

By writing the following nothing will happen when pressed

Code: Select all

"cancel/ok fun":[]
Here is an example JSON

Code: Select all

[{
"id":"question_notify",
"type":"notification",
"frames":[{"bmp":"person.png"}],
"text":"would you like to see a toast?",
"question":true,
"ok fun":[{"actions":[{"type":"toast", "id":"I'm a toast!"}],
"cancel fun":[]
}]

Re: Notifications (368)

Posted: 04 Apr 2019, 22:16
by AngelPandaEarth
?

Re: Notifications (368)

Posted: 04 Apr 2019, 23:55
by CommanderABab

Code: Select all

"actions":[{}]
needs to be within a pair of

Code: Select all

{}
.

Re: Notifications (368)

Posted: 26 Oct 2019, 19:58
by KINGTUT10101
How can I add those optional tags like "show once" to a notification shown via Lua?

Re: Notifications (368)

Posted: 26 Oct 2019, 22:09
by JustAnyone
Yes.

Re: Notifications (368)

Posted: 26 Oct 2019, 22:20
by KINGTUT10101
That's helpful...

Re: Notifications (368)

Posted: 26 Oct 2019, 23:47
by JustAnyone

Re: Notifications (368)

Posted: 27 Oct 2019, 03:02
by KINGTUT10101
You sly dog :bt