The International Simutrans Forum

 

Author Topic: [tutorial] Using the information bar  (Read 589 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
[tutorial] Using the information bar
« on: November 19, 2018, 06:15:21 AM »
I would like to give the player the information he needs to advance to the next step at all times, the best way to do this is by using the information bar. The problem is that the window configuration for scenarios is by default [off].

Why not activate the information bar for scenario messages, or at least do it from the scrip ?.

On the other hand, it would be very useful to be able to use links in the information bar, for example: A link that allows me to show the window of the scenario.

It would be nice to be able to give more use to that informative bar.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1151
  • PAK-DEV P192C
  • Languages: DE, EN
Re: [tutorial] Using the information bar
« Reply #1 on: November 19, 2018, 08:40:06 AM »
Three thoughts:
1.) Is the newsticker, a location where the message disappears on it's own, really the best position for information that's supposed to be permanently on screen?
2.) If you intend to display the message in a loop, wouldn't that be really annoying if you were to use different display settings?

3.) This could be combined with requests for a chat feature. If there was a chat similar to basically every other game, you could always have it display the last few messages/lines in the bottom left corner. Rather than using the newsticker, the scenario could be allowed to send a chat message, which would then always be visible - at least in singleplayer games.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: [tutorial] Using the information bar
« Reply #2 on: November 19, 2018, 10:09:50 AM »
Quote
1.) Is the newsticker, a location where the message disappears on it's own, really the best position for information that is supposed to be permanently on screen?
It's the only way, "Pop-.up" windows are very annoying.
Quote
2.) If you intend to display the message in a loop, wouldn't that be really annoying if you were to use different display settings?
I do not think that's a problem.
Quote
3.) This could be combined with requests for a chat feature. If there was a chat similar to basically every other game, you could always have it display the last few messages/lines in the bottom left corner. Rather than using the newsticker, the scenario could be allowed to send a chat message, which would then always be visible - at least in singleplayer games.
I have always wanted a window of information that appears in a lower corner and that hidden auomaticamente like that of open-ttd and other simulation games, but with the limited interface of simutrans, I doubt that this happens.


Offline Leartin at

  • Devotee
  • *
  • Posts: 1151
  • PAK-DEV P192C
  • Languages: DE, EN
Re: [tutorial] Using the information bar
« Reply #3 on: November 19, 2018, 11:00:24 AM »
It's the only way, "Pop-.up" windows are very annoying.[...]I do not think that's a problem.
I agree that the newsticker is a better place than popups, but you would need to ignore the users message settings, such that it's displayed in the ticker even if all messages are off, and not displayed as a popup even if that option is on. I don't think it's hard to do, but there are definitelly people who value their ability to decide whether and how messages are shown over the artistic expression of a scenario authors. I'm pointing it out for awareness, that's all.


I have always wanted a window of information that appears in a lower corner and that hidden auomaticamente like that of open-ttd and other simulation games, but with the limited interface of simutrans, I doubt that this happens.
I mostly mentioned it for completions sake, not because I think it will be done (or has higher priority than other suggestions). I just like it when different suggestions compliment each other, rather then implementing several instances of a noncoherent minimum (which is still better than nothing, though)

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: [tutorial] Using the information bar
« Reply #4 on: November 19, 2018, 05:57:48 PM »
I like using "ticker::add_msg(text, pos, colorval);"  for show the message directly.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9411
  • Languages: De,EN,JP
Re: [tutorial] Using the information bar
« Reply #5 on: November 20, 2018, 01:56:21 AM »
The message bar is the wrong place for permanent messages. People may go to toilet and then miss it. Also identical messages may not displayed more than once, if it is already in the history. This was added to avoid cluttering the histroy bar.

Also there is the message history in the message window. Having tons of identical messages there is pointless. No, I think one should respect the user settings.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: [tutorial] Using the information bar
« Reply #6 on: November 21, 2018, 01:01:59 PM »
This function to display a message without saturating the mailbox list and displayed directly:



//api_gui.cc
Code: [Select]
#include "../../simticker.h"




void_t add_newsticker(const char* text, koord pos )
{
   if (text) {
      ticker::add_msg(text, pos,  color_idx_to_rgb(COL_BLACK));
   }
   return void_t();
   
}




STATIC register_method(vm, add_newsticker, "add_newsticker");


This does not require having the mailbox configuration activated. ;) 

Edit .
I need help to get the coordinates (koor) from a text string. :-[


« Last Edit: November 21, 2018, 01:14:44 PM by Yona-TYT »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4555
  • Languages: EN, DE, AT
Re: [tutorial] Using the information bar
« Reply #7 on: November 21, 2018, 02:26:46 PM »
Something like this will not be included. There is the message system. The user then can control, where these messages appear.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: [tutorial] Using the information bar
« Reply #8 on: November 21, 2018, 04:33:11 PM »

Something like this will not be included. There is the message system. The user then can control, where these messages appear.

And what would be the way forward to achieve this ?.[