Page 1 of 2

Group info

Posted: 17 Jul 2007 16:48
by MagicBuzz
When you have a lot of groups with many trains, you may have difficults to see which groups earn a lot of money and which ones don't.

So I designed yesterday a path that add a new panel in the group list window.
When selecting a group, it will show for the group the same stats as for the vehicules, but for the whole group :
- Profit this year : sum of all profits of all vehicules in the group for this year
- Profit last year : sum of all profits of all vehicules in the group for last year
- Profit button : work like the vehicule profit button, but for the all group

Flyspray :
http://bugs.openttd.org/task/1042

See then end of the topic for lastest patch version.

Re: Group info

Posted: 17 Jul 2007 16:51
by Bilbo
This looks great and useful, I have to test it :)

Re: Group info

Posted: 18 Jul 2007 08:54
by rav
same here! looks good :o

*wishes for group-based vehicle replacing*

Re: Group info

Posted: 18 Jul 2007 09:14
by MagicBuzz
rav wrote:*wishes for group-based vehicle replacing*
:?:

that works already !
select a group, then in the "manage list" button select "replace vehicules" and it will replace only the vehicules of the selected group.

Re: Group info

Posted: 18 Jul 2007 13:49
by Aydan
how about a min/max profit value for each group? Especially the min would be useful to see if you have a runaway.

Re: Group info

Posted: 18 Jul 2007 16:20
by Bilbo
MagicBuzz wrote:
rav wrote:*wishes for group-based vehicle replacing*
:?:

that works already !
select a group, then in the "manage list" button select "replace vehicules" and it will replace only the vehicules of the selected group.
Well, you can select the replacement from the group loist, but in the end, it affected all vehicles and not onmly the ones in group. At least in older versions

Re: Group info

Posted: 18 Jul 2007 19:02
by MagicBuzz
Bilbo wrote:
MagicBuzz wrote:
rav wrote:*wishes for group-based vehicle replacing*
:?:

that works already !
select a group, then in the "manage list" button select "replace vehicules" and it will replace only the vehicules of the selected group.
Well, you can select the replacement from the group loist, but in the end, it affected all vehicles and not onmly the ones in group. At least in older versions
hmmm

can't say.

i'm using my "autorenew" patch that send for servicing only my vehicules from a current list if they actually need replacement.
but this works only with breakdown disabled.

Re: Group info

Posted: 19 Jul 2007 07:36
by MJS
Actually, this is the only place from where autoreplace replaces only a selection of all trains - the train lists that are called from the station window or from the shared train orders list still replace all trains...

Re: Group info

Posted: 03 Sep 2007 18:46
by MagicBuzz
Here is a small update of this patch.

I updated it according the lastest trunk version, and I now use proper strings IDs.

Also, the patch fix a small display bug in the group window : "All vehicles" and "Ungrouped vehicles" panels were not properly sized and positionned.

Re: Group info

Posted: 03 Sep 2007 19:42
by ThePenguin
Thank You! I've been wanting something like this for a while. I'm just not that good at C++ *yet*.

Re: Group info

Posted: 17 Oct 2008 08:26
by chrissicom
I really like this patch but I can't seem to get it working with current trunk, do you plan an update or is there an update floating around already? :)

Re: Group info

Posted: 21 Oct 2008 13:01
by MagicBuzz
I do not plan any update now.
I was quite bored to write patches and need to upgrade them each new trunk version without having any hope of getting into trunk.

Since 2 months I got a girlfriend, and I don't spend much time on my computer anymore. May be later, but not now.

Re: Group info

Posted: 16 Nov 2010 18:02
by MagicBuzz
*bump*

http://bugs.openttd.org/task/1042

Here is an update of the patch.

I removed the profit button as I think it's useless.

Re: Group info

Posted: 17 Nov 2010 18:56
by Zuu
What does "FF" stand for?

Re: Group info

Posted: 17 Nov 2010 18:58
by MagicBuzz
FF for "French Francs" ;) It's my money setting, but as I use a {CURRENCY} wildcard, you'll see $, €, £ or whatever you chose.

Re: Group info

Posted: 17 Nov 2010 18:59
by planetmaker
Zuu wrote:What does "FF" stand for?
Given the language... French Franc?

Re: Group info

Posted: 17 Nov 2010 19:24
by Zuu
Ah ok. I only looked at the patch-text, not the surrounding interface text. Also I'm used to having alpha-numerical currency labels to the right of the numbers, so I though FF was maybe an abbreviation for something related to the patch.

Re: Group info

Posted: 21 Nov 2010 16:53
by ChillCore
MagicBuzz in another thread wrote: There is currently a bug with group info, you may wait for a fix before integrating it if you are interested in.
=> The last line in the group's vehicle list isn't used. I didn't find how to use it in the list.
@see codeblock (code in group_gui.cpp) and screenshot. :)
Perhaps you may need to replace the "- 25" by the height of the widget based on font height specified by the user ... I have not yet tested what happens if font size is bigger or smaller.

Code: Select all

	virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
	{
		switch (widget) {
			case GRP_WIDGET_LIST_GROUP:
				this->tiny_step_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP;
				resize->height = this->tiny_step_height;
				/* Minimum height is the height of the list widget minus all and default vehicles and a bit for the bottom bar */
-				size->height =  4 * GetVehicleListHeight(this->vli.vtype, this->tiny_step_height) - (this->tiny_step_height > 25 ? 2 : 3) * this->tiny_step_height;
+				size->height =  (4 * GetVehicleListHeight(this->vli.vtype, this->tiny_step_height) - (this->tiny_step_height > 25 ? 2 : 3) * this->tiny_step_height) - 25;
				break;
Nice patch. Me likes. ;)

Re: Group info

Posted: 21 Nov 2010 18:37
by MagicBuzz
Thank you Chillcore :bow:

Here is the lasted patch version.

Re: Group info

Posted: 22 Nov 2010 11:07
by MagicBuzz
Aydan wrote:how about a min/max profit value for each group? Especially the min would be useful to see if you have a runaway.
Well, three years later, here it is ! ;)

In fact, when I removed the profit button of the selected group, I thought it could become usefull if it was shown for every group in the list.

Here is the lastest version of the patch with this complement.
group_info_profit_button.png
group_info_profit_button.png (18.09 KiB) Viewed 11609 times
-- Edit : There was a bug with the "all" group. I forgot to check the vehicle type when displaying the profit button, so the profit button was computed for all vehicle of any type...