New visual routes and new GUI

This commit is contained in:
erik 2025-05-29 17:52:30 +02:00
parent 037e5cd940
commit 1f85d9c6f0
4 changed files with 76 additions and 15 deletions

View file

@ -58,6 +58,12 @@
<EmbedInteropTypes>False</EmbedInteropTypes> <EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>lib\Decal.Interop.Inject.dll</HintPath> <HintPath>lib\Decal.Interop.Inject.dll</HintPath>
</Reference> </Reference>
<Reference Include="Decal.Interop.D3DService, Version=2.9.8.3, Culture=neutral, PublicKeyToken=481f17d392f1fb65, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Decal 3.0\.NET 4.0 PIA\Decal.Interop.D3DService.DLL</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
@ -151,6 +157,8 @@
<Compile Include="ClientTelemetry.cs" /> <Compile Include="ClientTelemetry.cs" />
<Compile Include="ManyHook.cs" /> <Compile Include="ManyHook.cs" />
<Compile Include="MossyInventory.cs" /> <Compile Include="MossyInventory.cs" />
<Compile Include="NavRoute.cs" />
<Compile Include="NavVisualization.cs" />
<Compile Include="vTank.cs" /> <Compile Include="vTank.cs" />
<Compile Include="VtankControl.cs" /> <Compile Include="VtankControl.cs" />
<Compile Include="Telemetry.cs" /> <Compile Include="Telemetry.cs" />
@ -160,7 +168,6 @@
<Compile Include="PluginSettings.cs" /> <Compile Include="PluginSettings.cs" />
<Compile Include="HttpCommandServer.cs" /> <Compile Include="HttpCommandServer.cs" />
<Compile Include="DelayedCommandManager.cs" /> <Compile Include="DelayedCommandManager.cs" />
<Compile Include="MainView.cs" />
<Compile Include="PluginCore.cs" /> <Compile Include="PluginCore.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
@ -169,6 +176,8 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
</Compile> </Compile>
<Compile Include="ViewSystemSelector.cs" /> <Compile Include="ViewSystemSelector.cs" />
<Compile Include="Views\BaseView.cs" />
<Compile Include="Views\TabbedMainView.cs" />
<Compile Include="WebSocket.cs" /> <Compile Include="WebSocket.cs" />
<Compile Include="Wrapper.cs" /> <Compile Include="Wrapper.cs" />
<Compile Include="Wrapper_Decal.cs" /> <Compile Include="Wrapper_Decal.cs" />
@ -183,6 +192,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="ViewXML\mainView.xml" /> <EmbeddedResource Include="ViewXML\mainView.xml" />
<EmbeddedResource Include="ViewXML\mainViewTabbed.xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />

View file

