Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/gui/gui2_togglebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ bool GuiToggleButton::getValue() const
return value;
}

void GuiToggleButton::toggle() {
onClick(); // trigger the click event used to toggle probe view vie key.
}

GuiToggleButton* GuiToggleButton::setValue(bool value)
{
if (this->value == value)
Expand Down
1 change: 1 addition & 0 deletions src/gui/gui2_togglebutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class GuiToggleButton : public GuiButton

bool getValue() const;
GuiToggleButton* setValue(bool value);
void toggle();
private:
void onClick();
};
Expand Down
2 changes: 2 additions & 0 deletions src/gui/hotkeyConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ Keys::Keys() :
// Science crew screen
science_scan_object("SCIENCE_SCAN_OBJECT", "S"),
science_scan_abort("SCIENCE_SCAN_ABORT", "D"),
science_toggle_probe_view("SCIENCE_TOGGLE_PROBE_VIEW"),
science_select_next_scannable("SCIENCE_SELECT_NEXT_SCANNABLE", "C"),
science_scan_param_increase{{
{"SCIENCE_SCAN_PARAM_INCREASE_1"},
Expand Down Expand Up @@ -430,6 +431,7 @@ void Keys::init()
// Science
science_scan_object.setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Scan object"));
science_scan_abort.setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Abort scan"));
science_toggle_probe_view.setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Toggle probe view"));
science_select_next_scannable.setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Select next scannable object"));
for (auto n = 0u; n < science_scan_param_increase.size(); n++)
{
Expand Down
1 change: 1 addition & 0 deletions src/gui/hotkeyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Keys
sp::io::Keybinding science_scan_object;
sp::io::Keybinding science_scan_abort;
sp::io::Keybinding science_select_next_scannable;
sp::io::Keybinding science_toggle_probe_view;
std::array<sp::io::Keybinding, 4> science_scan_param_increase;
std::array<sp::io::Keybinding, 4> science_scan_param_decrease;
std::array<sp::io::Keybinding, 4> science_scan_param_set;
Expand Down
6 changes: 6 additions & 0 deletions src/screens/crew6/scienceScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,12 @@ void ScienceScreen::onUpdate()
{
if (my_spaceship)
{
// Toggle probe view from the Science hotkey.
auto rl = my_spaceship.getComponent<RadarLink>();
if (keys.science_toggle_probe_view.getDown() && rl && rl->linked_entity)
{
probe_view_button->toggle();
}
// Initiate a scan on scannable objects.
if (keys.science_scan_object.getDown() &&
my_spaceship.hasComponent<ScienceScanner>() &&
Expand Down
Loading