OpenTTD Source  14.0-beta1
screenshot_gui.cpp File Reference
#include "stdafx.h"
#include "window_func.h"
#include "window_gui.h"
#include "screenshot.h"
#include "widgets/screenshot_widget.h"
#include "table/strings.h"
#include "gfx_func.h"

Go to the source code of this file.

Data Structures

struct  ScreenshotWindow
 

Functions

void ShowScreenshotWindow ()
 
void SetScreenshotWindowVisibility (bool hide)
 Set the visibility of the screenshot window when taking a screenshot. More...
 

Variables

static constexpr NWidgetPart _nested_screenshot []
 
static WindowDesc _screenshot_window_desc (__FILE__, __LINE__, WDP_AUTO, "take_a_screenshot", 200, 100, WC_SCREENSHOT, WC_NONE, 0, std::begin(_nested_screenshot), std::end(_nested_screenshot))
 

Detailed Description

GUI functions related to screenshots.

Definition in file screenshot_gui.cpp.

Function Documentation

◆ SetScreenshotWindowVisibility()

void SetScreenshotWindowVisibility ( bool  hide)

Set the visibility of the screenshot window when taking a screenshot.

Parameters
hideAre we hiding the window or showing it again after the screenshot is taken?

Definition at line 80 of file screenshot_gui.cpp.

References FindWindowById(), Window::left, Window::SetDirty(), and WC_SCREENSHOT.

Referenced by RealMakeScreenshot().

Variable Documentation

◆ _nested_screenshot

constexpr NWidgetPart _nested_screenshot[]
staticconstexpr
Initial value:
= {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_SCREENSHOT_CAPTION, 0),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE), SetFill(1, 1), SetDataTip(STR_SCREENSHOT_SCREENSHOT, 0), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_ZOOMIN), SetFill(1, 1), SetDataTip(STR_SCREENSHOT_ZOOMIN_SCREENSHOT, 0), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_DEFAULTZOOM), SetFill(1, 1), SetDataTip(STR_SCREENSHOT_DEFAULTZOOM_SCREENSHOT, 0), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_WORLD), SetFill(1, 1), SetDataTip(STR_SCREENSHOT_WORLD_SCREENSHOT, 0), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_HEIGHTMAP), SetFill(1, 1), SetDataTip(STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT, 0), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_MINIMAP), SetFill(1, 1), SetDataTip(STR_SCREENSHOT_MINIMAP_SCREENSHOT, 0), SetMinimalTextLines(2, 0),
}

Definition at line 46 of file screenshot_gui.cpp.

SetFill
constexpr NWidgetPart SetFill(uint16_t fill_x, uint16_t fill_y)
Widget part function for setting filling.
Definition: widget_type.h:1141
WWT_STICKYBOX
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition: widget_type.h:68
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:63
WID_SC_TAKE
@ WID_SC_TAKE
Button for taking a normal screenshot.
Definition: screenshot_widget.h:16
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:77
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1151
NC_EQUALSIZE
@ NC_EQUALSIZE
Value of the NCB_EQUALSIZE flag.
Definition: widget_type.h:508
WID_SC_TAKE_HEIGHTMAP
@ WID_SC_TAKE_HEIGHTMAP
Button for taking a heightmap "screenshot".
Definition: screenshot_widget.h:20
WID_SC_TAKE_DEFAULTZOOM
@ WID_SC_TAKE_DEFAULTZOOM
Button for taking a screenshot at normal zoom.
Definition: screenshot_widget.h:18
WWT_PUSHTXTBTN
@ WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
Definition: widget_type.h:110
WID_SC_TAKE_WORLD
@ WID_SC_TAKE_WORLD
Button for taking a screenshot of the whole world.
Definition: screenshot_widget.h:19
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=-1)
Widget part function for starting a new 'real' widget.
Definition: widget_type.h:1258
NWID_VERTICAL
@ NWID_VERTICAL
Vertical container.
Definition: widget_type.h:79
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition: widget_type.h:71
WID_SC_TAKE_ZOOMIN
@ WID_SC_TAKE_ZOOMIN
Button for taking a zoomed in screenshot.
Definition: screenshot_widget.h:17
SetDataTip
constexpr NWidgetPart SetDataTip(uint32_t data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1162
SetMinimalTextLines
constexpr NWidgetPart SetMinimalTextLines(uint8_t lines, uint8_t spacing, FontSize size=FS_NORMAL)
Widget part function for setting the minimal text lines.
Definition: widget_type.h:1109
WID_SC_TAKE_MINIMAP
@ WID_SC_TAKE_MINIMAP
Button for taking a minimap screenshot.
Definition: screenshot_widget.h:21
WWT_SHADEBOX
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition: widget_type.h:66