The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Yona-TYT on September 15, 2016, 04:59:59 PM

Title: [DONE] Show a message preview.
Post by: Yona-TYT 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.
(https://www.mediafire.com/convkey/4ab3/sd6gp8eviqhqn3f6g.jpg)
Title: Re: Show a message preview.
Post by: Dwachs 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.
Title: Re: Show a message preview.
Post by: Dwachs 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.
Title: Re: Show a message preview.
Post by: Yona-TYT on September 17, 2016, 10:10:45 AM
Thank you very much. ;D
Title: Re: [DONE] Show a message preview.
Post by: Yona-TYT 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?.
Title: Re: [DONE] Show a message preview.
Post by: Dwachs 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
Title: Re: [DONE] Show a message preview.
Post by: Yona-TYT on September 17, 2016, 02:39:42 PM
Quote from: Dwachs on September 17, 2016, 02:13:52 PM
check these functions

http://dwachs.github.io/simutrans-sqapi-doc/classgui.html (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. :-[
Title: Re: [DONE] Show a message preview.
Post by: Yona-TYT on October 07, 2016, 03:42:28 AM

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

(https://www.mediafire.com/convkey/34bc/5hsxhoblk2ii1v96g.jpg)
Title: Re: [DONE] Show a message preview.
Post by: Dwachs 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)
Title: Re: [DONE] Show a message preview.
Post by: Yona-TYT on October 07, 2016, 01:25:58 PM

Quote from: Dwachs 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)
This is for the tutorial scenario, I'm getting a little better things to make it easier. ;)
Title: Re: [DONE] Show a message preview.
Post by: Dwachs on October 07, 2016, 03:39:47 PM
works in r7891
Title: Re: [DONE] Show a message preview.
Post by: Yona-TYT on October 08, 2016, 02:45:35 PM
Thank you !.