Skip to content

Commit

Permalink
[STABLE] update for apiX
Browse files Browse the repository at this point in the history
  • Loading branch information
kalilistic committed Jul 2, 2024
1 parent 381892e commit 95c1abe
Show file tree
Hide file tree
Showing 18 changed files with 103 additions and 195 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "DrunkenToad"]
path = DrunkenToad
url = https://github.com/kalilistic/dalamud.drunkentoad
1 change: 1 addition & 0 deletions DrunkenToad
Submodule DrunkenToad added at af0fa8
6 changes: 6 additions & 0 deletions src/PriceCheck.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PriceCheck", "PriceCheck\PriceCheck.csproj", "{EBAF1BDC-2509-4504-8A4B-ED9C563FBEB6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrunkenToad", "..\DrunkenToad\DrunkenToad.csproj", "{DCA72F3A-A271-4C16-AC74-CE4BFCA1E13F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -12,5 +14,9 @@ Global
{EBAF1BDC-2509-4504-8A4B-ED9C563FBEB6}.Release|Any CPU.Build.0 = Release|x64
{EBAF1BDC-2509-4504-8A4B-ED9C563FBEB6}.Debug|Any CPU.ActiveCfg = Debug|x64
{EBAF1BDC-2509-4504-8A4B-ED9C563FBEB6}.Debug|Any CPU.Build.0 = Debug|x64
{DCA72F3A-A271-4C16-AC74-CE4BFCA1E13F}.Debug|Any CPU.ActiveCfg = Debug|x64
{DCA72F3A-A271-4C16-AC74-CE4BFCA1E13F}.Debug|Any CPU.Build.0 = Debug|x64
{DCA72F3A-A271-4C16-AC74-CE4BFCA1E13F}.Release|Any CPU.ActiveCfg = Release|x64
{DCA72F3A-A271-4C16-AC74-CE4BFCA1E13F}.Release|Any CPU.Build.0 = Release|x64
EndGlobalSection
EndGlobal
13 changes: 7 additions & 6 deletions src/PriceCheck/PriceCheck.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>2.6.1.0</Version>
<Version>2.7.0.0</Version>
<Title>PriceCheck</Title>
<Authors>kalilistic</Authors>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<Platforms>x64</Platforms>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down Expand Up @@ -93,11 +93,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<PackageReference Include="DalamudPackager" Version="2.1.13" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="Dalamud.DrunkenToad" Version="1.7.2" />
<PackageReference Include="Dalamud.ContextMenu" Version="1.3.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down Expand Up @@ -125,4 +123,7 @@
<None Remove="PriceCheck\Resource\translation\zh.json" />
<EmbeddedResource Include="PriceCheck\Resource\translation\zh.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\DrunkenToad\DrunkenToad.csproj" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions src/PriceCheck/PriceCheck/Configuration/PriceCheckConfig.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;

using Dalamud.DrunkenToad;
using Dalamud.Game.Text;

// ReSharper disable UseCollectionExpression
namespace PriceCheck
{
/// <summary>
Expand Down Expand Up @@ -118,7 +118,7 @@ public abstract class PriceCheckConfig
/// <summary>
/// Gets or sets the primary key for key bind.
/// </summary>
public PrimaryKey.Enum PrimaryKey { get; set; } = Dalamud.DrunkenToad.PrimaryKey.Enum.VkZ;
public PrimaryKey.Enum PrimaryKey { get; set; } = PriceCheck.PrimaryKey.Enum.VkZ;

/// <summary>
/// Gets or sets the minimum price to show.
Expand All @@ -143,12 +143,12 @@ public abstract class PriceCheckConfig
/// <summary>
/// Gets or sets list of items to show above.
/// </summary>
public List<byte> ShowContextAboveThis { get; set; } = new();
public List<byte> ShowContextAboveThis { get; set; } = new ();

/// <summary>
/// Gets or sets list of items to show below.
/// </summary>
public List<byte> ShowContextBelowThis { get; set; } = new();
public List<byte> ShowContextBelowThis { get; set; } = new ();

/// <summary>
/// Gets or sets chat channel to use for price check messages.
Expand Down
6 changes: 3 additions & 3 deletions src/PriceCheck/PriceCheck/Localization/LegacyLoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
using Dalamud.Plugin;
using Dalamud.Plugin.Services;

namespace NeatNoter.Localization;
namespace PriceCheck.Localization;

public class LegacyLoc
{
private readonly DalamudPluginInterface pluginInterface;
private readonly IDalamudPluginInterface pluginInterface;
private readonly ICommandManager commandManager;
private readonly string pluginName;
private readonly Assembly assembly;

public LegacyLoc(DalamudPluginInterface pluginInterface, ICommandManager commandManager)
public LegacyLoc(IDalamudPluginInterface pluginInterface, ICommandManager commandManager)
{
this.pluginInterface = pluginInterface;
this.commandManager = commandManager;
Expand Down
15 changes: 8 additions & 7 deletions src/PriceCheck/PriceCheck/Model/PriceMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using CheapLoc;

// ReSharper disable UseCollectionExpression
namespace PriceCheck
{
/// <summary>
Expand All @@ -13,49 +14,49 @@ public class PriceMode
/// <summary>
/// List of price modes.
/// </summary>
public static readonly List<PriceMode> PriceModes = new();
public static readonly List<PriceMode> PriceModes = new ();

/// <summary>
/// List of price mode names.
/// </summary>
public static readonly List<string> PriceModeNames = new();
public static readonly List<string> PriceModeNames = new ();

/// <summary>
/// Price mode: historical average.
/// </summary>
public static readonly PriceMode AveragePrice = new(
public static readonly PriceMode AveragePrice = new (
0,
Loc.Localize("AveragePrice", "Average Price"),
Loc.Localize("AveragePriceDesc", "The average sale price in recent sale history with outliers removed beyond three standard deviations of the mean."));

/// <summary>
/// Price mode: current average.
/// </summary>
public static readonly PriceMode CurrentAveragePrice = new(
public static readonly PriceMode CurrentAveragePrice = new (
1,
Loc.Localize("CurrentAveragePrice", "Current Average Price"),
Loc.Localize("CurrentAveragePriceDesc", "The average sale price in current listings with outliers removed beyond three standard deviations of the mean."));

/// <summary>
/// Price mode: minimum price.
/// </summary>
public static readonly PriceMode MinimumPrice = new(
public static readonly PriceMode MinimumPrice = new (
2,
Loc.Localize("MinimumPrice", "Minimum Price"),
Loc.Localize("MinimumPriceDesc", "The minimum price in current listings."));

/// <summary>
/// Price mode: maximum price.
/// </summary>
public static readonly PriceMode MaximumPrice = new(
public static readonly PriceMode MaximumPrice = new (
3,
Loc.Localize("MaximumPrice", "Maximum Price"),
Loc.Localize("MaximumPriceDesc", "The maximum price in current listings."));

/// <summary>
/// Price mode: current minimum price.
/// </summary>
public static readonly PriceMode CurrentMinimumPrice = new(
public static readonly PriceMode CurrentMinimumPrice = new (
4,
Loc.Localize("CurrentMinimumPrice", "Current Minimum Price"),
Loc.Localize("CurrentMinimumPriceDesc", "The minimum price in current listings across both normal and high quality items."));
Expand Down
2 changes: 2 additions & 0 deletions src/PriceCheck/PriceCheck/Model/PricedItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

using Dalamud.Interface.Colors;

// ReSharper disable RedundantDefaultMemberInitializer
// ReSharper disable PropertyCanBeMadeInitOnly.Global
namespace PriceCheck
{
/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions src/PriceCheck/PriceCheck/Model/PrimaryKey.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Dalamud.DrunkenToad
namespace PriceCheck
{
/// <summary>
/// Gets primary key.
Expand All @@ -11,7 +11,7 @@ public static class PrimaryKey
/// Get primary key names.
/// </summary>
public static readonly string[] Names =
{
[
"None",
"0",
"1",
Expand Down Expand Up @@ -48,8 +48,8 @@ public static class PrimaryKey
"W",
"X",
"Y",
"Z",
};
"Z"
];

/// <summary>
/// primary key enum.
Expand Down
60 changes: 0 additions & 60 deletions src/PriceCheck/PriceCheck/Plugin/Manager/ContextMenuManager.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;

using Dalamud.DrunkenToad;
using Dalamud.Logging;

namespace PriceCheck
{
/// <summary>
Expand Down Expand Up @@ -70,7 +67,7 @@ private void HoveredItemChanged(object? sender, ulong itemId)
}

// if keybind without pre-click
if (this.plugin.Configuration.KeybindEnabled && !this.plugin.Configuration.AllowKeybindAfterHover)
if (this.plugin.Configuration is { KeybindEnabled: true, AllowKeybindAfterHover: false })
{
// call immediately
if (!this.plugin.IsKeyBindPressed()) return;
Expand All @@ -79,7 +76,7 @@ private void HoveredItemChanged(object? sender, ulong itemId)
}

// if keybind post-click
if (this.plugin.Configuration.KeybindEnabled && this.plugin.Configuration.AllowKeybindAfterHover)
if (this.plugin.Configuration is { KeybindEnabled: true, AllowKeybindAfterHover: true })
{
if (this.plugin.IsKeyBindPressed())
{
Expand All @@ -104,7 +101,7 @@ private void HoveredItemChanged(object? sender, ulong itemId)
}
catch (Exception ex)
{
PluginLog.LogError(ex, "Failed to price check.");
PriceCheckPlugin.PluginLog.Error(ex, "Failed to price check.");
this.ItemId = 0;
this.plugin.ItemCancellationTokenSource = null;
}
Expand Down
Loading

0 comments on commit 95c1abe

Please sign in to comment.