Rise
The Vieneo Province
Loading...
Searching...
No Matches
ExternalCameraDialog.cpp
Go to the documentation of this file.
2#include "../GameClass.h"
4#include <algorithm>
5
7{
8 normalinterlace = false;
9 tabs = 0;
10 defaultwidth = static_cast<short>(ExternalCamera::Width);
11 defaultheight = static_cast<short>(ExternalCamera::Height);
13 icon = 17; // Navigation reticle from the existing dialog icon atlas.
14 allowresize = false;
15 allowscroll = false;
16}
17
19{
20 const bool external = gui->game->viewscreen->camera && gui->game->viewscreen->camera->outside &&
22 const bool hideTemporarily = gui->game->timeLapse || gui->game->showKeymapOverlay;
23 enabled = external && !hideTemporarily;
24
25 if (visibility.Update(external, hideTemporarily, gui->minimized, active, minimized))
26 {
27 // Open at the saved position, without the centered pop-up animation.
30 }
31}
32
34{
35 msgbartext[0] = L'\0';
36 if (const auto* camera = gui->game->viewscreen->camera)
37 {
38 const int length = static_cast<int>((std::min)(camera->name.size(), size_t(HELP_SIZE - 1)));
39 const int converted = MultiByteToWideChar(CP_ACP, 0, camera->name.c_str(), length,
41 msgbartext[converted] = L'\0';
42 _wcsupr_s(msgbartext, HELP_SIZE);
43 }
44}
45
static HMI * gui
Definition DialogBase.h:42
short icon
Definition DialogBase.h:55
bool active
Definition DialogBase.h:73
short tabs
Definition DialogBase.h:64
static void BringToFront(short t)
short defaultwidth
Definition DialogBase.h:53
short dialogid
Definition DialogBase.h:102
bool minimized
Definition DialogBase.h:104
static void CheckMoved(short t)
WCHAR msgbartext[HELP_SIZE]
Definition DialogBase.h:84
RiseMath::Vector3 windowdefaultlocation
Definition DialogBase.h:54
RiseMath::Vector3 windowlocation
Definition DialogBase.h:61
bool allowresize
Definition DialogBase.h:47
bool normalinterlace
Definition DialogBase.h:56
bool allowscroll
Definition DialogBase.h:47
DialogBase(short id)
bool enabled
Definition DialogBase.h:73
short defaultheight
Definition DialogBase.h:53
void Draw(RiseMath::Vector3 *tracked) override
void UpdateAvailability() override
ExternalCameraDialogVisibility visibility
bool Update(bool external, bool hideTemporarily, bool allMinimized, bool &active, bool &minimized)
bool showKeymapOverlay
Definition GameClass.h:133
bool timeLapse
Definition GameClass.h:134
std::unique_ptr< Viewscreen > viewscreen
Definition GameClass.h:107
GameClass * game
Definition gui.h:1213
void RenderExternalCameraOverlay(const RiseMath::Vector3 &position)
Definition gui.cpp:3038
bool minimized
Definition gui.h:1113
bool outside
Definition Camera.h:17
SCamera * camera
Definition Viewscreen.h:137
DeathType dead
Definition globals.cpp:37
s_network_objects playerships[MAX_SCAN]
Definition globals.cpp:112
#define HELP_SIZE
Definition gui.h:21
constexpr float Width
constexpr float Height