% % Modeless Waypoint Moving % % This allows you to move the waypoint of a ship in the ship screen % without explicitly entering scanner-move mode or such. Arrows move % by 10 ly, Ctrl-Arrows move by 100 ly (or prefix argument); Ctrl-Enter % locks onto next planet. % % The script integration of PCC is not yet perfect, as you can see with % this script: when you are locked at a ship in the starchart and hit % Shift-Arrow, it'll move 10 ly (because our routine is called and can % not tell apart Shift-Arrow from just Arrow). In older PCC versions % (below 1.0.19) it is even worse. PCC II will be better. I promise :-) % % + 18/Apr/2002 first version % + 01/Oct/2002 now works (sort-of) in the starchart % Sub WpMoveX (dx, scale) If UI.Prefix Then scale := UI.Prefix If UI.Screen=4 Then Chart.X := Chart.X + dx*scale Else SetWaypoint Waypoint.X + dx*scale, Waypoint.Y EndIf EndSub Sub WpMoveY (dy, scale) If UI.Prefix Then scale := UI.Prefix If UI.Screen=4 Then Chart.Y := Chart.Y + dy*scale Else SetWaypoint Waypoint.X, Waypoint.Y + dy*scale EndIf EndSub Sub WpMoveLockPlanet Local wx := Waypoint.X, wy := Waypoint.y Local dist, now ForEach Planet Do now := Distance(Loc.X, Loc.Y, Waypoint.X, Waypoint.Y) If IsEmpty(dist) Or (now < dist) Then wx := Loc.x; wy := Loc.y dist := now EndIf Next SetWaypoint wx, wy EndSub Bind ShipScreen 'up' := 'WpMoveY 1, 10', 'c-up' := 'WpMoveY 1, 100' Bind ShipScreen 'down' := 'WpMoveY -1, 10', 'c-down' := 'WpMoveY -1, 100' Bind ShipScreen 'left' := 'WpMoveX -1, 10', 'c-left' := 'WpMoveX -1, 100' Bind ShipScreen 'right' := 'WpMoveX 1, 10', 'c-right' := 'WpMoveX 1, 100' Bind ShipScreen 'c-enter' := 'WpMoveLockPlanet'