@ -12,6 +12,7 @@ using System.Threading.Tasks;
using System.Timers; using System.Timers;
using Decal.Adapter; using Decal.Adapter;
using Decal.Adapter.Wrappers; using Decal.Adapter.Wrappers;
using MosswartMassacre.Views;
namespace MosswartMassacre namespace MosswartMassacre
{ {
@ -34,6 +35,7 @@ namespace MosswartMassacre
public bool WebSocketEnabled { get; set; } = false; public bool WebSocketEnabled { get; set; } = false;
public bool InventoryLogEnabled { get; set; } = false; public bool InventoryLogEnabled { get; set; } = false;
private MossyInventory _inventoryLogger; private MossyInventory _inventoryLogger;
public static NavVisualization navVisualization;
private static Queue<string> rareMessageQueue = new Queue<string>(); private static Queue<string> rareMessageQueue = new Queue<string>();
private static DateTime _lastSent = DateTime.MinValue; private static DateTime _lastSent = DateTime.MinValue;
@ -60,8 +62,8 @@ namespace MosswartMassacre
updateTimer.Elapsed += UpdateStats; updateTimer.Elapsed += UpdateStats;
updateTimer.Start(); updateTimer.Start();
// Initialize the view (UI) // Initialize the view (UI) - use tabbed interface by default
MainView.ViewInit(); TabbedMainView.ViewInit();
// Enable TLS1.2 // Enable TLS1.2
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
@ -73,6 +75,9 @@ namespace MosswartMassacre
_inventoryLogger = new MossyInventory(); _inventoryLogger = new MossyInventory();
// Initialize navigation visualization system
navVisualization = new NavVisualization();
} }
@ -108,7 +113,7 @@ namespace MosswartMassacre
} }
// Clean up the view // Clean up the view
MainView.ViewDestroy(); TabbedMainView.ViewDestroy();
//Disable vtank interface //Disable vtank interface
vTank.Disable(); vTank.Disable();
// sluta lyssna på commands // sluta lyssna på commands
@ -117,6 +122,13 @@ namespace MosswartMassacre
//shutdown inv //shutdown inv
_inventoryLogger.Dispose(); _inventoryLogger.Dispose();
// Clean up navigation visualization
if (navVisualization != null)
{
navVisualization.Dispose();
navVisualization = null;
}
MyHost = null; MyHost = null;
} }
catch (Exception ex) catch (Exception ex)
@ -137,7 +149,8 @@ namespace MosswartMassacre
HttpServerEnabled = PluginSettings.Instance.HttpServerEnabled; HttpServerEnabled = PluginSettings.Instance.HttpServerEnabled;
TelemetryEnabled = PluginSettings.Instance.TelemetryEnabled; TelemetryEnabled = PluginSettings.Instance.TelemetryEnabled;
CharTag = PluginSettings.Instance.CharTag; CharTag = PluginSettings.Instance.CharTag;
MainView.SetRareMetaToggleState(RareMetaEnabled); TabbedMainView.SetRareMetaToggleState(RareMetaEnabled);
TabbedMainView.RefreshSettingsFromConfig(); // Refresh all UI settings after loading
if (TelemetryEnabled) if (TelemetryEnabled)
Telemetry.Start(); Telemetry.Start();
if (WebSocketEnabled) if (WebSocketEnabled)
@ -225,13 +238,13 @@ namespace MosswartMassacre
totalKills++; totalKills++;
lastKillTime = DateTime.Now; lastKillTime = DateTime.Now;
CalculateKillsPerInterval(); CalculateKillsPerInterval();
MainView.UpdateKillStats(totalKills, killsPer5Min, killsPerHour); TabbedMainView.UpdateKillStats(totalKills, killsPer5Min, killsPerHour);
} }
if (IsRareDiscoveryMessage(e.Text, out string rareText)) if (IsRareDiscoveryMessage(e.Text, out string rareText))
{ {
rareCount++; rareCount++;
MainView.UpdateRareCount(rareCount); TabbedMainView.UpdateRareCount(rareCount);
if (RareMetaEnabled) if (RareMetaEnabled)
{ {
@ -311,11 +324,11 @@ namespace MosswartMassacre
{ {
// Update the elapsed time // Update the elapsed time
TimeSpan elapsed = DateTime.Now - statsStartTime; TimeSpan elapsed = DateTime.Now - statsStartTime;
MainView.UpdateElapsedTime(elapsed); TabbedMainView.UpdateElapsedTime(elapsed);
// Recalculate kill rates // Recalculate kill rates
CalculateKillsPerInterval(); CalculateKillsPerInterval();
MainView.UpdateKillStats(totalKills, killsPer5Min, killsPerHour); TabbedMainView.UpdateKillStats(totalKills, killsPer5Min, killsPerHour);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -413,14 +426,14 @@ namespace MosswartMassacre
killsPerHour = 0; killsPerHour = 0;
WriteToChat("Stats have been reset."); WriteToChat("Stats have been reset.");
MainView.UpdateKillStats(totalKills, killsPer5Min, killsPerHour); TabbedMainView.UpdateKillStats(totalKills, killsPer5Min, killsPerHour);
MainView.UpdateRareCount(rareCount); TabbedMainView.UpdateRareCount(rareCount);
} }
public static void ToggleRareMeta() public static void ToggleRareMeta()
{ {
PluginSettings.Instance.RareMetaEnabled = !PluginSettings.Instance.RareMetaEnabled; PluginSettings.Instance.RareMetaEnabled = !PluginSettings.Instance.RareMetaEnabled;
RareMetaEnabled = PluginSettings.Instance.RareMetaEnabled; RareMetaEnabled = PluginSettings.Instance.RareMetaEnabled;
MainView.SetRareMetaToggleState(RareMetaEnabled); TabbedMainView.SetRareMetaToggleState(RareMetaEnabled);
} }
[DllImport("Decal.dll")] [DllImport("Decal.dll")]
@ -550,7 +563,7 @@ namespace MosswartMassacre
case "meta": case "meta":
RareMetaEnabled = !RareMetaEnabled; RareMetaEnabled = !RareMetaEnabled;
WriteToChat($"Rare meta state is now {(RareMetaEnabled ? "ON" : "OFF")}"); WriteToChat($"Rare meta state is now {(RareMetaEnabled ? "ON" : "OFF")}");
MainView.SetRareMetaToggleState(RareMetaEnabled); // <-- sync the UI TabbedMainView.SetRareMetaToggleState(RareMetaEnabled); // <-- sync the UI
break; break;
case "http": case "http":

View file

@ -20,6 +20,10 @@ namespace MosswartMassacre
private bool _webSocketEnabled = false; private bool _webSocketEnabled = false;
private bool _inventorylog = true; private bool _inventorylog = true;
private string _charTag = "default"; private string _charTag = "default";
private int _mainWindowX = 100;
private int _mainWindowY = 100;
private bool _useTabbedInterface = true;
private string _vtankProfilesPath = "";
public static PluginSettings Instance => _instance public static PluginSettings Instance => _instance
?? throw new InvalidOperationException("PluginSettings not initialized"); ?? throw new InvalidOperationException("PluginSettings not initialized");
@ -151,5 +155,29 @@ namespace MosswartMassacre
get => _inventorylog; get => _inventorylog;
set { _inventorylog = value; Save(); } set { _inventorylog = value; Save(); }
} }
public int MainWindowX
{
get => _mainWindowX;
set { _mainWindowX = value; Save(); }
}
public int MainWindowY
{
get => _mainWindowY;
set { _mainWindowY = value; Save(); }
}
public bool UseTabbedInterface
{
get => _useTabbedInterface;
set { _useTabbedInterface = value; Save(); }
}
public string VTankProfilesPath
{
get => _vtankProfilesPath;
set { _vtankProfilesPath = value; Save(); }
}
} }
} }

