The International Simutrans Forum

 

Author Topic: Small GUI-adjustments  (Read 3336 times)

0 Members and 1 Guest are viewing this topic.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Small GUI-adjustments
« on: November 25, 2017, 10:10:59 PM »
Hello,
Now that I have become a bit more friends with the GUI-stuf, I took the liberty to make some small GUI-adjustments, this time in the convoy window:

I have split the destination information into two lines, first line shows "Destination: blablablabla" and the second line holds the progress bar. Together with the progress bar I have made an entry which translates the progressbar into an actual value, namely how much distance is left. The second line is also oriented towards the right of the screen to help clarification.
A note to why I have split the info on two rows:
Stop names tends to be quite long, and fitting them between "Destination: " and the progress bar, potentially with both  [ >> ] and [ * ]  makes for a very very very short name. Initially I put the name on the second row and kept the progress bar and the distance to go at the first row, but thought that might be less intuitive.
Also, I wanted to have an "ETA:", but that seemed initially to be quite complicated to extract, so that will have to wait.

Lastly, I have adjusted the destination name field and the schedule name field so they dont run into the window of the convoy. When the text is too long, it will chop it down and replace the last caracters with "...". The destination entry did that earlier too, however now it also takes into account that it needs to fit [ >> ] and [ * ] before it runs out of space.

As a bonus, they even have become a tiny bit intelligent, so when you resize the window, the text will stretch out and you can read everything.

It exists on this branch: https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/small-gui-fixes

Do you think I should change anything?


Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #1 on: November 25, 2017, 11:40:01 PM »
Splendid - this is a definite improvement. The progress bar overlapping with the destination stop name has been a problem for some time now. I have incorporated this into the passenger-and-mail-classes branch.

Can I check whether we have a translation specification in a .dat file for "left"?

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #2 on: November 25, 2017, 11:44:27 PM »
oops, I will add! Did you upload the one from the classes branch yet?

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #3 on: November 26, 2017, 12:41:18 AM »
Yes, I did.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #4 on: November 29, 2017, 08:01:51 PM »
Question, does anybody use the following:

In the Line Management window, when selecting a line, alot of stuff comes on the screen. On the right hand side, just squeezed in between the name of the line and the statistics section there is a loading bar, showing an average load for all convoys in the line.

Would anyone mind if I remove that line and replace with a status text of the line?

The information which is given is also given by a small section in the upper right corner of the convoy display. There it says the total capacity of all convoys, the actual load in all convoys and then the same as a percentage. I would think that that is sufficient?

edit:
Thinking of it, I could even replace the loading bar just above the written out loading numbers..

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #5 on: November 29, 2017, 11:09:19 PM »
I took the liberty and made the change. Finally, at least I, will remember what those colors mean! :P

I tried to do the same in the halt window, but there appears to be no states given at all! I initially tried and invented a bunch of states and everything went fine up untill the overcrowded status where it started to mess with the actual colors. It uses some weird stuff with |= commands which I cannot figure out really.

I have undertaken a similar change in the factory window, however, there the states where just named "bad" "medium" "good" and only the staff shortage was a state that actually had any meaning to it. Looking in the code, I really dont understand how to interpret the variables they have given there, the same issue with |= and &=. I understand princippally what they mean ( a = a | b) but I cannot wrap my head around it.
I would like to add a bunch of more states like "inputs are empty", "outputs are full", "one, or more, good not connected" etc but given the circumstances, the text will now only show when it is in fact out of staff in that state color.

Incidentally, should there not be a state for when it is out of costumers, ie "customer shortage"? just like with staff, where I assume that when under a threashold, the sign will be given.

It is not ready just yet but it is on my github branch if you want to check it out.
https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/passenger-and-mail-classes
(accidentally commited to this branch instead of the usual one)

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #6 on: November 29, 2017, 11:21:04 PM »
Thank you for your work; however, I am afraid that this causes a crash for me whenever I open an industry window. I have reverted this for now.

