New GUI overhaul!, version 3.0.1.0
This commit is contained in:
parent
c05d6c9d1b
commit
79304baaad
16 changed files with 1579 additions and 4589 deletions
|
|
@ -39,7 +39,6 @@ namespace MosswartMassacre
|
|||
if (!string.IsNullOrEmpty(PluginSettings.Instance?.VTankProfilesPath))
|
||||
{
|
||||
vtankProfilesDirectory = PluginSettings.Instance.VTankProfilesPath;
|
||||
PluginCore.WriteToChat($"[NavViz] Using configured VTank profiles path: {vtankProfilesDirectory}");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -54,20 +53,17 @@ namespace MosswartMassacre
|
|||
if (!string.IsNullOrEmpty(profilePath))
|
||||
{
|
||||
vtankProfilesDirectory = profilePath;
|
||||
PluginCore.WriteToChat($"[NavViz] Found VTank profiles from registry: {vtankProfilesDirectory}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception regEx)
|
||||
catch
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] Registry lookup failed: {regEx.Message}");
|
||||
}
|
||||
|
||||
// Fall back to default path
|
||||
vtankProfilesDirectory = defaultPath;
|
||||
PluginCore.WriteToChat($"[NavViz] Using default VTank path: {vtankProfilesDirectory}");
|
||||
PluginCore.WriteToChat($"[NavViz] If this is wrong, configure the correct path in Settings tab.");
|
||||
// Using default path - user can configure in Settings if needed
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -76,6 +72,10 @@ namespace MosswartMassacre
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scan VTank directory for .nav files and populate available routes list
|
||||
/// Filters out follow files and temporary files, sorts alphabetically
|
||||
/// </summary>
|
||||
public void RefreshNavFileList()
|
||||
{
|
||||
// Re-initialize directory in case settings changed
|
||||
|
|
@ -83,43 +83,26 @@ namespace MosswartMassacre
|
|||
|
||||
availableNavFiles.Clear();
|
||||
|
||||
PluginCore.WriteToChat($"[NavViz] Refreshing nav files from: {vtankProfilesDirectory}");
|
||||
|
||||
if (string.IsNullOrEmpty(vtankProfilesDirectory))
|
||||
{
|
||||
PluginCore.WriteToChat("[NavViz] No VTank directory set");
|
||||
PluginCore.WriteToChat("VTank directory not configured. Set path in Settings tab.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Directory.Exists(vtankProfilesDirectory))
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] Directory does not exist: {vtankProfilesDirectory}");
|
||||
PluginCore.WriteToChat($"VTank directory not found: {vtankProfilesDirectory}");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Get ALL files first for debugging
|
||||
// Get all files and filter for .nav files only, excluding follow/temporary files
|
||||
var allFiles = Directory.GetFiles(vtankProfilesDirectory);
|
||||
PluginCore.WriteToChat($"[NavViz] Directory contents ({allFiles.Length} files):");
|
||||
foreach (var file in allFiles.Take(10)) // Show first 10 files
|
||||
{
|
||||
PluginCore.WriteToChat($" - {Path.GetFileName(file)}");
|
||||
}
|
||||
|
||||
// Filter for .nav files ONLY and exclude follow files
|
||||
var navFiles = allFiles
|
||||
.Where(file => {
|
||||
var ext = Path.GetExtension(file);
|
||||
var isNav = ext.Equals(".nav", StringComparison.OrdinalIgnoreCase);
|
||||
PluginCore.WriteToChat($"[NavViz] File: {Path.GetFileName(file)} - Extension: '{ext}' - IsNav: {isNav}");
|
||||
return isNav;
|
||||
})
|
||||
.Select(file => {
|
||||
var name = Path.GetFileNameWithoutExtension(file);
|
||||
PluginCore.WriteToChat($"[NavViz] Nav file name: {name}");
|
||||
return name;
|
||||
})
|
||||
.Where(file => Path.GetExtension(file).Equals(".nav", StringComparison.OrdinalIgnoreCase))
|
||||
.Select(file => Path.GetFileNameWithoutExtension(file))
|
||||
.Where(name => !string.IsNullOrEmpty(name) &&
|
||||
!name.StartsWith("follow", StringComparison.OrdinalIgnoreCase) &&
|
||||
!name.StartsWith("--", StringComparison.OrdinalIgnoreCase))
|
||||
|
|
@ -128,14 +111,24 @@ namespace MosswartMassacre
|
|||
|
||||
availableNavFiles.AddRange(navFiles);
|
||||
|
||||
PluginCore.WriteToChat($"[NavViz] Found {navFiles.Count} .nav files: {string.Join(", ", navFiles)}");
|
||||
// Only report summary - no need to spam chat with every file
|
||||
if (navFiles.Count > 0)
|
||||
{
|
||||
PluginCore.WriteToChat($"Navigation: Found {navFiles.Count} route files");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] Error refreshing nav files: {ex.Message}");
|
||||
PluginCore.WriteToChat($"Navigation: Error scanning files - {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load a specific navigation route file for visualization
|
||||
/// Clears current route if "None" specified, otherwise loads .nav file
|
||||
/// </summary>
|
||||
/// <param name="navFileName">Name of .nav file (without extension) or "None"</param>
|
||||
/// <returns>True if route loaded successfully, false otherwise</returns>
|
||||
public bool LoadRoute(string navFileName)
|
||||
{
|
||||
try
|
||||
|
|
@ -149,7 +142,6 @@ namespace MosswartMassacre
|
|||
|
||||
if (string.IsNullOrEmpty(navFileName) || navFileName == "None")
|
||||
{
|
||||
PluginCore.WriteToChat("[NavViz] Route cleared");
|
||||
RouteChanged?.Invoke(this, EventArgs.Empty);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -158,7 +150,7 @@ namespace MosswartMassacre
|
|||
|
||||
if (!File.Exists(fullPath))
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] Nav file not found: {navFileName}");
|
||||
PluginCore.WriteToChat($"Navigation file '{navFileName}' not found");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -172,41 +164,35 @@ namespace MosswartMassacre
|
|||
}
|
||||
|
||||
// Show route if visualization is enabled
|
||||
PluginCore.WriteToChat($"[NavViz] LoadRoute: IsEnabled = {IsEnabled}");
|
||||
if (IsEnabled)
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] Calling Show() for route {navFileName}");
|
||||
currentRoute.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] Visualization disabled, not showing route");
|
||||
}
|
||||
|
||||
RouteChanged?.Invoke(this, EventArgs.Empty);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] Error loading route {navFileName}: {ex.Message}");
|
||||
PluginCore.WriteToChat($"Navigation: Failed to load '{navFileName}' - {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable or disable navigation route visualization in 3D world
|
||||
/// Shows/hides the currently loaded route based on enabled state
|
||||
/// </summary>
|
||||
/// <param name="enabled">True to show route lines, false to hide</param>
|
||||
public void SetEnabled(bool enabled)
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] SetEnabled called: current={IsEnabled}, new={enabled}");
|
||||
if (IsEnabled == enabled)
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] SetEnabled: no change needed");
|
||||
return;
|
||||
}
|
||||
// No change needed if already in desired state
|
||||
if (IsEnabled == enabled) return;
|
||||
|
||||
IsEnabled = enabled;
|
||||
|
||||
if (currentRoute != null)
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] SetEnabled: currentRoute exists, {(enabled ? "showing" : "hiding")}");
|
||||
if (enabled)
|
||||
{
|
||||
currentRoute.Show();
|
||||
|
|
@ -218,10 +204,9 @@ namespace MosswartMassacre
|
|||
}
|
||||
else
|
||||
{
|
||||
PluginCore.WriteToChat($"[NavViz] SetEnabled: no currentRoute to {(enabled ? "show" : "hide")}");
|
||||
}
|
||||
|
||||
PluginCore.WriteToChat($"[NavViz] Navigation visualization {(enabled ? "enabled" : "disabled")}");
|
||||
PluginCore.WriteToChat($"Navigation visualization {(enabled ? "enabled" : "disabled")}");
|
||||
}
|
||||
|
||||
public void ToggleEnabled()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue