Author Topic: [sugg] scroll with button instead of edge of screen  (Read 3868 times)

0 Members and 1 Guest are viewing this topic.

Offline mobius

  • Posts: 2761
  • relax.
    • View Profile
[sugg] scroll with button instead of edge of screen
« on: May 08, 2017, 10:09:56 PM »
I don't like scrolling at the edge of the screen. It's especially annoying on vertical levels because you accidentally scroll every time you go the bar to press a button. But I've always found it annoying when for example you want to do something sort of near the edge of the screen; you accidentally scroll then lose what you were trying to do.

I'd prefer the option [like Lix has] to use a (assignable) button instead. Holding right mouse button then moving mouse scrolls. This can be used in conjunction with having your right mouse be used as something else also [like selecting walkers as I do] and won't conflict because you're not left clicking.
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


Offline namida

  • Administrator
  • Posts: 12436
    • View Profile
    • NeoLemmix Website
Re: [sugg] scroll with button instead of edge of screen
« Reply #1 on: May 09, 2017, 10:48:25 AM »
NeoLemmix's hotkey system (which despite the name, includes the middle / right mouse buttons and the mouse wheel) doesn't currently allow for assigning multiple functions to one key.

The idea in general should be doable, though.
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)

Offline namida

  • Administrator
  • Posts: 12436
    • View Profile
    • NeoLemmix Website
Re: [sugg] scroll with button instead of edge of screen
« Reply #2 on: May 09, 2017, 11:50:39 AM »
I've implemented this for the next update.

There are two seperate options. The first is to assign a hotkey which gives the hold-to-scroll function. The second is to disable edge-of-screen scrolling.

I'm not sure how ideal the current implementation is, so I'll be releasing an experimental build shortly that can be used to test this out.
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)

Offline Simon

  • Administrator
  • Posts: 3954
    • View Profile
    • Lix
Re: [sugg] scroll with button instead of edge of screen
« Reply #3 on: May 10, 2017, 01:50:22 AM »
I tested player V10.13.17:bfe87e5 in wine.

The improved egde scrolling feels snappy and good. Very refreshing, makes the game feel modern.

I remapped hold-to-scroll to RMB. Hold-to-scroll feels quick enough for me. The mouse is always kept in the window, that is perfect. I'd always use this hold-to-scroll over edge scrolling.

geoo would probably like to configure it even faster because his mouse is set slow and insensitive.

NL keeps scrolling even after I stop moving the mouse. This feels slippery. I have the map in my mind and habitually hold-to-scroll with one quick, controlled movement to where I want. I'm not 100 % sure if, due to the extra scrolling after I stop moving the mouse, NL overshoots my target, or whether NL has undershot before and now approaches the goal slowly. I believe this extra scrolling overshoots.

NL doesn't freeze the mouse cursor when hold-to-scrolling. Different than what I do in Lix, but NL's behavior is straightforward and simple. Unless you're extremely close to the window edge, you can scroll everywhere in NL. I merely have the hunch that not-freezing is related to the slippery overshooting. What is the basic behavior for NL's hold-to-scroll?

Waiting for mobius's reaction to this hold-to-scroll.

-- Simon

Offline namida

  • Administrator
  • Posts: 12436
    • View Profile
    • NeoLemmix Website
Re: [sugg] scroll with button instead of edge of screen
« Reply #4 on: May 10, 2017, 09:12:47 AM »
Here's the relevant parts of the code, with some comments added for this post:

Detecting initial press and activating hold-to-scroll mode
Code: [Select]
          lka_Scroll: begin
                        if PtInRect(Img.BoundsRect, Img.ParentToClient(ScreenToClient(Mouse.CursorPos))) and not fHoldScrollData.Active then
                        begin
                          fHoldScrollData.Active := true;
                          fHoldScrollData.StartCursor := Mouse.CursorPos;
                          fHoldScrollData.StartImg := FloatPoint(Img.OffsetHorz, Img.OffsetVert); // this doesn't get used, I thought I may have ended up using it but didn't
                        end;
                      end;