As to the |= operators, these are bitwise operators: see here for details.

Offline Vladki

  • Devotee
  • *
  • Posts: 3340
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Small GUI-adjustments
« Reply #7 on: November 30, 2017, 06:36:37 PM »
I think that the typical usage of | & is when you have a bitmapped variable of flags. E. G. Bit 1 means out of stock, bit 2 means output full, bit 3 means no workers, bit 4 means no customers. Then if you want to set a flag on bit 3 you do: flags |= 4 (00000100 in binary). If you want to check if it is set you do: if (flags & 4)...
If you want to clear the flag do: flag &= ~4

Instead of number you should
 #define NOWORKERS 4

You should find similar defines in header files.




Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #8 on: December 01, 2017, 12:31:52 PM »
Hmm thank you for the explanation, it made a bit more sense to me.

In the meantime, I remade the statuslines for the lines and factories. The factories only show wether it is out of staff, as I have disabled the other states from showing because they made no meaning without any further information.
I think the crash you experienced was due to the buffer being empty at times which it apperently doesnt like so much. Now the buffer allways gets a value and I dont experience any crashes.
They are online here: https://github.com/VictorErik/Simutrans-Experimental-Ves/commits/small-gui-fixes

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #9 on: December 01, 2017, 11:07:33 PM »
Unfortunately, I did not have time to test this before going away for the week-end, but I will look into this when I have a moment. Thank you for your work on this.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #10 on: December 03, 2017, 07:51:59 PM »
So, I believe it should be now possible to copy the reassigned classes of a convoy along with the convoy it self. As far as I have been able to follow the trail through the tools etc, the changes have been made with some lines into "simdepot.cc" in "convoihandle_t depot_t::copy_convoi( ... )"

I guess it is network safe, but I imagine we find that out rather quickly  :)

I will look into a button in the class manager window, which would apply the changes to all convoys. This has the drawback though, that only the classes of *this* convoy can be reassigned. So for the future, it would be better to have a separate window directly in the line management.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #11 on: December 03, 2017, 10:48:18 PM »
Excellent. When I have tested this, is the translations .dat file ready to be uploaded?

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #12 on: December 03, 2017, 10:50:47 PM »
Well, I have a big project ongoing now with the new LINE class manager (decided it was the best. With the experience from the previous window, this should be very easy), so I expect alot of translation new text to be coming very soon. So if you could keep it for just a moment, I will remind you when its done!

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #13 on: December 03, 2017, 10:59:40 PM »
Certainly.

Incidentally, you were asking earlier about the meaning of the industry status colours. These are actually all described in the industry's help texts:

Quote from: The help texts
The Status colour bar under the picture shows how and whether the industry is operating (also used in the <a href="factorylist_filter.txt">Industry List):

- white means that the industry does not require input;

- yellow means that the industry is connected by transport, but the supply of input commodities is poor or non-existant;

- green means that the industry is at optimum status;

- orange means that the industry is operational but improvements are possible in the supply of goods (for example, only some commodities are supplied to an end consumer industry);

- red means that the industry is operational, but that part of the industry supply chain has excess supply; and

- purple means that the industry is short staffed.

Edit: I have now incorporated these changes - thank you for your help with this.

Incidentally, if you are working on the line management window, one thing that you might want to look at is the livery selector, which currently does not work well with other elements in that dialogue when expanded.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #14 on: December 03, 2017, 11:56:31 PM »
Yes I found them, but I was aiming for some more detailed states. Red just means it’s “really bad”, but not what is bad. But thanks anyway :-)

I could have a look at that and see if something could work better!

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #16 on: December 05, 2017, 02:00:52 AM »
Splendid - now incorporated, with some minor text changes. Is the .dat file ready for uploading to Simutranslator yet?

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #17 on: December 05, 2017, 02:06:15 AM »
I can’t think of anything to add, can anyone else?

But in the meantime, the datfile can be shipped away! :)

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #18 on: December 05, 2017, 11:31:52 AM »
Excellent. You might want in the meantime to look into a bug report about the replace window, here.

