The International Simutrans Forum

 

Author Topic: Possibility to seperate the track menu in two menus.  (Read 2893 times)

0 Members and 1 Guest are viewing this topic.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1151
  • PAK-DEV P192C
  • Languages: DE, EN
Possibility to seperate the track menu in two menus.
« on: March 22, 2015, 01:17:06 PM »
In this case, I'll tell you what I want to do, rather than how I want to do it, since there are surely multiple ways to achieve it.

In pak192.comic, we currently have a track menu and a tram menu. However, while the tram menu and tram depot are quite empty in comparison, the track menu and track depot are quite full. Besides that, we feel like it would make more sense to have light rail and light metro together with trams, and in general rails, bridges and tunnels would look quite differently whether they are on the countryside or in cities.
So we play around with the idea of creating an "ÖPNV"-menu instead of the tram menu, where ÖPNV is öffentlicher Personennahverkehr, the german term for all public vehicles transporting passengers only a short distance.

It is quite easy to change all the vehicles to be tram vehicles, which does not change a thing about them, except they follow another speedbonus and are in another depot. So that's easy.

However, it seems there is no way to seperate ways, tunnels, tracks, signals or stations. So either one includes all of them in a menu, or none.
Three ideas:
1) If everything could have a tram_track subtype, it could probably be seperated by that, even if it works exactly like normal track. However, this seems very strange and counterintuitive.
2) If objects could be defined in the menu, rather than chunks of similar objects (like all track ways), the menus might be created like this. The drawback would be that every new object we include would need it's own entry in the menuconf, and addons would not be included at all (we would create an extra submenu which includes all track items, thus including addons as well)
3) An additional sorting parameter you could use in bunches as well. This would probably be the best, since just adding the attribute "track" and "tram" respectively would be sufficient.

Any other ideas what could be done?

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2836
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Possibility to seperate the track menu in two menus.
« Reply #1 on: March 23, 2015, 12:33:11 AM »
Define a custom system_type?

Offline Leartin at

  • Devotee
  • *
  • Posts: 1151
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Possibility to seperate the track menu in two menus.
« Reply #2 on: March 23, 2015, 08:18:44 AM »
You could do that for plain ways (actually, I'm not sure you can use custom numbers, but assuming that works), but you can't do it for elevated ways (since they require system-type 1), and tunnels, bridges, signals and stations don't use system_type at all.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2836
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Possibility to seperate the track menu in two menus.
« Reply #3 on: March 24, 2015, 02:19:49 AM »
Ah, but you are requesting too much then. :D

Maybe add a customway that would just serve for organisation purpose, customway would receive any number bigger than 0 and this number would be used in menuconf.tab as a third option. E.g. ways(1,0,1)

Default value would be 0 if value is omitted and on menuconf.tab if not specified as well.

Vehicles would be free to use any track no matter the value of this.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1151
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Possibility to seperate the track menu in two menus.
« Reply #4 on: December 16, 2015, 02:17:44 PM »
I'll use my necromancy powers to state that I'd still like to have more freedom in menu creation.

Recently, I started stealing the p96c harbour concept, in having several ways and other objects using the same concrete floor allowing to build huge docks or logistic centers. But it does not make much sense for these concrete-enclosed streets and railways to be along other streets and railways, since they wouldn't be used in combination with other ways of the same type, but in combination with other concrete-floor objects.

This (newer) thread is about basically the same problem, even though just reduced to trams:
http://forum.simutrans.com/index.php?topic=14815.0

Sorry to bother you, it's just somewhat important to me.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: Possibility to seperate the track menu in two menus.
« Reply #5 on: December 16, 2015, 08:57:13 PM »
Nobody stops you to create a menu where you only list the stuff you want to see.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1151
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Possibility to seperate the track menu in two menus.
« Reply #6 on: December 17, 2015, 05:48:16 AM »
Prissi, it's not somebody who stops me, it's something - the code ;)
I reported it as a bug report before, but I read your last answer as if everything is in order and it's just not supposed to work, hence the change to an extension request. Either way, it does not work correctly.

I could create the menu, but every Icon would be visible all the time. If that was true for the "normal" menu, you'd surely consider that a bug, so why should it be different for custom menus?


Bug-Report: http://forum.simutrans.com/index.php?topic=13786.0

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2836
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Possibility to seperate the track menu in two menus.
« Reply #7 on: December 17, 2015, 08:23:50 PM »
prissi thought you were talking about adding a button to load another menubar. That's already possible. But I understood you mean to separate some ways.

What Leartin wants is to only show a subset of way X in one menu and the rest in another. Currently this is impossible because the current lines only bulk show all the ways from that type.

ways(16,0) will show all runways. Leartin wants to add some of them in one menu and the rest in another.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: Possibility to seperate the track menu in two menus.
« Reply #8 on: December 18, 2015, 10:15:38 PM »
Do not use way(), write down the names by hand. THen you can show whatever you want to show. Or use an unused subtype (like 2) for the ways.