The International Simutrans Forum

 

Author Topic: [patch]vehicles show line name or convoy name  (Read 515 times)

0 Members and 1 Guest are viewing this topic.

Offline anoKTOK

  • *
  • Posts: 4
  • Languages: JP
[patch]vehicles show line name or convoy name
« on: May 07, 2020, 01:00:08 PM »
This is a patch of soukouki and anoKTOK.

Overview:
Vehicles show line name or convoy name.

Source code:
https://github.com/anoKTOK/simutrans-extended-building-extension/tree/vehicles_show_line_name_or_convoi_name
Remark. This source is based on the latest version (2020/ May / 07).


How to use:

(1) Open Option.
(2) Select Display.
(3) Choose "line name tooltips" where we often choose "convoi error tooltips", "convoi mouseover tooltips" and "all convoi tooltips".

Behavior:
If a vehicle have a line name, the vehicle shows the line name.
Otherwise, the vehicle shows the convoy name.

Example:

This is a picture near Nagasaki station.

tab:
line name tooltips

Offline Vladki

  • Devotee
  • *
  • Posts: 3241
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: [patch]vehicles show line name or convoy name
« Reply #1 on: May 07, 2020, 06:39:05 PM »
Wow, that's cool ;)

Offline Freahk

  • *
  • Posts: 960
  • Languages: DE, EN
Re: [patch]vehicles show line name or convoy name
« Reply #2 on: May 07, 2020, 07:56:33 PM »
Indeed a nice one :)
I'll always know immediately if that tram was intended to run on the mainline or just did a stupid detour because I messed up the route :D

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9906
  • Languages: De,EN,JP
Re: [patch]vehicles show line name or convoy name
« Reply #3 on: May 08, 2020, 03:08:25 PM »
Was a very good idea, now in r9077 in standard too. (Since I could not easily find the diff, I just wrote it myself.)

Offline Ranran

  • *
  • Posts: 865
  • Languages: ja
Re: [patch]vehicles show line name or convoy name
« Reply #4 on: May 09, 2020, 12:07:10 AM »
I think it's a very good idea. Otsukare thanks.  :)
IMO, some improvements will make it even better.


1) Separate from the convoy status message and assign a dedicated shortcut key. Because it's different genre information than displaying convoy alerts.
I don't think it is a good idea to hide the anomalous status with this display. Not suitable for constant display.

And while this display is convenient, at the same time it tends to be very annoying, so it is preferable that it can be easily turned on and off. However, it is troublesome to switch if it is in an unrelated cycle. It would be convenient to be able to separate and turn on and off only that.


2) Add an option to show it only when the mouse is over.
As mentioned above, this display can be very annoying, so if it has such option, I would prefer to use that option during usual.


3) Avoid confusion with station name displays.
The station name can switch between multiple display styles, but this is not possible. Therefore, if the station display is a square box with a player color background, it is difficult to distinguish it from that. (I usually use that style.)

I had some ideas; adding a waytype symbol to the name, adding a status bar to make it look different from the station etc
For the time being, I try to avoid conflict with the station display by making white letters on a dark background.

4) Make a distinction between line name and convoy name. I tried changing the background color slightly, but it may be difficult to understand. The background color of lineless convoy is a little dark.


I made a version with these improvements.



The repository is here
https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/independent-convoy-nameplate


Code: [Select]
# TOOL_CONVOY_NAMEPLATES=133
simple_tool[133]=,0
We can assign its shortcut key in menuconf.tab. In the example, it is assigned to the "0" key. Well this is a pakset task. In Britain-EX, the key of the convoy status tooltip is assigned to shift + 7, so a key close to this is preferable.



Future improvement idea:
Added a symbol for whether it is a reverse route on it. For example, an up arrow and a down arrow. ↩ ↦




Aside from that, your original code does not correctly correspond to key assignments. If you implement it with the original specifications, you will need to modify it by referring to the prissi's code.

Offline anoKTOK

  • *
  • Posts: 4
  • Languages: JP
Re: [patch]vehicles show line name or convoy name
« Reply #5 on: May 09, 2020, 07:15:20 AM »
Was a very good idea, now in r9077 in standard too. (Since I could not easily find the diff, I just wrote it myself.)

Thank you very much for adding this patch!


IMO, some improvements will make it even better.


1) Separate from the convoy status message and assign a dedicated shortcut key. Because it's different genre information than displaying convoy alerts.
I don't think it is a good idea to hide the anomalous status with this display. Not suitable for constant display.

And while this display is convenient, at the same time it tends to be very annoying, so it is preferable that it can be easily turned on and off. However, it is troublesome to switch if it is in an unrelated cycle. It would be convenient to be able to separate and turn on and off only that.


2) Add an option to show it only when the mouse is over.
As mentioned above, this display can be very annoying, so if it has such option, I would prefer to use that option during usual.


3) Avoid confusion with station name displays.
The station name can switch between multiple display styles, but this is not possible. Therefore, if the station display is a square box with a player color background, it is difficult to distinguish it from that. (I usually use that style.)

I had some ideas; adding a waytype symbol to the name, adding a status bar to make it look different from the station etc
For the time being, I try to avoid conflict with the station display by making white letters on a dark background.

4) Make a distinction between line name and convoy name. I tried changing the background color slightly, but it may be difficult to understand. The background color of lineless convoy is a little dark.

Thank you for advising. Arigato thanks.  :)
I played with your patch. I think it is more useful.


