Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConsoleEnablerMod overhaul #687

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

igromanru
Copy link
Contributor

@igromanru igromanru commented Oct 17, 2024

Changes

  • Check if ~ (Tilde) and F10 already exist as ConsoleKeys, if not add them at the end of the array
  • Add some missing IsValid checks
  • Removed obsolete parameters from callbacks and function calls

Description

I don't know the reasons for the structure of the mod, but I couldn't find any harm in my improvements.
Originally the mod overwrites the first hotkey for the console with F10, if the game has default settings that allows you to open the console, it would overwrite the default key.
Also the most universal key to open a console on English keyboard layouts is ~ (tilde).
My changes add ~ in addition to F10, check if hotkeys are already set, if not the mod expands the ConsoleKeys array and adds ~ and F10 as additional options to open the console. Not only does it allow you to respect the game's settings, but it also allows other mods to add their own hotkeys to open the console.

Testing

I've tested the changes and I use it basically daily with my Cheat Console Commands Mod for Abiotic Factor.
For test purposes I've locally changed key mappings to F11 in my mod here and it worked. I could open the console with any of assigned keys.

Changelog changes

Like usually I'll write down the changes in the Changelog.md a bit later, maybe after an initial review, so I know which changes will remain.
Added

…ey instead of replacing the first one

feat: Add some missing IsValid checks
refactor: Removed obsolete parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant