MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DisplayInsertMarker

Method DisplayInsertMarker

engine/Poseidon/UI/Map/UIMapDialogs.cpp:108–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108DisplayInsertMarker::DisplayInsertMarker(ControlsContainer* parent, float x, float y, float cx, float cy, float cw,
109 float ch, bool enableSimulation)
110 : Display(parent)
111{
112 _enableSimulation = enableSimulation;
113
114 InputSubsystem::Instance().ChangeGameFocus(+1);
115
116 Load("RscDisplayInsertMarker");
117 _x = x;
118 _y = y;
119 _cx = cx;
120 _cy = cy;
121 _cw = cw;
122 _ch = ch;
123
124 _exitKey = -1;
125 _exitVK = -1;
126
127 _picture = 0;
128 _color = 0;
129 UpdatePicture();
130
131 Control* picture = dynamic_cast<Control*>(GetCtrl(IDC_INSERT_MARKER_PICTURE));
132 Control* edit = dynamic_cast<Control*>(GetCtrl(IDC_INSERT_MARKER));
133 if (picture && edit)
134 {
135 float wP = picture->W();
136 float wE = edit->W();
137 float w = wP + wE;
138 float hP = picture->H();
139 float hE = edit->H();
140 float h = floatMax(hP, hE);
141 y -= 0.5 * h;
142 x -= 0.5 * wP;
143 saturate(x, _cx, _cx + _cw - w);
144 saturate(y, _cy, _cy + _ch - h);
145 picture->SetPos(x, y + 0.5 * (h - hP), wP, hP);
146 edit->SetPos(x + wP, y + 0.5 * (h - hE), wE, hE);
147 }
148}
149
150DisplayInsertMarker::~DisplayInsertMarker()
151{

Callers

nothing calls this directly

Calls 7

GetCtrlFunction · 0.85
floatMaxFunction · 0.85
saturateFunction · 0.85
ChangeGameFocusMethod · 0.80
WMethod · 0.45
HMethod · 0.45
SetPosMethod · 0.45

Tested by

no test coverage detected