Author Topic: Pop-ups why not ?.  (Read 1822 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

Pop-ups why not ?.
« on: October 02, 2016, 03:34:02 AM »



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 ?.  ???




Offline DrSuperGood

Re: Pop-ups why not ?.
« Reply #1 on: October 02, 2016, 06:29:04 AM »
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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4251
  • Total likes: 177
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Pop-ups why not ?.
« Reply #2 on: October 02, 2016, 11:47:40 AM »
What are you trying to achieve? Just presenting a pop-up message?
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: Pop-ups why not ?.
« Reply #3 on: October 02, 2016, 06:52:02 PM »
Just presenting a pop-up message?
Yes, display a pop-up message only.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4251
  • Total likes: 177
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Pop-ups why not ?.
« Reply #4 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
Code: [Select]
scenario.api = "120.2"
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: Pop-ups why not ?.
« Reply #5 on: October 08, 2016, 02:59:30 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
Code: [Select]
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.

Offline Yona-TYT

Re: Pop-ups why not ?.
« Reply #6 on: January 18, 2017, 01:34:51 PM »
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. ;)




Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4251
  • Total likes: 177
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Pop-ups why not ?.
« Reply #7 on: January 18, 2017, 07:22:16 PM »
I do not understand: add parameter to what? with which goal? what do you mean by display mode?
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: Pop-ups why not ?.
« Reply #8 on: January 18, 2017, 08:51:45 PM »
add parameter to what?
To "gui.add_message"
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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2594
  • Total likes: 290
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Pop-ups why not ?.
« Reply #9 on: January 22, 2017, 04:06:18 PM »
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