Rise
The Vieneo Province
LineInput.cpp
Go to the documentation of this file.
1 #include "../Instrument.h"
2 #include "../../Bus.h"
3 
4 LineInput::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  WCHAR lclOutgoing[80], lclPrompt[80];
20  swprintf_s(lclPrompt, 80, L"%S", prompt);
21  DrawTextW(lclPrompt, 0, 0, 0, DT_NOCLIP, 0xFF00FFFF);
22 
23  if (cursorState)
24  swprintf_s(lclOutgoing, 80, L"%S_", outgoing);
25  else
26  swprintf_s(lclOutgoing, 80, L"%S", outgoing);
27  DrawTextW(lclOutgoing, 0, 10, 0, DT_NOCLIP, 0xFFFFFFFF);
28  }
29 }
30 
31 void LineInput::FrameMove(float fElapsed)
32 {
33  logger->AddToCallStack("LineInput::FrameMove");
34  cursorTime += fElapsed;
35  if (cursorTime>1.0f)
36  {
37  cursorTime=0.0f;
39  }
40 }
Definition: Logger.h:9
void Render() override
Definition: LineInput.cpp:12
char g_bTextInput
Definition: globals.cpp:108
Definition: Bus.h:16
float cursorTime
Definition: Instrument.h:121
std::string pageName
Definition: Instrument.h:122
UINT defaultFont
Definition: Instrument.h:20
char outgoing[80]
Definition: globals.cpp:107
void FrameMove(float fElapsed) override
Definition: LineInput.cpp:31
Logger * logger
Definition: Instrument.h:19
int cursorState
Definition: Instrument.h:120
char prompt[80]
Definition: globals.cpp:109
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
void AddToCallStack(const char *msg)
Definition: Logger.cpp:86