[SUG][PLAYER] Hotkey placeholders in pre/post texts.

Started by namida, September 05, 2019, 09:02:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

namida

This is mostly for the sake of the NeoLemmix Introduction Pack, and is supported for postview texts purely on the basis of "it would be extra work to specifically not allow it there, compared to just allowing it on both sides".

But yeah - IchoTolot wants to mention what hotkeys are in the intro texts. Fair enough - but the issue is that there are multiple default hotkey setups one can choose from, as well as the possibility of custom hotkeys. This means that any hard-written text is not guaranteed to be correct.

Therefore, here's a feature that will help with that!

As an example, I can have the following in an NXLV file:

$PRETEXT
   LINE Back skip: [HOTKEY:SKIP-]
   LINE Forward skip: [HOTKEY:SKIP+]
   LINE Pause: [HOTKEY:PAUSE]
   LINE Fart: [HOTKEY:FART]
   LINE Back One: [HOTKEY:SKIP:-1]
   LINE To Shrugger: [HOTKEY:SPECIAL_SKIP:NEXTSHRUG]
$END


"SKIP-" and "SKIP+" are special values that will list any fixed-duration (ie: not the "to next shrugger" etc) backwards or forwards skip key respectively, regardless of duration. Aside from those two special cases, the key words are exactly the same as in the hotkey INI file in the "Settings" directory. The text outside of the [ ] brackets is just interpreted as normal text, just like it currently is.

The result of the above is as shown in the attached screenshot. Obviously - intended use case would be similar to this, with a dedicated line to list hotkeys. The actual text body would simply mention "hotkeys exist" or something. This avoids the need to either write text that can adapt to any number of hotkeys, or write code that somehow determines just a single one of the various options to display.

Not shown in screenshot: If a function has no hotkey assigned, the placeholder will be replaced with {No Hotkey Assigned}.
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

For the record: I wrote this in a way that can fairly easily be expanded, if there's ever a need to support other similar tags in preview / postview texts. So if you've got other suggestions - with actual good use cases for them, not just "this would be a cool feature" - feel free to make them.
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

V12.6.5 includes this feature, although there's no reason it can't be further improved if ideas arise so I'll leave this topic open for now.
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)

Proxima

Already mentioned in discord, but I wanted to leave a permanent note: I suggest "None" rather than "No Hotkey Assigned". Just in case. :P

namida

#4
I wondered if "None" might not be clear enough. If no one feels that's a concern, I can definitely change it.

EDIT: Changed in commit 12186F7. I can change it back if anyone does have concerns re: above.
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

Seems there's no further input on this, so closing this topic now. If anyone does want to make further requests / suggestions relating to this feature, please open a new topic.
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)