Group info

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Group info

Post 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.
Attachments
Preview 1
Preview 1
group_stats_1.png (8.05 KiB) Viewed 14551 times
Preview 2
Preview 2
group_stats_2.png (7.33 KiB) Viewed 14550 times
group_info_r21289.patch
(3.35 KiB) Downloaded 282 times
Last edited by MagicBuzz on 21 Nov 2010 18:38, edited 2 times in total.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Group info

Post by Bilbo »

This looks great and useful, I have to test it :)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
rav
Traffic Manager
Traffic Manager
Posts: 253
Joined: 17 May 2007 13:36
Location: Netherlands
Contact:

Re: Group info

Post by rav »

same here! looks good :o

*wishes for group-based vehicle replacing*
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post 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.
Aydan
Traffic Manager
Traffic Manager
Posts: 199
Joined: 28 Feb 2003 14:49
Location: Germany

Re: Group info

Post 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.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Group info

Post 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
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post 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.
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Group info

Post 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...
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post 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.
Attachments
patch_group_info_r11039.patch
r11039
(5.71 KiB) Downloaded 350 times
An exemple of groups with information panel
An exemple of groups with information panel
group_stats.png (17.43 KiB) Viewed 1674 times
ThePenguin
Engineer
Engineer
Posts: 40
Joined: 15 May 2007 16:49

Re: Group info

Post by ThePenguin »

Thank You! I've been wanting something like this for a while. I'm just not that good at C++ *yet*.
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Group info

Post 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? :)
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post 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.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post 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.
Attachments
group_info_r21209.patch
(2.75 KiB) Downloaded 273 times
group_info.png
group_info.png (20.95 KiB) Viewed 1288 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Group info

Post by Zuu »

What does "FF" stand for?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post 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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Group info

Post by planetmaker »

Zuu wrote:What does "FF" stand for?
Given the language... French Franc?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Group info

Post 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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Group info

Post 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. ;)
Attachments
Farfingford Transport, 2151-01-29#1.png
Farfingford Transport, 2151-01-29#1.png (19.6 KiB) Viewed 11556 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post by MagicBuzz »

Thank you Chillcore :bow:

Here is the lasted patch version.
Attachments
group_info_r21289.patch
(3.35 KiB) Downloaded 331 times
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Group info

Post 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 11492 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...
Attachments
group_info_r21293.patch
(6.35 KiB) Downloaded 238 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 10 guests