21 #include "table/strings.h" 64 const NWidgetBase *wi = this->GetWidget<NWidgetBase>(i);
88 const NWidgetBase *nwid = this->GetWidget<NWidgetBase>(i);
110 pt.y += 2 * (sm_height - this->GetWidget<NWidgetBase>(
WID_TT_BUTTONS)->current_y);
121 if (!gui_scope)
return;
128 static const NWidgetPart _nested_transparency_widgets[] = {
155 _nested_transparency_widgets,
lengthof(_nested_transparency_widgets)
163 AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
Compute the initial position of the window.
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.
static bool IsInsideBS(const T x, const uint base, const uint size)
Checks if a value is between a window started at some base point.
virtual void OnPaint()
The window must be repainted.
TransparencyOptionBits _invisibility_opt
The bits that should be invisible.
Functions, definitions and such used only by the GUI.
Data structure for an opened window.
bool _ctrl_pressed
Is Ctrl pressed?
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
virtual void OnInvalidateData(int data=0, bool gui_scope=true)
Some data on this window has become invalid.
Transparency toolbar; Window numbers:
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.
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.
virtual void DrawWidget(const Rect &r, int widget) const
Draw the contents of a nested widget.
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) ...
virtual void OnClick(Point pt, int widget, int click_count)
A click with the left mouse button has been made on the window.
Functions related to transparency.
uint TransparencyOptionBits
transparency option bits
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.