OpenTTD Source 20241224-master-gee860a5c8e
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 NWidgetPart _nested_screenshot []
 
static WindowDesc _screenshot_window_desc (WDP_AUTO, "take_a_screenshot", 200, 100, WC_SCREENSHOT, WC_NONE, 0, _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 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 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),
}
constexpr NWidgetPart SetFill(uint16_t fill_x, uint16_t fill_y)
Widget part function for setting filling.
constexpr NWidgetPart SetDataTip(uint32_t data, StringID tip)
Widget part function for setting the data and tooltip.
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=-1)
Widget part function for starting a new 'real' widget.
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
constexpr NWidgetPart SetMinimalTextLines(uint8_t lines, uint8_t spacing, FontSize size=FS_NORMAL)
Widget part function for setting the minimal text lines.
@ WID_SC_TAKE
Button for taking a normal screenshot.
@ WID_SC_TAKE_WORLD
Button for taking a screenshot of the whole world.
@ WID_SC_TAKE_MINIMAP
Button for taking a minimap screenshot.
@ WID_SC_TAKE_ZOOMIN
Button for taking a zoomed in screenshot.
@ WID_SC_TAKE_DEFAULTZOOM
Button for taking a screenshot at normal zoom.
@ WID_SC_TAKE_HEIGHTMAP
Button for taking a heightmap "screenshot".
@ NC_EQUALSIZE
Value of the NCB_EQUALSIZE flag.
@ WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:75
@ WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition widget_type.h:66
@ WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition widget_type.h:64
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition widget_type.h:61
@ NWID_VERTICAL
Vertical container.
Definition widget_type.h:77
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition widget_type.h:69

Definition at line 50 of file screenshot_gui.cpp.