annotate src/transparency_gui.cpp @ 9196:7f58b98c86c5 draft

(svn r13062) -Codechange: make a class of the TransparencyToolbar.
author belugas <belugas@openttd.org>
date Tue, 13 May 2008 00:37:29 +0000
parents 00b40c2158ff
children 7b6607adc42d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
1 /* $Id$ */
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
2
9111
d48433370037 (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 <rubidium@openttd.org>
parents: 8806
diff changeset
3 /** @file transparency_gui.cpp The transparency GUI. */
d48433370037 (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 <rubidium@openttd.org>
parents: 8806
diff changeset
4
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
5 #include "stdafx.h"
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
6 #include "openttd.h"
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
7 #include "gui.h"
8107
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents: 8106
diff changeset
8 #include "window_gui.h"
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
9 #include "variables.h"
7849
e6ee8bfd9045 (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas <belugas@openttd.org>
parents: 7341
diff changeset
10 #include "transparency.h"
8157
019833e42fda (svn r11719) -Codechange: split sound.h in a header with types and one with functions.
rubidium <rubidium@openttd.org>
parents: 8131
diff changeset
11 #include "sound_func.h"
7849
e6ee8bfd9045 (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas <belugas@openttd.org>
parents: 7341
diff changeset
12
8264
2495310e220f (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium <rubidium@openttd.org>
parents: 8224
diff changeset
13 #include "table/sprites.h"
2495310e220f (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium <rubidium@openttd.org>
parents: 8224
diff changeset
14 #include "table/strings.h"
2495310e220f (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium <rubidium@openttd.org>
parents: 8224
diff changeset
15
7849
e6ee8bfd9045 (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas <belugas@openttd.org>
parents: 7341
diff changeset
16 TransparencyOptionBits _transparency_opt;
8527
0ab483c54082 (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros <maedhros@openttd.org>
parents: 8452
diff changeset
17 TransparencyOptionBits _transparency_lock;
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
18 TransparencyOptionBits _invisibility_opt;
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
19
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
20 class TransparenciesWindow : public Window
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
21 {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
22 enum TransparencyToolbarWidgets{
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
23 TTW_WIDGET_SIGNS = 3, ///< Make signs background transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
24 TTW_WIDGET_TREES, ///< Make trees transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
25 TTW_WIDGET_HOUSES, ///< Make houses transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
26 TTW_WIDGET_INDUSTRIES, ///< Make Industries transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
27 TTW_WIDGET_BUILDINGS, ///< Make player buildings and structures transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
28 TTW_WIDGET_BRIDGES, ///< Make bridges transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
29 TTW_WIDGET_STRUCTURES, ///< Make unmovable structures transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
30 TTW_WIDGET_CATENARY, ///< Make catenary transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
31 TTW_WIDGET_LOADING, ///< Make loading indicators transparent
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
32 TTW_WIDGET_END, ///< End of toggle buttons
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
33
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
34 /* Panel with buttons for invisibility */
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
35 TTW_BUTTONS = 12, ///< Panel with 'invisibility' buttons
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
36 };
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
37
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
38 public:
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
39 TransparenciesWindow(const WindowDesc *desc, void *data, int window_number) : Window(desc, data, window_number)
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
40 {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
41 this->FindWindowPlacementAndResize(desc);
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
42 }
6496
af3092f47536 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas <belugas@openttd.org>
parents: 6427
diff changeset
43
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
44 virtual void OnPaint()
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
45 {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
46 /* must be sure that the widgets show the transparency variable changes
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
47 * also when we use shortcuts */
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
48 for (uint i = TTW_WIDGET_SIGNS; i < TTW_WIDGET_END; i++) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
49 this->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
50 }
8448
5b5fdcb49728 (svn r12018) -Fix(FS#1721,r9563): Restore initial intent on the invisible tree while transparent building patch setting
belugas <belugas@openttd.org>
parents: 8264
diff changeset
51
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
52 DrawWindowWidgets(this);
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
53 for (uint i = TO_SIGNS; i < TO_END; i++) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
54 if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, this->widget[TTW_WIDGET_SIGNS + i].left + 1, this->widget[TTW_WIDGET_SIGNS + i].top + 1);
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
55 }
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
56
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
57 /* Do not draw button for invisible loading indicators */
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
58 for (uint i = 0; i < 8; i++) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
59 if (i < TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
60 DrawFrameRect(i * 22, 38, i * 22 + 19, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
61 } else if (i == TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
62 DrawFrameRect(i * 22, 38, i * 22 + 41, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
63 } else { // i > TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
64 DrawFrameRect((i + 1) * 22, 38, (i + 1) * 22 + 19, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
65 }
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
66 }
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
67 }
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
68
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
69 virtual void OnClick(Point pt, int widget)
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
70 {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
71 if (widget >= TTW_WIDGET_SIGNS && widget < TTW_WIDGET_END) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
72 if (_ctrl_pressed) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
73 /* toggle the bit of the transparencies lock variable */
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
74 ToggleTransparencyLock((TransparencyOption)(widget - TTW_WIDGET_SIGNS));
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
75 this->SetDirty();
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
76 } else {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
77 /* toggle the bit of the transparencies variable and play a sound */
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
78 ToggleTransparency((TransparencyOption)(widget - TTW_WIDGET_SIGNS));
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
79 SndPlayFx(SND_15_BEEP);
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
80 MarkWholeScreenDirty();
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
81 }
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
82 } else if (widget == TTW_BUTTONS) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
83 uint x = pt.x / 22;
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
84
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
85 if (x > TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) x--;
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
86 if (x > TTW_WIDGET_CATENARY - TTW_WIDGET_SIGNS) return;
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
87
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
88 ToggleInvisibility((TransparencyOption)x);
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
89 SndPlayFx(SND_15_BEEP);
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
90
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
91 /* Redraw whole screen only if transparency is set */
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
92 if (IsTransparencySet((TransparencyOption)x)) {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
93 MarkWholeScreenDirty();
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
94 } else {
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
95 this->InvalidateWidget(TTW_BUTTONS);
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
96 }
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
97 }
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
98 }
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
99 };
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
100
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
101 static const Widget _transparency_widgets[] = {
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
102 { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
8528
58090cf32d23 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz <smatz@openttd.org>
parents: 8527
diff changeset
103 { WWT_CAPTION, RESIZE_NONE, 7, 11, 206, 0, 13, STR_TRANSPARENCY_TOOLB, STR_018C_WINDOW_TITLE_DRAG_THIS},
58090cf32d23 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz <smatz@openttd.org>
parents: 8527
diff changeset
104 {WWT_STICKYBOX, RESIZE_NONE, 7, 207, 218, 0, 13, STR_NULL, STR_STICKY_BUTTON},
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
105
6496
af3092f47536 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas <belugas@openttd.org>
parents: 6427
diff changeset
106 /* transparency widgets:
8657
e809d9e09e4d (svn r12319) -Cleanup: Comment fixes (Roujin)
peter1138 <peter1138@openttd.org>
parents: 8528
diff changeset
107 * transparent signs, trees, houses, industries, player's buildings, bridges, unmovable structures, catenary and loading indicators */
6600
1eb24158c55a (svn r9814) -Fix (r1): Remove the duplicate sign sprite from openttd.grf since it's in the original data files.
maedhros <maedhros@openttd.org>
parents: 6598
diff changeset
108 { WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_SIGN, STR_TRANSPARENT_SIGNS_DESC},
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
109 { WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_PLANTTREES, STR_TRANSPARENT_TREES_DESC},
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
110 { WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_TOWN, STR_TRANSPARENT_HOUSES_DESC},
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
111 { WWT_IMGBTN, RESIZE_NONE, 7, 66, 87, 14, 35, SPR_IMG_INDUSTRY, STR_TRANSPARENT_INDUSTRIES_DESC},
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
112 { WWT_IMGBTN, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_IMG_COMPANY_LIST, STR_TRANSPARENT_BUILDINGS_DESC},
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
113 { WWT_IMGBTN, RESIZE_NONE, 7, 110, 152, 14, 35, SPR_IMG_BRIDGE, STR_TRANSPARENT_BRIDGES_DESC},
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
114 { WWT_IMGBTN, RESIZE_NONE, 7, 153, 174, 14, 35, SPR_IMG_TRANSMITTER, STR_TRANSPARENT_STRUCTURES_DESC},
8528
58090cf32d23 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz <smatz@openttd.org>
parents: 8527
diff changeset
115 { WWT_IMGBTN, RESIZE_NONE, 7, 175, 196, 14, 35, SPR_BUILD_X_ELRAIL, STR_TRANSPARENT_CATENARY_DESC},
58090cf32d23 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz <smatz@openttd.org>
parents: 8527
diff changeset
116 { WWT_IMGBTN, RESIZE_NONE, 7, 197, 218, 14, 35, SPR_IMG_TRAINLIST, STR_TRANSPARENT_LOADING_DESC},
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
117
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
118 { WWT_PANEL, RESIZE_NONE, 7, 0, 218, 36, 48, 0x0, STR_TRANSPARENT_INVISIBLE_DESC},
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
119
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
120 { WIDGETS_END},
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
121 };
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
122
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
123 static const WindowDesc _transparency_desc = {
8806
104bbcae351d (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz <smatz@openttd.org>
parents: 8657
diff changeset
124 WDP_ALIGN_TBR, 58+36, 219, 49, 219, 49,
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
125 WC_TRANSPARENCY_TOOLBAR, WC_NONE,
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
126 WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
127 _transparency_widgets,
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
128 TransparencyToolbWndProc
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
129 };
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
130
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
131 void ShowTransparencyToolbar(void)
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
132 {
9196
7f58b98c86c5 (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas <belugas@openttd.org>
parents: 9143
diff changeset
133 AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
6427
2437ed7b277c (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138 <peter1138@openttd.org>
parents:
diff changeset
134 }