Author Topic: [DONE] Show a message preview.  (Read 1519 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

[DONE] Show a message preview.
« on: September 15, 2016, 04:59:59 PM »



Do not know if this is possible but I would like to show a preview when coordinates are entered in a message.


I want to use this in the "is_work_allowed_here" when a warning message is returned.


It is the same behavior you see in the chat.
« Last Edit: September 17, 2016, 10:45:06 AM by Dwachs »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4224
  • Total likes: 168
  • Helpful: 148
  • Languages: EN, DE, AT
Re: Show a message preview.
« Reply #1 on: September 16, 2016, 06:19:07 AM »
This is possible to implement, but not easy: The return value of is_allowed_* are just text, which is displayed as an error message. No markup possible (right now). The chat messages use a different system.
Parsley, sage, rosemary, and maggikraut.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4224
  • Total likes: 168
  • Helpful: 148
  • Languages: EN, DE, AT
Re: Show a message preview.
« Reply #2 on: September 17, 2016, 09:40:20 AM »
This is now possible with r7880. Syntax as in chat messages: @12,34 or (12,34). Use coord_to_string to get the right coordinate when map is rotated.
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: Show a message preview.
« Reply #3 on: September 17, 2016, 10:10:45 AM »
Thank you very much. ;D

Offline Yona-TYT

Re: [DONE] Show a message preview.
« Reply #4 on: September 17, 2016, 10:50:59 AM »
@Dwachs, Where you can call it a print("")? (For a moment I thought that "print()" was used to show pop-up. :o )


Better said, how I can display a pop-up?, Is there a function?.
« Last Edit: September 17, 2016, 12:53:10 PM by Yona-TYT »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4224
  • Total likes: 168
  • Helpful: 148
  • Languages: EN, DE, AT
Re: [DONE] Show a message preview.
« Reply #5 on: September 17, 2016, 02:13:52 PM »
check these functions

http://dwachs.github.io/simutrans-sqapi-doc/classgui.html

they do not work in network games
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: [DONE] Show a message preview.
« Reply #6 on: September 17, 2016, 02:39:42 PM »
check these functions

http://dwachs.github.io/simutrans-sqapi-doc/classgui.html

they do not work in network games
If I had already noticed that, the problem is that it will not display a pop-up until the player configure. :-[

Offline Yona-TYT

Re: [DONE] Show a message preview.
« Reply #7 on: October 07, 2016, 03:42:28 AM »

@Dwachs
It does not work with "is_waystop_correct(player,schedule,nr,load,wait,coord)".

« Last Edit: October 07, 2016, 04:06:01 AM by Yona-TYT »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4224
  • Total likes: 168
  • Helpful: 148
  • Languages: EN, DE, AT
Re: [DONE] Show a message preview.
« Reply #8 on: October 07, 2016, 05:31:11 AM »
edit: you mean the error messages of is_schedule_allowed? That should be easily possible.

(is_schedule_allowed still does not work in network games)
« Last Edit: October 07, 2016, 05:52:22 AM by Dwachs »
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: [DONE] Show a message preview.
« Reply #9 on: October 07, 2016, 01:25:58 PM »

edit: you mean the error messages of is_schedule_allowed? That should be easily possible.

(is_schedule_allowed still does not work in network games)
This is for the tutorial scenario, I'm getting a little better things to make it easier. ;)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4224
  • Total likes: 168
  • Helpful: 148
  • Languages: EN, DE, AT
Re: [DONE] Show a message preview.
« Reply #10 on: October 07, 2016, 03:39:47 PM »
works in r7891
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: [DONE] Show a message preview.
« Reply #11 on: October 08, 2016, 02:45:35 PM »
Thank you !.