Author Topic: Sort Vehicles in Depot Window  (Read 3514 times)

0 Members and 1 Guest are viewing this topic.

Offline HyperSim

Re: Sort Vehicles in Depot Window
« Reply #70 on: January 09, 2018, 04:58:05 PM »
Dates like that are problematic, since the month/year order and separators are different among cultures (e.g. Japan year/month versus Germany month.year). Thus there was one central routine to take care of dates.
Also it needsto deal with missing intro or retirement dates.

I've already solved this problem. Please check the post above.
Use the same format as the status bar to show intro. date and retire date. (depending on show_month in simuconf.tab)[/li][/list]

Quote
My suggestion to convert power and gear would be rather a multiplier shown to get the effective power.
Power: 88 kW (x2.0)
I like prissi's idea more than Leartin's idea, but considering the sorting, sort by "effective power", not "power" would be better...

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8863
  • Total likes: 336
  • Helpful: 230
  • Languages: De,EN,JP
Re: Sort Vehicles in Depot Window
« Reply #71 on: January 10, 2018, 01:11:51 AM »
No, you did not. You wrote 2012/01 but for Germany we need 10.2012 and for Japan 2012年1月, which are apparently not the same. Also we need to indicate missing entry of retire dates.

Offline HyperSim

Re: Sort Vehicles in Depot Window
« Reply #72 on: January 10, 2018, 03:08:52 PM »
No, you did not. You wrote 2012/01 but for Germany we need 10.2012 and for Japan 2012年1月, which are apparently not the same. Also we need to indicate missing entry of retire dates.

I understand.
So, if show_month is 2 or 5, the text should be "Available: 2000年1月 - 2012年1月".
If show_month is 3 or 6, the text should be "Available: January 2000 - January 2012".
If show_month is 4 or 7, the text should be "Available: 01.2000 - 01.2012".

The text will be "Available: January 2000 -" for missing entry of retire dates in my plan and I think it is the best way.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8863
  • Total likes: 336
  • Helpful: 230
  • Languages: De,EN,JP
Re: Sort Vehicles in Depot Window
« Reply #73 on: January 10, 2018, 11:31:01 PM »
But there are countries that use "-" as delimiter between month and year. Maybe better a text or a symbol "*" for undefined dates? Or just the current text string as it is.

Offline HyperSim

Re: Sort Vehicles in Depot Window
« Reply #74 on: January 11, 2018, 07:55:51 AM »
But there are countries that use "-" as delimiter between month and year. Maybe better a text or a symbol "*" for undefined dates? Or just the current text string as it is.

In simutrans "-" is not used for delimiter, so I don't think it may cause misunderstanding.
Or show "Available: January 2000 - Forever" or something?

Offline Leartin

Re: Sort Vehicles in Depot Window
« Reply #75 on: January 11, 2018, 02:11:47 PM »
But there are countries that use "-" as delimiter between month and year. Maybe better a text or a symbol "*" for undefined dates? Or just the current text string as it is.

That deliminator would be an ISO8601 conform hyphen, like in Lithuania. For an interval, ISO8601 mainly uses a solidus, but the standard allows for a double hyphen. That somewhat conforms to what it used in normal writing, which isn't a hyphen (-)  but a slightly longer en-dash (–) for intervals, and for full dates usually spaced on both sides.
"2000-01 – 2012-01" doesn't seem like a problem to me, so neither does "2000-01 –", though a placeholder "2000-01 – *" looks even better – especially if it's the other way around in  "* – 2012-01"

Offline HyperSim

Re: Sort Vehicles in Depot Window
« Reply #76 on: January 12, 2018, 01:51:37 AM »
I refined the window layout and adopted this discussion.
  • Merge Power and Gear.
  • Merge Intro. and Retire date.
  • Use appropriate format to show date. (depot_win_show_month.png)
  • If the retire date is not defined, show "*" instead of the date. (vehicle_without_retire_date.png)

I adopted number instead of month name to show date because there's not enough space in some cases. (problem.png)
I wanted to use short month names (Jan., Feb., Mar. ...) but we have to add translation if I use them.

.diff file based on r8365 is in attachment.


By the way, I found a typo in simuconf.tab in line 568.
Code: [Select]
# 5>=show no season but everything else in japan format=5, us format=5, german=6This should be
Code: [Select]
# 5>=show no season but everything else in japan format=5, us format=6, german=7

Offline HyperSim

Re: Sort Vehicles in Depot Window
« Reply #77 on: January 12, 2018, 01:58:56 AM »
Sorry, I found some mistakes in .diff file.

Offline TurfIt

Re: Sort Vehicles in Depot Window
« Reply #78 on: January 12, 2018, 02:40:49 AM »
IMHO only show_month = 3 or 4 gives a workable long date string in the status line (December 6 1922, 6 December 1922). However the both 12/1922 and 12.1922 for short dates are gibberish - show_month = 2 for 1922/12 is ok, but then gives garbage for long format.  Hence, if the short date strings are being added, they need their own config setting.

Offline HyperSim

Re: Sort Vehicles in Depot Window
« Reply #79 on: January 15, 2018, 05:49:51 AM »
IMHO only show_month = 3 or 4 gives a workable long date string in the status line (December 6 1922, 6 December 1922). However the both 12/1922 and 12.1922 for short dates are gibberish - show_month = 2 for 1922/12 is ok, but then gives garbage for long format.  Hence, if the short date strings are being added, they need their own config setting.

I replaced short month name instead of number.  It's not difficult.

However, I think adding new config settings should be discussed in a new topic because we should prepare so many options.
I consdered what option we might pepare.
  • show month or not (show_month=0, 1)
  • which format to use (Japan style, US style, German style)
  • use number, long name or short name
So, we should prepare 2 + 3*3 = 11 options.
I want to listen to other opinions.
« Last Edit: January 15, 2018, 06:01:03 AM by HyperSim »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8863
  • Total likes: 336
  • Helpful: 230
  • Languages: De,EN,JP
Re: Sort Vehicles in Depot Window
« Reply #80 on: January 16, 2018, 03:26:56 AM »
Online game info window uses a simpler hack for short dates with "/" only. Maybe we should rather get a rountine from translator.

tranlator::get_short_date( year, month );

Offline HyperSim

Re: Sort Vehicles in Depot Window
« Reply #81 on: January 17, 2018, 02:30:37 PM »
Online game info window uses a simpler hack for short dates with "/" only. Maybe we should rather get a rountine from translator.

tranlator::get_short_date( year, month );

That sounds nice. I think this routine enables displaying "2000年1月" style. (In english, there are no "年" in date.)