[FIXED][Sug][Player] show different cursor when in directional select mode?

Started by ccexplore, December 27, 2018, 12:33:01 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ccexplore

I haven't really played NeoLemmix until the recent level solving contest, and multiple times I thought I hit some weird bug where the mouse stops detecting lemmings.  Eventually (as in sometime today), it finally dawned on me that I might have had directional select on, and forgot about it after multiple rewinds and trying different things etc.  The mouse cursor looked like it's not detecting the lemming and it seemed like assignments to the lemming didn't work, when in fact it was just that the lemming was in the wrong direction from the forgotten directional mode.

Now that I know what to look for I won't be confused again, but before that when I didn't know what was happening, I wound up restarting the game, which is a little annoying.  If the mouse cursor looks a little different during directional mode (eg. have an arrow at the left/right over the usual crosshair), this confusion would not have occurred.

Nepster

Before I am able to fix this, I need some help from namida: How can I compile the various Cursor-Bitmaps into the LemmixResources.res file?

namida

I couldn't help you there, those have remained unchanged since vanilla Lemmix (partly because I never figured out how it worked - not that I put too much effort into doing so). You might need to ask EricLang on that one.
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)

Nepster

Thanks. The internet describes a lot of ways to produce these .res files via .rc files (which are just text files with a fancy name), but you have to give each image an internal name. I have not yet decided whether I will try to reconstruct these internal names from the code, or rewrite the whole cursor code to use external graphics.

namida

From what I can tell, LemmixResources.res's contents are bitmap images - one graphic and one transparency mask per cursor. I'd imagine these could almost as easily be loaded from external BMP files, or even better, generated at runtime from a single external PNG file (either a single one containing all cursors, or one per cursor).

If I remember correctly, the code that loads these images and turns them into cursors is in GameWindow.pas.

Also, if NL code no longer has the source RC file, Lemmix's source code should.
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

Commit 3c869d1 moves the cursor graphics to external PNG files (with the following commit removing the old source BMP files). It also implements directional select graphics.

The current code could theoretically be exapnded to include a special icon for "select walkers", other combinations, etc. It could also be used to add a customized menu cursor, if we decide we want mouse support there (which might not be a bad idea). However, it has its limits when adding various special cursors - currently, while it can assemble a cursor graphic from multiple images, it has to pre-generate every possible combination (including with every possible zoom level), which could quickly end up being too slow or using too much memory. I can probably modify this so it at least generates the different zoomed versions on the fly - this might be fast enough to achieve what we want.
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)