diff --git a/src/AcDream.Plugins.MossTank/MossTankPanel.cs b/src/AcDream.Plugins.MossTank/MossTankPanel.cs index 17419490e..42e22e134 100644 --- a/src/AcDream.Plugins.MossTank/MossTankPanel.cs +++ b/src/AcDream.Plugins.MossTank/MossTankPanel.cs @@ -203,7 +203,7 @@ internal sealed partial class MossTankPanel private string _routeChatDraft = "/ls"; private int _routePauseSeconds = 5; private RouteRecallKind _routeRecallKind = RouteRecallKind.PrimaryPortal; - private bool _routeAddToEnd = true; + private RouteInsertMode _routeInsertMode = RouteInsertMode.AddToEnd; private IReadOnlyList _metaRows = Array.Empty(); private int _selectedMetaRule; private string _metaProfileNameDraft = string.Empty; @@ -819,7 +819,16 @@ internal sealed partial class MossTankPanel public string RouteProfileNameDraft => _routeProfileNameDraft; public string RouteNotice => _routeNotice; public string RouteChatDraft => _routeChatDraft; - public string RoutePauseText => $"{_routePauseSeconds} seconds"; + // Fix round B item 8: VTank's own txtPauseWaypointTime is a real + // editable field defaulting to "5" (docs/research/vtank-kb/ + // 08-ui-views.md §1's Route table), not a "-"/"+" stepper. + public string RoutePauseSecondsFieldText => + _routePauseSeconds.ToString(CultureInfo.InvariantCulture); + public Action SetRoutePauseSecondsText => value => + { + if (int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out int seconds)) + _routePauseSeconds = Math.Clamp(seconds, 0, 3600); + }; public string RouteMinimumDistanceText => string.Create( CultureInfo.InvariantCulture, $"Follow/Nav Min Distance: {_navigationSettings.MinimumDistanceMeters:0.0}m"); @@ -827,9 +836,24 @@ internal sealed partial class MossTankPanel _navigationSettings.FollowTargetObjectId == 0u ? "Follow target: [None]" : $"Follow target: {_navigationSettings.FollowTargetName}"; - public string RouteAddPositionText => _routeAddToEnd - ? "Add to End" - : "Insert After Selection"; + // Fix round B item 8: VTank's own cmbNavInsertMode is a 3-option + // (Add to End / Insert Above / Insert Below), not the old + // 2-state toggle button. + public IReadOnlyList RouteInsertModeNames { get; } = + ["Add to End", "Insert Above", "Insert Below"]; + public string SelectedRouteInsertMode => _routeInsertMode switch + { + RouteInsertMode.InsertAbove => "Insert Above", + RouteInsertMode.InsertBelow => "Insert Below", + _ => "Add to End", + }; + public Action SelectRouteInsertMode => value => + _routeInsertMode = value switch + { + "Insert Above" => RouteInsertMode.InsertAbove, + "Insert Below" => RouteInsertMode.InsertBelow, + _ => RouteInsertMode.AddToEnd, + }; public Action ToggleNavigation => () => { @@ -891,12 +915,6 @@ internal sealed partial class MossTankPanel public Action RemoveRouteWaypoint => RemoveRouteWaypointCore; public Action MoveRouteWaypointUp => () => MoveRouteWaypoint(-1); public Action MoveRouteWaypointDown => () => MoveRouteWaypoint(1); - public Action ToggleRouteAddPosition => () => - _routeAddToEnd = !_routeAddToEnd; - public Action RoutePauseDown => () => - _routePauseSeconds = Math.Max(0, _routePauseSeconds - 1); - public Action RoutePauseUp => () => - _routePauseSeconds = Math.Min(3600, _routePauseSeconds + 1); public Action RouteMinimumDistanceDown => () => { _navigationSettings.MinimumDistanceMeters = Math.Max( @@ -2200,11 +2218,13 @@ internal sealed partial class MossTankPanel private void AddRouteWaypoint(RouteWaypoint waypoint) { - int insertion = _routeAddToEnd - ? _navigationSettings.Waypoints.Count - : Math.Min( - _navigationSettings.Waypoints.Count, - _selectedRouteWaypoint + 1); + int count = _navigationSettings.Waypoints.Count; + int insertion = _routeInsertMode switch + { + RouteInsertMode.InsertAbove => Math.Clamp(_selectedRouteWaypoint, 0, count), + RouteInsertMode.InsertBelow => Math.Min(count, _selectedRouteWaypoint + 1), + _ => count, + }; _navigationSettings.Waypoints.Insert(insertion, waypoint); _selectedRouteWaypoint = insertion; _navigation.Reset(); diff --git a/src/AcDream.Plugins.MossTank/Navigation.cs b/src/AcDream.Plugins.MossTank/Navigation.cs index fc3622c57..663619412 100644 --- a/src/AcDream.Plugins.MossTank/Navigation.cs +++ b/src/AcDream.Plugins.MossTank/Navigation.cs @@ -40,6 +40,21 @@ internal enum RouteJumpDirection StrafeRight, } +/// +/// VTank's own cmbNavInsertMode (docs/research/vtank-kb/08-ui-views.md §1 +/// "Tab: Route": "options: Add to End / Insert Above / Insert Below"). +/// Replaces the old two-state _routeAddToEnd bool (fix round B item 8) — +/// InsertAbove/InsertBelow are both relative to the currently selected +/// waypoint, distinguishing "before" from "after" rather than collapsing +/// both non-append cases into one. +/// +internal enum RouteInsertMode +{ + AddToEnd, + InsertAbove, + InsertBelow, +} + internal sealed class RouteWaypoint { public RouteWaypointType Type { get; set; } diff --git a/src/AcDream.Plugins.MossTank/mosstank-advanced.xml b/src/AcDream.Plugins.MossTank/mosstank-advanced.xml index d609ce237..9e0900793 100644 --- a/src/AcDream.Plugins.MossTank/mosstank-advanced.xml +++ b/src/AcDream.Plugins.MossTank/mosstank-advanced.xml @@ -30,8 +30,29 @@ overlapped and read as garbled text on screen once this became a top-level window (live-verified, screenshot before the fix showed "AdvancedOptionsced Options — complete VTank settings table"). ---> -392 + to fit this section without touching the retail editor above it; item 9 + is expected to reshuffle the retail portion further (clVal column, + lFilterList checklist, description readout) without moving this section. + Bold text isn't representable in the plain retail UI font (0x40000000 + has no bold face) — the section header uses the same bright caption + color other headers use instead. --> +