src/subsidy_gui.cpp
author skidd13
Tue, 20 Nov 2007 14:11:19 +0000
changeset 8428 f8300c908bd9
parent 8320 6ffad7a5d242
child 8452 93186e0f15cb
child 9723 eee46cb39750
permissions -rw-r--r--
(svn r11485) -Codechange: Remove the doubled function ToggleBitT and rename the remaining to fit with the naming style
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     2
6916
e87d54a598ea (svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near
belugas
parents: 6654
diff changeset
     3
/** @file subsidy_gui.cpp */
e87d54a598ea (svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near
belugas
parents: 6654
diff changeset
     4
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
#include "stdafx.h"
1891
92a3b0aa0946 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1093
diff changeset
     6
#include "openttd.h"
507
8aa8100b0b22 (svn r815) Include strings.h only in the files which need it.
tron
parents: 193
diff changeset
     7
#include "table/strings.h"
7762
03721db0ac1c (svn r10587) -Codechange: move the string/dparam related stuff from variables.h to strings.h
rubidium
parents: 7554
diff changeset
     8
#include "strings.h"
2163
637ec3c361f5 (svn r2673) Include functions.h directly, not globally via openttd.h
tron
parents: 2159
diff changeset
     9
#include "functions.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    10
#include "window.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
#include "station.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
#include "industry.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
#include "town.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
#include "player.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    15
#include "gfx.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    16
#include "economy.h"
2159
3b634157c3b2 (svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents: 1962
diff changeset
    17
#include "variables.h"
4261
2ec8f5a9747b (svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
rubidium
parents: 4171
diff changeset
    18
#include "date.h"
6654
c864458011b9 (svn r9300) -Codechange: Use cargo's town effect property in the subsidy gui
peter1138
parents: 6573
diff changeset
    19
#include "cargotype.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    20
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
static void HandleSubsidyClick(int y)
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
    22
{
4171
3fadda3afe70 (svn r5609) CodeChange : Apply coding style
belugas
parents: 2857
diff changeset
    23
	const Subsidy *s;
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    24
	uint num;
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    25
	int offs;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    26
	TileIndex xy;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    27
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    28
	if (y < 0) return;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    29
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    30
	num = 0;
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    31
	for (s = _subsidies; s != endof(_subsidies); s++) {
2469
1bfbb0dc0b75 (svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
tron
parents: 2186
diff changeset
    32
		if (s->cargo_type != CT_INVALID && s->age < 12) {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    33
			y -= 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    34
			if (y < 0) goto handle_click;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    35
			num++;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    36
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    37
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    38
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    39
	if (num == 0) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
		y -= 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    41
		if (y < 0) return;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
	y -= 11;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    45
	if (y < 0) return;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    46
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    47
	for (s = _subsidies; s != endof(_subsidies); s++) {
2469
1bfbb0dc0b75 (svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
tron
parents: 2186
diff changeset
    48
		if (s->cargo_type != CT_INVALID && s->age >= 12) {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    49
			y -= 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    50
			if (y < 0) goto handle_click;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    51
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    52
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    53
	return;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
    54
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
handle_click:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    56
6654
c864458011b9 (svn r9300) -Codechange: Use cargo's town effect property in the subsidy gui
peter1138
parents: 6573
diff changeset
    57
	TownEffect te = GetCargo(s->cargo_type)->town_effect;
c864458011b9 (svn r9300) -Codechange: Use cargo's town effect property in the subsidy gui
peter1138
parents: 6573
diff changeset
    58
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    59
	/* determine from coordinate for subsidy and try to scroll to it */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    60
	offs = s->from;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
	if (s->age >= 12) {
919
b0d6c7642f99 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents: 867
diff changeset
    62
		xy = GetStation(offs)->xy;
6654
c864458011b9 (svn r9300) -Codechange: Use cargo's town effect property in the subsidy gui
peter1138
parents: 6573
diff changeset
    63
	} else if (te == TE_PASSENGERS || te == TE_MAIL) {
919
b0d6c7642f99 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents: 867
diff changeset
    64
		xy = GetTown(offs)->xy;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    65
	} else {
919
b0d6c7642f99 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents: 867
diff changeset
    66
		xy = GetIndustry(offs)->xy;
6654
c864458011b9 (svn r9300) -Codechange: Use cargo's town effect property in the subsidy gui
peter1138
parents: 6573
diff changeset
    67
	}
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
    68
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    69
	if (!ScrollMainWindowToTile(xy)) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    70
		/* otherwise determine to coordinate for subsidy and scroll to it */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    71
		offs = s->to;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    72
		if (s->age >= 12) {
919
b0d6c7642f99 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents: 867
diff changeset
    73
			xy = GetStation(offs)->xy;
6654
c864458011b9 (svn r9300) -Codechange: Use cargo's town effect property in the subsidy gui
peter1138
parents: 6573
diff changeset
    74
		} else if (te == TE_PASSENGERS || te == TE_MAIL || te == TE_GOODS || te == TE_FOOD) {
919
b0d6c7642f99 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents: 867
diff changeset
    75
			xy = GetTown(offs)->xy;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    76
		} else {
919
b0d6c7642f99 (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
truelight
parents: 867
diff changeset
    77
			xy = GetIndustry(offs)->xy;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    78
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    79
		ScrollMainWindowToTile(xy);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    80
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    81
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    82
4171
3fadda3afe70 (svn r5609) CodeChange : Apply coding style
belugas
parents: 2857
diff changeset
    83
static void DrawSubsidiesWindow(const Window *w)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    84
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    85
	YearMonthDay ymd;
4171
3fadda3afe70 (svn r5609) CodeChange : Apply coding style
belugas
parents: 2857
diff changeset
    86
	const Subsidy *s;
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    87
	uint num;
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    88
	int x;
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
    89
	int y;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    90
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    91
	DrawWindowWidgets(w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    92
4288
60398d0e64ee (svn r5918) -Cleanup: rename ConvertDayToYMD/ConvertYMDToDay as they really convert a Date to/from a YearMonthDay.
rubidium
parents: 4261
diff changeset
    93
	ConvertDateToYMD(_date, &ymd);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    94
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    95
	y = 15;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    96
	x = 1;
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
    97
	DrawString(x, y, STR_2026_SUBSIDIES_ON_OFFER_FOR, TC_FROMSTRING);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    98
	y += 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    99
	num = 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   100
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   101
	for (s = _subsidies; s != endof(_subsidies); s++) {
2469
1bfbb0dc0b75 (svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
tron
parents: 2186
diff changeset
   102
		if (s->cargo_type != CT_INVALID && s->age < 12) {
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   103
			int x2;
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   104
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   105
			SetupSubsidyDecodeParam(s, 1);
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
   106
			x2 = DrawString(x + 2, y, STR_2027_FROM_TO, TC_FROMSTRING);
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 176
diff changeset
   107
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   108
			SetDParam(0, _date - ymd.day + 384 - s->age * 32);
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
   109
			DrawString(x2, y, STR_2028_BY, TC_FROMSTRING);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   110
			y += 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   111
			num++;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   112
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   113
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   114
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   115
	if (num == 0) {
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
   116
		DrawString(x + 2, y, STR_202A_NONE, TC_FROMSTRING);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   117
		y += 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   118
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   119
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
   120
	DrawString(x, y + 1, STR_202B_SERVICES_ALREADY_SUBSIDISED, TC_FROMSTRING);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   121
	y += 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   122
	num = 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   123
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   124
	for (s = _subsidies; s != endof(_subsidies); s++) {
2469
1bfbb0dc0b75 (svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
tron
parents: 2186
diff changeset
   125
		if (s->cargo_type != CT_INVALID && s->age >= 12) {
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   126
			int xt;
2630
35249d2ded3e (svn r3172) static, const
tron
parents: 2469
diff changeset
   127
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   128
			SetupSubsidyDecodeParam(s, 1);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
7554
076c42f44a83 (svn r10323) -Codechange: reference company name, number and player (president) name
peter1138
parents: 6916
diff changeset
   130
			PlayerID player = GetStation(s->to)->owner;
076c42f44a83 (svn r10323) -Codechange: reference company name, number and player (president) name
peter1138
parents: 6916
diff changeset
   131
			SetDParam(3, player);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
   133
			xt = DrawString(x + 2, y, STR_202C_FROM_TO, TC_FROMSTRING);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
534
17ab2f22ff74 (svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents: 507
diff changeset
   135
			SetDParam(0, _date - ymd.day + 768 - s->age * 32);
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
   136
			DrawString(xt, y, STR_202D_UNTIL, TC_FROMSTRING);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
			y += 10;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   138
			num++;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   139
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   141
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 7837
diff changeset
   142
	if (num == 0) DrawString(x + 2, y, STR_202A_NONE, TC_FROMSTRING);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   143
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   144
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   145
static void SubsidiesListWndProc(Window *w, WindowEvent *e)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   146
{
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   147
	switch (e->event) {
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   148
		case WE_PAINT: DrawSubsidiesWindow(w); break;
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   149
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   150
		case WE_CLICK:
4634
897461a3e9ca (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4288
diff changeset
   151
			switch (e->we.click.widget) {
897461a3e9ca (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4288
diff changeset
   152
				case 3:
897461a3e9ca (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4288
diff changeset
   153
					HandleSubsidyClick(e->we.click.pt.y - 25);
897461a3e9ca (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4288
diff changeset
   154
					break;
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   155
			}
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2630
diff changeset
   156
		break;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   157
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   158
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   159
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   160
static const Widget _subsidies_list_widgets[] = {
2857
1877bc2188fc (svn r3405) - Feature: Make subsidies window pinnable. Don't ask me why this wasn't included in the first round of pinning.
Darkvater
parents: 2791
diff changeset
   161
{   WWT_CLOSEBOX,   RESIZE_NONE, 13,   0,  10,   0,  13, STR_00C5,           STR_018B_CLOSE_WINDOW},
1877bc2188fc (svn r3405) - Feature: Make subsidies window pinnable. Don't ask me why this wasn't included in the first round of pinning.
Darkvater
parents: 2791
diff changeset
   162
{    WWT_CAPTION,   RESIZE_NONE, 13,  11, 617,   0,  13, STR_2025_SUBSIDIES, STR_018C_WINDOW_TITLE_DRAG_THIS},
1877bc2188fc (svn r3405) - Feature: Make subsidies window pinnable. Don't ask me why this wasn't included in the first round of pinning.
Darkvater
parents: 2791
diff changeset
   163
{  WWT_STICKYBOX,   RESIZE_NONE, 13, 618, 629,   0,  13, STR_NULL,           STR_STICKY_BUTTON},
4938
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4634
diff changeset
   164
{      WWT_PANEL,   RESIZE_NONE, 13,   0, 629,  14, 126, 0x0,                STR_01FD_CLICK_ON_SERVICE_TO_CENTER},
176
84990c4b9212 (svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents: 0
diff changeset
   165
{   WIDGETS_END},
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   166
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   167
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   168
static const WindowDesc _subsidies_list_desc = {
7837
65d7362153a6 (svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents: 7762
diff changeset
   169
	WDP_AUTO, WDP_AUTO, 630, 127, 630, 127,
6144
5a0ffbf27ced (svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium
parents: 5835
diff changeset
   170
	WC_SUBSIDIES_LIST, WC_NONE,
2857
1877bc2188fc (svn r3405) - Feature: Make subsidies window pinnable. Don't ask me why this wasn't included in the first round of pinning.
Darkvater
parents: 2791
diff changeset
   171
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   172
	_subsidies_list_widgets,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   173
	SubsidiesListWndProc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   174
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   175
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   176
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6144
diff changeset
   177
void ShowSubsidiesList()
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   178
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   179
	AllocateWindowDescFront(&_subsidies_list_desc, 0);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   180
}