Processing hold-to-scroll
Code: [Select]
  procedure HandleHeldScroll;
  var
    HDiff, VDiff: Integer;
  begin
    HDiff := (Mouse.CursorPos.X - fHoldScrollData.StartCursor.X) div fInternalZoom; // fInternalZoom is the current magnification for the gameplay display
    VDiff := (Mouse.CursorPos.Y - fHoldScrollData.StartCursor.Y) div fInternalZoom; // just on the offchance this is a significant difference from C++ / D, "div" is integer division (truncating remainder)

    if Abs(HDiff) = 1 then
      fHoldScrollData.StartCursor.X := Mouse.CursorPos.X
    else
      fHoldScrollData.StartCursor.X := fHoldScrollData.StartCursor.X + (HDiff * 3 div 4);

    if Abs(VDiff) = 1 then
      fHoldScrollData.StartCursor.Y := Mouse.CursorPos.Y
    else
      fHoldScrollData.StartCursor.Y := fHoldScrollData.StartCursor.Y + (VDiff * 3 div 4);

    Img.BeginUpdate;
    Scroll(HDiff, VDiff); // Distances used by this procedure are in physics pixels, not screen pixels
    Img.EndUpdate;
  end;

Terminating hold-to-scroll
Code: [Select]
  ...else if fHoldScrollData.Active then
  begin
    if GameParams.Hotkeys.CheckForKey(lka_Scroll) then
      HandleHeldScroll
    else
      fHoldScrollData.Active := false;
  end else...
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)

Offline namida

  • Administrator
  • Posts: 12436
    • View Profile
    • NeoLemmix Website
Re: [sugg] scroll with button instead of edge of screen
« Reply #5 on: May 15, 2017, 04:16:54 PM »
mobius: Have you tried this feature out in the experimental yet? How are you finding it? (If you don't like it being on a keyboard key, it can be remapped to the middle or right mouse button in the hotkey configuration menu.)
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)

Offline mobius

  • Posts: 2761
  • relax.
    • View Profile
Re: [sugg] scroll with button instead of edge of screen
« Reply #6 on: May 18, 2017, 01:20:53 AM »
I pretty much agree with Simon's comments. The edge scrolling speed is perfect imo

this exp version appears to have a glitch which I haven't seen before: when you pause and backtrack; the climber skill always gets selected. (no matter which skill is currently selected)

Also, during replays the skills selected don't seem mirror what's actually being selected. Though I seem to recall this particular thing being debated or changed recently.
« Last Edit: May 18, 2017, 01:29:35 AM by möbius »
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


Offline namida

  • Administrator
  • Posts: 12436
    • View Profile
    • NeoLemmix Website
Re: [sugg] scroll with button instead of edge of screen
« Reply #7 on: May 18, 2017, 02:49:34 AM »
Quote
this exp version appears to have a glitch which I haven't seen before: when you pause and backtrack; the climber skill always gets selected. (no matter which skill is currently selected)

Didn't see this myself, but will look into it. I am aware of one bug in this experimental, where increasing / decreasing the release rate happens way too fast.

Quote
Also, during replays the skills selected don't seem mirror what's actually being selected. Though I seem to recall this particular thing being debated or changed recently.

This has been the case for a very long time now. At first it came in the form of an option to disable this functionality, but most people seemed to prefer disabling it. So nowdays, NeoLemmix doesn't even keep track of what skill was selected when.
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)

Offline namida

  • Administrator
  • Posts: 12436
    • View Profile
    • NeoLemmix Website
Re: [sugg] scroll with button instead of edge of screen
« Reply #8 on: June 13, 2017, 01:09:18 PM »
Quote
this exp version appears to have a glitch which I haven't seen before: when you pause and backtrack; the climber skill always gets selected. (no matter which skill is currently selected)

Didn't see this myself, but will look into it. I am aware of one bug in this experimental, where increasing / decreasing the release rate happens way too fast.

Forgot to mention it here, but this is long since fixed now.

Anyway, since there hasn't been further feedback on this, I'm closing this topic. Feel free to make a new one if you have any bug reports or further suggestions relating to this feature.
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)