using System; using System.Numerics; using ImGuiNET; namespace RynthCore.Plugin.RynthAi.LegacyUi; internal sealed class LegacyAdvancedSettingsUi { private readonly LegacyUiSettings _settings; private MissileCraftingManager? _missileCraftingManager; // Scratch buffer for the "never attack" name entry box. private string _newBlacklistName = ""; private static readonly string[] AttackHeights = { "Low", "Medium", "High" }; private static readonly string[] LootOwnershipModes = { "My Kills Only", "Fellowship Kills", "All Corpses" }; private static readonly string[] MovementModes = { "Legacy (Autorun)", "Tier 1 (CM_Movement)", "Tier 2 (MoveToPosition)" }; public LegacyAdvancedSettingsUi(LegacyUiSettings settings) { _settings = settings; } public void SetMissileCraftingManager(MissileCraftingManager mgr) => _missileCraftingManager = mgr; private Func? _autoVendorStatus; public void SetAutoVendorStatusProvider(Func status) => _autoVendorStatus = status; public string MissileCraftingState => _missileCraftingManager?.State.ToString() ?? string.Empty; public bool MissileCraftingActive => _missileCraftingManager?.IsCrafting ?? false; public string MissileCraftingStatus => _missileCraftingManager?.StatusMessage ?? string.Empty; public void Render() { if (!_settings.ShowAdvancedWindow) return; ImGui.SetNextWindowSize(new Vector2(600, 400), ImGuiCond.FirstUseEver); if (ImGui.Begin("RynthAi Advanced Settings", ref _settings.ShowAdvancedWindow)) { ImGui.BeginChild("AdvancedSidebar", new Vector2(150, 0), ImGuiChildFlags.Borders); for (int i = 0; i < _settings.AdvancedTabs.Length; i++) { if (ImGui.Selectable(_settings.AdvancedTabs[i], _settings.SelectedAdvancedTab == i)) _settings.SelectedAdvancedTab = i; } ImGui.EndChild(); ImGui.SameLine(); ImGui.BeginGroup(); ImGui.BeginChild("AdvancedContent", new Vector2(0, -ImGui.GetFrameHeightWithSpacing()), ImGuiChildFlags.Borders); RenderTabContent(_settings.SelectedAdvancedTab); ImGui.EndChild(); if (ImGui.Button("Close")) _settings.ShowAdvancedWindow = false; ImGui.EndGroup(); } ImGui.End(); } private void RenderVendoring() { ImGui.Text("AutoVendor (UtilityBelt)"); ImGui.Separator(); ImGui.Spacing(); string status = _autoVendorStatus?.Invoke() ?? "Not logged in"; ImGui.TextDisabled($"Status: {status}"); ImGui.Spacing(); ImGui.Checkbox("Enabled##AV", ref _settings.AutoVendorEnabled); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Buy and sell by a loot profile when a vendor opens (and allow /ub autovendor).\n" + "Profiles: .utl or default.utl in your character's AutoVendor\n" + "folder, the server folder, or " + Vendor.AutoVendorManager.MainProfileDir + "."); ImGui.Checkbox("Test Mode (only print what it would do)##AV", ref _settings.AutoVendorTestMode); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Lists what would be bought and sold without trading. Leave this on until\n" + "the list looks right: selling can't be undone."); ImGui.Checkbox("Buy##AV", ref _settings.AutoVendorEnableBuying); ImGui.SameLine(); ImGui.Checkbox("Sell##AV", ref _settings.AutoVendorEnableSelling); ImGui.Checkbox("Only Sell From Main Pack##AV", ref _settings.AutoVendorOnlyFromMainPack); ImGui.Checkbox("Show Merchant Info##AV", ref _settings.AutoVendorShowMerchantInfo); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Print the vendor's buy/sell rates and max value when it opens."); ImGui.Checkbox("Think When Finished##AV", ref _settings.AutoVendorThink); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Send 'AutoVendor finished: ' (and failures) as a /tell to yourself,\n" + "so a meta's chat condition can wait for it."); ImGui.Spacing(); ImGui.Text("/ub vendor open"); ImGui.SetNextItemWidth(120); if (ImGui.InputInt("Tries##AV", ref _settings.AutoVendorTries)) _settings.AutoVendorTries = Math.Clamp(_settings.AutoVendorTries, 1, 20); ImGui.SetNextItemWidth(120); if (ImGui.InputInt("Time Between Tries (ms)##AV", ref _settings.AutoVendorTriesTime, 250)) _settings.AutoVendorTriesTime = Math.Clamp(_settings.AutoVendorTriesTime, 500, 30000); ImGui.Spacing(); ImGui.TextDisabled("Never sold: equipped, attuned, bonded, retained, tinkered, imbued,"); ImGui.TextDisabled("inscribed, rare, zero value, packs, or anything a Keep rule could match."); } private void RenderTabContent(int tabIndex) { if (tabIndex < 0 || tabIndex >= _settings.AdvancedTabs.Length) return; string tabName = _settings.AdvancedTabs[tabIndex]; ImGui.TextColored(new Vector4(0.4f, 0.7f, 1.0f, 1.0f), $"Advanced Settings > {tabName}"); ImGui.Separator(); ImGui.Spacing(); switch (tabName) { case "Display": ImGui.Checkbox("Show Target Stamina / Mana", ref _settings.ShowTargetStaminaMana); if (ImGui.IsItemHovered()) ImGui.SetTooltip("When enabled, displays stamina and mana bars\nfor the selected target (requires appraisal data)."); break; case "UI": ImGui.Text("Radar"); ImGui.Separator(); ImGui.Checkbox("Get Rid of Retail Radar", ref _settings.SuppressRetailRadar); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Suppress the game's built-in radar (bezel, compass, coords, blips)."); ImGui.Checkbox("Show RynthRadar", ref _settings.ShowRynthRadar); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Render the custom square radar widget (indoor walls + dot markers, works outdoors)."); ImGui.Checkbox("Radar Click-Through", ref _settings.RadarClickThrough); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Mouse events over the radar pass through to the game instead of the widget."); ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Chat"); ImGui.Checkbox("Show RynthChat", ref _settings.ShowRynthChat); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Render the custom chat viewer (scrollback + channel coloring)."); ImGui.Checkbox("Chat Click-Through", ref _settings.ChatClickThrough); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Mouse events over the chat pass through to the game. The gear button stays clickable."); ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Power Bar"); ImGui.Checkbox("Get Rid of Retail Power Bar", ref _settings.SuppressRetailPowerbar); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Hide the vanilla attack/magic power bar that appears under the cursor while charging.\nThe bar's underlying combat state still works — only the on-screen widget is hidden."); break; case "Misc": if (ImGui.Checkbox("Enable FPS Limit", ref _settings.EnableFPSLimit)) { } if (_settings.EnableFPSLimit) { ImGui.Indent(); ImGui.SetNextItemWidth(150); ImGui.SliderInt("Focused FPS", ref _settings.TargetFPSFocused, 10, 240); ImGui.SetNextItemWidth(150); ImGui.SliderInt("Background FPS", ref _settings.TargetFPSBackground, 5, 60); ImGui.Unindent(); } ImGui.Separator(); ImGui.Spacing(); ImGui.Checkbox("Auto Cram", ref _settings.EnableAutocram); if (ImGui.IsItemHovered()) { ImGui.SetTooltip("Automatically moves items from your main pack into side packs.\nNote: recently used weapons stay in the main pack."); } ImGui.Spacing(); ImGui.Checkbox("Peace Mode When Idle", ref _settings.PeaceModeWhenIdle); ImGui.Checkbox("Start Macro On Login", ref _settings.StartMacroOnLogin); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Automatically starts the macro when RynthAi loads."); ImGui.Checkbox("Patrol On Login", ref _settings.PatrolOnLogin); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Automatically starts dungeon patrol when RynthAi loads."); ImGui.Checkbox("Enable Raycasting", ref _settings.EnableRaycasting); ImGui.Separator(); ImGui.Spacing(); ImGui.Text("Missile Arc Velocities (m/s)"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Per-weapon launch speed used for line-of-sight arc checks.\n" + "Lower velocity = higher arc. Tune until LoS matches in-game hits\n" + "(/ra lostest bow on a selected mob shows the arc and where it hits).\n" + "Indoors the arc is checked against ceilings too."); ImGui.Checkbox("Use Arcs for Missile LoS", ref _settings.UseArcs); if (ImGui.IsItemHovered()) ImGui.SetTooltip("On: a missile target must pass the straight line AND the arc the\n" + "missile flies (checked against ceilings in dungeons).\n" + "Off: all missile LoS checks are a straight line (eye-to-eye)."); if (_settings.UseArcs) { ImGui.Indent(); ImGui.SetNextItemWidth(150); ImGui.SliderFloat("Bow", ref _settings.BowArcVelocity, 10.0f, 60.0f, "%.1f"); ImGui.SetNextItemWidth(150); ImGui.SliderFloat("Crossbow", ref _settings.CrossbowArcVelocity, 10.0f, 80.0f, "%.1f"); ImGui.SetNextItemWidth(150); ImGui.SliderFloat("Atlatl", ref _settings.AtlatlArcVelocity, 10.0f, 60.0f, "%.1f"); ImGui.SetNextItemWidth(150); ImGui.SliderFloat("Magic Arc", ref _settings.MagicArcVelocity, 10.0f, 60.0f, "%.1f"); ImGui.SetNextItemWidth(150); ImGui.SliderFloat("Arc Clearance (m)", ref _settings.MissileArcClearance, 0.0f, 3.0f, "%.1f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Extra headroom the arc must have at mid-flight. Raise it if shots\n" + "still hit ceilings; lower it if mobs the arrows can reach are skipped.\n" + "Default 0.5."); ImGui.Unindent(); } ImGui.Checkbox("LoS Debug Log", ref _settings.LosDebugLog); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Log each in-range mob's LoS verdict ([LOS] lines: straight line or arc,\n" + "how high the arc rises, where it hits, distance and cells). For tuning."); ImGui.Separator(); ImGui.Spacing(); ImGui.Text("Monster Blacklist"); ImGui.SetNextItemWidth(150); ImGui.SliderInt("Casts Before Blacklist", ref _settings.BlacklistAttempts, 1, 20); if (ImGui.IsItemHovered()) ImGui.SetTooltip("How many offensive casts that deal NO damage (each judged after the settle window) before a mob is blacklisted."); ImGui.SetNextItemWidth(150); ImGui.SliderInt("Blacklist Timeout (sec)", ref _settings.BlacklistTimeoutSec, 5, 120); if (ImGui.IsItemHovered()) ImGui.SetTooltip("How long a blacklisted mob is ignored before re-trying."); ImGui.SetNextItemWidth(150); ImGui.SliderInt("Cast Settle (ms)", ref _settings.BlacklistCastSettleMs, 250, 15000); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Grace after a cast before it counts as a no-damage miss — lets the damage/health packet arrive so good targets aren't blacklisted prematurely."); ImGui.SetNextItemWidth(150); ImGui.SliderInt("No Progress Timeout (sec)", ref _settings.TargetNoProgressTimeoutSec, 0, 300); if (ImGui.IsItemHovered()) ImGui.SetTooltip( "Blacklist a target after being engaged this many seconds without dealing damage.\n" + "0 = disabled. Default 60s. Useful for targets stuck in geometry or unreachable."); ImGui.Spacing(); ImGui.Text("Never Attack (by name)"); ImGui.SetNextItemWidth(220); bool addByEnter = ImGui.InputTextWithHint("##blacklistName", "Monster name (e.g. Drudge)", ref _newBlacklistName, 64, ImGuiInputTextFlags.EnterReturnsTrue); if (ImGui.IsItemHovered()) ImGui.SetTooltip( "Monsters whose name CONTAINS this text (case-insensitive) are never\n" + "targeted, faced, or attacked. This manual do-not-attack list is\n" + "separate from the automatic no-damage blacklist above."); ImGui.SameLine(); if ((ImGui.Button("Add##blacklist") || addByEnter) && !string.IsNullOrWhiteSpace(_newBlacklistName)) { string entry = _newBlacklistName.Trim(); bool exists = false; for (int i = 0; i < _settings.MonsterNameBlacklist.Count; i++) if (string.Equals(_settings.MonsterNameBlacklist[i], entry, StringComparison.OrdinalIgnoreCase)) { exists = true; break; } if (!exists) _settings.MonsterNameBlacklist.Add(entry); _newBlacklistName = ""; } if (_settings.MonsterNameBlacklist.Count == 0) { ImGui.TextDisabled("(empty — any monster may be attacked)"); } else { int removeIdx = -1; for (int i = 0; i < _settings.MonsterNameBlacklist.Count; i++) { ImGui.PushID(i); if (ImGui.SmallButton("X")) removeIdx = i; ImGui.SameLine(); ImGui.TextUnformatted(_settings.MonsterNameBlacklist[i]); ImGui.PopID(); } if (removeIdx >= 0) _settings.MonsterNameBlacklist.RemoveAt(removeIdx); } ImGui.Separator(); ImGui.Spacing(); ImGui.Text("Give Queue"); ImGui.SetNextItemWidth(150); ImGui.SliderInt("Give Interval (ms)", ref _settings.GiveQueueIntervalMs, 50, 2000); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Minimum delay between each item sent by /ra givea commands.\nLower = faster but may drop items if the server can't keep up."); break; case "Recharge": ImGui.Text("Self Vitals (%)"); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Heal At", ref _settings.HealAt, 0, 100); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Re-stam At", ref _settings.RestamAt, 0, 100); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Get Mana At", ref _settings.GetManaAt, 0, 100); ImGui.Spacing(); ImGui.Text("Top-Off Vitals (%)"); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Top HP", ref _settings.TopOffHP, 0, 100); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Top Stam", ref _settings.TopOffStam, 0, 100); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Top Mana", ref _settings.TopOffMana, 0, 100); ImGui.Spacing(); ImGui.Text("Helper Settings (%)"); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Heal Others", ref _settings.HealOthersAt, 0, 100); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Re-stam Others", ref _settings.RestamOthersAt, 0, 100); ImGui.SetNextItemWidth(120); ImGui.SliderInt("Infuse Others", ref _settings.InfuseOthersAt, 0, 100); break; case "Melee Combat": ImGui.Text("Attack Power & Height"); ImGui.Separator(); ImGui.Checkbox("Use Recklessness", ref _settings.UseRecklessness); if (ImGui.IsItemHovered()) ImGui.SetTooltip("When enabled and Recklessness is trained, auto power uses 80% instead of 100%."); ImGui.Spacing(); bool meleeAuto = _settings.MeleeAttackPower < 0; if (ImGui.Checkbox("Melee Auto Power", ref meleeAuto)) _settings.MeleeAttackPower = meleeAuto ? -1 : 100; ImGui.Indent(); ImGui.SetNextItemWidth(150); if (meleeAuto) { int displayVal = 100; ImGui.BeginDisabled(); ImGui.SliderInt("Melee Power %", ref displayVal, 0, 100); ImGui.EndDisabled(); } else { ImGui.SliderInt("Melee Power %", ref _settings.MeleeAttackPower, 0, 100); } ImGui.Unindent(); ImGui.SetNextItemWidth(120); ImGui.Combo("Melee Attack Height", ref _settings.MeleeAttackHeight, AttackHeights, AttackHeights.Length); ImGui.Spacing(); bool missileAuto = _settings.MissileAttackPower < 0; if (ImGui.Checkbox("Missile Auto Power", ref missileAuto)) _settings.MissileAttackPower = missileAuto ? -1 : 100; ImGui.Indent(); ImGui.SetNextItemWidth(150); if (missileAuto) { int displayVal = 100; ImGui.BeginDisabled(); ImGui.SliderInt("Missile Power %", ref displayVal, 0, 100); ImGui.EndDisabled(); } else { ImGui.SliderInt("Missile Power %", ref _settings.MissileAttackPower, 0, 100); } ImGui.Unindent(); ImGui.SetNextItemWidth(120); ImGui.Combo("Missile Attack Height", ref _settings.MissileAttackHeight, AttackHeights, AttackHeights.Length); ImGui.Separator(); ImGui.Spacing(); ImGui.Checkbox("Use Native Attack", ref _settings.UseNativeAttack); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Uses the client's combat pipeline for attacks.\nThe client handles turn-to-face naturally (no backwards arrows)."); ImGui.Spacing(); ImGui.Checkbox("Summon Pets", ref _settings.SummonPets); ImGui.SetNextItemWidth(120); ImGui.InputInt("Pet Min Monsters", ref _settings.PetMinMonsters); break; case "Spell Combat": ImGui.Text("War/Void Casting Settings"); ImGui.Separator(); ImGui.SetNextItemWidth(180); ImGui.SliderInt("Spell Interval (ms)", ref _settings.SpellCastIntervalMs, 100, 1500); if (ImGui.IsItemHovered()) ImGui.SetTooltip( "Delay between BUFF / utility spell casts (not combat).\n" + "Lower = faster buff chains. 400ms is a good balance.\n" + "Below 200ms may cause fizzles or dropped casts on laggy servers."); ImGui.SetNextItemWidth(180); ImGui.SliderInt("Attack Spell Delay (ms)", ref _settings.AttackSpellIntervalMs, 250, 5000); if (ImGui.IsItemHovered()) ImGui.SetTooltip( "Delay between offensive (war/void) COMBAT casts only.\n" + "Spacing casts ~1-2s (1500ms default) stops back-to-back\n" + "\"You're too busy!\" refusals that drop casts and cost kills.\n" + "Does NOT affect buffing speed."); ImGui.Spacing(); ImGui.Checkbox("Cast Dispel Self", ref _settings.CastDispelSelf); ImGui.Spacing(); ImGui.Text("Ring Spell Override"); ImGui.SetNextItemWidth(120); ImGui.InputInt("Min Ring Targets", ref _settings.MinRingTargets); if (ImGui.IsItemHovered()) ImGui.SetTooltip("If this many monsters are within ring range, ring spells are used instead of arc/bolt/streak."); ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Spell Difficulty (Min Buffed Skill)"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Minimum buffed skill level required to cast each spell tier.\nRaise these above AC's hard minimums (1/50/100/150/200/250/300/350) to avoid fizzles."); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 1", ref _settings.MinSkillLevelTier1); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 2", ref _settings.MinSkillLevelTier2); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 3", ref _settings.MinSkillLevelTier3); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 4", ref _settings.MinSkillLevelTier4); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 5", ref _settings.MinSkillLevelTier5); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 6", ref _settings.MinSkillLevelTier6); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 7", ref _settings.MinSkillLevelTier7); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 8", ref _settings.MinSkillLevelTier8); break; case "Ranges": ImGui.Text("Standard Ranges (Yards)"); ImGui.SetNextItemWidth(120); ImGui.InputInt("Monster Range", ref _settings.MonsterRange); ImGui.SetNextItemWidth(120); ImGui.InputInt("Disengage Range", ref _settings.MonsterDisengageRange); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Drop a locked target only past this distance (hysteresis).\n0 or <= Monster Range = auto (Monster Range + 3)."); ImGui.SetNextItemWidth(120); ImGui.InputInt("Ring Range", ref _settings.RingRange); ImGui.SetNextItemWidth(120); ImGui.InputInt("Approach Range", ref _settings.ApproachRange); ImGui.Spacing(); ImGui.Text("Corpse Acquisition (Yards)"); ImGui.Separator(); ImGui.SetNextItemWidth(180); ImGui.InputDouble("Corpse Max (yd)", ref _settings.CorpseApproachRangeMax, 0.5, 1.0, "%.1f"); ImGui.SetNextItemWidth(180); ImGui.InputDouble("Corpse Min (yd)", ref _settings.CorpseApproachRangeMin, 0.5, 1.0, "%.1f"); break; case "Navigation": ImGui.Checkbox("Boost Nav Priority", ref _settings.BoostNavPriority); ImGui.SetNextItemWidth(120); ImGui.InputFloat("Follow/Nav Min", ref _settings.FollowNavMin, 0.1f, 1.0f, "%.1f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Arrival distance in yards. Also sets the nav marker ring radius."); ImGui.Spacing(); ImGui.Text("Nav Marker Display"); ImGui.SetNextItemWidth(120); ImGui.SliderFloat("Ring Thickness", ref _settings.NavRingThickness, 1.0f, 16.0f, "%.0f"); ImGui.SetNextItemWidth(120); ImGui.SliderFloat("Line Thickness", ref _settings.NavLineThickness, 1.0f, 16.0f, "%.0f"); ImGui.SetNextItemWidth(120); ImGui.SliderFloat("Height Offset", ref _settings.NavHeightOffset, -5.0f, 5.0f, "%.2f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Vertical offset for nav markers above the ground. Negative = lower."); ImGui.SetNextItemWidth(120); ImGui.SliderFloat("Slope Sink", ref _settings.NavSlopeSink, 0.0f, 8.0f, "%.2f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Extra downward offset on slopes only. 0 = off; flat ground unaffected."); ImGui.Checkbox("Show Terrain Passability", ref _settings.ShowTerrainPassability); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Highlight impassable terrain triangles in red."); ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Doors"); ImGui.Checkbox("Open Doors While Navigating", ref _settings.OpenDoors); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Automatically open doors encountered during navigation."); if (_settings.OpenDoors) { ImGui.SetNextItemWidth(180); ImGui.SliderFloat("Door Detection Range (yd)", ref _settings.OpenDoorRange, 0.1f, 70.0f, "%.1f"); ImGui.Checkbox("Auto-Unlock Doors", ref _settings.AutoUnlockDoors); if (ImGui.IsItemHovered()) ImGui.SetTooltip("If a door is locked, try to use a lockpick from your Consumable Items list."); } ImGui.Spacing(); ImGui.Text("Movement Engine"); ImGui.SetNextItemWidth(200); ImGui.Combo("Mode", ref _settings.MovementMode, MovementModes, MovementModes.Length); if (ImGui.IsItemHovered()) { ImGui.SetTooltip( "Legacy: SetAutorun + smooth heading servo (TurnToHeading)\n" + "Tier 1: SetAutorun + CM_Movement turn commands (DoMovement)\n" + "Tier 2: Client physics MoveToPosition (not built yet — falls back to Legacy)"); } ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Steering"); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Stop & Turn Angle", ref _settings.NavStopTurnAngle, 1f, 5f, "%.0f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Stop forward motion and turn in place when heading error exceeds this."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Resume Run Angle", ref _settings.NavResumeTurnAngle, 1f, 5f, "%.0f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Resume running once the turn-in-place error drops below this."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Dead Zone", ref _settings.NavDeadZone, 0.5f, 1f, "%.1f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Ignore heading corrections smaller than this."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Sweep Detect Mult", ref _settings.NavSweepMult, 0.5f, 1f, "%.1f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Closest-approach detection radius multiplier."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Lookahead (yd)", ref _settings.NavLookaheadYards, 0.5f, 1f, "%.1f"); if (_settings.NavLookaheadYards < 0f) _settings.NavLookaheadYards = 0f; if (ImGui.IsItemHovered()) ImGui.SetTooltip("Within this distance of a waypoint, blend the aim point toward the next one to cut corners smoothly. 0 = off (aim straight at each waypoint)."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Shortcut Tolerance (yd)", ref _settings.NavShortcutYards, 0.5f, 1f, "%.1f"); _settings.NavShortcutYards = Math.Clamp(_settings.NavShortcutYards, 0f, 10f); if (ImGui.IsItemHovered()) ImGui.SetTooltip("On reaching a waypoint, skip ahead only while the straight line to a later waypoint passes within this distance of every waypoint skipped. Lower keeps closer to the route; 0 = visit every waypoint."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Turn Rate (deg/s)", ref _settings.NavTurnRateDegPerSec, 15f, 45f, "%.0f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Mode 0 (heading servo) max turn speed. Higher = snappier turns, lower = gentler. Ignored by Tier 1 / Tier 2."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Tier1 Turn Speed", ref _settings.NavTier1TurnSpeed, 0.1f, 0.5f, "%.2f"); if (ImGui.IsItemHovered()) ImGui.SetTooltip("Tier 1 (CM_Movement) DoMovement turn-command speed. Only used when Movement Engine = Tier 1."); ImGui.SetNextItemWidth(80); ImGui.InputFloat("Post-Portal Delay (s)", ref _settings.PostPortalDelaySec, 0.25f, 1f, "%.2f"); if (_settings.PostPortalDelaySec < 0f) _settings.PostPortalDelaySec = 0f; if (ImGui.IsItemHovered()) ImGui.SetTooltip("Seconds to settle after any portal/recall teleport before nav resumes."); if (_settings.MovementMode == 2) { ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Tier 2 Tuning"); ImGui.SetNextItemWidth(100); ImGui.InputFloat("Speed##t2", ref _settings.T2Speed, 0.1f, 0.5f, "%.1f"); ImGui.SetNextItemWidth(100); ImGui.InputFloat("Walk Within (yd)", ref _settings.T2WalkWithinYd, 1f, 5f, "%.0f"); ImGui.SetNextItemWidth(100); ImGui.InputFloat("Stop Distance (yd)", ref _settings.T2DistanceTo, 0.1f, 0.5f, "%.1f"); ImGui.SetNextItemWidth(100); ImGui.InputFloat("Reissue Timeout (ms)", ref _settings.T2ReissueMs, 100f, 500f, "%.0f"); ImGui.SetNextItemWidth(100); ImGui.InputFloat("Max Range (yd)", ref _settings.T2MaxRangeYd, 50f, 100f, "%.0f"); ImGui.SetNextItemWidth(100); ImGui.InputInt("Max Landblock Dist", ref _settings.T2MaxLandblocks, 1); } break; case "Buffing": ImGui.Checkbox("Enable Buffing", ref _settings.EnableBuffing); ImGui.Checkbox("Rebuff When Idle", ref _settings.RebuffWhenIdle); ImGui.Spacing(); ImGui.SetNextItemWidth(180); ImGui.SliderInt("Rebuff With (seconds left)", ref _settings.RebuffSecondsRemaining, 30, 1800); if (ImGui.IsItemHovered()) ImGui.SetTooltip( "Recast a self buff when its remaining duration drops below this value.\n" + "Default 300 (5 minutes). Lower values rebuff more eagerly; very low\n" + "values (<60s) risk a gap between the old buff dropping and the new one\n" + "landing."); ImGui.SetNextItemWidth(180); ImGui.SliderInt("Also Refresh Under (seconds left)", ref _settings.RebuffTopOffSecondsRemaining, 30, 3600); if (ImGui.IsItemHovered()) ImGui.SetTooltip( "When a buff is due, also recast every other buff with less than this\n" + "much time left, so they land together. Buffs with more time are left\n" + "alone. Default 1200 (20 minutes). At or below 'Rebuff With', only the\n" + "expiring buff is recast."); ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Buff Difficulty (Min Buffed Skill)"); if (ImGui.IsItemHovered()) ImGui.SetTooltip( "Minimum buffed skill level required to cast each self-buff tier.\n" + "Separate from Spell Combat thresholds so you can tune buffing\n" + "more aggressively — buff fizzles just retry on the next heartbeat.\n" + "AC's hard minimums are 1/50/100/150/200/250/300/350."); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 1##Buff", ref _settings.BuffMinSkillLevelTier1); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 2##Buff", ref _settings.BuffMinSkillLevelTier2); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 3##Buff", ref _settings.BuffMinSkillLevelTier3); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 4##Buff", ref _settings.BuffMinSkillLevelTier4); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 5##Buff", ref _settings.BuffMinSkillLevelTier5); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 6##Buff", ref _settings.BuffMinSkillLevelTier6); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 7##Buff", ref _settings.BuffMinSkillLevelTier7); ImGui.SetNextItemWidth(120); ImGui.InputInt("Level 8##Buff", ref _settings.BuffMinSkillLevelTier8); break; case "Looting": ImGui.Checkbox("Enable Looting", ref _settings.EnableLooting); ImGui.Checkbox("Boost Loot Priority", ref _settings.BoostLootPriority); ImGui.Checkbox("Loot Only Rare Corpses", ref _settings.LootOnlyRareCorpses); ImGui.Checkbox("Jump When Looting", ref _settings.LootJumpEnabled); if (_settings.LootJumpEnabled) { ImGui.SetNextItemWidth(120); ImGui.SliderInt("Jump Height", ref _settings.LootJumpHeight, 1, 100); } ImGui.Spacing(); ImGui.Text("Corpse Ownership"); ImGui.SetNextItemWidth(180); ImGui.Combo("Loot From", ref _settings.LootOwnership, LootOwnershipModes, LootOwnershipModes.Length); ImGui.Spacing(); ImGui.Text("Inventory Management"); ImGui.Checkbox("Enable Autostack", ref _settings.EnableAutostack); ImGui.Checkbox("Enable Autocram", ref _settings.EnableAutocram); ImGui.Checkbox("Combine Salvage Bags", ref _settings.EnableCombineSalvage); if (ImGui.IsItemHovered()) ImGui.SetTooltip("After the salvage queue empties, move same-name bags together so the server merges them."); ImGui.Checkbox("Combine Bags During Salvage", ref _settings.CombineBagsDuringSalvage); if (ImGui.IsItemHovered()) ImGui.SetTooltip("When salvaging an item, also add any under-full salvage bag of the same material to the salvage panel — the salvage operation merges them into a single bag."); ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Loot Timers (ms)"); ImGui.SetNextItemWidth(120); ImGui.InputInt("Inter-Item Delay", ref _settings.LootInterItemDelayMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Content Settle", ref _settings.LootContentSettleMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Empty Corpse Wait", ref _settings.LootEmptyCorpseMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Closing Delay", ref _settings.LootClosingDelayMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Assess Window", ref _settings.LootAssessWindowMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Loot Retry Timeout", ref _settings.LootRetryTimeoutMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Corpse Open Retry", ref _settings.LootOpenRetryMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Corpse Timeout", ref _settings.LootCorpseTimeoutMs); ImGui.Spacing(); ImGui.Separator(); ImGui.Text("Salvage Timers (ms) - First / Fast"); ImGui.SetNextItemWidth(120); ImGui.InputInt("Open (First)", ref _settings.SalvageOpenDelayFirstMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Open (Fast)", ref _settings.SalvageOpenDelayFastMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Add Item (First)", ref _settings.SalvageAddDelayFirstMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Add Item (Fast)", ref _settings.SalvageAddDelayFastMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Salvage Click", ref _settings.SalvageSalvageDelayMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Result (First)", ref _settings.SalvageResultDelayFirstMs); ImGui.SetNextItemWidth(120); ImGui.InputInt("Result (Fast)", ref _settings.SalvageResultDelayFastMs); break; case "Crafting": ImGui.Text("Missile Ammo Crafting"); ImGui.Separator(); ImGui.Spacing(); ImGui.Checkbox("Enable Missile Crafting", ref _settings.EnableMissileCrafting); if (ImGui.IsItemHovered()) { ImGui.SetTooltip("Auto-manage missile ammo when the ammo slot is empty or low."); } if (!_settings.EnableMissileCrafting) { ImGui.TextDisabled("(Disabled)"); break; } ImGui.Spacing(); if (_missileCraftingManager != null) { string stateLabel = _missileCraftingManager.State.ToString(); Vector4 stateColor = _missileCraftingManager.IsCrafting ? new Vector4(0.9f, 0.7f, 0.2f, 1.0f) : new Vector4(0.5f, 0.5f, 0.5f, 1.0f); ImGui.Text("State:"); ImGui.SameLine(); ImGui.TextColored(stateColor, stateLabel); if (!string.IsNullOrEmpty(_missileCraftingManager.StatusMessage)) ImGui.TextWrapped(_missileCraftingManager.StatusMessage); } break; case "Vendoring": RenderVendoring(); break; default: ImGui.Text($"Settings for {tabName} are currently under development."); break; } } }