Thank you very much for your work on this.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #19 on: December 12, 2017, 02:49:38 PM »
I have just pushed a fix to https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/small-gui-fixes which addresses some issues:

* The bug in the cargo manifest now shows cargo under correct headline (hopefully..)
* An attempt to make the halt info window show a default sort option. This doesnt work yet, however
* Some missing translation texts (go ahead and upload the dat-file)
* Some modifications to in what order the line class window draws stuff. In the servergame, the window is quite unresponsive, and this is what I have tried to address

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #20 on: December 12, 2017, 07:03:19 PM »
Well, sorry for doubleposting.
I would just say that I played around with the sorter and added a new sort option:
"sort by trip type"
This will sort passengers into commuters and visitors, usefull for when you want to see what types are traveling towards your industries.
Since this adds another two sort options to the list, I have also added tooltips to the sort options now. Well, actually not entirely true, I have added a tooltip to the LABEL right above the sorter, since comboboxes cannot have tooltips apperently. The context of the tooltip will change dependent on how its being sorted.
So to provoke the tooltip, hover above the text right above the combobox.

If you would like to have a look and perhaps consider it for implementation, it exists here: https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/sort-by-visitors

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #21 on: December 13, 2017, 01:24:11 AM »
Thank you very much for that. I have very limited time this evening, so I have incorporated the bug fixes, but have not had time to look into the sorting by visiting/commuting passengers yet.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #22 on: December 14, 2017, 09:06:08 PM »
I am writing out convoy states. Up to two would be showed at the same time. Do you have any suggestions for convoy states that you would like to see?
Currently I have:

* Is overcrowded
* Obsolete vehicles with upgrades, or
* Obsolete vehicles
* Nothing moved since last month

I have purposedly omitted "Convoy made a loss since last month", as that is kind of obvious, is it not?
Also, we here only consider states that are not what its doing "right now", like "loading", "no rute" etc.

Can you think of more states?

However, there is one issue worth considereing:
With the current implementation I have done, there might be quite alot of colors:



Suggestion would be to either remove the coloration of (some of?) the parameters, or to limit the number of statuses to one, or some third alternative?
What do you guys think?

Offline zook2

  • *
  • Posts: 321
Re: Small GUI-adjustments
« Reply #23 on: December 15, 2017, 02:46:52 AM »
- Personally, I don't need Overcrowded. The first thing I look at when I open a convoy view is the number of passengers.
- Obsolete is visible in the Line Manager.
- No Schedule, perhaps?

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #24 on: December 17, 2017, 12:45:08 AM »
Thank you for your work on this. I have now merged the latest changes from your GUI branch, although I notice that the convoy states have been commented out for the time being.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #25 on: December 18, 2017, 08:12:44 PM »
Yes, indeed the convoy states is commented out for the moment. Maybe we should let it go out into the master so people can try it? Its easy just by uncommenting the section, either you or I could do it.

However, after the discussion about the factories, I realized its quite difficult to get a grip of how far away the factories actually are from each other, so I have now added the distance to them. Do you think this is sensible?



Incidentally, theese are the four sheep farms I was having trouble with in the other thread  :)

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #26 on: December 18, 2017, 09:17:49 PM »
The distance to industries is an excellent idea - very helpful, thank you.

