Skip to content

More gamekeys#4609

Draft
PieterVdc wants to merge 16 commits intodkfans:masterfrom
PieterVdc:more-gamekeys
Draft

More gamekeys#4609
PieterVdc wants to merge 16 commits intodkfans:masterfrom
PieterVdc:more-gamekeys

Conversation

@PieterVdc
Copy link
Member

No description provided.

@PieterVdc PieterVdc marked this pull request as ready for review March 9, 2026 19:05
Copilot AI review requested due to automatic review settings March 9, 2026 19:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 252 to 256
if ((ignore_mods) || (key_modifiers == settings.kbkeys[key_id].mods)) {
i = settings.kbkeys[key_id].code;
result = lbKeyOn[i];
} else {
result = 0;
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore_mods currently bypasses the modifier check entirely (if (ignore_mods || key_modifiers == ...)), which means a binding like Alt+X will also match plain X when ignore_mods is true. Several new call sites pass true expecting to allow extra modifiers, so this can cause unintended actions (eg. exit) without the required modifier. Consider changing the ignore_mods logic to still require the configured modifiers (eg. (key_modifiers & required_mods) == required_mods) while allowing additional modifiers, or rename/split the flag to avoid misuse.

Copilot uses AI. Check for mistakes.
Comment on lines +259 to +263
//hardcoded alternative keys
if (!result)
{
if ((key_id == GKey_FrameSkipIncrease) && is_key_pressed(KC_EQUALS, KMod_CONTROL))
result = 1;
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded alternative-key path sets result = 1 but never updates *val to the actual alternative key code. Callers that do clear_key_pressed(val) will clear the primary binding instead of the key that was actually pressed, leaving the alternative key latched and potentially retriggering every frame. When an alternative matches, set *val accordingly (and consider covering GKey_CheatMenu3 too if Shift+Enter is meant to keep working in dungeon view).

Copilot uses AI. Check for mistakes.
Comment on lines +3117 to 3121
int32_t val;
if (is_game_key_pressed(Gkey_ExitGame, &val ,true))
{
clear_key_pressed(KC_X);
clear_key_pressed(val);
exit_keeper = true;
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_game_key_pressed(Gkey_ExitGame, &val, true) combined with the current ignore_mods behavior makes the ExitGame action trigger on the bound keycode regardless of modifiers (eg. plain X instead of Alt+X). Until ignore_mods is adjusted to only ignore extra modifiers, this should not pass true here (or should explicitly enforce the configured modifier).

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +84
GKey_ScreenRecord,
GKey_ScreenShot,
GKey_FrameSkipIncrease,
GKey_FrameSkipDecrease,
GKey_ZoomMinimapIn,
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GameKeys enum introduces mixed naming (GKey_* vs existing Gkey_*). This inconsistency makes the API harder to use and is easy to misuse when adding future keys. Please standardize the new entries to the established Gkey_ prefix (and update call sites) so all game key identifiers follow one convention.

Copilot uses AI. Check for mistakes.
Comment on lines +7452 to +7455
#: guitext:10 90
msgctxt "Game controls"
msgid "Prev Instance"
msgstr "Vorherige Instanz"
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source reference comment has a typo: #: guitext:10 90 contains a space, which likely breaks tooling/searchability for the guitext:1090 entry. Please correct it to #: guitext:1090.

Copilot uses AI. Check for mistakes.
#define STRINGS_MAX 2000
#define DK_STRINGS_MAX 941
#define GUI_STRINGS_COUNT 1083
#define GUI_STRINGS_COUNT GuiStrEnd - STRINGS_MAX
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GUI_STRINGS_COUNT is now defined as GuiStrEnd - STRINGS_MAX without parentheses. As a macro, this is prone to operator-precedence bugs if used in expressions (eg. GUI_STRINGS_COUNT/2 would expand unexpectedly). Wrap the expression in parentheses (and ideally the whole macro) to make it safe: #define GUI_STRINGS_COUNT (GuiStrEnd - STRINGS_MAX).

Copilot uses AI. Check for mistakes.
@PieterVdc PieterVdc marked this pull request as draft March 9, 2026 21:25

#: guitext:1089
msgctxt "Game controls"
msgid "Next Instance"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with 'Ability' over instance, as referred to in string 25


#: guitext:1090
msgctxt "Game controls"
msgid "Prev Instance"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*previous

msgid "Prev Instance"
msgstr ""

#: guitext:1091
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really do not think it's a good idea to list the cheat menu controls in the define keys list.


#: guitext:1096
msgctxt "Game controls"
msgid "Landview Show All Ensigns"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 cheat controls do not belong either

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.

4 participants