News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

[patch]vehicles show line name or convoy name

Started by anoKTOK, May 07, 2020, 01:00:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

anoKTOK

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


Mariculous

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

prissi

Was a very good idea, now in r9077 in standard too. (Since I could not easily find the diff, I just wrote it myself.)

Ranran(retired)

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



# 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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

anoKTOK

Quote from: prissi 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.)

Thank you very much for adding this patch!


Quote from: Ranran on May 09, 2020, 12:07:10 AM
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.


Quote from: Ranran on May 09, 2020, 12:07:10 AM
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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

I reply only two point first.
QuoteFirst 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?


QuoteFinally, 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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

#9
Quotebut 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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Ranran(retired)

#10
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
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

Quote from: jamespetts on May 17, 2020, 11:57:45 AMUnfortunately, 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
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Yes, it was the resolved conflicts one that I used.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

#14
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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

I have pull-requested a Dwachs fix for a tooltip location issue. Please check pull request #197.

However, airplanes behave strangely on slopes, but might phystam know something about this?
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

Quote from: jamespetts on June 16, 2020, 10:40:36 AM
Thank you - now incorporated.

Ah accidentally we both backported the same fix... https://github.com/jamespetts/simutrans-extended/pull/151
So maybe there were some conficts trying to merge both

Ranran(retired)

Quote from: Vladki on June 16, 2020, 12:22:33 PMSo maybe there were some conficts trying to merge both
It's a simple two line fix though.

As I pointed out in that thread, it's not just a convoy line name tooltip issue.
The same applies to station name plates and alert tooltips. Did you try to fix it individually?
All you need to do is fix the original issue and it should be cured.

And the code in that part was completely the same as standard.

Issues not fixed by this, such as airplane tooltips, are likely to be other issues.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

The merge conflict was easy to resolve and has now been resolved - thank you both for your work on this.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

I apologize for not confirming. (´・ω・`)
The issue with airplane tooltips seems to be a standard's issue.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Vladki

Quote from: Ranran on June 16, 2020, 01:36:16 PMThe same applies to station name plates and alert tooltips. Did you try to fix it individually?
Station names were fixed too by the original patch.

Ranran(retired)

In void air_vehicle_t::display_overlay(int xpos_org, int ypos_org) const,



vehicle_t::display_overlay(xpos_org, ypos_org - tile_raster_scale_y(current_flughohe - get_hoff() - 2, raster_width));

I think this is the reason why the tooltip display of the airplane is incorrect.
I haven't checked if the standard code is the same, but the behavior in the game looks the same.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

prissi

Since airplanes cannot handle slopes it should be save to remove this.