View file

@ -29,12 +29,13 @@ A collection of DECAL plugins for Asheron's Call, providing utility overlays and
- On button click, it logs a chat message; extend the `btnCycle.Hit` handler to add gear-cycling logic. - On button click, it logs a chat message; extend the `btnCycle.Hit` handler to add gear-cycling logic.
## MosswartMassacre ## MosswartMassacre
Tracks monster kills and rare drops, with multiple utility features. Tracks monster kills and rare drops, with multiple utility features including navigation route visualization.
### Features ### Features
- **Kill Tracking**: Counts total kills and computes rates (kills/5 min, kills/hour). - **Kill Tracking**: Counts total kills and computes rates (kills/5 min, kills/hour).
- **Rare Discoveries**: Increments rare count and can automatically set rare meta state. - **Rare Discoveries**: Increments rare count and can automatically set rare meta state.
- **UI Overlay**: Displays stats and provides buttons to reset stats or toggle rare meta. - **Navigation Visualization****NEW**: Visualize VTank navigation routes in 3D with route comparison capabilities.
- **Tabbed UI Interface**: Enhanced interface with Main, Settings, Statistics, and Navigation tabs.
- **Command Interface** (`/mm` commands): - **Command Interface** (`/mm` commands):
- `/mm help` : Show available commands. - `/mm help` : Show available commands.
- `/mm report` : Display current stats in chat. - `/mm report` : Display current stats in chat.
@ -49,6 +50,13 @@ A collection of DECAL plugins for Asheron's Call, providing utility overlays and
- Listens on `http://localhost:8085/`. - Listens on `http://localhost:8085/`.
- Accepts POST data: `target=<player>&command=<text>`, then sends a /tell and executes the command. - Accepts POST data: `target=<player>&command=<text>`, then sends a /tell and executes the command.
### Navigation Visualization ✅ NEW
- **VTank Integration**: Automatically detects VTank installation and loads .nav files.
- **3D Route Display**: Shows navigation routes as red lines in the game world.
- **Route Comparison**: Visualize different routes alongside UtilityBelt's active navigation.
- **Supported Formats**: All VTank nav types (Circular, Linear, Target, Once) and waypoint types.
- **Usage**: Enable in Navigation tab, select route from dropdown, click "Load Route".
### Configuration ### Configuration
- Per-character YAML config stored at `<PluginDir>/<CharacterName>.yaml`. - Per-character YAML config stored at `<PluginDir>/<CharacterName>.yaml`.
- Settings include: - Settings include:
@ -57,6 +65,7 @@ A collection of DECAL plugins for Asheron's Call, providing utility overlays and
- `http_server_enabled` - `http_server_enabled`
- `telemetry_enabled` - `telemetry_enabled`
- `char_tag` - `char_tag`
- `vtank_profiles_path`**NEW**: Custom VTank profiles directory
- Config is auto-generated on first run; modify it or use UI/commands to update. - Config is auto-generated on first run; modify it or use UI/commands to update.
### Telemetry ### Telemetry
@ -66,6 +75,7 @@ A collection of DECAL plugins for Asheron's Call, providing utility overlays and
## Dependencies ## Dependencies
- Decal.Adapter (v2.9.8.3) - Decal.Adapter (v2.9.8.3)
- Decal.Interop.Core & Decal.Interop.Inject - Decal.Interop.Core & Decal.Interop.Inject
- Decal.Interop.D3DService ✅ **NEW**: For 3D navigation visualization
- VirindiViewService - VirindiViewService
- Newtonsoft.Json (v13.0.3) - Newtonsoft.Json (v13.0.3)
- YamlDotNet (v16.3.0) - YamlDotNet (v16.3.0)