MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / popupTarget

Method popupTarget

src/Geoscape/MultipleTargetsState.cpp:119–148  ·  view source on GitHub ↗

* Displays the right popup for a specific target. * @param target Pointer to target. */

Source from the content-addressed store, hash-verified

117 * @param target Pointer to target.
118 */
119void MultipleTargetsState::popupTarget(Target *target)
120{
121 _game->popState();
122 if (_craft == 0)
123 {
124 Base* b = dynamic_cast<Base*>(target);
125 Craft* c = dynamic_cast<Craft*>(target);
126 Ufo* u = dynamic_cast<Ufo*>(target);
127 if (b != 0)
128 {
129 _game->pushState(new InterceptState(_game, _state->getGlobe(), b));
130 }
131 else if (c != 0)
132 {
133 _game->pushState(new GeoscapeCraftState(_game, c, _state->getGlobe(), 0));
134 }
135 else if (u != 0)
136 {
137 _game->pushState(new UfoDetectedState(_game, u, _state, false, u->getHyperDetected()));
138 }
139 else
140 {
141 _game->pushState(new TargetInfoState(_game, target, _state->getGlobe()));
142 }
143 }
144 else
145 {
146 _game->pushState(new ConfirmDestinationState(_game, _craft, target));
147 }
148}
149
150/**
151 * Returns to the previous screen.

Callers

nothing calls this directly

Calls 4

pushStateMethod · 0.80
getGlobeMethod · 0.80
getHyperDetectedMethod · 0.80
popStateMethod · 0.45

Tested by

no test coverage detected