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);
Window(WindowDesc *desc)
Empty constructor, initialization has been moved to InitNested() called from the constructor of the d...
void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
High level window description.
void DrawWidgets() const
Paint all widgets of a window.
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
TransparencyOptionBits _transparency_opt
The bits that should be transparent.
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.
Functions, definitions and such used only by the GUI.
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.
Data structure for an opened window.
bool _ctrl_pressed
Is Ctrl pressed?
void OnPaint() override
The window must be repainted.
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
Transparency toolbar; Window numbers:
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
static void ToggleInvisibility(TransparencyOption to)
Toggle the invisibility option bit.
SoundSettings sound
sound effect settings
Point GetToolbarAlignedWindowPosition(int window_width)
Computer the position of the top-left corner of a window to be opened right under the toolbar...
ClientSettings _settings_client
The current settings for this game.
byte _display_opt
What do we want to draw/do?
Types related to global configuration settings.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
static void ToggleTransparency(TransparencyOption to)
Toggle the transparency option bit.
#define lengthof(x)
Return the length of an fixed size array.
static void ToggleTransparencyLock(TransparencyOption to)
Toggle the transparency lock bit.
Functions related to sound.
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
No window, redirects to WC_MAIN_WINDOW.
If set the frame is lowered and the background colour brighter (ie. buttons when pressed) ...
Functions related to transparency.
uint TransparencyOptionBits
transparency option bits
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
Coordinates of a point in 2D.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
Specification of a rectangle with absolute coordinates of all edges.
WindowNumber window_number
Window number within the window class.
Manually align the window (so no automatic location finding)
bool click_beep
Beep on a random selection of buttons.
void ShowTransparencyToolbar()
Show the transparency toolbar.
This file contains all sprite-related enums and defines.
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...
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
TransparencyOptionBits _transparency_lock
Prevent these bits from flipping with X.