src/transparency_gui.cpp
author rubidium
Wed, 07 May 2008 21:45:27 +0000
changeset 10457 ea18877d8eba
parent 10434 d6accd017341
child 10462 416b62f5ee6f
permissions -rw-r--r--
(svn r12999) -Fix [FS#1995]: when a Window got deleted on a double click event, we should not send a click event to the now non-existant Window as that causes segfaults.
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
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
    20
enum TransparencyToolbarWidgets{
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    21
	TTW_WIDGET_SIGNS = 3,    ///< Make signs background transparent
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    22
	TTW_WIDGET_TREES,        ///< Make trees transparent
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    23
	TTW_WIDGET_HOUSES,       ///< Make houses transparent
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    24
	TTW_WIDGET_INDUSTRIES,   ///< Make Industries transparent
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    25
	TTW_WIDGET_BUILDINGS,    ///< Make player buildings and structures transparent
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    26
	TTW_WIDGET_BRIDGES,      ///< Make bridges transparent
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    27
	TTW_WIDGET_STRUCTURES,   ///< Make unmovable structures transparent
9024
85bc26dd4935 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz
parents: 9023
diff changeset
    28
	TTW_WIDGET_CATENARY,     ///< Make catenary transparent
9153
9bab3a04381c (svn r12319) -Cleanup: Comment fixes (Roujin)
peter1138
parents: 9024
diff changeset
    29
	TTW_WIDGET_LOADING,      ///< Make loading indicators transparent
7094
623d0668e267 (svn r9812) -Fix (r9679): Obiwan prevented proper display of last transparency button.
peter1138
parents: 6992
diff changeset
    30
	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
    31
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    32
	/* Panel with buttons for invisibility */
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    33
	TTW_BUTTONS = 12,        ///< Panel with 'invisibility' buttons
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
    34
};
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    35
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
    36
static void TransparencyToolbWndProc(Window *w, WindowEvent *e)
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
{
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
    38
	switch (e->event) {
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
    39
		case WE_PAINT:
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
    40
			/* must be sure that the widgets show the transparency variable changes
7775aeb8b9d3 (svn r9679) -Codechange: use enums to identify transparency widgets and add a bit of documentation (patch by Wolf01)
belugas
parents: 6923
diff changeset
    41
			 * also when we use shortcuts */
7094
623d0668e267 (svn r9812) -Fix (r9679): Obiwan prevented proper display of last transparency button.
peter1138
parents: 6992
diff changeset
    42
			for (uint i = TTW_WIDGET_SIGNS; i < TTW_WIDGET_END; i++) {
8493
3ab458f7cff4 (svn r11555) -Codechange: use the new members introduced in r11551.
rubidium
parents: 8345
diff changeset
    43
				w->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
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
    44
			}
8944
8cd013359596 (svn r12018) -Fix(FS#1721,r9563): Restore initial intent on the invisible tree while transparent building patch setting
belugas
parents: 8760
diff changeset
    45
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
    46
			DrawWindowWidgets(w);
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
    47
			for (uint i = TO_SIGNS; i < TO_END; i++) {
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    48
				if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, w->widget[TTW_WIDGET_SIGNS + i].left + 1, w->widget[TTW_WIDGET_SIGNS + i].top + 1);
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    49
			}
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    50
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    51
			/* Do not draw button for invisible loading indicators */
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    52
			for (uint i = 0; i < 8; i++) {
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    53
				if (i < TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) {
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    54
					DrawFrameRect(i * 22, 38, i * 22 + 19, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    55
				} else if (i == TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) {
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    56
					DrawFrameRect(i * 22, 38, i * 22 + 41, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    57
				} else { // i > TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    58
					DrawFrameRect((i + 1) * 22, 38, (i + 1) * 22 + 19, 46, true, HasBit(_invisibility_opt, i) ? FR_LOWERED : FR_NONE);
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    59
				}
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    60
			}
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    61
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
    62
			break;
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
    63
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
    64
		case WE_CLICK:
9024
85bc26dd4935 (svn r12103) -Feature(tte): separate catenary transparency settings from building transparency settings
smatz
parents: 9023
diff changeset
    65
			if (e->we.click.widget >= TTW_WIDGET_SIGNS && e->we.click.widget < TTW_WIDGET_END) {
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
    66
				if (_ctrl_pressed) {
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    67
					/* toggle the bit of the transparencies lock variable */
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    68
					ToggleTransparencyLock((TransparencyOption)(e->we.click.widget - TTW_WIDGET_SIGNS));
10434
d6accd017341 (svn r12976) -Codechange: use w->SetDirty() instead of SetWindowDirty(w) when it's certain that w != NULL.
rubidium
parents: 10429
diff changeset
    69
					w->SetDirty();
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
    70
				} else {
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    71
					/* toggle the bit of the transparencies variable and play a sound */
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    72
					ToggleTransparency((TransparencyOption)(e->we.click.widget - TTW_WIDGET_SIGNS));
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    73
					SndPlayFx(SND_15_BEEP);
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    74
					MarkWholeScreenDirty();
3435736a1a6b (svn r12102) -Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x'. (Roujin)
maedhros
parents: 8948
diff changeset
    75
				}
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    76
			} else if (e->we.click.widget == TTW_BUTTONS) {
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    77
				uint x = e->we.click.pt.x / 22;
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    78
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    79
				if (x > TTW_WIDGET_BRIDGES - TTW_WIDGET_SIGNS) x--;
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    80
				if (x > TTW_WIDGET_CATENARY - TTW_WIDGET_SIGNS) break;
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    81
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    82
				ToggleInvisibility((TransparencyOption)x);
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    83
				SndPlayFx(SND_15_BEEP);
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    84
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    85
				/* Redraw whole screen only if transparency is set */
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    86
				if (IsTransparencySet((TransparencyOption)x)) {
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    87
					MarkWholeScreenDirty();
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    88
				} else {
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    89
					w->InvalidateWidget(TTW_BUTTONS);
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    90
				}
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
    91
			}
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
    92
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
    93
			break;
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
    94
	}
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
    95
}
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
    96
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
    97
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
    98
{ 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
    99
{  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
   100
{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
   101
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
   102
/* transparency widgets:
9153
9bab3a04381c (svn r12319) -Cleanup: Comment fixes (Roujin)
peter1138
parents: 9024
diff changeset
   103
 * 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
   104
{   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
   105
{   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
   106
{   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
   107
{   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
   108
{   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
   109
{   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
   110
{   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
   111
{   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
   112
{   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
   113
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
   114
{    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
   115
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
   116
{   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
   117
};
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
   118
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
   119
static const WindowDesc _transparency_desc = {
9302
4aa3c4a44b16 (svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
smatz
parents: 9153
diff changeset
   120
	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
   121
	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
   122
	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
   123
	_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
   124
	TransparencyToolbWndProc
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
};
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
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
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
   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
	AllocateWindowDescFront(&_transparency_desc, 0);
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
}