News:

Congratulations!
 You've won the News Item Lottery! Your prize? Reading this news item! :)

Pop-ups why not ?.

Started by Yona-TYT, October 02, 2016, 03:34:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT




I had mentioned this here: http://forum.simutrans.com/index.php?topic=15748.msg154543#msg154543  ;)


I always thought that this was possible, but when I started to experiment with the script, I found that there is no practical way to show pop-ups.


Perhaps there is a good reason for this is not it ?.  ???




DrSuperGood

Quote
Perhaps there is a good reason for this is not it ?.
The game currently lacks the functionality for popups like confirmations. Additionally anything that requires user input to make a logical decision (eg for scripting) requires net synchronization of the input events so that the same decision can be made on the same frame across all clients.

Dwachs

What are you trying to achieve? Just presenting a pop-up message?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on October 02, 2016, 11:47:40 AM
Just presenting a pop-up message?
Yes, display a pop-up message only.

Dwachs

Please try the new r7890. Please download the complete package (you need updated base scripts).

The method gui.add_message will send messages to all players, these messages land in the message center -> scneario.
In order to work properly (message get colored by player color), you need to set scenario.api to

scenario.api = "120.2"
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on October 06, 2016, 08:24:12 PM
Please try the new r7890. Please download the complete package (you need updated base scripts).

The method gui.add_message will send messages to all players, these messages land in the message center -> scneario.
In order to work properly (message get colored by player color), you need to set scenario.api to

scenario.api = "120.2"


Thank you very much :thumbsup: [size=78%], but the truth I was referring to a simple warning window, such as return of "is_work_allowed_here (pl, tool_id, pos)" but can be called without having to make click. (as a print ()).[/size]


I want to use in the tutorial.

Yona-TYT

I do not know if this is possible, but it would be good to add a new parameter that allows to configure the display mode, zero can be the default value. ;)




Dwachs

I do not understand: add parameter to what? with which goal? what do you mean by display mode?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on January 18, 2017, 07:22:16 PM
add parameter to what?
To "gui.add_message"
Quote from: Dwachs on January 18, 2017, 07:22:16 PM
with which goal?
Choose how to display the message:
0-> Nothing changes.
1-> Is Displayed in the status bar.
2-> Is Displayed in a temporary window.
3-> Is Displayed in a permanent window.

An_dz

I thought the script could choose where to show the message, like:

show_msg(string msg, int place)

place = 0 // permanent window
place = 1 // temp window
place = 2 // ticker