Added chest looter
This commit is contained in:
parent
5fe0f85369
commit
2eb9a7773e
5 changed files with 569 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
|
@ -13,6 +14,8 @@
|
|||
<LangVersion>8.0</LangVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
|
@ -35,9 +38,12 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>C:\Games\Decal Plugins\UtilityBelt\0Harmony.dll</HintPath>
|
||||
<HintPath>..\..\..\..\Documents\Decal Plugins\UtilityBelt\0Harmony.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Decal.Adapter">
|
||||
<HintPath>lib\Decal.Adapter.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
|
|
@ -68,21 +74,156 @@
|
|||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Decal 3.0\.NET 4.0 PIA\Decal.Interop.D3DService.DLL</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Decal.Interop.Input">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Decal 3.0\.NET 4.0 PIA\Decal.Interop.Input.DLL</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.AppContext, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.Tracing, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Linq, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Linq.Expressions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Remoting" />
|
||||
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.RegularExpressions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="utank2-i, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>bin\Debug\utank2-i.dll</HintPath>
|
||||
|
|
@ -186,6 +327,8 @@
|
|||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ChestLooter.cs" />
|
||||
<Compile Include="ChestLooterSettings.cs" />
|
||||
<Compile Include="SpellManager.cs" />
|
||||
<Compile Include="Views\FlagTrackerView.cs" />
|
||||
<Compile Include="Views\VVSBaseView.cs" />
|
||||
|
|
@ -231,12 +374,13 @@
|
|||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\Fody.6.8.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.8.0\build\Fody.targets')" />
|
||||
<Import Project="..\packages\Fody.6.9.3\build\Fody.targets" Condition="Exists('..\packages\Fody.6.9.3\build\Fody.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this machine. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Fody.6.8.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.8.0\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Fody.6.9.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.9.3\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ namespace MosswartMassacre
|
|||
private bool _useTabbedInterface = true;
|
||||
private string _vtankProfilesPath = "";
|
||||
private bool _verboseLogging = false;
|
||||
private ChestLooterSettings _chestLooterSettings = new ChestLooterSettings();
|
||||
|
||||
public static PluginSettings Instance => _instance
|
||||
?? throw new InvalidOperationException("PluginSettings not initialized");
|
||||
|
|
@ -204,5 +205,22 @@ namespace MosswartMassacre
|
|||
get => _verboseLogging;
|
||||
set { _verboseLogging = value; Save(); }
|
||||
}
|
||||
|
||||
public ChestLooterSettings ChestLooterSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_chestLooterSettings == null)
|
||||
{
|
||||
_chestLooterSettings = new ChestLooterSettings();
|
||||
}
|
||||
return _chestLooterSettings;
|
||||
}
|
||||
set
|
||||
{
|
||||
_chestLooterSettings = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,5 +220,109 @@ namespace MosswartMassacre
|
|||
int rawIcon = GetItemIcon(itemName);
|
||||
return rawIcon != 0 ? rawIcon + 0x6000000 : 0x6002D14;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------
|
||||
* 5) Chest Looter helper methods
|
||||
* -------------------------------------------------------- */
|
||||
|
||||
/// <summary>
|
||||
/// Calculate 3D distance from player to a world object
|
||||
/// </summary>
|
||||
/// <param name="objectId">World object ID</param>
|
||||
/// <returns>Distance in meters, or float.MaxValue if object is invalid</returns>
|
||||
public static float GetDistanceToWorldObject(int objectId)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!CoreManager.Current.Actions.IsValidObject(objectId))
|
||||
return float.MaxValue;
|
||||
|
||||
Vector3 playerPos = GetPlayerPosition();
|
||||
Vector3 objectPos = GetWorldObjectPosition(objectId);
|
||||
|
||||
return Vector3.Distance(playerPos, objectPos);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return float.MaxValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find the closest chest with the specified name in the game world
|
||||
/// </summary>
|
||||
/// <param name="chestName">Name of the chest to find</param>
|
||||
/// <returns>WorldObject of the closest chest, or null if not found</returns>
|
||||
public static WorldObject FindClosestChestByName(string chestName)
|
||||
{
|
||||
try
|
||||
{
|
||||
WorldObject closestChest = null;
|
||||
float closestDistance = float.MaxValue;
|
||||
|
||||
// Search all objects in WorldFilter
|
||||
using (var objects = CoreManager.Current.WorldFilter.GetAll())
|
||||
{
|
||||
foreach (WorldObject wo in objects)
|
||||
{
|
||||
// Check if this is a container (chest)
|
||||
if (wo.ObjectClass != ObjectClass.Container)
|
||||
continue;
|
||||
|
||||
// Check if name matches (case-insensitive, partial match allowed)
|
||||
if (!wo.Name.Contains(chestName) &&
|
||||
!string.Equals(wo.Name, chestName, StringComparison.OrdinalIgnoreCase))
|
||||
continue;
|
||||
|
||||
// Calculate distance
|
||||
float distance = GetDistanceToWorldObject(wo.Id);
|
||||
|
||||
// Update closest if this is nearer
|
||||
if (distance < closestDistance)
|
||||
{
|
||||
closestDistance = distance;
|
||||
closestChest = wo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return closestChest;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find a key in the player's inventory by name
|
||||
/// </summary>
|
||||
/// <param name="keyName">Name of the key to find</param>
|
||||
/// <returns>WorldObject of the key, or null if not found</returns>
|
||||
public static WorldObject FindKeyInInventory(string keyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (WorldObject wo in CoreManager.Current.WorldFilter.GetInventory())
|
||||
{
|
||||
// Check if this is a key
|
||||
if (wo.ObjectClass != ObjectClass.Key)
|
||||
continue;
|
||||
|
||||
// Check if name matches (case-insensitive, partial match allowed)
|
||||
if (wo.Name.Contains(keyName) ||
|
||||
string.Equals(wo.Name, keyName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return wo;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,18 @@ namespace MosswartMassacre.Views
|
|||
private HudButton btnOpenFlagTracker;
|
||||
// lblFlagTrackerStatus removed - not present in XML
|
||||
#endregion
|
||||
|
||||
|
||||
#region Chest Looter Tab Controls
|
||||
private HudTextBox txtChestName;
|
||||
private HudTextBox txtKeyName;
|
||||
private HudButton btnSetChest;
|
||||
private HudButton btnSetKey;
|
||||
private HudButton btnStartLooter;
|
||||
private HudButton btnStopLooter;
|
||||
private HudCheckBox chkEnableChests;
|
||||
private HudStaticText lblLooterStatus;
|
||||
#endregion
|
||||
|
||||
#region Statistics Tracking
|
||||
private double bestHourlyKills = 0;
|
||||
private DateTime sessionStartTime;
|
||||
|
|
@ -140,6 +151,7 @@ namespace MosswartMassacre.Views
|
|||
InitializeStatisticsTabControls();
|
||||
InitializeNavigationTabControls();
|
||||
InitializeFlagTrackerTabControls();
|
||||
InitializeChestLooterTabControls();
|
||||
|
||||
// Initialize the base view and set initial position
|
||||
Initialize();
|
||||
|
|
@ -293,7 +305,7 @@ namespace MosswartMassacre.Views
|
|||
{
|
||||
// Flag Tracker tab controls
|
||||
btnOpenFlagTracker = GetControl<HudButton>("btnOpenFlagTracker");
|
||||
|
||||
|
||||
// Hook up Flag Tracker events
|
||||
if (btnOpenFlagTracker != null)
|
||||
btnOpenFlagTracker.Hit += OnOpenFlagTrackerClick;
|
||||
|
|
@ -303,6 +315,41 @@ namespace MosswartMassacre.Views
|
|||
PluginCore.WriteToChat($"Error initializing flag tracker controls: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeChestLooterTabControls()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Chest Looter tab controls
|
||||
txtChestName = GetControl<HudTextBox>("txtChestName");
|
||||
txtKeyName = GetControl<HudTextBox>("txtKeyName");
|
||||
btnSetChest = GetControl<HudButton>("btnSetChest");
|
||||
btnSetKey = GetControl<HudButton>("btnSetKey");
|
||||
btnStartLooter = GetControl<HudButton>("btnStartLooter");
|
||||
btnStopLooter = GetControl<HudButton>("btnStopLooter");
|
||||
chkEnableChests = GetControl<HudCheckBox>("chkEnableChests");
|
||||
lblLooterStatus = GetControl<HudStaticText>("lblLooterStatus");
|
||||
|
||||
// Hook up Chest Looter events
|
||||
if (btnSetChest != null)
|
||||
btnSetChest.Hit += OnSetChestClick;
|
||||
if (btnSetKey != null)
|
||||
btnSetKey.Hit += OnSetKeyClick;
|
||||
if (btnStartLooter != null)
|
||||
btnStartLooter.Hit += OnStartLooterClick;
|
||||
if (btnStopLooter != null)
|
||||
btnStopLooter.Hit += OnStopLooterClick;
|
||||
if (chkEnableChests != null)
|
||||
chkEnableChests.Change += OnEnableChestsChanged;
|
||||
|
||||
// Load current settings
|
||||
LoadChestLooterSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"Error initializing chest looter controls: {ex.Message}");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Event Handlers - Settings Tab
|
||||
|
|
@ -610,6 +657,207 @@ namespace MosswartMassacre.Views
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region Event Handlers - Chest Looter Tab
|
||||
|
||||
private void OnSetChestClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var core = Decal.Adapter.CoreManager.Current;
|
||||
var chest = core.WorldFilter[core.Actions.CurrentSelection];
|
||||
if (chest == null)
|
||||
{
|
||||
PluginCore.WriteToChat("[ChestLooter] No chest selected");
|
||||
return;
|
||||
}
|
||||
|
||||
if (chest.ObjectClass != Decal.Adapter.Wrappers.ObjectClass.Container)
|
||||
{
|
||||
PluginCore.WriteToChat("[ChestLooter] Selected object is not a container");
|
||||
return;
|
||||
}
|
||||
|
||||
txtChestName.Text = chest.Name;
|
||||
if (PluginCore.chestLooter != null)
|
||||
{
|
||||
PluginCore.chestLooter.SetChestName(chest.Name);
|
||||
}
|
||||
PluginCore.WriteToChat($"[ChestLooter] Chest set to: {chest.Name}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[ChestLooter] Error setting chest: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSetKeyClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var core = Decal.Adapter.CoreManager.Current;
|
||||
var key = core.WorldFilter[core.Actions.CurrentSelection];
|
||||
if (key == null)
|
||||
{
|
||||
PluginCore.WriteToChat("[ChestLooter] No key selected");
|
||||
return;
|
||||
}
|
||||
|
||||
if (key.ObjectClass != Decal.Adapter.Wrappers.ObjectClass.Key)
|
||||
{
|
||||
PluginCore.WriteToChat("[ChestLooter] Selected object is not a key");
|
||||
return;
|
||||
}
|
||||
|
||||
txtKeyName.Text = key.Name;
|
||||
if (PluginCore.chestLooter != null)
|
||||
{
|
||||
PluginCore.chestLooter.SetKeyName(key.Name);
|
||||
}
|
||||
PluginCore.WriteToChat($"[ChestLooter] Key set to: {key.Name}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[ChestLooter] Error setting key: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnStartLooterClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (PluginCore.chestLooter == null)
|
||||
{
|
||||
PluginCore.WriteToChat("[ChestLooter] Chest looter not initialized");
|
||||
return;
|
||||
}
|
||||
|
||||
string chestName = txtChestName?.Text ?? "";
|
||||
string keyName = txtKeyName?.Text ?? "";
|
||||
|
||||
if (string.IsNullOrEmpty(chestName))
|
||||
{
|
||||
PluginCore.WriteToChat("[ChestLooter] Please set chest name first");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(keyName))
|
||||
{
|
||||
PluginCore.WriteToChat("[ChestLooter] Please set key name first");
|
||||
return;
|
||||
}
|
||||
|
||||
bool started = PluginCore.chestLooter.StartByName(chestName, keyName);
|
||||
if (started)
|
||||
{
|
||||
UpdateLooterStatus("Starting...");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[ChestLooter] Error starting looter: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnStopLooterClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (PluginCore.chestLooter != null)
|
||||
{
|
||||
PluginCore.chestLooter.Stop();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[ChestLooter] Error stopping looter: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnableChestsChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var settings = PluginSettings.Instance;
|
||||
if (settings?.ChestLooterSettings != null && chkEnableChests != null)
|
||||
{
|
||||
settings.ChestLooterSettings.EnableChests = chkEnableChests.Checked;
|
||||
PluginSettings.Save();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[ChestLooter] Error changing enable chests: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadChestLooterSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
var settings = PluginSettings.Instance?.ChestLooterSettings;
|
||||
if (settings != null)
|
||||
{
|
||||
if (txtChestName != null)
|
||||
txtChestName.Text = settings.ChestName ?? "";
|
||||
if (txtKeyName != null)
|
||||
txtKeyName.Text = settings.KeyName ?? "";
|
||||
if (chkEnableChests != null)
|
||||
chkEnableChests.Checked = settings.EnableChests;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PluginCore.WriteToChat($"[ChestLooter] Error loading settings: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateLooterStatus(string status)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (lblLooterStatus != null)
|
||||
{
|
||||
lblLooterStatus.Text = $"Status: {status}";
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public static void UpdateChestLooterStatus(string status)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
instance.UpdateLooterStatus(status);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update chest/key text boxes from settings (called when set via command line)
|
||||
/// </summary>
|
||||
public static void RefreshChestLooterUI()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (instance == null) return;
|
||||
|
||||
var settings = PluginSettings.Instance?.ChestLooterSettings;
|
||||
if (settings != null)
|
||||
{
|
||||
if (instance.txtChestName != null)
|
||||
instance.txtChestName.Text = settings.ChestName ?? "";
|
||||
if (instance.txtKeyName != null)
|
||||
instance.txtKeyName.Text = settings.KeyName ?? "";
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handlers - Navigation Tab
|
||||
private void OnNavVisualizationEnabledChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Costura.Fody" version="5.7.0" targetFramework="net48" />
|
||||
<package id="Fody" version="6.8.0" targetFramework="net48" />
|
||||
<package id="Costura.Fody" version="5.7.0" targetFramework="net48" developmentDependency="true" />
|
||||
<package id="Fody" version="6.9.3" targetFramework="net48" developmentDependency="true" />
|
||||
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net48" />
|
||||
<package id="NETStandard.Library" version="1.6.1" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="System.AppContext" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Collections" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Console" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Globalization" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.IO" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.IO.Compression" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.IO.FileSystem" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Linq" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Net.Http" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.ObjectModel" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Reflection" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Threading" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net48" />
|
||||
<package id="YamlDotNet" version="16.3.0" targetFramework="net48" />
|
||||
</packages>
|
||||
Loading…
Add table
Add a link
Reference in a new issue