Page 1 of 1

Waypoint stats

Posted: 14 Jul 2007 17:03
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

Re: Waypoint stats

Posted: 15 Jul 2007 01:10
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.

Re: Waypoint stats

Posted: 15 Jul 2007 23:54
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.

Re: Waypoint stats

Posted: 19 Jul 2007 15:57
by Bilbo
Perhaps similar statistics would be nice for stations too...