diff --git a/src/gui/hotkeyConfig.cpp b/src/gui/hotkeyConfig.cpp index 5e3727823d..3e3fbfa4b0 100644 --- a/src/gui/hotkeyConfig.cpp +++ b/src/gui/hotkeyConfig.cpp @@ -219,6 +219,8 @@ Keys::Keys() : weapons_disable_aim_lock("WEAPONS_AIM_LOCK_DISABLE"), weapons_aim_left("WEAPONS_AIM_LEFT", "G"), weapons_aim_right("WEAPONS_AIM_RIGHT", "H"), + weapons_aim_left_step("WEAPONS_AIM_LEFT_STEP"), + weapons_aim_right_step("WEAPONS_AIM_RIGHT_STEP"), //Science science_scan_object("SCIENCE_SCAN_OBJECT", "S"), @@ -242,6 +244,18 @@ Keys::Keys() : {"SCIENCE_SCAN_PARAM_SET_3"}, {"SCIENCE_SCAN_PARAM_SET_4"}, }}, + science_scan_param_increase_step{{ + {"SCIENCE_SCAN_PARAM_INCREASE_STEP_1"}, + {"SCIENCE_SCAN_PARAM_INCREASE_STEP_2"}, + {"SCIENCE_SCAN_PARAM_INCREASE_STEP_3"}, + {"SCIENCE_SCAN_PARAM_INCREASE_STEP_4"}, + }}, + science_scan_param_decrease_step{{ + {"SCIENCE_SCAN_PARAM_DECREASE_STEP_1"}, + {"SCIENCE_SCAN_PARAM_DECREASE_STEP_2"}, + {"SCIENCE_SCAN_PARAM_DECREASE_STEP_3"}, + {"SCIENCE_SCAN_PARAM_DECREASE_STEP_4"}, + }}, //Engineering engineering_select_system{ @@ -417,6 +431,8 @@ void Keys::init() weapons_disable_aim_lock.setLabel(tr("hotkey_menu", "Weapons"), tr("hotkey_Weapons", "Disable missile aim lock")); weapons_aim_left.setLabel(tr("hotkey_menu", "Weapons"), tr("hotkey_Weapons", "Turn missile aim to the left")); weapons_aim_right.setLabel(tr("hotkey_menu", "Weapons"), tr("hotkey_Weapons", "Turn missile aim to the right")); + weapons_aim_left_step.setLabel(tr("hotkey_menu", "Weapons"), tr("hotkey_Weapons", "Turn missile aim left (15° steps)")); + weapons_aim_right_step.setLabel(tr("hotkey_menu", "Weapons"), tr("hotkey_Weapons", "Turn missile aim right (15° steps)")); //Science science_scan_object.setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Scan object")); @@ -427,6 +443,8 @@ void Keys::init() science_scan_param_increase[n].setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Scanning parameter {number} increase").format({{"number", string(n+1)}})); science_scan_param_decrease[n].setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Scanning parameter {number} decrease").format({{"number", string(n+1)}})); science_scan_param_set[n].setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Set scanning parameter {number} (joystick)").format({{"number", string(n+1)}})); + science_scan_param_increase_step[n].setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Scan parameter {number} increase stepwise").format({{"number", string(n+1)}})); + science_scan_param_decrease_step[n].setLabel(tr("hotkey_menu", "Science"), tr("hotkey_Science", "Scan parameter {number} decrease stepwise").format({{"number", string(n+1)}})); } //Engineering diff --git a/src/gui/hotkeyConfig.h b/src/gui/hotkeyConfig.h index 0a17ddc74c..1dd93e78fc 100644 --- a/src/gui/hotkeyConfig.h +++ b/src/gui/hotkeyConfig.h @@ -110,6 +110,8 @@ class Keys sp::io::Keybinding weapons_disable_aim_lock; sp::io::Keybinding weapons_aim_left; sp::io::Keybinding weapons_aim_right; + sp::io::Keybinding weapons_aim_left_step; + sp::io::Keybinding weapons_aim_right_step; //Science sp::io::Keybinding science_scan_object; @@ -118,6 +120,8 @@ class Keys std::array science_scan_param_increase; std::array science_scan_param_decrease; std::array science_scan_param_set; + std::array science_scan_param_increase_step; + std::array science_scan_param_decrease_step; //Engineering sp::io::Keybinding engineering_select_system[ShipSystem::COUNT]; diff --git a/src/screenComponents/scanningDialog.cpp b/src/screenComponents/scanningDialog.cpp index ad10f47dc4..dfc1f0029a 100644 --- a/src/screenComponents/scanningDialog.cpp +++ b/src/screenComponents/scanningDialog.cpp @@ -91,6 +91,10 @@ void GuiScanningDialog::onUpdate() for(int n=0; nsetValue(sliders[n]->getValue() + adjust); diff --git a/src/screens/crew1/singlePilotScreen.cpp b/src/screens/crew1/singlePilotScreen.cpp index 6346025d09..28c912f46a 100644 --- a/src/screens/crew1/singlePilotScreen.cpp +++ b/src/screens/crew1/singlePilotScreen.cpp @@ -187,6 +187,17 @@ void SinglePilotScreen::onUpdate() } auto aim_adjust = keys.weapons_aim_left.getValue() - keys.weapons_aim_right.getValue(); + // when using 15° steps, make sure the angle is a multiple of 15 + if (keys.weapons_aim_left_step.getDown()) + { + missile_aim->setValue(std::round(missile_aim->getValue()/15)*15); + aim_adjust =3.0f; + } + if (keys.weapons_aim_right_step.getDown()) + { + missile_aim->setValue(std::round(missile_aim->getValue()/15)*15); + aim_adjust =-3.0f; + } if (aim_adjust != 0.0f) { missile_aim->setValue(missile_aim->getValue() - 5.0f * aim_adjust); diff --git a/src/screens/crew4/tacticalScreen.cpp b/src/screens/crew4/tacticalScreen.cpp index e727013544..029eb1c0f5 100644 --- a/src/screens/crew4/tacticalScreen.cpp +++ b/src/screens/crew4/tacticalScreen.cpp @@ -168,6 +168,17 @@ void TacticalScreen::onUpdate() } auto aim_adjust = keys.weapons_aim_left.getValue() - keys.weapons_aim_right.getValue(); + // when using 15° steps, make sure the angle is a multiple of 15 + if (keys.weapons_aim_left_step.getDown()) + { + missile_aim->setValue(std::round(missile_aim->getValue()/15)*15); + aim_adjust =3.0f; + } + if (keys.weapons_aim_right_step.getDown()) + { + missile_aim->setValue(std::round(missile_aim->getValue()/15)*15); + aim_adjust =-3.0f; + } if (aim_adjust != 0.0f) { missile_aim->setValue(missile_aim->getValue() - 5.0f * aim_adjust); diff --git a/src/screens/crew6/weaponsScreen.cpp b/src/screens/crew6/weaponsScreen.cpp index 872625630c..2703acf0cb 100644 --- a/src/screens/crew6/weaponsScreen.cpp +++ b/src/screens/crew6/weaponsScreen.cpp @@ -156,6 +156,17 @@ void WeaponsScreen::onUpdate() } } auto aim_adjust = keys.weapons_aim_left.getValue() - keys.weapons_aim_right.getValue(); + // when using 15° steps, make sure the angle is a multiple of 15 + if (keys.weapons_aim_left_step.getDown()) + { + missile_aim->setValue(std::round(missile_aim->getValue()/15)*15); + aim_adjust =3.0f; + } + if (keys.weapons_aim_right_step.getDown()) + { + missile_aim->setValue(std::round(missile_aim->getValue()/15)*15); + aim_adjust =-3.0f; + } if (aim_adjust != 0.0f) { missile_aim->setValue(missile_aim->getValue() - 5.0f * aim_adjust);