mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
overlay: re-enable keyboard navigation (#802)
## Link to GitHub Issue or related Pull Request, if one exists Fixes #800 ## Description of change Restores keyboard navigation by default in spicecfg, and add an option to optionally enable it in the overlay. ## Testing
This commit is contained in:
@@ -1115,6 +1115,9 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::DisableOverlay].value_bool()) {
|
if (options[launcher::Options::DisableOverlay].value_bool()) {
|
||||||
overlay::ENABLED = false;
|
overlay::ENABLED = false;
|
||||||
}
|
}
|
||||||
|
if (options[launcher::Options::OverlayKeyboardNavigation].value_bool()) {
|
||||||
|
overlay::ENABLE_KEYBOARD_NAVIGATION = true;
|
||||||
|
}
|
||||||
if (options[launcher::Options::OverlayScaling].is_active() && !cfg::CONFIGURATOR_STANDALONE && !cfg_run) {
|
if (options[launcher::Options::OverlayScaling].is_active() && !cfg::CONFIGURATOR_STANDALONE && !cfg_run) {
|
||||||
const auto val = options[launcher::Options::OverlayScaling].value_uint32();
|
const auto val = options[launcher::Options::OverlayScaling].value_uint32();
|
||||||
if (10 <= val && val <= 400 && val != 100) {
|
if (10 <= val && val <= 400 && val != 100) {
|
||||||
|
|||||||
@@ -510,6 +510,13 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
.category = "General Overlay",
|
.category = "General Overlay",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.title = "Overlay Keyboard Navigation",
|
||||||
|
.name = "keyboardnav",
|
||||||
|
.desc = "Enables keyboard navigation in the in-game overlay.",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.category = "General Overlay",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// OverlayScaling
|
// OverlayScaling
|
||||||
.title = "Spice Overlay UI Scale %",
|
.title = "Spice Overlay UI Scale %",
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ namespace launcher {
|
|||||||
SOFTID,
|
SOFTID,
|
||||||
VREnable,
|
VREnable,
|
||||||
DisableOverlay,
|
DisableOverlay,
|
||||||
|
OverlayKeyboardNavigation,
|
||||||
OverlayScaling,
|
OverlayScaling,
|
||||||
NotificationPosition,
|
NotificationPosition,
|
||||||
spice2x_FpsAutoShow,
|
spice2x_FpsAutoShow,
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ namespace overlay {
|
|||||||
bool AUTO_SHOW_IOPANEL = false;
|
bool AUTO_SHOW_IOPANEL = false;
|
||||||
bool AUTO_SHOW_KEYPAD_P1 = false;
|
bool AUTO_SHOW_KEYPAD_P1 = false;
|
||||||
bool AUTO_SHOW_KEYPAD_P2 = false;
|
bool AUTO_SHOW_KEYPAD_P2 = false;
|
||||||
|
bool ENABLE_KEYBOARD_NAVIGATION = false;
|
||||||
bool USE_WM_CHAR_FOR_IMGUI_CHAR_INPUT = false;
|
bool USE_WM_CHAR_FOR_IMGUI_CHAR_INPUT = false;
|
||||||
FpsLocation FPS_LOCATION = FpsLocation::TopRight;
|
FpsLocation FPS_LOCATION = FpsLocation::TopRight;
|
||||||
std::optional<uint32_t> UI_SCALE_PERCENT;
|
std::optional<uint32_t> UI_SCALE_PERCENT;
|
||||||
@@ -312,6 +313,9 @@ void overlay::SpiceOverlay::init() {
|
|||||||
auto &io = ImGui::GetIO();
|
auto &io = ImGui::GetIO();
|
||||||
io.UserData = this;
|
io.UserData = this;
|
||||||
io.ConfigFlags = ImGuiConfigFlags_None;
|
io.ConfigFlags = ImGuiConfigFlags_None;
|
||||||
|
if (cfg::CONFIGURATOR_STANDALONE || ENABLE_KEYBOARD_NAVIGATION) {
|
||||||
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||||
|
}
|
||||||
if (!cfg::CONFIGURATOR_STANDALONE) {
|
if (!cfg::CONFIGURATOR_STANDALONE) {
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace overlay {
|
|||||||
extern bool AUTO_SHOW_IOPANEL;
|
extern bool AUTO_SHOW_IOPANEL;
|
||||||
extern bool AUTO_SHOW_KEYPAD_P1;
|
extern bool AUTO_SHOW_KEYPAD_P1;
|
||||||
extern bool AUTO_SHOW_KEYPAD_P2;
|
extern bool AUTO_SHOW_KEYPAD_P2;
|
||||||
|
extern bool ENABLE_KEYBOARD_NAVIGATION;
|
||||||
extern bool USE_WM_CHAR_FOR_IMGUI_CHAR_INPUT;
|
extern bool USE_WM_CHAR_FOR_IMGUI_CHAR_INPUT;
|
||||||
extern FpsLocation FPS_LOCATION;
|
extern FpsLocation FPS_LOCATION;
|
||||||
extern bool SHOW_DEBUG_LOG_WINDOW;
|
extern bool SHOW_DEBUG_LOG_WINDOW;
|
||||||
|
|||||||
Reference in New Issue
Block a user