src/transparency_gui.cpp
author rubidium
Thu, 18 Dec 2008 12:23:08 +0000
changeset 10436 8d3a9fbe8f19
parent 10207 c291a21b304e
permissions -rw-r--r--
(svn r14689) -Change: make configure die on commonly made user mistakes, like not having SDL development files or zlib headers installed; you can still compile a dedicated server or a binary without zlib, but you have to explicitly force it.
6427
7dc1012757d8 (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
parents:
diff changeset
     1
/* $Id$ */
7dc1012757d8 (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
parents:
diff changeset
     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: 8806
diff changeset
     3
/** @file transparency_gui.cpp The transparency GUI. */
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: 8806
diff changeset
     4
6427
7dc1012757d8 (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
parents:
diff changeset
     5
#include "stdafx.h"
7dc1012757d8 (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
parents:
diff changeset
     6
#include "openttd.h"
7dc1012757d8 (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
parents:
diff changeset
     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 "window_gui.h"
6427
7dc1012757d8 (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
parents:
diff changeset
     9
#include "variables.h"
7849
0a1c0af2c96c (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas
parents: 7341
diff changeset
    10
#include "transparency.h"
8157
1505def01945 (svn r11719) -Codechange: split sound.h in a header with types and one with functions.
rubidium
parents: 8131
diff changeset
    11
#include "sound_func.h"
7849
0a1c0af2c96c (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas
parents: 7341
diff changeset
    12
8264
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8224
diff changeset
    13
#include "table/sprites.h"
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8224
diff changeset
    14
#include "table/strings.h"
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8224
diff changeset
    15
7849
0a1c0af2c96c (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas
parents: 7341
diff changeset
    16
TransparencyOptionBits _transparency_opt;
8527
a32b9ac056af (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8452
diff changeset
    17
TransparencyOptionBits _transparency_lock;
8806
4fe163e0b52a (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 8657
diff changeset
    18
TransparencyOptionBits _invisibility_opt;
6427
7dc1012757d8 (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
parents:
diff changeset
    19
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    20
class TransparenciesWindow : public Window
6427
7dc1012757d8 (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
parents:
diff changeset
    21
{
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    22
	enum TransparencyToolbarWidgets{
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    23
		TTW_WIDGET_SIGNS = 3,    ///< Make signs background transparent
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    24
		TTW_WIDGET_TREES,        ///< Make trees transparent
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    25
		TTW_WIDGET_HOUSES,       ///< Make houses transparent
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    26
		TTW_WIDGET_INDUSTRIES,   ///< Make Industries transparent
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 10205
diff changeset
    27
		TTW_WIDGET_BUILDINGS,    ///< Make company buildings and structures transparent
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    28
		TTW_WIDGET_BRIDGES,      ///< Make bridges transparent
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    29
		TTW_WIDGET_STRUCTURES,   ///< Make unmovable structures transparent
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    30
		TTW_WIDGET_CATENARY,     ///< Make catenary transparent
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    31
		TTW_WIDGET_LOADING,      ///< Make loading indicators transparent
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    32
		TTW_WIDGET_END,          ///< End of toggle buttons
8806
4fe163e0b52a (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 8657
diff changeset
    33
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    34
		/* Panel with buttons for invisibility */
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    35
		TTW_BUTTONS = 12,        ///< Panel with 'invisibility' buttons
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    36
	};
6427
7dc1012757d8 (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
parents:
diff changeset
    37
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    38
public:
9203
082fbf0500c4 (svn r13069) -Codechange: it is no longer needed to pass a void *data pointer with the WE_CREATE message because nothing uses it anymore.
rubidium
parents: 9197
diff changeset
    39
	TransparenciesWindow(const WindowDesc *desc, int window_number) : Window(desc, window_number)
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    40
	{
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    41
		this->FindWindowPlacementAndResize(desc);
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    42
	}
8806
4fe163e0b52a (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 8657
diff changeset
    43
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    44
	virtual void OnPaint()
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    45
	{
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    46
		/* must be sure that the widgets show the transparency variable changes
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    47
		 * also when we use shortcuts */
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    48
		for (uint i = TTW_WIDGET_SIGNS; i < TTW_WIDGET_END; i++) {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    49
			this->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    50
		}
8806
4fe163e0b52a (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 8657
diff changeset
    51
9273
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9203
diff changeset
    52
		this->DrawWidgets();
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    53
		for (uint i = TO_SIGNS; i < TO_END; i++) {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
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);
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    55
		}
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    56
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    57
		/* Do not draw button for invisible loading indicators */
9754
934a4d138205 (svn r13890) -Codechange: Simplify drawing of invisibilty buttons in the transparency gui -- the real widgets above already have coordinates so there is no need to hardcode them again. As an added bonus the invisibility buttons now line up properly.
peter1138
parents: 9753
diff changeset
    58
		for (uint i = TTW_WIDGET_SIGNS; i <= TTW_WIDGET_CATENARY; i++) {
934a4d138205 (svn r13890) -Codechange: Simplify drawing of invisibilty buttons in the transparency gui -- the real widgets above already have coordinates so there is no need to hardcode them again. As an added bonus the invisibility buttons now line up properly.
peter1138
parents: 9753
diff changeset
    59
			const Widget *wi = &this->widget[i];
934a4d138205 (svn r13890) -Codechange: Simplify drawing of invisibilty buttons in the transparency gui -- the real widgets above already have coordinates so there is no need to hardcode them again. As an added bonus the invisibility buttons now line up properly.
peter1138
parents: 9753
diff changeset
    60
			DrawFrameRect(wi->left + 1, 38, wi->right - 1, 46, COLOUR_PALE_GREEN, HasBit(_invisibility_opt, i - TTW_WIDGET_SIGNS) ? FR_LOWERED : FR_NONE);
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    61
		}
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    62
	}
8806
4fe163e0b52a (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 8657
diff changeset
    63
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    64
	virtual void OnClick(Point pt, int widget)
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    65
	{
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    66
		if (widget >= TTW_WIDGET_SIGNS && widget < TTW_WIDGET_END) {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    67
			if (_ctrl_pressed) {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    68
				/* toggle the bit of the transparencies lock variable */
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    69
				ToggleTransparencyLock((TransparencyOption)(widget - TTW_WIDGET_SIGNS));
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    70
				this->SetDirty();
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    71
			} else {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    72
				/* toggle the bit of the transparencies variable and play a sound */
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    73
				ToggleTransparency((TransparencyOption)(widget - TTW_WIDGET_SIGNS));
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    74
				SndPlayFx(SND_15_BEEP);
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    75
				MarkWholeScreenDirty();
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    76
			}
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    77
		} else if (widget == TTW_BUTTONS) {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    78
			uint x = pt.x / 22;
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    79
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    80
			if (x > TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) x--;
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    81
			if (x > TTW_WIDGET_CATENARY - TTW_WIDGET_SIGNS) return;
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    82
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    83
			ToggleInvisibility((TransparencyOption)x);
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    84
			SndPlayFx(SND_15_BEEP);
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    85
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    86
			/* Redraw whole screen only if transparency is set */
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    87
			if (IsTransparencySet((TransparencyOption)x)) {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    88
				MarkWholeScreenDirty();
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    89
			} else {
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    90
				this->InvalidateWidget(TTW_BUTTONS);
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    91
			}
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    92
		}
6427
7dc1012757d8 (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
parents:
diff changeset
    93
	}
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
    94
};
6427
7dc1012757d8 (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
parents:
diff changeset
    95
7dc1012757d8 (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
parents:
diff changeset
    96
static const Widget _transparency_widgets[] = {
9753
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
    97
{ WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,  10,   0,  13, STR_00C5,                 STR_018B_CLOSE_WINDOW},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
    98
{  WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,  11, 206,   0,  13, STR_TRANSPARENCY_TOOLB,   STR_018C_WINDOW_TITLE_DRAG_THIS},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
    99
{WWT_STICKYBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN, 207, 218,   0,  13, STR_NULL,                 STR_STICKY_BUTTON},
6427
7dc1012757d8 (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
parents:
diff changeset
   100
6496
40748e256bbe (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6427
diff changeset
   101
/* transparency widgets:
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 10205
diff changeset
   102
 * transparent signs, trees, houses, industries, company's buildings, bridges, unmovable structures, catenary and loading indicators */
9753
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   103
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,  21,  14,  35, SPR_IMG_SIGN,         STR_TRANSPARENT_SIGNS_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   104
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  22,  43,  14,  35, SPR_IMG_PLANTTREES,   STR_TRANSPARENT_TREES_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   105
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  44,  65,  14,  35, SPR_IMG_TOWN,         STR_TRANSPARENT_HOUSES_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   106
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  66,  87,  14,  35, SPR_IMG_INDUSTRY,     STR_TRANSPARENT_INDUSTRIES_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   107
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN,  88, 109,  14,  35, SPR_IMG_COMPANY_LIST, STR_TRANSPARENT_BUILDINGS_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   108
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 110, 152,  14,  35, SPR_IMG_BRIDGE,       STR_TRANSPARENT_BRIDGES_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   109
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 153, 174,  14,  35, SPR_IMG_TRANSMITTER,  STR_TRANSPARENT_STRUCTURES_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   110
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 175, 196,  14,  35, SPR_BUILD_X_ELRAIL,   STR_TRANSPARENT_CATENARY_DESC},
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   111
{   WWT_IMGBTN,   RESIZE_NONE,  COLOUR_DARK_GREEN, 197, 218,  14,  35, SPR_IMG_TRAINLIST,    STR_TRANSPARENT_LOADING_DESC},
6427
7dc1012757d8 (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
parents:
diff changeset
   112
9753
669f1fe48c3a (svn r13889) -Codechange: Replace numbers with Colours enum on transparency gui.
belugas
parents: 9317
diff changeset
   113
{    WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0, 218,  36,  48, 0x0,                  STR_TRANSPARENT_INVISIBLE_DESC},
8806
4fe163e0b52a (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 8657
diff changeset
   114
6427
7dc1012757d8 (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
parents:
diff changeset
   115
{   WIDGETS_END},
7dc1012757d8 (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
parents:
diff changeset
   116
};
7dc1012757d8 (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
parents:
diff changeset
   117
7dc1012757d8 (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
parents:
diff changeset
   118
static const WindowDesc _transparency_desc = {
10205
d1ffc50f6c94 (svn r14419) -Codechange: adding two digits for no obvious reason (nor comment), plus code style Infringement.
belugas
parents: 9754
diff changeset
   119
	WDP_ALIGN_TBR, 94, 219, 49, 219, 49,
6427
7dc1012757d8 (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
parents:
diff changeset
   120
	WC_TRANSPARENCY_TOOLBAR, WC_NONE,
7dc1012757d8 (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
parents:
diff changeset
   121
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
7dc1012757d8 (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
parents:
diff changeset
   122
	_transparency_widgets,
7dc1012757d8 (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
parents:
diff changeset
   123
};
7dc1012757d8 (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
parents:
diff changeset
   124
7dc1012757d8 (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
parents:
diff changeset
   125
void ShowTransparencyToolbar(void)
7dc1012757d8 (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
parents:
diff changeset
   126
{
9196
e19365d5619d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 9143
diff changeset
   127
	AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
6427
7dc1012757d8 (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
parents:
diff changeset
   128
}