[MISSING] Hotkey configuration menu

Started by namida, September 21, 2023, 05:42:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

namida

Loap supports configurable hotkeys, but at present these must be manually edited via the INI file. It would be good to implement a menu where these can be configured.

One complication is modifier keys (ie: like holding Shift + pressing a key, instead of just pressing the key). Loap supports designating keys as modifier keys, and any key can be designated as such. This needs to be factored into the hotkey configuation menu - including that a hotkey may ignore modifier keys, or specifically require no modifier keys are pressed, or require a combination of them rather than just one.

Another, likely much less troublesome issue, is that Loap does not prevent having multiple functions for the same key. It will generally just do both things if a key configured this way is pressed, if possible.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

#1
For reference in the meantime, here are the values you can use for hotkey definitions. For the general structure of the file, read up on the basics of NeoLemmix text-based data files; Loap uses exactly the same structure for its text-based data files including this one.

The value for FUNCTION defines what the key does. List below.
The value for KEY defines what key needs to be pressed. Any value from the MonoGame Keys enum can be used. Unlike in NeoLemmix, the mouse buttons cannot be customized.
The value for PARAMETER depends on the FUNCTION of the key. Most FUNCTIONs do not use PARAMETER and in such cases it can be omitted.
The value for MODIFIER determines which modifier keys must be held. Zero means specifically no modifier, otherwise add 1 for Modifier 1, 2 for Modifier 2, 4 for Modifier 3, 8 for Modifier 4, etc. (Or in other words: 2^n, where n is the modifier index. Add values together to require a combination.) Omit it or set to -1 to ignore modifiers.

Values for FUNCTION
Modifier: Sets the key as a modifier (a key you hold together with another key to change its effect). PARAMETER indicates which modifier index.
ForceSelectWalker: Only Walker lemmings can be selected when the key is held.
ForceSelectNonWalker: Only lemmings performing an action can be selected when the key is held.
RemoveFrameLimiter: Turns FPS limit off (or on, if it's already off).
ShowFPS: Turns FPS display on (or off, if it's already on).
ConfineCursor: Restricts the mouse cursor to inside Loap's window (or frees it, if it's already trapped).
Pause: Pauses or unpauses the game.
FastForward: Activates or deactivates fast forward.
FrameSkip: Skips forward or backwards a certain number of frames. PARAMETER indicates the skip duration; use a negative value for backwards skips.
SkipToLastAssignment: Skips backwards to the last frame where a skill was assigned (including the nuke).
SkipToNextShrugger: Skips forwards to the next frame where a currently-building lemming becomes a shrugger or otherwise stops building.
SelectSkill: Selects a skill. PARAMETER indicates the skill, where Blocker is 0, Turner is 1, etc in the same order as on the skill panel in-game.
Nuke: Activates the nuke.
ChangeSpawnRate: Changes the spawn (release) rate. PARAMETER indicates how much to change it by; you'd most likely want to put -1 or 1.
SaveReplay: Saves a replay to a file.
LoadReplay: Loads a replay from a file.
Restart: Instantly restarts gameplay from frame 0 (without exiting to postview).
Quit: Exits to the postview screen.
SaveState: Saves a state at the current frame.
LoadState: Loads the saved state.
ChangeCamera: Changes to another camera. PARAMETER indicates the camera number to change to (1 to 9).
CloneCamera: Clones the current camera to another slot. PARAMETER indicates the camera number to clone to (1 to 9). You can clone to the first unused slot as well as to any existing slot.
MoveCamera: Moves the active camera. PARAMETER indicates the type of movement; 1, 2 and 3 are movement along the X, Y and Z axes respectively, 4 is rotation, 5 is pitch. Using the negatives of these values inverts the movement direction.
PhaseCamera: When held, the camera can move through walls.
AdjustCameraSpeed: When held, the camera moves faster or slower than the default speed. PARAMETER sets the speed change, where 100 = default speed (and 200 is twice as fast, etc).
ResetCamera: Resets the active camera to its initial position.
ToggleMinimap: Turns the minimap on or off.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

#2
I've begun implementing this at last. In its current state (commit bfac1a4), you can view the hotkeys sorted either by key or by function, but you can't edit them yet.

My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

As of commit e12b4cd, it is now possible to delete hotkeys, as well as to reset them to default. Adding new ones is still to come.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

The hotkey config menu is fully functional as of commit e0e2575.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)