author | smatz |
Sun, 07 Sep 2008 16:22:55 +0000 | |
changeset 10087 | 3159b77d3506 |
parent 10053 | 4df9e8656293 |
child 10156 | 5f8b021e74d6 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
9111
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
8969
diff
changeset
|
3 |
/** @file signs_gui.cpp The GUI for signs. */ |
6420
456c275f3313
(svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near
belugas
parents:
6247
diff
changeset
|
4 |
|
0 | 5 |
#include "stdafx.h" |
1891
862800791170
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents:
1575
diff
changeset
|
6 |
#include "openttd.h" |
0 | 7 |
#include "gui.h" |
8107
bb7deea89175
(svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium
parents:
8106
diff
changeset
|
8 |
#include "textbuf_gui.h" |
bb7deea89175
(svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium
parents:
8106
diff
changeset
|
9 |
#include "window_gui.h" |
8254
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
8224
diff
changeset
|
10 |
#include "player_gui.h" |
9510
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
11 |
#include "player_func.h" |
8790 | 12 |
#include "signs_base.h" |
13 |
#include "signs_func.h" |
|
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
14 |
#include "debug.h" |
2159
f6284cf5fab0
(svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents:
2135
diff
changeset
|
15 |
#include "variables.h" |
8116
8da76dcb3287
(svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
8114
diff
changeset
|
16 |
#include "command_func.h" |
8114
dd6d21dc99c1
(svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
8107
diff
changeset
|
17 |
#include "strings_func.h" |
8130
d2eb7d04f6e1
(svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents:
8121
diff
changeset
|
18 |
#include "core/alloc_func.hpp" |
8131
160939e24ed3
(svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h'
rubidium
parents:
8130
diff
changeset
|
19 |
#include "window_func.h" |
8139
4e91c448c409
(svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h).
rubidium
parents:
8131
diff
changeset
|
20 |
#include "map_func.h" |
8224
c5a64d87cc54
(svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents:
8139
diff
changeset
|
21 |
#include "gfx_func.h" |
c5a64d87cc54
(svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents:
8139
diff
changeset
|
22 |
#include "viewport_func.h" |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
23 |
#include "querystring_gui.h" |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
24 |
#include "sortlist_type.h" |
10087
3159b77d3506
(svn r14263) -Codechange: give a better error message when removing a sign fails
smatz
parents:
10053
diff
changeset
|
25 |
#include "string_func.h" |
0 | 26 |
|
8264
b1e85998c7d3
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents:
8258
diff
changeset
|
27 |
#include "table/strings.h" |
b1e85998c7d3
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents:
8258
diff
changeset
|
28 |
#include "table/sprites.h" |
b1e85998c7d3
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents:
8258
diff
changeset
|
29 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
30 |
struct SignList { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
31 |
typedef GUIList<const Sign *> GUISignList; |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
32 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
33 |
static const Sign *last_sign; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
34 |
GUISignList signs; |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
35 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
36 |
void BuildSignsList() |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
37 |
{ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
38 |
if (!this->signs.NeedRebuild()) return; |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
39 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
40 |
DEBUG(misc, 3, "Building sign list"); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
41 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
42 |
this->signs.Clear(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
43 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
44 |
const Sign *si; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
45 |
FOR_ALL_SIGNS(si) *this->signs.Append() = si; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
46 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
47 |
this->signs.Compact(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
48 |
this->signs.RebuildDone(); |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
49 |
} |
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
50 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
51 |
/** Sort signs by their name */ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
52 |
static int CDECL SignNameSorter(const Sign* const *a, const Sign* const *b) |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
53 |
{ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
54 |
static char buf_cache[64]; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
55 |
char buf[64]; |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
56 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
57 |
SetDParam(0, (*a)->index); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
58 |
GetString(buf, STR_SIGN_NAME, lastof(buf)); |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
59 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
60 |
if (*b != last_sign) { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
61 |
last_sign = *b; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
62 |
SetDParam(0, (*b)->index); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
63 |
GetString(buf_cache, STR_SIGN_NAME, lastof(buf_cache)); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
64 |
} |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
65 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
66 |
return strcasecmp(buf, buf_cache); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
67 |
} |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
68 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
69 |
void SortSignsList() |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
70 |
{ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
71 |
if (!this->signs.Sort(&SignNameSorter)) return; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
72 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
73 |
/* Reset the name sorter sort cache */ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
74 |
this->last_sign = NULL; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
75 |
} |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
76 |
}; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
77 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
78 |
const Sign *SignList::last_sign = NULL; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
79 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
80 |
struct SignListWindow : Window, SignList { |
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
81 |
SignListWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
82 |
{ |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
83 |
this->vscroll.cap = 12; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
84 |
this->resize.step_height = 10; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
85 |
this->resize.height = this->height - 10 * 7; // minimum if 5 in the list |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
86 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
87 |
this->signs.ForceRebuild(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
88 |
this->signs.NeedResort(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
89 |
|
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
90 |
this->FindWindowPlacementAndResize(desc); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
91 |
} |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
92 |
|
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
93 |
virtual void OnPaint() |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
94 |
{ |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
95 |
BuildSignsList(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
96 |
SortSignsList(); |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
97 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
98 |
SetVScrollCount(this, this->signs.Length()); |
8927
f04618a15ec7
(svn r12697) -Codechange: give signs_gui.cpp a touch of coding style.
rubidium
parents:
8790
diff
changeset
|
99 |
|
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
100 |
SetDParam(0, this->vscroll.count); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
101 |
this->DrawWidgets(); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
102 |
|
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
103 |
/* No signs? */ |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
104 |
int y = 16; // offset from top of widget |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
105 |
if (this->vscroll.count == 0) { |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
106 |
DrawString(2, y, STR_304A_NONE, TC_FROMSTRING); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
107 |
return; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
108 |
} |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
109 |
|
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
110 |
/* Start drawing the signs */ |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
111 |
for (uint16 i = this->vscroll.pos; i < this->vscroll.cap + this->vscroll.pos && i < this->vscroll.count; i++) { |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
112 |
const Sign *si = this->signs[i]; |
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
113 |
|
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
114 |
if (si->owner != OWNER_NONE) DrawPlayerIcon(si->owner, 4, y + 1); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
115 |
|
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
116 |
SetDParam(0, si->index); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
117 |
DrawString(22, y, STR_SIGN_NAME, TC_YELLOW); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
118 |
y += 10; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
119 |
} |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
120 |
} |
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
121 |
|
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
122 |
virtual void OnClick(Point pt, int widget) |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
123 |
{ |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
124 |
if (widget == 3) { |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
125 |
uint32 id_v = (pt.y - 15) / 10; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
126 |
|
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
127 |
if (id_v >= this->vscroll.cap) return; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
128 |
id_v += this->vscroll.pos; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
129 |
if (id_v >= this->vscroll.count) return; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
130 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
131 |
const Sign *si = this->signs[id_v]; |
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
132 |
ScrollMainWindowToTile(TileVirtXY(si->x, si->y)); |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
133 |
} |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
134 |
} |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
135 |
|
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
136 |
virtual void OnResize(Point new_size, Point delta) |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
137 |
{ |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
138 |
this->vscroll.cap += delta.y / 10; |
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
139 |
} |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
140 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
141 |
virtual void OnInvalidateData(int data) |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
142 |
{ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
143 |
if (data == 0) { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
144 |
this->signs.ForceRebuild(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
145 |
} else { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
146 |
this->signs.ForceResort(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
147 |
} |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
148 |
} |
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
149 |
}; |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
150 |
|
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
151 |
static const Widget _sign_list_widget[] = { |
9764
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
152 |
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
153 |
{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 345, 0, 13, STR_SIGN_LIST_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
154 |
{ WWT_STICKYBOX, RESIZE_LR, COLOUR_GREY, 346, 357, 0, 13, 0x0, STR_STICKY_BUTTON}, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
155 |
{ WWT_PANEL, RESIZE_RB, COLOUR_GREY, 0, 345, 14, 137, 0x0, STR_NULL}, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
156 |
{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_GREY, 346, 357, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
157 |
{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_GREY, 346, 357, 126, 137, 0x0, STR_RESIZE_BUTTON}, |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
158 |
{ WIDGETS_END}, |
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
159 |
}; |
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
160 |
|
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
161 |
static const WindowDesc _sign_list_desc = { |
7341
02515d0d4ced
(svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents:
7127
diff
changeset
|
162 |
WDP_AUTO, WDP_AUTO, 358, 138, 358, 138, |
5893
7e431a4abebb
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium
parents:
5751
diff
changeset
|
163 |
WC_SIGN_LIST, WC_NONE, |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
164 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE, |
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
165 |
_sign_list_widget, |
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
166 |
}; |
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
167 |
|
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
168 |
|
6247 | 169 |
void ShowSignList() |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
170 |
{ |
9316
f8c7d3af9e1b
(svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents:
9305
diff
changeset
|
171 |
AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0); |
1575
1f403d3c354f
(svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents:
1130
diff
changeset
|
172 |
} |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
173 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
174 |
static void RenameSign(SignID index, const char *text) |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
175 |
{ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
176 |
_cmd_text = text; |
10087
3159b77d3506
(svn r14263) -Codechange: give a better error message when removing a sign fails
smatz
parents:
10053
diff
changeset
|
177 |
DoCommandP(0, index, 0, NULL, CMD_RENAME_SIGN | (StrEmpty(text) ? CMD_MSG(STR_CAN_T_DELETE_SIGN) : CMD_MSG(STR_280C_CAN_T_CHANGE_SIGN_NAME))); |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
178 |
} |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
179 |
|
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
180 |
enum QueryEditSignWidgets { |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
181 |
QUERY_EDIT_SIGN_WIDGET_TEXT = 3, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
182 |
QUERY_EDIT_SIGN_WIDGET_OK, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
183 |
QUERY_EDIT_SIGN_WIDGET_CANCEL, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
184 |
QUERY_EDIT_SIGN_WIDGET_DELETE, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
185 |
QUERY_EDIT_SIGN_WIDGET_PREVIOUS = QUERY_EDIT_SIGN_WIDGET_DELETE + 2, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
186 |
QUERY_EDIT_SIGN_WIDGET_NEXT, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
187 |
}; |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
188 |
|
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
189 |
struct SignWindow : QueryStringBaseWindow, SignList { |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
190 |
SignID cur_sign; |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
191 |
|
9913
d9ce89020cc0
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents:
9897
diff
changeset
|
192 |
SignWindow(const WindowDesc *desc, const Sign *si) : QueryStringBaseWindow(MAX_LENGTH_SIGN_NAME_BYTES, desc) |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
193 |
{ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
194 |
SetBit(_no_scroll, SCROLL_EDIT); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
195 |
this->caption = STR_280B_EDIT_SIGN_TEXT; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
196 |
this->afilter = CS_ALPHANUMERAL; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
197 |
this->LowerWidget(QUERY_EDIT_SIGN_WIDGET_TEXT); |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
198 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
199 |
UpdateSignEditWindow(si); |
9305
d6694e58c36b
(svn r13173) -Codechange: make windows of the main toolbars.
rubidium
parents:
9285
diff
changeset
|
200 |
this->FindWindowPlacementAndResize(desc); |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
201 |
} |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
202 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
203 |
~SignWindow() |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
204 |
{ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
205 |
ClrBit(_no_scroll, SCROLL_EDIT); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
206 |
} |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
207 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
208 |
void UpdateSignEditWindow(const Sign *si) |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
209 |
{ |
9897
4d9a6ff6703e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium
parents:
9764
diff
changeset
|
210 |
char *last_of = &this->edit_str_buf[this->edit_str_size - 1]; |
4d9a6ff6703e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium
parents:
9764
diff
changeset
|
211 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
212 |
/* Display an empty string when the sign hasnt been edited yet */ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
213 |
if (si->name != NULL) { |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
214 |
SetDParam(0, si->index); |
9897
4d9a6ff6703e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium
parents:
9764
diff
changeset
|
215 |
GetString(this->edit_str_buf, STR_SIGN_NAME, last_of); |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
216 |
} else { |
9897
4d9a6ff6703e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium
parents:
9764
diff
changeset
|
217 |
GetString(this->edit_str_buf, STR_EMPTY, last_of); |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
218 |
} |
9897
4d9a6ff6703e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium
parents:
9764
diff
changeset
|
219 |
*last_of = '\0'; |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
220 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
221 |
this->cur_sign = si->index; |
9913
d9ce89020cc0
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents:
9897
diff
changeset
|
222 |
InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, MAX_LENGTH_SIGN_NAME_PIXELS); |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
223 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
224 |
this->InvalidateWidget(QUERY_EDIT_SIGN_WIDGET_TEXT); |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
225 |
} |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
226 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
227 |
virtual void OnPaint() |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
228 |
{ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
229 |
SetDParam(0, this->caption); |
9273
35e0224ea8f1
(svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents:
9179
diff
changeset
|
230 |
this->DrawWidgets(); |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
231 |
this->DrawEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
232 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
233 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
234 |
virtual void OnClick(Point pt, int widget) |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
235 |
{ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
236 |
switch (widget) { |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
237 |
case QUERY_EDIT_SIGN_WIDGET_PREVIOUS: { |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
238 |
/* Rebuild the sign list */ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
239 |
this->signs.ForceRebuild(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
240 |
this->signs.NeedResort(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
241 |
this->BuildSignsList(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
242 |
this->SortSignsList(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
243 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
244 |
/* By default pick the last entry */ |
10053
4df9e8656293
(svn r14215) -Cleanup (r13866): Strange line wrapping...
peter1138
parents:
9913
diff
changeset
|
245 |
const Sign *si = this->signs[this->signs.Length() - 1]; |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
246 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
247 |
for (uint i = 1; i < this->signs.Length(); i++) { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
248 |
if (this->cur_sign == this->signs[i]->index) { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
249 |
si = this->signs[i - 1]; |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
250 |
break; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
251 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
252 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
253 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
254 |
/* Scroll to sign and reopen window */ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
255 |
ScrollMainWindowToTile(TileVirtXY(si->x, si->y)); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
256 |
UpdateSignEditWindow(si); |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
257 |
break; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
258 |
} |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
259 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
260 |
case QUERY_EDIT_SIGN_WIDGET_NEXT: { |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
261 |
/* Rebuild the sign list */ |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
262 |
this->signs.ForceRebuild(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
263 |
this->signs.NeedResort(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
264 |
this->BuildSignsList(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
265 |
this->SortSignsList(); |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
266 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
267 |
/* By default pick the last entry */ |
10053
4df9e8656293
(svn r14215) -Cleanup (r13866): Strange line wrapping...
peter1138
parents:
9913
diff
changeset
|
268 |
const Sign *si = this->signs[this->signs.Length() - 1]; |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
269 |
|
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
270 |
for (uint i = 0; i < this->signs.Length() - 1; i++) { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
271 |
if (this->cur_sign == this->signs[i]->index) { |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
272 |
si = this->signs[i + 1]; |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
273 |
break; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
274 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
275 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
276 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
277 |
/* Scroll to sign and reopen window */ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
278 |
ScrollMainWindowToTile(TileVirtXY(si->x, si->y)); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
279 |
UpdateSignEditWindow(si); |
9734
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
280 |
break; |
eb7fab767c8e
(svn r13866) -Codechange: Use sortlist for sign windows
peter1138
parents:
9510
diff
changeset
|
281 |
} |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
282 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
283 |
case QUERY_EDIT_SIGN_WIDGET_TEXT: |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
284 |
ShowOnScreenKeyboard(this, widget, QUERY_EDIT_SIGN_WIDGET_CANCEL, QUERY_EDIT_SIGN_WIDGET_OK); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
285 |
break; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
286 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
287 |
case QUERY_EDIT_SIGN_WIDGET_DELETE: |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
288 |
/* Only need to set the buffer to null, the rest is handled as the OK button */ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
289 |
DeleteTextBufferAll(&this->text); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
290 |
/* FALL THROUGH */ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
291 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
292 |
case QUERY_EDIT_SIGN_WIDGET_OK: |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
293 |
RenameSign(this->cur_sign, this->text.buf); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
294 |
/* FALL THROUGH */ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
295 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
296 |
case QUERY_EDIT_SIGN_WIDGET_CANCEL: |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
297 |
delete this; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
298 |
break; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
299 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
300 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
301 |
|
9285
235e5e2d7f55
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents:
9273
diff
changeset
|
302 |
virtual EventState OnKeyPress(uint16 key, uint16 keycode) |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
303 |
{ |
9285
235e5e2d7f55
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents:
9273
diff
changeset
|
304 |
EventState state = ES_NOT_HANDLED; |
235e5e2d7f55
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents:
9273
diff
changeset
|
305 |
switch (this->HandleEditBoxKey(QUERY_EDIT_SIGN_WIDGET_TEXT, key, keycode, state)) { |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
306 |
case 1: // Enter pressed, confirms change |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
307 |
RenameSign(this->cur_sign, this->text.buf); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
308 |
/* FALL THROUGH */ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
309 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
310 |
case 2: // ESC pressed, closes window, abandons changes |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
311 |
delete this; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
312 |
break; |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
313 |
} |
9285
235e5e2d7f55
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents:
9273
diff
changeset
|
314 |
return state; |
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
315 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
316 |
|
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
317 |
virtual void OnMouseLoop() |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
318 |
{ |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
319 |
this->HandleEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT); |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
320 |
} |
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
321 |
}; |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
322 |
|
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
323 |
static const Widget _query_sign_edit_widgets[] = { |
9764
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
324 |
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
325 |
{ WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 11, 259, 0, 13, STR_012D, STR_NULL }, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
326 |
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 259, 14, 29, STR_NULL, STR_NULL }, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
327 |
{ WWT_EDITBOX, RESIZE_NONE, COLOUR_GREY, 2, 257, 16, 27, STR_SIGN_OSKTITLE, STR_NULL }, // Text field |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
328 |
{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 0, 60, 30, 41, STR_012F_OK, STR_NULL }, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
329 |
{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 61, 120, 30, 41, STR_012E_CANCEL, STR_NULL }, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
330 |
{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 121, 180, 30, 41, STR_0290_DELETE, STR_NULL }, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
331 |
{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 181, 237, 30, 41, STR_NULL, STR_NULL }, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
332 |
{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 238, 248, 30, 41, STR_6819, STR_PREVIOUS_SIGN_TOOLTIP }, |
9b21f847d91c
(svn r13900) -Codechange: Replace numbers with Colours enum on settings, smallmaps, stations and signs guis.
belugas
parents:
9734
diff
changeset
|
333 |
{ WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREY, 249, 259, 30, 41, STR_681A, STR_NEXT_SIGN_TOOLTIP }, |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
334 |
{ WIDGETS_END }, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
335 |
}; |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
336 |
|
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
337 |
static const WindowDesc _query_sign_edit_desc = { |
7341
02515d0d4ced
(svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents:
7127
diff
changeset
|
338 |
190, 170, 260, 42, 260, 42, |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
339 |
WC_QUERY_STRING, WC_NONE, |
8019
fc0e94dee165
(svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas
parents:
8018
diff
changeset
|
340 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
341 |
_query_sign_edit_widgets, |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
342 |
}; |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
343 |
|
9510
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
344 |
void HandleClickOnSign(const Sign *si) |
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
345 |
{ |
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
346 |
if (_ctrl_pressed && si->owner == _local_player) { |
10087
3159b77d3506
(svn r14263) -Codechange: give a better error message when removing a sign fails
smatz
parents:
10053
diff
changeset
|
347 |
RenameSign(si->index, NULL); |
9510
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
348 |
return; |
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
349 |
} |
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
350 |
ShowRenameSignWindow(si); |
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
351 |
} |
5ca327a7ce93
(svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents:
9317
diff
changeset
|
352 |
|
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
353 |
void ShowRenameSignWindow(const Sign *si) |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
354 |
{ |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
355 |
/* Delete all other edit windows and the save window */ |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
356 |
DeleteWindowById(WC_QUERY_STRING, 0); |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
357 |
DeleteWindowById(WC_SAVELOAD, 0); |
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
358 |
|
9179
780666b686ed
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
9143
diff
changeset
|
359 |
new SignWindow(&_query_sign_edit_desc, si); |
7127
86924644d78a
(svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents:
7056
diff
changeset
|
360 |
} |