Future improvement idea:
Added a symbol for whether it is a reverse route on it. For example, an up arrow and a down arrow. ↩ ↦

Certainly, it may be easier to see.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19684
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [patch]vehicles show line name or convoy name
« Reply #6 on: May 16, 2020, 03:50:58 PM »
Thank you all for your work on this: this looks very good. I have been testing Ranran's version of this. One or two small things need addressing before being incorporated.

First of all, the text "mouseover convoy nameplates" is too large to fit in the space between the horizontal scroll bars in the display settings dialogue. Secondly, even if I widen the dialogue, the rightmost horizontal scroll bar element remains in place, unlike that of the "Mouse-over convoy tooltips" selector, which dynamically moves to the right. Finally, I wonder whether it might be possible to set up a shortcut key for this? I am not immediately clear on whether this has been done or at least all but alteration of menuconf.tab done. In Pak128.Britain-Ex, the SHIFT+I key combination is currently free.

Apart from those small things, this does seem to be a very good enhancement: thank you all for your work on this.

Offline Ranran

  • *
  • Posts: 865
  • Languages: ja
Re: [patch]vehicles show line name or convoy name
« Reply #7 on: May 16, 2020, 11:00:02 PM »
I reply only two point first.
Quote
First of all, the text "mouseover convoy nameplates" is too large to fit in the space between the horizontal scroll bars in the display settings dialogue.
I expected to solve this using translated text.
Because I'm not an English native speaker I can't come up with a better short word. Is that possible?


Quote
Finally, I wonder whether it might be possible to set up a shortcut key for this? I am not immediately clear on whether this has been done or at least all but alteration of menuconf.tab done. In Pak128.Britain-Ex, the SHIFT+I key combination is currently free.
As far as I tested it worked with 0 key. But I'll check it again.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19684
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [patch]vehicles show line name or convoy name
« Reply #8 on: May 16, 2020, 11:10:51 PM »
For the translation text, you might simply replace "nameplate" with "names", which should shorten it somewhat. I also suggest that the first letter of the first word of the text be a capital letter to match the others.

As to the shortcut key, I cannot get this to work; but do I need to download a modified menuconf.tab for this? Incidentally, merging this into the latest master caused merge conflicts in ja.tab again which you may need to resolve by re-instating the deleted part.

Offline Ranran

  • *
  • Posts: 865
  • Languages: ja
Re: [patch]vehicles show line name or convoy name
« Reply #9 on: May 16, 2020, 11:21:53 PM »
Quote
but do I need to download a modified menuconf.tab for this?
Yes, you need to edit britain-ex manuconf as menuconf is pakset specific.

please left Japanese.tab as is. I think many fixes are needed, so I'll pull request the fixes in bulk later. :done:

EDIT:
I attached the edited menuconf.tab. It is set to Shift + I.
« Last Edit: May 17, 2020, 05:06:31 AM by Ranran »

Offline Ranran

  • *
  • Posts: 865
  • Languages: ja
Re: [patch]vehicles show line name or convoy name
« Reply #10 on: May 17, 2020, 12:29:56 AM »
Thank you for your advice. Now I think I have solved those issues.
- Right arrow left behind, and "nameplate" text is too long.

Please confirm.

Shortcut key seems to work for me. Test using the menuconf.tab attached to the previous post.
You have to press the key three times to cycle through the display.

EDIT:
Merged and tested to resolve conflict issues involving translations. Note that the save version is incremented. (You can't open a saved game that you've already saved a nameplate build with the old revision number(21). It only happens if you build and test your own)
I redone the pull request, please confirm:
https://github.com/jamespetts/simutrans-extended/pull/167
Also for pakset:
https://github.com/jamespetts/simutrans-pak128.britain/pull/88
« Last Edit: May 17, 2020, 05:05:32 AM by Ranran »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19684
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [patch]vehicles show line name or convoy name
« Reply #11 on: May 17, 2020, 11:57:45 AM »
Thank you very much for this - this is now confirmed working. I have merged and incorporated this and updated the English translation texts.

Unfortunately, there were still merge conflicts in the Japanese translation texts - I tried to resolve these as best as I could, but you may want to check this.

Offline Ranran

  • *
  • Posts: 865
  • Languages: ja
Re: [patch]vehicles show line name or convoy name
« Reply #12 on: May 17, 2020, 12:04:06 PM »
Unfortunately, there were still merge conflicts in the Japanese translation texts - I tried to resolve these as best as I could, but you may want to check this.
That is odd.
Did you check this branch?
https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/show-line-nameplate-with-resolved-conflicts

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19684
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [patch]vehicles show line name or convoy name
« Reply #13 on: May 18, 2020, 12:20:18 AM »
Yes, it was the resolved conflicts one that I used.

Offline Ranran

  • *
  • Posts: 865
  • Languages: ja
Re: [patch]vehicles show line name or convoy name
« Reply #14 on: May 18, 2020, 01:11:45 AM »
If you cannot find any problem other than ja.tab with that patch, please discard the changes of ja.tab. I will check and fix it later.

EDIT:
I checked and fixed it again so I think now the ja.tab conflict is resolved. please check pull request #168.
« Last Edit: May 18, 2020, 01:34:02 AM by Ranran »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19684
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [patch]vehicles show line name or convoy name
« Reply #15 on: May 18, 2020, 11:08:35 AM »
Now incorporated - thank you.