News:

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

Small GUI-adjustments

Started by Ves, November 25, 2017, 10:10:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ves

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?


jamespetts

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"?
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.

Ves

oops, I will add! Did you upload the one from the classes branch yet?

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.

Ves

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..

Ves

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)

jamespetts

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.
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

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.

Sent from my ONEPLUS A3003 using Tapatalk


Ves

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

jamespetts

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.
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.

Ves

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.

jamespetts

Excellent. When I have tested this, is the translations .dat file ready to be uploaded?
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.

Ves

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!

jamespetts

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.
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.

Ves

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!


jamespetts

Splendid - now incorporated, with some minor text changes. Is the .dat file ready for uploading to Simutranslator yet?
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.

Ves

I can't think of anything to add, can anyone else?

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

jamespetts

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.
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.

Ves

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

Ves

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

jamespetts

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.
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.

Ves

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?

zook2

- 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?

jamespetts

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.
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.

Ves

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  :)

jamespetts

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.
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.

Ves

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.

jamespetts

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".
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.

Ves

The stuck message is also already an action state!  ;D

jamespetts

Splendid! It probably does not need to be an overall state as well, in that case.
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.

Ves

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?

jamespetts

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.
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.

Ves

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.


jamespetts

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.
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.

Ves

Yes, "nothing transported" might indeed be a better term! Changed!


Ok, my trains on my testmap have had quite a hard time during my tests, so that might have screwed things up!  :o
My issue against the counter is that it is difficult to compare a counter to another one, especially if you are have to hunt around the screen for different counters and vehicles and buttons, so you quickly loose track of the counters. The current counters in game I think are fine as they are, it is only when I am trying to compare two counters, say two trains with different schedules, and there is only a very small time difference. Then it can be very tricky indeed to spot which one is in front of the other and by how much. But indeed, if you use the clock, it would feel quite arbitrary if the time would be way out in the future..
One of the intentions I had with this clock in the convoy window was to show some timing information which doesnt change constantly, so the player can have something to compare with. When the train is waiting for schedule, it would be useless to show a counter, since the counter is already displayed above in the "action state", so therefore a clock would fit perfect there I think.

To display the next month a "+" -sign would be put in front. Many transport agencies I have seen does that for when they mean that its the next day. For really long jurney times multiple ++'ses could be used, but I am not convinced that it would be necessary, and instead one could perhaps simplify the clock and write how many months away the time is instead.

jamespetts

That is an interesting suggestion about the + sign, especially if it is well-recognised. Does anyone else have any views 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.

Ves

I have uploaded the current version to my github in this branch: https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/arrival-departure-times-in-convoy-window
It is not working perfect yet, I get some crashes which I need to investigate.
Features:

* The ETA will turn orange if your vehicle is more than 5 minutes delayed
* If the convoy arrives next month, a + sign will appear. This is not currently on ETD, since that uses another format
* If the convoy arrives after two months, the entire clock is replaced with a text "ETA: 2,3 months"
* When convoy is waiting at a station, the clock will take the remaining loadingtime, but still displayed as a clock.
* The clock will disappear in certain situations, like when wait for full load, is stuck, wait for time 2 months and similar.

prissi

By the way, Simutrans windows (als least in Standard) have a standard size, so tehy are tileable. It probably make sense to increase that tileable size, if you play with dialoge content.

jamespetts

Splendid, thank you for this, and thank you, Prissi, for the useful information about tiled windows.
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.

Ves

Thanks Prissi for pointing that out. I had not thought about increasing the default size in that way, but I will look and see wether it's needed!

Ves

I repaired the displayment of max convoy good in the convoy assembler window, which should be available here: https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/small-gui-fixes

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.