OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
19 #include "table/strings.h"
62 const NWidgetBase *wi = this->GetWidget<NWidgetBase>(i);
86 const NWidgetBase *nwid = this->GetWidget<NWidgetBase>(i);
108 pt.y += 2 * (sm_height - this->GetWidget<NWidgetBase>(
WID_TT_BUTTONS)->current_y);
119 if (!gui_scope)
return;
126 static const NWidgetPart _nested_transparency_widgets[] = {
153 _nested_transparency_widgets,
lengthof(_nested_transparency_widgets)
161 AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
@ WC_TRANSPARENCY_TOOLBAR
Transparency toolbar; Window numbers:
static bool IsTransparencySet(TransparencyOption to)
Check if the transparency option bit is set and if we aren't in the game menu (there's never transpar...
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
bool _ctrl_pressed
Is Ctrl pressed?
@ SND_15_BEEP
19 == 0x13 GUI button click
ClientSettings _settings_client
The current settings for this game.
@ FR_LOWERED
If set the frame is lowered and the background colour brighter (ie. buttons when pressed)
Window(WindowDesc *desc)
Empty constructor, initialization has been moved to InitNested() called from the constructor of the d...
High level window description.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
SoundSettings sound
sound effect settings
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
static bool IsInsideBS(const T x, const size_t base, const size_t size)
Checks if a value is between a window started at some base point.
Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
Compute the initial position of the window.
TransparencyOptionBits _invisibility_opt
The bits that should be invisible.
uint TransparencyOptionBits
transparency option bits
Point GetToolbarAlignedWindowPosition(int window_width)
Computer the position of the top-left corner of a window to be opened right under the toolbar.
void OnPaint() override
The window must be repainted.
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
Coordinates of a point in 2D.
static void ToggleInvisibility(TransparencyOption to)
Toggle the invisibility option bit.
WindowNumber window_number
Window number within the window class.
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
void ShowTransparencyToolbar()
Show the transparency toolbar.
TransparencyOptionBits _transparency_opt
The bits that should be transparent.
TransparencyOptionBits _transparency_lock
Prevent these bits from flipping with X.
byte _display_opt
What do we want to draw/do?
bool click_beep
Beep on a random selection of buttons.
#define lengthof(x)
Return the length of an fixed size array.
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
@ WDP_MANUAL
Manually align the window (so no automatic location finding)
static void ToggleTransparency(TransparencyOption to)
Toggle the transparency option bit.
static void ToggleTransparencyLock(TransparencyOption to)
Toggle the transparency lock bit.
Data structure for an opened window.
void DrawWidgets() const
Paint all widgets of a window.
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
Specification of a rectangle with absolute coordinates of all edges.
void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.