Waypoint stats

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

Post Reply
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Waypoint stats

Post by chrissicom »

I tried to make a patch to display waypoint stats. The code is taken from an old more advanced patch which includes a lot of other features. I have replaced a few things but there are 5 compiler errors left which I cannot resolve. Maybe somebody can look at it :-)

2>Compiling...
2>waypoint.cpp
2>..\src\waypoint.cpp(582) : error C2065: 'VEH_Train' : undeclared identifier
2>..\src\waypoint.cpp(675) : error C2039: 'disabled_state' : is not a member of 'Window'
2> d:\openttd\openttd-source\src\window.h(266) : see declaration of 'Window'
2>..\src\waypoint.cpp(677) : error C2039: 'disabled_state' : is not a member of 'Window'
2> d:\openttd\openttd-source\src\window.h(266) : see declaration of 'Window'
2>..\src\waypoint.cpp(714) : error C2039: 'click' : is not a member of 'WindowEvent'
2> d:\openttd\openttd-source\src\window.h(140) : see declaration of 'WindowEvent'
2>..\src\waypoint.cpp(714) : error C2228: left of '.widget' must have class/struct/union
Attachments
waypointstats.diff
(15.69 KiB) Downloaded 101 times
l_Blue_l
Transport Coordinator
Transport Coordinator
Posts: 285
Joined: 29 Mar 2006 22:42
Contact:

Re: Waypoint stats

Post by l_Blue_l »

it is now "VEH_TRAIN" not "VEH_Train"
and it is "e->we.click.widget" instead of "e->click.widget"

Good luck finding what the other problems are. It may help to have a look in old source code to see what has changed to similar code and see if you can spot the difference.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Waypoint stats

Post by belugas »

disable_state is not a member of w for quite a long time.
Remove it from the Window struct and place it in the Widget struct allows us to have no more limits of widgets per window, clickable or not.
You could replace your calls by something like SetWindowWidgetDisabledState(w, 5, wp->veh_scheduled != 0)
My guess is that your code is a really old one, or coming from a really old source...
And there are really some strange stuff in your diff.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Waypoint stats

Post by Bilbo »

Perhaps similar statistics would be nice for stations too...
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)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 24 guests