Changeset 619 for trunk


Ignore:
Timestamp:
Sep 15, 2024, 2:22:57 PM (2 months ago)
Author:
chronos
Message:
  • Modified: Map scrolling with mouse on window borders instead of screen borders to support mouse scrolling in windowed mode and on multiple monitors.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r617 r619  
    55535553var
    55545554  dx, dy, ScrollSpeed: Integer;
     5555  MousePos: TPoint;
     5556const
     5557  ScrollWidth = 5;
    55555558begin
    55565559  if Idle and (Me >= 0) and (GameMode <> cMovie) then
     
    55765579        dx := 0;
    55775580        dy := 0;
    5578         if Mouse.CursorPos.Y < Screen.Height - PanelHeight then
    5579           if Mouse.CursorPos.X = 0 then
     5581        MousePos := ScreenToClient(Mouse.CursorPos);
     5582        if MousePos.Y < Height - PanelHeight then
     5583          if MousePos.X <= ScrollWidth then
    55805584            dx := -ScrollSpeed // scroll left
    5581           else if Mouse.CursorPos.X >= Screen.Width - 1 then
     5585          else if MousePos.X >= Width - ScrollWidth - 1 then
    55825586            dx := ScrollSpeed; // scroll right
    5583         if Mouse.CursorPos.Y = 0 then
     5587        if MousePos.Y <= ScrollWidth then
    55845588          dy := -ScrollSpeed // scroll up
    5585         else if (Mouse.CursorPos.Y >= Screen.Height - 1) and
    5586           (Mouse.CursorPos.X >= TerrainBtn.Left + TerrainBtn.Width) and
    5587           (Mouse.CursorPos.X < xRightPanel + 10 - 8) then
     5589        else if (MousePos.Y >= Height - ScrollWidth - 1) and
     5590          (MousePos.X >= TerrainBtn.Left + TerrainBtn.Width) and
     5591          (MousePos.X < xRightPanel + 10 - 8) then
    55885592          dy := ScrollSpeed; // scroll down
    55895593        if (dx <> 0) or (dy <> 0) then
Note: See TracChangeset for help on using the changeset viewer.