@@ -117,31 +117,69 @@ OperationScreen::OperationScreen(GuiContainer* owner)
117117 info_reputation->setTextSize (20 )->setSize (200 , 40 );
118118
119119 // Scenario clock display.
120-
121120 info_clock = new GuiKeyValueDisplay (stats, " INFO_CLOCK" , 0 .55f , tr (" Clock" ) + " :" , " " );
122121 info_clock->setTextSize (20 )->setSize (200 , 40 );
123122
124123 mode = TargetSelection;
125124
126- new ShipsLog (this );
127- (new GuiCommsOverlay (this ))->setSize (GuiElement::GuiSizeMax, GuiElement::GuiSizeMax);
125+ ships_log = new ShipsLog (this );
126+ comms_overlay = new GuiCommsOverlay (this );
127+ comms_overlay->setSize (GuiElement::GuiSizeMax, GuiElement::GuiSizeMax);
128128}
129129
130130void OperationScreen::onDraw (sp::RenderTarget& target)
131131{
132132 GuiOverlay::onDraw (target);
133133
134134 if (!my_spaceship) return ;
135+
135136 if (science->radar_view ->isVisible ())
136137 {
137- info_reputation->setValue (string (Faction::getInfo (my_spaceship).reputation_points , 0 ))->show ();
138-
139- // Update mission clock
140- info_clock->setValue (gameGlobalInfo->getMissionTime ())->show ();
138+ // Update reputation counter.
139+ info_reputation
140+ ->setValue (string (Faction::getInfo (my_spaceship).reputation_points , 0 ))
141+ ->show ();
142+
143+ // Update mission clock.
144+ info_clock
145+ ->setValue (gameGlobalInfo->getMissionTime ())
146+ ->show ();
141147 }
142148 else
143149 {
144150 info_reputation->hide ();
145151 info_clock->hide ();
146152 }
147153}
154+
155+ void OperationScreen::onUpdate ()
156+ {
157+ // Relay keybinds, copied from Relay screen.
158+ // Don't process hotkeys while the chat text entry has keyboard focus.
159+ if (comms_overlay && comms_overlay->isChatEntryFocused ()) return ;
160+
161+ // Open comms with the selected target.
162+ if (keys.relay_open_comms .getDown ())
163+ {
164+ auto target = science->targets .get ();
165+ if (target) my_player_info->commandOpenTextComm (target);
166+ }
167+
168+ // Toggle waypoint placement mode.
169+ if (keys.relay_toggle_waypoint .getDown ())
170+ {
171+ if (mode == TargetSelection) mode = WaypointPlacement;
172+ else if (mode == WaypointPlacement) mode = TargetSelection;
173+ }
174+
175+ // Delete the selected waypoint.
176+ if (keys.relay_delete_waypoint .getDown ())
177+ {
178+ if (science->targets .getWaypointIndex () >= 0 )
179+ my_player_info->commandRemoveWaypoint (science->targets .getWaypointIndex ());
180+ }
181+
182+ // Toggle ship's log min/maximized state.
183+ if (ships_log && keys.relay_toggle_ships_log .getDown ())
184+ ships_log->toggle ();
185+ }
0 commit comments