News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

[patch] Show vehicle icon in pop-up windows

Started by Yona-TYT, August 20, 2021, 02:10:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

This is something I always wanted to use in scripts. It's not a big deal, just get the image of the vehicle from a text (As is done with the coordinates). It's just an experiment, it still works.  :D   

Edit.
Update: move "get_image_from_text" to siemens.

Yona-TYT

#1
I apologize, my bad internet connection made me post twice on the same topic.  :-[   
Edit.
Remove this: https://forum.simutrans.com/index.php/topic,21076.msg196554.html#msg196554

prissi

This is really a bad hack. I would rather add a second default image paramter to the message box opning call, and then pass the text there. This way you would show the image and a meaningful text. But for such a repurposed vehicle message seems better.

Yona-TYT

Quote from: prissi on August 21, 2021, 12:01:40 PMI would rather add a second default image paramter to the message box opning call, and then pass the text there.

Are you referring to this?.
    else if (image != IMG_EMPTY) {
        create_win( new news_img(error, image), w_time_delete, magic_none );
    }