Rise
The Vieneo Province
Loading...
Searching...
No Matches
LineInput.cpp
Go to the documentation of this file.
1#include "../Instrument.h"
2#include "../../Bus.h"
3
4LineInput::LineInput(int prmX, int prmY, float prmXScale, float prmYScale, Bus* prmBus, Logger* prmLogger, DeviceObject* prmDevice, std::vector<Font*> prmFonts, std::string prmPageName) :
5 Instrument(prmX, prmY, prmXScale, prmYScale, prmBus, prmLogger, prmDevice, prmFonts)
6{
7 logger->AddToCallStack("LineInput::ctor");
8 defaultFont = 1;
9 pageName = prmPageName;
10}
11
13{
14 logger->AddToCallStack("LineInput::Render");
15 if ((pageName == "Intermedia" && g_bTextInput == 2) || // server requested info
16 (pageName == "Cargo Manifest" && g_bTextInput >= 5 && g_bTextInput <= 8) || // cash, fuel, jettison
17 (pageName == "Scanner" && g_bTextInput >= 5 && g_bTextInput <= 6)) // cash, fuel
18 {
19 DrawTextW(lclPrompt, 5, 0, 0.1f, DT_NOCLIP, 0xFF00FFFF);
20
21 DrawTextW(lclOutgoing, 5, 10, 0.1f, DT_NOCLIP, 0xFFFFFFFF);
22 }
23}
24
25void LineInput::FrameMove(float fElapsed)
26{
27 logger->AddToCallStack("LineInput::FrameMove");
28 cursorTime += fElapsed;
29 if (cursorTime > 1.0f)
30 {
31 cursorTime = 0.0f;
33 }
34
35 swprintf_s(lclPrompt, 80, L"%S", prompt);
36
37 if (cursorState)
38 swprintf_s(lclOutgoing, 80, L"%S_", outgoing);
39 else
40 swprintf_s(lclOutgoing, 80, L"%S", outgoing);
41}
Definition Bus.h:20
Instrument(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts)
Definition Instrument.h:36
Logger * logger
Definition Instrument.h:23
UINT defaultFont
Definition Instrument.h:24
void Render() override
Definition LineInput.cpp:12
WCHAR lclOutgoing[80]
Definition Instrument.h:145
int cursorState
Definition Instrument.h:142
float cursorTime
Definition Instrument.h:143
WCHAR lclPrompt[80]
Definition Instrument.h:145
void FrameMove(float fElapsed) override
Definition LineInput.cpp:25
LineInput(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts, std::string prmPageName)
Definition LineInput.cpp:4
std::string pageName
Definition Instrument.h:144
void AddToCallStack(const char *msg)
Definition Logger.cpp:355
char prompt[80]
Definition globals.cpp:62
char g_bTextInput
Definition globals.cpp:61
char outgoing[80]
Definition globals.cpp:60