From d835b52b9203001895762c5b361e160c6eb92abb Mon Sep 17 00:00:00 2001 From: Guffawaffle Date: Sat, 29 Aug 2026 19:29:19 -0500 Subject: [PATCH 1/7] feat: add native navigation shortcuts --- example_community_patch_settings_da.toml | 6 +++ example_community_patch_settings_de.toml | 6 +++ ...munity_patch_settings_en-GB-x-cockney.toml | 6 +++ ...mmunity_patch_settings_en-x-minionese.toml | 6 +++ example_community_patch_settings_en.toml | 6 +++ example_community_patch_settings_es.toml | 6 +++ example_community_patch_settings_fr.toml | 6 +++ example_community_patch_settings_nl.toml | 6 +++ example_community_patch_settings_ru.toml | 6 +++ example_community_patch_settings_tlh.toml | 6 +++ mods/src/config.cc | 4 ++ mods/src/defaultconfig.h | 2 + mods/src/patches/gamefunctions.h | 2 + mods/src/patches/parts/hotkey_ownership.h | 31 ++++++++++++ mods/src/patches/parts/hotkeys.cc | 50 +++++++++++++++++++ mods/src/patches/parts/zoom.cc | 8 ++- 16 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 mods/src/patches/parts/hotkey_ownership.h diff --git a/example_community_patch_settings_da.toml b/example_community_patch_settings_da.toml index 4e4003d2f..d85668a1e 100644 --- a/example_community_patch_settings_da.toml +++ b/example_community_patch_settings_da.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Gå til begivenheder show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Gå til Exocomp show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Gå til galaksen show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Gå til gaver show_gifts = "/" diff --git a/example_community_patch_settings_de.toml b/example_community_patch_settings_de.toml index 2dda59892..1d3a29ea0 100644 --- a/example_community_patch_settings_de.toml +++ b/example_community_patch_settings_de.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Zu den Events show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Zu den Exocomps show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Zur Galaxie show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Zu den Geschenken show_gifts = "/" diff --git a/example_community_patch_settings_en-GB-x-cockney.toml b/example_community_patch_settings_en-GB-x-cockney.toml index 0ccf711ca..f26a643a5 100644 --- a/example_community_patch_settings_en-GB-x-cockney.toml +++ b/example_community_patch_settings_en-GB-x-cockney.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Go to Exocomp show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Go to Galaxy show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_en-x-minionese.toml b/example_community_patch_settings_en-x-minionese.toml index 9f1e1e3a6..b72dce46d 100644 --- a/example_community_patch_settings_en-x-minionese.toml +++ b/example_community_patch_settings_en-x-minionese.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Go to Exocomp show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Go to Galaxy show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_en.toml b/example_community_patch_settings_en.toml index 9ffe927fe..6f5b351e8 100644 --- a/example_community_patch_settings_en.toml +++ b/example_community_patch_settings_en.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Go to Exocomp show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Go to Galaxy show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_es.toml b/example_community_patch_settings_es.toml index b89c9a2e8..869bab2d3 100644 --- a/example_community_patch_settings_es.toml +++ b/example_community_patch_settings_es.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Ir a eventos show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Ir a Exocomp show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Ir a la galaxia show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Ir a regalos show_gifts = "/" diff --git a/example_community_patch_settings_fr.toml b/example_community_patch_settings_fr.toml index fdbc5f79d..9b362845d 100644 --- a/example_community_patch_settings_fr.toml +++ b/example_community_patch_settings_fr.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Aller aux événements show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Aller aux Exocomps show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Aller à la galaxie show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Aller aux cadeaux show_gifts = "/" diff --git a/example_community_patch_settings_nl.toml b/example_community_patch_settings_nl.toml index b2b39b208..ac7dd837d 100644 --- a/example_community_patch_settings_nl.toml +++ b/example_community_patch_settings_nl.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Ga naar Evenementen show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Ga naar Exocomp show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Ga naar Sterrenstelsel show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Ga naar Cadeaus show_gifts = "/" diff --git a/example_community_patch_settings_ru.toml b/example_community_patch_settings_ru.toml index ad3db036a..4ef20e0f8 100644 --- a/example_community_patch_settings_ru.toml +++ b/example_community_patch_settings_ru.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Перейти к событиям show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Перейти к экзокомпу show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Перейти к галактике show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Перейти к подаркам show_gifts = "/" diff --git a/example_community_patch_settings_tlh.toml b/example_community_patch_settings_tlh.toml index b9bce7597..9298f33f0 100644 --- a/example_community_patch_settings_tlh.toml +++ b/example_community_patch_settings_tlh.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go Daq Events show_events = "SHIFT-E" +# Scopely-native Go to Events action +show_events_native = "F5" + # Go Daq Exocomp show_exocomp = "X" @@ -464,6 +467,9 @@ show_factions = "F" # Go Daq Galaxy show_galaxy = "G" +# Scopely-native Galaxy action +show_galaxy_native = "E" + # Go Daq Gifts show_gifts = "/" diff --git a/mods/src/config.cc b/mods/src/config.cc index 95deab836..f9b5ae58d 100644 --- a/mods/src/config.cc +++ b/mods/src/config.cc @@ -1226,6 +1226,8 @@ void Config::Load() parse_config_shortcut(config, parsed, "show_chatside1", GameFunction::ShowChatSide1, DCSH::show_chatside1); parse_config_shortcut(config, parsed, "show_chatside2", GameFunction::ShowChatSide2, DCSH::show_chatside2); parse_config_shortcut(config, parsed, "show_galaxy", GameFunction::ShowGalaxy, DCSH::show_galaxy); + parse_config_shortcut(config, parsed, "show_galaxy_native", GameFunction::ShowGalaxyNative, + DCSH::show_galaxy_native); parse_config_shortcut(config, parsed, "show_system", GameFunction::ShowSystem, DCSH::show_system); parse_config_shortcut(config, parsed, "zoom_preset1", GameFunction::ZoomPreset1, DCSH::zoom_preset1); parse_config_shortcut(config, parsed, "zoom_preset2", GameFunction::ZoomPreset2, DCSH::zoom_preset2); @@ -1261,6 +1263,8 @@ void Config::Load() parse_config_shortcut(config, parsed, "show_commander", GameFunction::ShowCommander, DCSH::show_commander); parse_config_shortcut(config, parsed, "show_daily", GameFunction::ShowDaily, DCSH::show_daily); parse_config_shortcut(config, parsed, "show_events", GameFunction::ShowEvents, DCSH::show_events); + parse_config_shortcut(config, parsed, "show_events_native", GameFunction::ShowEventsNative, + DCSH::show_events_native); parse_config_shortcut(config, parsed, "show_exocomp", GameFunction::ShowExoComp, DCSH::show_exocomp); parse_config_shortcut(config, parsed, "show_factions", GameFunction::ShowFactions, DCSH::show_factions); parse_config_shortcut(config, parsed, "show_inventory", GameFunction::ShowInventory, DCSH::show_inventory); diff --git a/mods/src/defaultconfig.h b/mods/src/defaultconfig.h index b22cad5b8..c61412f12 100644 --- a/mods/src/defaultconfig.h +++ b/mods/src/defaultconfig.h @@ -141,9 +141,11 @@ namespace Shortcuts constexpr const char* show_commander = "O"; constexpr const char* show_daily = "Z"; constexpr const char* show_events = "SHIFT-E"; + constexpr const char* show_events_native = "F5"; constexpr const char* show_exocomp = "X"; constexpr const char* show_factions = "F"; constexpr const char* show_galaxy = "G"; + constexpr const char* show_galaxy_native = "E"; constexpr const char* show_gifts = "/"; constexpr const char* show_inventory = "I"; constexpr const char* show_lookup = "L"; diff --git a/mods/src/patches/gamefunctions.h b/mods/src/patches/gamefunctions.h index bd4b0fb50..469a013a2 100644 --- a/mods/src/patches/gamefunctions.h +++ b/mods/src/patches/gamefunctions.h @@ -40,11 +40,13 @@ enum GameFunction { ShowStationInterior, ShoWStationExterior, ShowGalaxy, + ShowGalaxyNative, ShowSystem, ShowChat, ShowChatSide1, ShowChatSide2, ShowEvents, + ShowEventsNative, ShowSettings, ZoomPreset1, ZoomPreset2, diff --git a/mods/src/patches/parts/hotkey_ownership.h b/mods/src/patches/parts/hotkey_ownership.h new file mode 100644 index 000000000..ec37fd5ef --- /dev/null +++ b/mods/src/patches/parts/hotkey_ownership.h @@ -0,0 +1,31 @@ +#pragma once + +#include "patches/gamefunctions.h" +#include "patches/mapkey.h" + +#include + +// Screen navigation and camera shortcuts run from separate Unity update hooks. Give screen navigation ownership of a +// shared chord so the result does not depend on which hook Unity calls first. +inline bool IsScreenNavigationShortcutPressed() +{ + static constexpr std::array screen_navigation_actions{ + GameFunction::ShowAlliance, GameFunction::ShowAllianceArmada, GameFunction::ShowAllianceHelp, + GameFunction::ShowArtifacts, GameFunction::ShowAwayTeam, GameFunction::ShowBookmarks, + GameFunction::ShowCommander, GameFunction::ShowDaily, GameFunction::ShowEvents, + GameFunction::ShowEventsNative, GameFunction::ShowExoComp, GameFunction::ShowFactions, + GameFunction::ShowGalaxy, GameFunction::ShowGalaxyNative, GameFunction::ShowGifts, + GameFunction::ShowInventory, GameFunction::ShowLookup, GameFunction::ShowMissions, + GameFunction::ShowOfficers, GameFunction::ShowQTrials, GameFunction::ShowRefinery, + GameFunction::ShowResearch, GameFunction::ShowScrapYard, GameFunction::ShowSettings, + GameFunction::ShowShips, GameFunction::ShowStationInterior, GameFunction::ShoWStationExterior, + GameFunction::ShowSystem, + }; + + for (const auto action : screen_navigation_actions) { + if (MapKey::IsPressed(action)) { + return true; + } + } + return false; +} diff --git a/mods/src/patches/parts/hotkeys.cc b/mods/src/patches/parts/hotkeys.cc index f04ddafb1..5009cb495 100644 --- a/mods/src/patches/parts/hotkeys.cc +++ b/mods/src/patches/parts/hotkeys.cc @@ -42,6 +42,7 @@ #include +#include #include #include @@ -52,6 +53,38 @@ static bool reset_focus_next_frame = false; static int show_info_pending = 0; +static void* shortcuts_manager_instance = nullptr; +static const MethodInfo* on_galaxy_action = nullptr; +static const MethodInfo* on_events_action = nullptr; + +struct InputActionCallbackContext { + void* state; + int32_t action_index; +}; + +static_assert(sizeof(InputActionCallbackContext) == 16); + +bool InvokeNativeShortcut(const MethodInfo* method, const char* action_name) +{ + if (!shortcuts_manager_instance || !method) { + spdlog::warn("[Hotkeys] native {} shortcut is unavailable", action_name); + return false; + } + + // These callbacks do not inspect CallbackContext, but runtime_invoke still requires storage for the value-type + // argument. Using the managed invoker also avoids platform-specific by-value ABI assumptions. + InputActionCallbackContext context{}; + void* args[]{&context}; + Il2CppException* exception = nullptr; + il2cpp_runtime_invoke(method, shortcuts_manager_instance, args, &exception); + if (exception) { + spdlog::warn("[Hotkeys] native {} shortcut raised exception={}", action_name, static_cast(exception)); + return false; + } + + return true; +} + bool force_space_action_next_frame = false; void ChangeNavigationSection(SectionID sectionID); @@ -399,6 +432,9 @@ void ScreenManager_Update_Hook(auto original, ScreenManager* _this) return GotoSection(SectionID::Shop_MainFactions); } else if (MapKey::IsDown(GameFunction::ShoWStationExterior)) { return GotoSection(SectionID::Starbase_Exterior); + } else if (MapKey::IsDown(GameFunction::ShowGalaxyNative)) { + InvokeNativeShortcut(on_galaxy_action, "Galaxy"); + return; } else if (MapKey::IsDown(GameFunction::ShowGalaxy)) { return ChangeNavigationSection(SectionID::Navigation_Galaxy); } else if (MapKey::IsDown(GameFunction::ShowStationInterior)) { @@ -423,6 +459,9 @@ void ScreenManager_Update_Hook(auto original, ScreenManager* _this) return GotoSection(SectionID::FleetCommander_Management); } else if (MapKey::IsDown(GameFunction::ShowAwayTeam)) { return GotoSection(SectionID::Missions_AwayTeamsList); + } else if (MapKey::IsDown(GameFunction::ShowEventsNative)) { + InvokeNativeShortcut(on_events_action, "Events"); + return; } else if (MapKey::IsDown(GameFunction::ShowEvents)) { return GotoSection(SectionID::Tournament_Group_Selection); } else if (MapKey::IsDown(GameFunction::ShowExoComp)) { @@ -958,6 +997,7 @@ void ChatMessageListLocalViewController_AboutToShow_Hook(ChatMessageListLocalVie void InitializeActions_Hook(auto original, void* _this) { + shortcuts_manager_instance = _this; if (Config::Get().use_scopely_hotkeys) { return original(_this); } @@ -1034,6 +1074,16 @@ void InstallHotkeyHooks() if (!shortcuts_manager_helper.isValidHelper()) { ErrorMsg::MissingHelper("GameInput", "ShortcutsManager"); } else { + on_galaxy_action = shortcuts_manager_helper.GetMethodInfo("OnGalaxyAction", 1); + if (on_galaxy_action == nullptr) { + ErrorMsg::MissingMethod("ShortcutsManager", "OnGalaxyAction"); + } + + on_events_action = shortcuts_manager_helper.GetMethodInfo("OnEventsAction", 1); + if (on_events_action == nullptr) { + ErrorMsg::MissingMethod("ShortcutsManager", "OnEventsAction"); + } + auto ptr_can_user_shortcuts = shortcuts_manager_helper.GetMethod("InitializeActions"); if (ptr_can_user_shortcuts == nullptr) { ErrorMsg::MissingMethod("ShortcutsManager", "InitializeActions"); diff --git a/mods/src/patches/parts/zoom.cc b/mods/src/patches/parts/zoom.cc index c19de3af1..0449592b9 100644 --- a/mods/src/patches/parts/zoom.cc +++ b/mods/src/patches/parts/zoom.cc @@ -2,9 +2,11 @@ #include "errormsg.h" #include +#include #include +#include #include #include #include @@ -145,7 +147,11 @@ void NavigationZoom_Update_Hook(auto original, NavigationZoom *_this) EnsureSystemZoomRange(_this); - if (!Key::IsInputFocused()) { + const auto navigation_owns_chord = + config->hotkeys_enabled && !config->use_scopely_hotkeys && !Hub::IsInChat() + && IsScreenNavigationShortcutPressed(); + + if (!Key::IsInputFocused() && !navigation_owns_chord) { if (MapKey::IsDown(GameFunction::SetZoomPreset1)) { return StoreZoom("System Preset 1", config->system_zoom_preset_1, _this); } else if (MapKey::IsDown(GameFunction::SetZoomPreset2)) { From 2fca4d2aba110049ed68b3e3e5569f534fffe68f Mon Sep 17 00:00:00 2001 From: Guffawaffle Date: Sat, 29 Aug 2026 19:38:20 -0500 Subject: [PATCH 2/7] fix: scope native shortcut to galaxy --- README.md | 9 +- example_community_patch_settings_da.toml | 7 +- example_community_patch_settings_de.toml | 7 +- ...munity_patch_settings_en-GB-x-cockney.toml | 7 +- ...mmunity_patch_settings_en-x-minionese.toml | 7 +- example_community_patch_settings_en.toml | 7 +- example_community_patch_settings_es.toml | 7 +- example_community_patch_settings_fr.toml | 7 +- example_community_patch_settings_nl.toml | 7 +- example_community_patch_settings_ru.toml | 7 +- example_community_patch_settings_tlh.toml | 7 +- mods/src/config.cc | 2 - mods/src/defaultconfig.h | 3 +- mods/src/patches/gamefunctions.h | 1 - mods/src/patches/parts/hotkey_ownership.h | 19 ++-- mods/src/patches/parts/hotkeys.cc | 9 -- mods/src/patches/parts/zoom.cc | 91 ++++++++++--------- 17 files changed, 82 insertions(+), 122 deletions(-) diff --git a/README.md b/README.md index 79b566f7d..801fe08e6 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ been applied. Valid values for any short can be found in [KEYMAPPING.md](KEYMAPP | -----------: | -------------------------------- | | F10 | Bug fixer (exits game) | | F1-F5 | Zoom presets | -| Q | Zoom Out | -| E | Zoom In | +| Q | Zoom In | +| E | Zoom Out | | MINUS | Zoom (min) | | EQUALS | Zoom (default) | | BACKSPACE | Zoom (max) | @@ -109,9 +109,11 @@ action items such as: | Key | Shortcut | | ------: | ---------------- | -| T | Events | +| T | Away Teams | | G | Galaxy | +| Ctrl-G | Galaxy (native) | | H | System | +| Shift-E | Events | | Shift-G | Exterior View | | Shift-H | Interior View | | B | Bookmarks | @@ -125,7 +127,6 @@ action items such as: | O | Command Center | | Shift-O | Officers | | Shift-Q | Q-Trials | -| Shift-T | Away Teams | | X | ExoComp | | Z | Daily Missions | diff --git a/example_community_patch_settings_da.toml b/example_community_patch_settings_da.toml index d85668a1e..5c0499957 100644 --- a/example_community_patch_settings_da.toml +++ b/example_community_patch_settings_da.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Gå til begivenheder show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Gå til Exocomp show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Gå til galaksen show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Gå til gaver show_gifts = "/" diff --git a/example_community_patch_settings_de.toml b/example_community_patch_settings_de.toml index 1d3a29ea0..90d4daada 100644 --- a/example_community_patch_settings_de.toml +++ b/example_community_patch_settings_de.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Zu den Events show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Zu den Exocomps show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Zur Galaxie show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Zu den Geschenken show_gifts = "/" diff --git a/example_community_patch_settings_en-GB-x-cockney.toml b/example_community_patch_settings_en-GB-x-cockney.toml index f26a643a5..d00195fae 100644 --- a/example_community_patch_settings_en-GB-x-cockney.toml +++ b/example_community_patch_settings_en-GB-x-cockney.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Go to Exocomp show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Go to Galaxy show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_en-x-minionese.toml b/example_community_patch_settings_en-x-minionese.toml index b72dce46d..6d96c31f5 100644 --- a/example_community_patch_settings_en-x-minionese.toml +++ b/example_community_patch_settings_en-x-minionese.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Go to Exocomp show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Go to Galaxy show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_en.toml b/example_community_patch_settings_en.toml index 6f5b351e8..9e7bc39db 100644 --- a/example_community_patch_settings_en.toml +++ b/example_community_patch_settings_en.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Go to Exocomp show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Go to Galaxy show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_es.toml b/example_community_patch_settings_es.toml index 869bab2d3..baa3caf9b 100644 --- a/example_community_patch_settings_es.toml +++ b/example_community_patch_settings_es.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Ir a eventos show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Ir a Exocomp show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Ir a la galaxia show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Ir a regalos show_gifts = "/" diff --git a/example_community_patch_settings_fr.toml b/example_community_patch_settings_fr.toml index 9b362845d..a107f23ce 100644 --- a/example_community_patch_settings_fr.toml +++ b/example_community_patch_settings_fr.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Aller aux événements show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Aller aux Exocomps show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Aller à la galaxie show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Aller aux cadeaux show_gifts = "/" diff --git a/example_community_patch_settings_nl.toml b/example_community_patch_settings_nl.toml index ac7dd837d..ac72b48df 100644 --- a/example_community_patch_settings_nl.toml +++ b/example_community_patch_settings_nl.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Ga naar Evenementen show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Ga naar Exocomp show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Ga naar Sterrenstelsel show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Ga naar Cadeaus show_gifts = "/" diff --git a/example_community_patch_settings_ru.toml b/example_community_patch_settings_ru.toml index 4ef20e0f8..f227910f2 100644 --- a/example_community_patch_settings_ru.toml +++ b/example_community_patch_settings_ru.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Перейти к событиям show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Перейти к экзокомпу show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Перейти к галактике show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Перейти к подаркам show_gifts = "/" diff --git a/example_community_patch_settings_tlh.toml b/example_community_patch_settings_tlh.toml index 9298f33f0..89eff1157 100644 --- a/example_community_patch_settings_tlh.toml +++ b/example_community_patch_settings_tlh.toml @@ -455,9 +455,6 @@ show_daily = "Z" # Go Daq Events show_events = "SHIFT-E" -# Scopely-native Go to Events action -show_events_native = "F5" - # Go Daq Exocomp show_exocomp = "X" @@ -467,8 +464,8 @@ show_factions = "F" # Go Daq Galaxy show_galaxy = "G" -# Scopely-native Galaxy action -show_galaxy_native = "E" +# Scopely shortcut-native Galaxy Action +show_galaxy_native = "CTRL-G" # Go Daq Gifts show_gifts = "/" diff --git a/mods/src/config.cc b/mods/src/config.cc index f9b5ae58d..6aa4c5b56 100644 --- a/mods/src/config.cc +++ b/mods/src/config.cc @@ -1263,8 +1263,6 @@ void Config::Load() parse_config_shortcut(config, parsed, "show_commander", GameFunction::ShowCommander, DCSH::show_commander); parse_config_shortcut(config, parsed, "show_daily", GameFunction::ShowDaily, DCSH::show_daily); parse_config_shortcut(config, parsed, "show_events", GameFunction::ShowEvents, DCSH::show_events); - parse_config_shortcut(config, parsed, "show_events_native", GameFunction::ShowEventsNative, - DCSH::show_events_native); parse_config_shortcut(config, parsed, "show_exocomp", GameFunction::ShowExoComp, DCSH::show_exocomp); parse_config_shortcut(config, parsed, "show_factions", GameFunction::ShowFactions, DCSH::show_factions); parse_config_shortcut(config, parsed, "show_inventory", GameFunction::ShowInventory, DCSH::show_inventory); diff --git a/mods/src/defaultconfig.h b/mods/src/defaultconfig.h index c61412f12..089cb246a 100644 --- a/mods/src/defaultconfig.h +++ b/mods/src/defaultconfig.h @@ -141,11 +141,10 @@ namespace Shortcuts constexpr const char* show_commander = "O"; constexpr const char* show_daily = "Z"; constexpr const char* show_events = "SHIFT-E"; - constexpr const char* show_events_native = "F5"; constexpr const char* show_exocomp = "X"; constexpr const char* show_factions = "F"; constexpr const char* show_galaxy = "G"; - constexpr const char* show_galaxy_native = "E"; + constexpr const char* show_galaxy_native = "CTRL-G"; constexpr const char* show_gifts = "/"; constexpr const char* show_inventory = "I"; constexpr const char* show_lookup = "L"; diff --git a/mods/src/patches/gamefunctions.h b/mods/src/patches/gamefunctions.h index 469a013a2..c99ebf970 100644 --- a/mods/src/patches/gamefunctions.h +++ b/mods/src/patches/gamefunctions.h @@ -46,7 +46,6 @@ enum GameFunction { ShowChatSide1, ShowChatSide2, ShowEvents, - ShowEventsNative, ShowSettings, ZoomPreset1, ZoomPreset2, diff --git a/mods/src/patches/parts/hotkey_ownership.h b/mods/src/patches/parts/hotkey_ownership.h index ec37fd5ef..b4fbfdfbc 100644 --- a/mods/src/patches/parts/hotkey_ownership.h +++ b/mods/src/patches/parts/hotkey_ownership.h @@ -10,16 +10,15 @@ inline bool IsScreenNavigationShortcutPressed() { static constexpr std::array screen_navigation_actions{ - GameFunction::ShowAlliance, GameFunction::ShowAllianceArmada, GameFunction::ShowAllianceHelp, - GameFunction::ShowArtifacts, GameFunction::ShowAwayTeam, GameFunction::ShowBookmarks, - GameFunction::ShowCommander, GameFunction::ShowDaily, GameFunction::ShowEvents, - GameFunction::ShowEventsNative, GameFunction::ShowExoComp, GameFunction::ShowFactions, - GameFunction::ShowGalaxy, GameFunction::ShowGalaxyNative, GameFunction::ShowGifts, - GameFunction::ShowInventory, GameFunction::ShowLookup, GameFunction::ShowMissions, - GameFunction::ShowOfficers, GameFunction::ShowQTrials, GameFunction::ShowRefinery, - GameFunction::ShowResearch, GameFunction::ShowScrapYard, GameFunction::ShowSettings, - GameFunction::ShowShips, GameFunction::ShowStationInterior, GameFunction::ShoWStationExterior, - GameFunction::ShowSystem, + GameFunction::ShowAlliance, GameFunction::ShowAllianceArmada, GameFunction::ShowAllianceHelp, + GameFunction::ShowArtifacts, GameFunction::ShowAwayTeam, GameFunction::ShowBookmarks, + GameFunction::ShowCommander, GameFunction::ShowDaily, GameFunction::ShowEvents, + GameFunction::ShowExoComp, GameFunction::ShowFactions, GameFunction::ShowGalaxy, + GameFunction::ShowGalaxyNative, GameFunction::ShowGifts, GameFunction::ShowInventory, + GameFunction::ShowLookup, GameFunction::ShowMissions, GameFunction::ShowOfficers, + GameFunction::ShowQTrials, GameFunction::ShowRefinery, GameFunction::ShowResearch, + GameFunction::ShowScrapYard, GameFunction::ShowSettings, GameFunction::ShowShips, + GameFunction::ShowStationInterior, GameFunction::ShoWStationExterior, GameFunction::ShowSystem, }; for (const auto action : screen_navigation_actions) { diff --git a/mods/src/patches/parts/hotkeys.cc b/mods/src/patches/parts/hotkeys.cc index 5009cb495..f5bab7c5c 100644 --- a/mods/src/patches/parts/hotkeys.cc +++ b/mods/src/patches/parts/hotkeys.cc @@ -55,7 +55,6 @@ static int show_info_pending = 0; static void* shortcuts_manager_instance = nullptr; static const MethodInfo* on_galaxy_action = nullptr; -static const MethodInfo* on_events_action = nullptr; struct InputActionCallbackContext { void* state; @@ -459,9 +458,6 @@ void ScreenManager_Update_Hook(auto original, ScreenManager* _this) return GotoSection(SectionID::FleetCommander_Management); } else if (MapKey::IsDown(GameFunction::ShowAwayTeam)) { return GotoSection(SectionID::Missions_AwayTeamsList); - } else if (MapKey::IsDown(GameFunction::ShowEventsNative)) { - InvokeNativeShortcut(on_events_action, "Events"); - return; } else if (MapKey::IsDown(GameFunction::ShowEvents)) { return GotoSection(SectionID::Tournament_Group_Selection); } else if (MapKey::IsDown(GameFunction::ShowExoComp)) { @@ -1079,11 +1075,6 @@ void InstallHotkeyHooks() ErrorMsg::MissingMethod("ShortcutsManager", "OnGalaxyAction"); } - on_events_action = shortcuts_manager_helper.GetMethodInfo("OnEventsAction", 1); - if (on_events_action == nullptr) { - ErrorMsg::MissingMethod("ShortcutsManager", "OnEventsAction"); - } - auto ptr_can_user_shortcuts = shortcuts_manager_helper.GetMethod("InitializeActions"); if (ptr_can_user_shortcuts == nullptr) { ErrorMsg::MissingMethod("ShortcutsManager", "InitializeActions"); diff --git a/mods/src/patches/parts/zoom.cc b/mods/src/patches/parts/zoom.cc index 0449592b9..a9cbeb16c 100644 --- a/mods/src/patches/parts/zoom.cc +++ b/mods/src/patches/parts/zoom.cc @@ -147,51 +147,54 @@ void NavigationZoom_Update_Hook(auto original, NavigationZoom *_this) EnsureSystemZoomRange(_this); + const auto mod_camera_shortcuts_enabled = config->hotkeys_enabled && !config->use_scopely_hotkeys; const auto navigation_owns_chord = - config->hotkeys_enabled && !config->use_scopely_hotkeys && !Hub::IsInChat() - && IsScreenNavigationShortcutPressed(); - - if (!Key::IsInputFocused() && !navigation_owns_chord) { - if (MapKey::IsDown(GameFunction::SetZoomPreset1)) { - return StoreZoom("System Preset 1", config->system_zoom_preset_1, _this); - } else if (MapKey::IsDown(GameFunction::SetZoomPreset2)) { - return StoreZoom("System Preset 2", config->system_zoom_preset_2, _this); - } else if (MapKey::IsDown(GameFunction::SetZoomPreset3)) { - return StoreZoom("System Preset 3", config->system_zoom_preset_3, _this); - } else if (MapKey::IsDown(GameFunction::SetZoomPreset4)) { - return StoreZoom("System Preset 4", config->system_zoom_preset_4, _this); - } else if (MapKey::IsDown(GameFunction::SetZoomPreset5)) { - return StoreZoom("System Preset 5", config->system_zoom_preset_5, _this); - } else if (MapKey::IsDown(GameFunction::SetZoomDefault)) { - return StoreZoom("System Default", config->default_system_zoom, _this); - } + mod_camera_shortcuts_enabled && !Hub::IsInChat() && IsScreenNavigationShortcutPressed(); + const auto camera_shortcuts_enabled = mod_camera_shortcuts_enabled && !navigation_owns_chord; + + if (!Key::IsInputFocused()) { + if (camera_shortcuts_enabled) { + if (MapKey::IsDown(GameFunction::SetZoomPreset1)) { + return StoreZoom("System Preset 1", config->system_zoom_preset_1, _this); + } else if (MapKey::IsDown(GameFunction::SetZoomPreset2)) { + return StoreZoom("System Preset 2", config->system_zoom_preset_2, _this); + } else if (MapKey::IsDown(GameFunction::SetZoomPreset3)) { + return StoreZoom("System Preset 3", config->system_zoom_preset_3, _this); + } else if (MapKey::IsDown(GameFunction::SetZoomPreset4)) { + return StoreZoom("System Preset 4", config->system_zoom_preset_4, _this); + } else if (MapKey::IsDown(GameFunction::SetZoomPreset5)) { + return StoreZoom("System Preset 5", config->system_zoom_preset_5, _this); + } else if (MapKey::IsDown(GameFunction::SetZoomDefault)) { + return StoreZoom("System Default", config->default_system_zoom, _this); + } - do_absolute_zoom = true; - if (MapKey::IsDown(GameFunction::ZoomPreset1)) { - zoomDelta = config->system_zoom_preset_1; - do_store_zoom = true; - } else if (MapKey::IsDown(GameFunction::ZoomPreset2)) { - zoomDelta = config->system_zoom_preset_2; - do_store_zoom = true; - } else if (MapKey::IsDown(GameFunction::ZoomPreset3)) { - zoomDelta = config->system_zoom_preset_3; - do_store_zoom = true; - } else if (MapKey::IsDown(GameFunction::ZoomPreset4)) { - zoomDelta = config->system_zoom_preset_4; - do_store_zoom = true; - } else if (MapKey::IsDown(GameFunction::ZoomPreset5)) { - zoomDelta = config->system_zoom_preset_5; - do_store_zoom = true; - } + do_absolute_zoom = true; + if (MapKey::IsDown(GameFunction::ZoomPreset1)) { + zoomDelta = config->system_zoom_preset_1; + do_store_zoom = true; + } else if (MapKey::IsDown(GameFunction::ZoomPreset2)) { + zoomDelta = config->system_zoom_preset_2; + do_store_zoom = true; + } else if (MapKey::IsDown(GameFunction::ZoomPreset3)) { + zoomDelta = config->system_zoom_preset_3; + do_store_zoom = true; + } else if (MapKey::IsDown(GameFunction::ZoomPreset4)) { + zoomDelta = config->system_zoom_preset_4; + do_store_zoom = true; + } else if (MapKey::IsDown(GameFunction::ZoomPreset5)) { + zoomDelta = config->system_zoom_preset_5; + do_store_zoom = true; + } - if (config->hotkeys_extended) { - if (MapKey::IsDown(GameFunction::ZoomReset)) { - do_absolute_zoom = false; - do_default_zoom = true; - } else if (MapKey::IsDown(GameFunction::ZoomMin)) { - zoomDelta = config->zoom; - } else if (MapKey::IsDown(GameFunction::ZoomMax)) { - zoomDelta = 100; + if (config->hotkeys_extended) { + if (MapKey::IsDown(GameFunction::ZoomReset)) { + do_absolute_zoom = false; + do_default_zoom = true; + } else if (MapKey::IsDown(GameFunction::ZoomMin)) { + zoomDelta = config->zoom; + } else if (MapKey::IsDown(GameFunction::ZoomMax)) { + zoomDelta = 100; + } } } @@ -205,7 +208,7 @@ void NavigationZoom_Update_Hook(auto original, NavigationZoom *_this) zoomDelta = config->keyboard_zoom_speed * dt; } - if (MapKey::IsPressed(GameFunction::ZoomIn) || do_absolute_zoom) { + if ((camera_shortcuts_enabled && MapKey::IsPressed(GameFunction::ZoomIn)) || do_absolute_zoom) { vec3 mousePos; GetMousePosition(&mousePos); _this->_zoomLocation = vec2{.x = mousePos.x, .y = mousePos.y}; @@ -219,7 +222,7 @@ void NavigationZoom_Update_Hook(auto original, NavigationZoom *_this) auto worldPos = GetMouseWorldPos(_this->_sceneCamera, &mousePos); _this->_worldPoint = worldPos; _this->ZoomCameraAtWorldPoint(); - } else if (MapKey::IsPressed(GameFunction::ZoomOut) && !Key::IsInputFocused()) { + } else if (camera_shortcuts_enabled && MapKey::IsPressed(GameFunction::ZoomOut)) { vec3 mousePos; GetMousePosition(&mousePos); _this->_zoomLocation = vec2{.x = mousePos.x, .y = mousePos.y}; From 4e17dcd82c9a100dd737f06440aa446dc056dbab Mon Sep 17 00:00:00 2001 From: Guffawaffle Date: Sat, 29 Aug 2026 19:42:30 -0500 Subject: [PATCH 3/7] fix: resolve live shortcut manager --- mods/src/patches/parts/hotkeys.cc | 8 ++++---- mods/src/patches/parts/zoom.cc | 4 +--- mods/src/prime/ShortcutsManager.h | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 mods/src/prime/ShortcutsManager.h diff --git a/mods/src/patches/parts/hotkeys.cc b/mods/src/patches/parts/hotkeys.cc index f5bab7c5c..f2293c6f1 100644 --- a/mods/src/patches/parts/hotkeys.cc +++ b/mods/src/patches/parts/hotkeys.cc @@ -34,6 +34,7 @@ #include "prime/ScanEngageButtonsWidget.h" #include "prime/ScreenManager.h" #include "prime/SelectableList.h" +#include "prime/ShortcutsManager.h" #include "patches/key.h" #include "patches/mapkey.h" @@ -53,7 +54,6 @@ static bool reset_focus_next_frame = false; static int show_info_pending = 0; -static void* shortcuts_manager_instance = nullptr; static const MethodInfo* on_galaxy_action = nullptr; struct InputActionCallbackContext { @@ -65,7 +65,8 @@ static_assert(sizeof(InputActionCallbackContext) == 16); bool InvokeNativeShortcut(const MethodInfo* method, const char* action_name) { - if (!shortcuts_manager_instance || !method) { + auto* shortcuts_manager = ShortcutsManager::Instance(); + if (!shortcuts_manager || !method) { spdlog::warn("[Hotkeys] native {} shortcut is unavailable", action_name); return false; } @@ -75,7 +76,7 @@ bool InvokeNativeShortcut(const MethodInfo* method, const char* action_name) InputActionCallbackContext context{}; void* args[]{&context}; Il2CppException* exception = nullptr; - il2cpp_runtime_invoke(method, shortcuts_manager_instance, args, &exception); + il2cpp_runtime_invoke(method, shortcuts_manager, args, &exception); if (exception) { spdlog::warn("[Hotkeys] native {} shortcut raised exception={}", action_name, static_cast(exception)); return false; @@ -993,7 +994,6 @@ void ChatMessageListLocalViewController_AboutToShow_Hook(ChatMessageListLocalVie void InitializeActions_Hook(auto original, void* _this) { - shortcuts_manager_instance = _this; if (Config::Get().use_scopely_hotkeys) { return original(_this); } diff --git a/mods/src/patches/parts/zoom.cc b/mods/src/patches/parts/zoom.cc index a9cbeb16c..a7823f1e6 100644 --- a/mods/src/patches/parts/zoom.cc +++ b/mods/src/patches/parts/zoom.cc @@ -6,7 +6,6 @@ #include -#include #include #include #include @@ -148,8 +147,7 @@ void NavigationZoom_Update_Hook(auto original, NavigationZoom *_this) EnsureSystemZoomRange(_this); const auto mod_camera_shortcuts_enabled = config->hotkeys_enabled && !config->use_scopely_hotkeys; - const auto navigation_owns_chord = - mod_camera_shortcuts_enabled && !Hub::IsInChat() && IsScreenNavigationShortcutPressed(); + const auto navigation_owns_chord = mod_camera_shortcuts_enabled && IsScreenNavigationShortcutPressed(); const auto camera_shortcuts_enabled = mod_camera_shortcuts_enabled && !navigation_owns_chord; if (!Key::IsInputFocused()) { diff --git a/mods/src/prime/ShortcutsManager.h b/mods/src/prime/ShortcutsManager.h new file mode 100644 index 000000000..5529506f2 --- /dev/null +++ b/mods/src/prime/ShortcutsManager.h @@ -0,0 +1,14 @@ +#pragma once + +#include "MonoSingleton.h" + +struct ShortcutsManager : MonoSingleton { + friend struct MonoSingleton; + +private: + static IL2CppClassHelper& get_class_helper() + { + static auto class_helper = il2cpp_get_class_helper("Assembly-CSharp", "Digit.Prime.GameInput", "ShortcutsManager"); + return class_helper; + } +}; From dbdc22f92036ee7cc1a5ecb9ea2090fd7e6c0d10 Mon Sep 17 00:00:00 2001 From: Guffawaffle Date: Sat, 29 Aug 2026 22:27:57 -0500 Subject: [PATCH 4/7] fix: rely on configured zoom shortcuts --- mods/src/patches/parts/hotkey_ownership.h | 30 ----------------------- mods/src/patches/parts/zoom.cc | 5 +--- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 mods/src/patches/parts/hotkey_ownership.h diff --git a/mods/src/patches/parts/hotkey_ownership.h b/mods/src/patches/parts/hotkey_ownership.h deleted file mode 100644 index b4fbfdfbc..000000000 --- a/mods/src/patches/parts/hotkey_ownership.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include "patches/gamefunctions.h" -#include "patches/mapkey.h" - -#include - -// Screen navigation and camera shortcuts run from separate Unity update hooks. Give screen navigation ownership of a -// shared chord so the result does not depend on which hook Unity calls first. -inline bool IsScreenNavigationShortcutPressed() -{ - static constexpr std::array screen_navigation_actions{ - GameFunction::ShowAlliance, GameFunction::ShowAllianceArmada, GameFunction::ShowAllianceHelp, - GameFunction::ShowArtifacts, GameFunction::ShowAwayTeam, GameFunction::ShowBookmarks, - GameFunction::ShowCommander, GameFunction::ShowDaily, GameFunction::ShowEvents, - GameFunction::ShowExoComp, GameFunction::ShowFactions, GameFunction::ShowGalaxy, - GameFunction::ShowGalaxyNative, GameFunction::ShowGifts, GameFunction::ShowInventory, - GameFunction::ShowLookup, GameFunction::ShowMissions, GameFunction::ShowOfficers, - GameFunction::ShowQTrials, GameFunction::ShowRefinery, GameFunction::ShowResearch, - GameFunction::ShowScrapYard, GameFunction::ShowSettings, GameFunction::ShowShips, - GameFunction::ShowStationInterior, GameFunction::ShoWStationExterior, GameFunction::ShowSystem, - }; - - for (const auto action : screen_navigation_actions) { - if (MapKey::IsPressed(action)) { - return true; - } - } - return false; -} diff --git a/mods/src/patches/parts/zoom.cc b/mods/src/patches/parts/zoom.cc index a7823f1e6..e4b08f588 100644 --- a/mods/src/patches/parts/zoom.cc +++ b/mods/src/patches/parts/zoom.cc @@ -2,7 +2,6 @@ #include "errormsg.h" #include -#include #include @@ -146,9 +145,7 @@ void NavigationZoom_Update_Hook(auto original, NavigationZoom *_this) EnsureSystemZoomRange(_this); - const auto mod_camera_shortcuts_enabled = config->hotkeys_enabled && !config->use_scopely_hotkeys; - const auto navigation_owns_chord = mod_camera_shortcuts_enabled && IsScreenNavigationShortcutPressed(); - const auto camera_shortcuts_enabled = mod_camera_shortcuts_enabled && !navigation_owns_chord; + const auto camera_shortcuts_enabled = config->hotkeys_enabled && !config->use_scopely_hotkeys; if (!Key::IsInputFocused()) { if (camera_shortcuts_enabled) { From abbe39cba36a6324e66a395873ce66ffd2b18ca8 Mon Sep 17 00:00:00 2001 From: Guffawaffle Date: Sat, 29 Aug 2026 22:34:15 -0500 Subject: [PATCH 5/7] docs: use valid equals shortcut token --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 801fe08e6..de1db1f3e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ been applied. Valid values for any short can be found in [KEYMAPPING.md](KEYMAPP | Q | Zoom In | | E | Zoom Out | | MINUS | Zoom (min) | -| EQUALS | Zoom (default) | +| = | Zoom (default) | | BACKSPACE | Zoom (max) | | C | Open/Focus Chat - Full Screen | | Alt-C | Open/Focus Chat - Side of Screen | From b32349b851498682b68a483a3dac35741f862e32 Mon Sep 17 00:00:00 2001 From: Guffawaffle Date: Sat, 29 Aug 2026 22:52:27 -0500 Subject: [PATCH 6/7] feat: add native Events shortcut action --- README.md | 1 + example_community_patch_settings_da.toml | 5 ++++- example_community_patch_settings_de.toml | 5 ++++- ...le_community_patch_settings_en-GB-x-cockney.toml | 5 ++++- ...ple_community_patch_settings_en-x-minionese.toml | 5 ++++- example_community_patch_settings_en.toml | 5 ++++- example_community_patch_settings_es.toml | 5 ++++- example_community_patch_settings_fr.toml | 5 ++++- example_community_patch_settings_nl.toml | 5 ++++- example_community_patch_settings_ru.toml | 5 ++++- example_community_patch_settings_tlh.toml | 5 ++++- mods/src/config.cc | 6 ++++-- mods/src/defaultconfig.h | 5 ++++- mods/src/patches/gamefunctions.h | 3 ++- mods/src/patches/parts/hotkeys.cc | 13 +++++++++++-- 15 files changed, 62 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index de1db1f3e..29281264b 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ action items such as: | Ctrl-G | Galaxy (native) | | H | System | | Shift-E | Events | +| Ctrl-E | Events (native) | | Shift-G | Exterior View | | Shift-H | Interior View | | B | Bookmarks | diff --git a/example_community_patch_settings_da.toml b/example_community_patch_settings_da.toml index 5c0499957..98c078e80 100644 --- a/example_community_patch_settings_da.toml +++ b/example_community_patch_settings_da.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Gå til begivenheder show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Gå til Exocomp show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Gå til gaver show_gifts = "/" diff --git a/example_community_patch_settings_de.toml b/example_community_patch_settings_de.toml index 90d4daada..e185936c6 100644 --- a/example_community_patch_settings_de.toml +++ b/example_community_patch_settings_de.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Zu den Events show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Zu den Exocomps show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Zu den Geschenken show_gifts = "/" diff --git a/example_community_patch_settings_en-GB-x-cockney.toml b/example_community_patch_settings_en-GB-x-cockney.toml index d00195fae..4969e2e40 100644 --- a/example_community_patch_settings_en-GB-x-cockney.toml +++ b/example_community_patch_settings_en-GB-x-cockney.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Go to Exocomp show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_en-x-minionese.toml b/example_community_patch_settings_en-x-minionese.toml index 6d96c31f5..e0facf124 100644 --- a/example_community_patch_settings_en-x-minionese.toml +++ b/example_community_patch_settings_en-x-minionese.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Go to Exocomp show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_en.toml b/example_community_patch_settings_en.toml index 9e7bc39db..9e31340b9 100644 --- a/example_community_patch_settings_en.toml +++ b/example_community_patch_settings_en.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go to Events show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Go to Exocomp show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Go to Gifts show_gifts = "/" diff --git a/example_community_patch_settings_es.toml b/example_community_patch_settings_es.toml index baa3caf9b..5750f6711 100644 --- a/example_community_patch_settings_es.toml +++ b/example_community_patch_settings_es.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Ir a eventos show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Ir a Exocomp show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Ir a regalos show_gifts = "/" diff --git a/example_community_patch_settings_fr.toml b/example_community_patch_settings_fr.toml index a107f23ce..c415cc260 100644 --- a/example_community_patch_settings_fr.toml +++ b/example_community_patch_settings_fr.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Aller aux événements show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Aller aux Exocomps show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Aller aux cadeaux show_gifts = "/" diff --git a/example_community_patch_settings_nl.toml b/example_community_patch_settings_nl.toml index ac72b48df..bf1bdde48 100644 --- a/example_community_patch_settings_nl.toml +++ b/example_community_patch_settings_nl.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Ga naar Evenementen show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Ga naar Exocomp show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Ga naar Cadeaus show_gifts = "/" diff --git a/example_community_patch_settings_ru.toml b/example_community_patch_settings_ru.toml index f227910f2..92e084d7b 100644 --- a/example_community_patch_settings_ru.toml +++ b/example_community_patch_settings_ru.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Перейти к событиям show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Перейти к экзокомпу show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Перейти к подаркам show_gifts = "/" diff --git a/example_community_patch_settings_tlh.toml b/example_community_patch_settings_tlh.toml index 89eff1157..3e7be9c88 100644 --- a/example_community_patch_settings_tlh.toml +++ b/example_community_patch_settings_tlh.toml @@ -455,6 +455,9 @@ show_daily = "Z" # Go Daq Events show_events = "SHIFT-E" +# Scopely shortcut-native Events Action +native_shortcut_events = "CTRL-E" + # Go Daq Exocomp show_exocomp = "X" @@ -465,7 +468,7 @@ show_factions = "F" show_galaxy = "G" # Scopely shortcut-native Galaxy Action -show_galaxy_native = "CTRL-G" +native_shortcut_galaxy = "CTRL-G" # Go Daq Gifts show_gifts = "/" diff --git a/mods/src/config.cc b/mods/src/config.cc index 6aa4c5b56..ca3721ecb 100644 --- a/mods/src/config.cc +++ b/mods/src/config.cc @@ -1226,8 +1226,8 @@ void Config::Load() parse_config_shortcut(config, parsed, "show_chatside1", GameFunction::ShowChatSide1, DCSH::show_chatside1); parse_config_shortcut(config, parsed, "show_chatside2", GameFunction::ShowChatSide2, DCSH::show_chatside2); parse_config_shortcut(config, parsed, "show_galaxy", GameFunction::ShowGalaxy, DCSH::show_galaxy); - parse_config_shortcut(config, parsed, "show_galaxy_native", GameFunction::ShowGalaxyNative, - DCSH::show_galaxy_native); + parse_config_shortcut(config, parsed, "native_shortcut_galaxy", GameFunction::NativeShortcutGalaxy, + DCSH::native_shortcut_galaxy); parse_config_shortcut(config, parsed, "show_system", GameFunction::ShowSystem, DCSH::show_system); parse_config_shortcut(config, parsed, "zoom_preset1", GameFunction::ZoomPreset1, DCSH::zoom_preset1); parse_config_shortcut(config, parsed, "zoom_preset2", GameFunction::ZoomPreset2, DCSH::zoom_preset2); @@ -1263,6 +1263,8 @@ void Config::Load() parse_config_shortcut(config, parsed, "show_commander", GameFunction::ShowCommander, DCSH::show_commander); parse_config_shortcut(config, parsed, "show_daily", GameFunction::ShowDaily, DCSH::show_daily); parse_config_shortcut(config, parsed, "show_events", GameFunction::ShowEvents, DCSH::show_events); + parse_config_shortcut(config, parsed, "native_shortcut_events", GameFunction::NativeShortcutEvents, + DCSH::native_shortcut_events); parse_config_shortcut(config, parsed, "show_exocomp", GameFunction::ShowExoComp, DCSH::show_exocomp); parse_config_shortcut(config, parsed, "show_factions", GameFunction::ShowFactions, DCSH::show_factions); parse_config_shortcut(config, parsed, "show_inventory", GameFunction::ShowInventory, DCSH::show_inventory); diff --git a/mods/src/defaultconfig.h b/mods/src/defaultconfig.h index 089cb246a..edd136053 100644 --- a/mods/src/defaultconfig.h +++ b/mods/src/defaultconfig.h @@ -129,6 +129,10 @@ namespace Shortcuts constexpr const char* set_zoom_preset3 = "SHIFT-F3"; constexpr const char* set_zoom_preset4 = "SHIFT-F4"; constexpr const char* set_zoom_preset5 = "SHIFT-F5"; + + constexpr const char* native_shortcut_events = "CTRL-E"; + constexpr const char* native_shortcut_galaxy = "CTRL-G"; + constexpr const char* show_alliance = "ALT-'"; constexpr const char* show_alliance_armada = "CTRL-'"; constexpr const char* show_alliance_help = "SHIFT-'"; @@ -144,7 +148,6 @@ namespace Shortcuts constexpr const char* show_exocomp = "X"; constexpr const char* show_factions = "F"; constexpr const char* show_galaxy = "G"; - constexpr const char* show_galaxy_native = "CTRL-G"; constexpr const char* show_gifts = "/"; constexpr const char* show_inventory = "I"; constexpr const char* show_lookup = "L"; diff --git a/mods/src/patches/gamefunctions.h b/mods/src/patches/gamefunctions.h index c99ebf970..3ad39fd59 100644 --- a/mods/src/patches/gamefunctions.h +++ b/mods/src/patches/gamefunctions.h @@ -40,12 +40,13 @@ enum GameFunction { ShowStationInterior, ShoWStationExterior, ShowGalaxy, - ShowGalaxyNative, + NativeShortcutGalaxy, ShowSystem, ShowChat, ShowChatSide1, ShowChatSide2, ShowEvents, + NativeShortcutEvents, ShowSettings, ZoomPreset1, ZoomPreset2, diff --git a/mods/src/patches/parts/hotkeys.cc b/mods/src/patches/parts/hotkeys.cc index f2293c6f1..e5e8a6143 100644 --- a/mods/src/patches/parts/hotkeys.cc +++ b/mods/src/patches/parts/hotkeys.cc @@ -54,7 +54,8 @@ static bool reset_focus_next_frame = false; static int show_info_pending = 0; -static const MethodInfo* on_galaxy_action = nullptr; +static const MethodInfo* on_events_action = nullptr; +static const MethodInfo* on_galaxy_action = nullptr; struct InputActionCallbackContext { void* state; @@ -432,7 +433,7 @@ void ScreenManager_Update_Hook(auto original, ScreenManager* _this) return GotoSection(SectionID::Shop_MainFactions); } else if (MapKey::IsDown(GameFunction::ShoWStationExterior)) { return GotoSection(SectionID::Starbase_Exterior); - } else if (MapKey::IsDown(GameFunction::ShowGalaxyNative)) { + } else if (MapKey::IsDown(GameFunction::NativeShortcutGalaxy)) { InvokeNativeShortcut(on_galaxy_action, "Galaxy"); return; } else if (MapKey::IsDown(GameFunction::ShowGalaxy)) { @@ -459,6 +460,9 @@ void ScreenManager_Update_Hook(auto original, ScreenManager* _this) return GotoSection(SectionID::FleetCommander_Management); } else if (MapKey::IsDown(GameFunction::ShowAwayTeam)) { return GotoSection(SectionID::Missions_AwayTeamsList); + } else if (MapKey::IsDown(GameFunction::NativeShortcutEvents)) { + InvokeNativeShortcut(on_events_action, "Events"); + return; } else if (MapKey::IsDown(GameFunction::ShowEvents)) { return GotoSection(SectionID::Tournament_Group_Selection); } else if (MapKey::IsDown(GameFunction::ShowExoComp)) { @@ -1070,6 +1074,11 @@ void InstallHotkeyHooks() if (!shortcuts_manager_helper.isValidHelper()) { ErrorMsg::MissingHelper("GameInput", "ShortcutsManager"); } else { + on_events_action = shortcuts_manager_helper.GetMethodInfo("OnEventsAction", 1); + if (on_events_action == nullptr) { + ErrorMsg::MissingMethod("ShortcutsManager", "OnEventsAction"); + } + on_galaxy_action = shortcuts_manager_helper.GetMethodInfo("OnGalaxyAction", 1); if (on_galaxy_action == nullptr) { ErrorMsg::MissingMethod("ShortcutsManager", "OnGalaxyAction"); From f7111e6e0fc78aef79b7548b7c0a014739e958e0 Mon Sep 17 00:00:00 2001 From: Guffawaffle Date: Sat, 29 Aug 2026 22:57:01 -0500 Subject: [PATCH 7/7] fix: preserve native Galaxy shortcut alias --- mods/src/config.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/src/config.cc b/mods/src/config.cc index ca3721ecb..654110174 100644 --- a/mods/src/config.cc +++ b/mods/src/config.cc @@ -1226,8 +1226,8 @@ void Config::Load() parse_config_shortcut(config, parsed, "show_chatside1", GameFunction::ShowChatSide1, DCSH::show_chatside1); parse_config_shortcut(config, parsed, "show_chatside2", GameFunction::ShowChatSide2, DCSH::show_chatside2); parse_config_shortcut(config, parsed, "show_galaxy", GameFunction::ShowGalaxy, DCSH::show_galaxy); - parse_config_shortcut(config, parsed, "native_shortcut_galaxy", GameFunction::NativeShortcutGalaxy, - DCSH::native_shortcut_galaxy); + parse_config_shortcut_aliases(config, parsed, "native_shortcut_galaxy", GameFunction::NativeShortcutGalaxy, + DCSH::native_shortcut_galaxy, {"show_galaxy_native"}); parse_config_shortcut(config, parsed, "show_system", GameFunction::ShowSystem, DCSH::show_system); parse_config_shortcut(config, parsed, "zoom_preset1", GameFunction::ZoomPreset1, DCSH::zoom_preset1); parse_config_shortcut(config, parsed, "zoom_preset2", GameFunction::ZoomPreset2, DCSH::zoom_preset2);