src/transparency_gui.cpp
author Tero Marttila <terom@fixme.fi>
Tue, 22 Jul 2008 23:20:33 +0300
changeset 11184 88c967f1422b
parent 10641 13148f508e6d
permissions -rw-r--r--
add an empty bin/cache dir
6923
6913c8a82cc0 (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$ */
6913c8a82cc0 (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
10429
1b99254f9607 (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: 9302
diff changeset
     3
/** @file transparency_gui.cpp The transparency GUI. */
1b99254f9607 (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: 9302
diff changeset
     4
6923
6913c8a82cc0 (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"
6913c8a82cc0 (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"
6913c8a82cc0 (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"
8603
88c5ce6a5215 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium
parents: 8602
diff changeset
     8
#include "window_gui.h"
6923
6913c8a82cc0 (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"
8345
6caa3fdb972c (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas
parents: 7837
diff changeset
    10
#include "transparency.h"
8653
a83f7a536919 (svn r11719) -Codechange: split sound.h in a header with types and one with functions.
rubidium
parents: 8627
diff changeset
    11
#include "sound_func.h"
8345
6caa3fdb972c (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas
parents: 7837
diff changeset
    12
8760
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8720
diff changeset
    13
#include "table/sprites.h"
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8720
diff changeset
    14
#include "table/strings.h"
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8720
diff changeset
    15
8345
6caa3fdb972c (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
belugas
parents: 7837
diff changeset
    16
TransparencyOptionBits _transparency_opt;
9023
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    17
TransparencyOptionBits _transparency_lock;
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    18
TransparencyOptionBits _invisibility_opt;
6923
6913c8a82cc0 (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
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    20
class TransparenciesWindow : public Window
6923
6913c8a82cc0 (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
{
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    22
	enum TransparencyToolbarWidgets{
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    23
		TTW_WIDGET_SIGNS = 3,    ///< Make signs background transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    24
		TTW_WIDGET_TREES,        ///< Make trees transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    25
		TTW_WIDGET_HOUSES,       ///< Make houses transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    26
		TTW_WIDGET_INDUSTRIES,   ///< Make Industries transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    27
		TTW_WIDGET_BUILDINGS,    ///< Make player buildings and structures transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    28
		TTW_WIDGET_BRIDGES,      ///< Make bridges transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    29
		TTW_WIDGET_STRUCTURES,   ///< Make unmovable structures transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    30
		TTW_WIDGET_CATENARY,     ///< Make catenary transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    31
		TTW_WIDGET_LOADING,      ///< Make loading indicators transparent
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    32
		TTW_WIDGET_END,          ///< End of toggle buttons
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    33
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    34
		/* Panel with buttons for invisibility */
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    35
		TTW_BUTTONS = 12,        ///< Panel with 'invisibility' buttons
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    36
	};
6923
6913c8a82cc0 (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
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    38
public:
10525
da5bc725cda4 (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: 10519
diff changeset
    39
	TransparenciesWindow(const WindowDesc *desc, int window_number) : Window(desc, window_number)
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    40
	{
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    41
		this->FindWindowPlacementAndResize(desc);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    42
	}
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    43
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    44
	virtual void OnPaint()
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    45
	{
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    46
		/* must be sure that the widgets show the transparency variable changes
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    47
		 * also when we use shortcuts */
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    48
		for (uint i = TTW_WIDGET_SIGNS; i < TTW_WIDGET_END; i++) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    49
			this->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    50
		}
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    51
10595
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10525
diff changeset
    52
		this->DrawWidgets();
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    53
		for (uint i = TO_SIGNS; i < TO_END; i++) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
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);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    55
		}
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    56
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    57
		/* Do not draw button for invisible loading indicators */
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    58
		for (uint i = 0; i < 8; i++) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    59
			if (i < TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    60
				DrawFrameRect(i * 22, 38, i * 22 + 19, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    61
			} else if (i == TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    62
				DrawFrameRect(i * 22, 38, i * 22 + 41, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    63
			} else { // i > TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    64
				DrawFrameRect((i + 1) * 22, 38, (i + 1) * 22 + 19, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
6923
6913c8a82cc0 (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
    65
			}
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    66
		}
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    67
	}
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    68
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    69
	virtual void OnClick(Point pt, int widget)
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    70
	{
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    71
		if (widget >= TTW_WIDGET_SIGNS && widget < TTW_WIDGET_END) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    72
			if (_ctrl_pressed) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    73
				/* toggle the bit of the transparencies lock variable */
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    74
				ToggleTransparencyLock((TransparencyOption)(widget - TTW_WIDGET_SIGNS));
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    75
				this->SetDirty();
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    76
			} else {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    77
				/* toggle the bit of the transparencies variable and play a sound */
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    78
				ToggleTransparency((TransparencyOption)(widget - TTW_WIDGET_SIGNS));
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    79
				SndPlayFx(SND_15_BEEP);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    80
				MarkWholeScreenDirty();
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    81
			}
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    82
		} else if (widget == TTW_BUTTONS) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    83
			uint x = pt.x / 22;
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    84
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    85
			if (x > TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) x--;
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    86
			if (x > TTW_WIDGET_CATENARY - TTW_WIDGET_SIGNS) return;
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    87
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    88
			ToggleInvisibility((TransparencyOption)x);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    89
			SndPlayFx(SND_15_BEEP);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    90
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    91
			/* Redraw whole screen only if transparency is set */
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    92
			if (IsTransparencySet((TransparencyOption)x)) {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    93
				MarkWholeScreenDirty();
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    94
			} else {
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    95
				this->InvalidateWidget(TTW_BUTTONS);
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    96
			}
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    97
		}
6923
6913c8a82cc0 (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
    98
	}
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
    99
};
6923
6913c8a82cc0 (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
6913c8a82cc0 (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
   101
static const Widget _transparency_widgets[] = {
6913c8a82cc0 (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
   102
{ WWT_CLOSEBOX,   RESIZE_NONE,  7,   0,  10,   0,  13, STR_00C5,                 STR_018B_CLOSE_WINDOW},
9024
85bc26dd4935 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz
parents: 9023
diff changeset
   103
{  WWT_CAPTION,   RESIZE_NONE,  7,  11, 206,   0,  13, STR_TRANSPARENCY_TOOLB,   STR_018C_WINDOW_TITLE_DRAG_THIS},
85bc26dd4935 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz
parents: 9023
diff changeset
   104
{WWT_STICKYBOX,   RESIZE_NONE,  7, 207, 218,   0,  13, STR_NULL,                 STR_STICKY_BUTTON},
6923
6913c8a82cc0 (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
   105
6992
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
   106
/* transparency widgets:
9153
9bab3a04381c (svn r12319) -Cleanup: Comment fixes (Roujin)
peter1138
parents: 9024
diff changeset
   107
 * transparent signs, trees, houses, industries, player's buildings, bridges, unmovable structures, catenary and loading indicators */
7096
fd549da22194 (svn r9814) -Fix (r1): Remove the duplicate sign sprite from openttd.grf since it's in the original data files.
maedhros
parents: 7094
diff changeset
   108
{   WWT_IMGBTN,   RESIZE_NONE,  7,   0,  21,  14,  35, SPR_IMG_SIGN,         STR_TRANSPARENT_SIGNS_DESC},
6923
6913c8a82cc0 (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
   109
{   WWT_IMGBTN,   RESIZE_NONE,  7,  22,  43,  14,  35, SPR_IMG_PLANTTREES,   STR_TRANSPARENT_TREES_DESC},
6913c8a82cc0 (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
   110
{   WWT_IMGBTN,   RESIZE_NONE,  7,  44,  65,  14,  35, SPR_IMG_TOWN,         STR_TRANSPARENT_HOUSES_DESC},
6913c8a82cc0 (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
   111
{   WWT_IMGBTN,   RESIZE_NONE,  7,  66,  87,  14,  35, SPR_IMG_INDUSTRY,     STR_TRANSPARENT_INDUSTRIES_DESC},
6913c8a82cc0 (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
{   WWT_IMGBTN,   RESIZE_NONE,  7,  88, 109,  14,  35, SPR_IMG_COMPANY_LIST, STR_TRANSPARENT_BUILDINGS_DESC},
6913c8a82cc0 (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
   113
{   WWT_IMGBTN,   RESIZE_NONE,  7, 110, 152,  14,  35, SPR_IMG_BRIDGE,       STR_TRANSPARENT_BRIDGES_DESC},
6913c8a82cc0 (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
   114
{   WWT_IMGBTN,   RESIZE_NONE,  7, 153, 174,  14,  35, SPR_IMG_TRANSMITTER,  STR_TRANSPARENT_STRUCTURES_DESC},
9024
85bc26dd4935 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz
parents: 9023
diff changeset
   115
{   WWT_IMGBTN,   RESIZE_NONE,  7, 175, 196,  14,  35, SPR_BUILD_X_ELRAIL,   STR_TRANSPARENT_CATENARY_DESC},
85bc26dd4935 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz
parents: 9023
diff changeset
   116
{   WWT_IMGBTN,   RESIZE_NONE,  7, 197, 218,  14,  35, SPR_IMG_TRAINLIST,    STR_TRANSPARENT_LOADING_DESC},
6923
6913c8a82cc0 (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
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
   118
{    WWT_PANEL,   RESIZE_NONE,  7,   0, 218,  36,  48, 0x0,                  STR_TRANSPARENT_INVISIBLE_DESC},
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
   119
6923
6913c8a82cc0 (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
{   WIDGETS_END},
6913c8a82cc0 (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
};
6913c8a82cc0 (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
6913c8a82cc0 (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
static const WindowDesc _transparency_desc = {
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
   124
	WDP_ALIGN_TBR, 58+36, 219, 49, 219, 49,
6923
6913c8a82cc0 (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
	WC_TRANSPARENCY_TOOLBAR, WC_NONE,
6913c8a82cc0 (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
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
6913c8a82cc0 (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
   127
	_transparency_widgets,
6913c8a82cc0 (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
};
6913c8a82cc0 (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
   129
6913c8a82cc0 (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
   130
void ShowTransparencyToolbar(void)
6913c8a82cc0 (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
   131
{
10518
b7c8733d4d9d (svn r13062) -Codechange: make a class of the TransparencyToolbar.
belugas
parents: 10462
diff changeset
   132
	AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
6923
6913c8a82cc0 (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
   133
}