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