As to the convoy states, I do not think that we need text showing overcrowding, since this is shown by a status colour (purple) and the numbers are very visible. Would it not make more sense to show state information on the very first line (where, in the screenshot, you currently have "Waiting for schedule..."? Instead of "Waiting for clearance" in yellow, when the convoy has been stuck for some time, it might instead say "Waiting for clearance (held indefinitely)" in orange. You might similarly have "Editing schedule" in light yellow, "out of range" in red or orange, and "emergency stop" in red.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #27 on: December 18, 2017, 10:03:55 PM »
Those are already existing in the window!  ;D

What I am talking about are states which are not that obvious. I realize its quite confusing to talk about states and states, so lets call them "overall states" and "action states" for the sake being. The action state is the top line. This line already today shows "out of range", "loading", "stuck", "emergency brake" etc. Those are the actions the convoy is doing absolute now.

The overall states, however, are states that can apply to a convoy on a monthly basis, like "regularly overcrowded", "nothing transported", "obsolete vehicles" etc. The convoy can fine continue with active "overall states", but might benefit from caretaking by the player.

That being said, more "action states" can indeed be added, like you suggest showing a more heavy "waiting for clearance (held indefinitely)", which currently just changes color I believe.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #28 on: December 18, 2017, 10:17:23 PM »
Ahh, I see: I was confused, as I thought that you were discussing the actual things in convoi_t::state. This does make more sense now that you have explained it, although the stuck status should still, I think, be an "action state" rather than an "overall state".

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #29 on: December 18, 2017, 10:24:22 PM »
The stuck message is also already an action state!  ;D

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #30 on: December 18, 2017, 10:38:51 PM »
Splendid! It probably does not need to be an overall state as well, in that case.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #31 on: December 18, 2017, 11:05:01 PM »
Are you sure?
I always have wondered what it meant when the weight shifted to yellow (it means nothing moved) or purple (overcrowded). Now I do know what it means when the name is blue and the price is red, but other might not know that.
I would very much like to show this, I am just not certain of in which form is a good way. Since the colorisation risks being massive, some other way might be preferable.
One alternative could be to just show it in the convoy detail?

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #32 on: December 18, 2017, 11:44:35 PM »
What I suggest is that, instead of having the "stuck" state indicated in the lower "overall states" text, it should be indicated explicitly as part of the "active state" text in the way described above (by adding, e.g., "held indefinitely" in brackets after "Waiting for clearance"), as well as changing the colour to orange.

Offline Ves

  • Devotee
  • *
  • Posts: 1796
  • Languages: EN, SV, DK
Re: Small GUI-adjustments
« Reply #33 on: December 19, 2017, 12:10:51 AM »
Currently it looks like this:


I think we are getting confused by the explanations, you can check for your self in convoi_info_t.cc at the commented out section starting at line 725 here:
https://github.com/jamespetts/simutrans-extended/blob/master/gui/convoi_info_t.cc#L725
You will see the overall states I am talking about if you read the translator::translate - stuff.
"Nothing moved" is not equal to stuck: The convoy can drive back and forth, following its schedule, but no good moved. That is what trigger that state.

----
Btw, for something else, I have been looking into having a ETA and ETD in the convoy window. The ETA "Estimated Time on Arrival" estimates the time for when the train reaches the next station, and ETD "Estimated Time on Departure" estimates, well you guessed it. I have made it work by grabbing the next halt from the schedule, copy the code that fetches the predicted times to the convoy window, and then modified it to only show the time.
Currently it is setup to display what time it will be when the convoy arrives or departs, but I am not sure that most people agree on what is most usefull. A timestamp or a time counter?
At the moment nothing really uses a timestamp to anything, but that could be changed if desired.
There is one issue that it can be quite inacurate, but this is way above my skilllevel. I have just seen it in the halt window and wanted it in the convoy window instead. But that means that I cannot modify it more than how it is displayed, so if the inacuracy is making it too useless, the clock would have to be removed.
Some small tweaks here and there I have to do, but will put it to my GUI branch later tonight for testing.


Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19826
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Small GUI-adjustments
« Reply #34 on: December 19, 2017, 12:20:51 AM »
My apologies for the confusion: I understand the distinction now. Do I understand correctly that "nothing moved" means "nothing transported" rather than "no vehicles moved"? If so, that makes much more sense as an "overall state", as you describe it.

The estimated times of arrival seem potentially useful (clearer as a count-down than a specific time, I think, especially if the time is next month). As the the accuracy of this, this is simply based on an average of the convoy's past performance, which may not always be consistent.