The International Simutrans Forum

 

Author Topic: [patch] Show vehicle icon in pop-up windows  (Read 394 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1793
    • Simutrans-BLOG
  • Languages: ES
[patch] Show vehicle icon in pop-up windows
« on: August 20, 2021, 02:10:29 PM »
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.
« Last Edit: August 20, 2021, 08:12:37 PM by Yona-TYT »

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1793
    • Simutrans-BLOG
  • Languages: ES
Re: [patch] Show vehicle icon in pop-up windows
« Reply #1 on: August 20, 2021, 02:14:47 PM »
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
« Last Edit: August 20, 2021, 08:11:49 PM by Yona-TYT »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: [patch] Show vehicle icon in pop-up windows
« Reply #2 on: August 21, 2021, 12:01:40 PM »
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.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1793
    • Simutrans-BLOG
  • Languages: ES
Re: [patch] Show vehicle icon in pop-up windows
« Reply #3 on: August 21, 2021, 06:29:30 PM »
I 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?.
Code: [Select]
    else if (image != IMG_EMPTY) {
        create_win( new news_img(error, image), w_time_delete, magic_none );
    }