OpenTTD Source: src/screenshot_gui.cpp File Reference

OpenTTD Source 15.0-RC2

Data Structures | Functions | Variables
screenshot_gui.cpp File Reference

GUI functions related to screenshots. More...

`#include "stdafx.h"`
`#include "window_func.h"`
`#include "window_gui.h"`
`#include "screenshot.h"`
`#include "gfx_func.h"`
`#include "widgets/screenshot_widget.h"`
`#include "table/strings.h"`
`#include "safeguards.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.

## Variables
static constexpr std::initializer_list< NWidgetPart > | _nested_screenshot
static WindowDesc | _screenshot_window_desc (WDP_AUTO, "take_a_screenshot", 200, 100, WC_SCREENSHOT, WC_NONE, {}, _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

  hide | Are we hiding the window or showing it again after the screenshot is taken?

Definition at line 84 of file screenshot_gui.cpp.

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

Referenced by RealMakeScreenshot().

## ◆ ShowScreenshotWindow()

void ShowScreenshotWindow | ( |  | ) |

Definition at line 74 of file screenshot_gui.cpp.

## Variable Documentation

## ◆ _nested_screenshot

constexpr std::initializer_list<NWidgetPart> _nested_screenshot
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_SCREENSHOT_CAPTION),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_VERTICAL, NWidContainerFlag::EqualSize),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_SCREENSHOT), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_ZOOMIN), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_ZOOMIN_SCREENSHOT), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_DEFAULTZOOM), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_DEFAULTZOOM_SCREENSHOT), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_WORLD), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_WORLD_SCREENSHOT), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_HEIGHTMAP), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT), SetMinimalTextLines(2, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_MINIMAP), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_MINIMAP_SCREENSHOT), SetMinimalTextLines(2, 0),
EndContainer(),
}
SetFill
constexpr NWidgetPart SetFill(uint16_t fill_x, uint16_t fill_y)
Widget part function for setting filling.
Definition widget_type.h:1219
SetStringTip
constexpr NWidgetPart SetStringTip(StringID string, StringID tip={})
Widget part function for setting the string and tooltip.
Definition widget_type.h:1240
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition widget_type.h:1229
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=INVALID_WIDGET)
Widget part function for starting a new 'real' widget.
Definition widget_type.h:1424
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:1187
WID_SC_TAKE
@ WID_SC_TAKE
Button for taking a normal screenshot.
Definition screenshot_widget.h:16
WID_SC_TAKE_WORLD
@ WID_SC_TAKE_WORLD
Button for taking a screenshot of the whole world.
Definition screenshot_widget.h:19
WID_SC_TAKE_MINIMAP
@ WID_SC_TAKE_MINIMAP
Button for taking a minimap screenshot.
Definition screenshot_widget.h:21
WID_SC_TAKE_ZOOMIN
@ WID_SC_TAKE_ZOOMIN
Button for taking a zoomed in screenshot.
Definition screenshot_widget.h:17
WID_SC_TAKE_DEFAULTZOOM
@ WID_SC_TAKE_DEFAULTZOOM
Button for taking a screenshot at normal zoom.
Definition screenshot_widget.h:18
WID_SC_TAKE_HEIGHTMAP
@ WID_SC_TAKE_HEIGHTMAP
Button for taking a heightmap "screenshot".
Definition screenshot_widget.h:20
WWT_PUSHTXTBTN
@ WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
Definition widget_type.h:104
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:66
WWT_STICKYBOX
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition widget_type.h:57
WWT_SHADEBOX
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition widget_type.h:55
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition widget_type.h:52
NWID_VERTICAL
@ NWID_VERTICAL
Vertical container.
Definition widget_type.h:68
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition widget_type.h:60
EqualSize
@ EqualSize
Containers should keep all their (resizing) children equally large.
Definition widget_type.h:541

Definition at line 50 of file screenshot_gui.cpp.