6 Commits

Author SHA1 Message Date
cd23b9e381 yes 2025-08-06 17:01:25 +03:00
f299e04189 Upgrade 13 2025-08-06 17:01:08 +03:00
023418599e api13 2025-08-06 16:53:14 +03:00
b124838915 test 2025-08-06 15:58:06 +03:00
726ecc5688 Fixing readme 2025-06-24 18:10:16 +03:00
561811cd1f Enhance command handling and add namespace imports
- Added `using` directives for essential namespaces in `Plugin.cs`.
- Implemented a "set" subcommand for configuring activity options, including color and prefix/suffix settings.
- Added error handling for duplicate and invalid inputs, with user feedback via chat.
- Updated the configuration for the first activity based on user input.
2025-06-22 21:44:51 +03:00
7 changed files with 103 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ jobs:
- name: Download Dalamud Latest - name: Download Dalamud Latest
run: | run: |
wget https://goatcorp.github.io/dalamud-distrib/latest.zip -O ${{ env.DALAMUD_HOME }}.zip wget https://kamori.goats.dev/File/Get/c047a875a16963ea8f47c51d87443610dee93285954d7ba60d91ce49c9474488 -O ${{ env.DALAMUD_HOME }}.zip
unzip ${{ env.DALAMUD_HOME }}.zip -d ${{ env.DALAMUD_HOME }} unzip ${{ env.DALAMUD_HOME }}.zip -d ${{ env.DALAMUD_HOME }}
- name: Restore Project - name: Restore Project

View File

@@ -2,10 +2,6 @@
Update honorific title based on discord activity informations. Update honorific title based on discord activity informations.
## Installation
Installable using my custom repository (instructions here: https://github.com/anya-hichu/DalamudPluginRepo) or from compiled archives.
## Commands ## Commands

View File

@@ -6,6 +6,12 @@ using Dalamud.Plugin.Services;
using SpotifyHonorific.Windows; using SpotifyHonorific.Windows;
using SpotifyHonorific.Activities; using SpotifyHonorific.Activities;
using SpotifyHonorific.Updaters; using SpotifyHonorific.Updaters;
using System;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
using System.Numerics;
namespace SpotifyHonorific; namespace SpotifyHonorific;
@@ -70,6 +76,87 @@ public sealed class Plugin : IDalamudPlugin
Config.Save(); Config.Save();
Updater.Stop(); Updater.Stop();
} }
else if (subcommand == "set")
{
var splitArgs = args.Trim().Split(' ', 2, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
if (splitArgs.Length != 2)
{
return;
}
var setArgs = splitArgs[1].Split('|', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
bool? prefix = null;
Vector3? color = null;
Vector3? glow = null;
foreach (var a in setArgs)
{
var arg = a.ToLower();
var colorArg = arg.Skip(arg.StartsWith('#') ? 1 : 0).ToArray();
if (colorArg.Length == 6 && colorArg.All(chr => chr is >= '0' and <= '9' or >= 'a' and <= 'f'))
{
if (color != null && glow != null)
{
ChatGui.PrintError($"Duplicate Option in Set: '{a}'", "SpotifyHonorific");
return;
}
var rHex = string.Join(null, colorArg.Skip(0).Take(2));
var gHex = string.Join(null, colorArg.Skip(2).Take(2));
var bHex = string.Join(null, colorArg.Skip(4).Take(2));
if (byte.TryParse(rHex, NumberStyles.HexNumber, NumberFormatInfo.InvariantInfo, out var r) &&
byte.TryParse(gHex, NumberStyles.HexNumber, NumberFormatInfo.InvariantInfo, out var g) &&
byte.TryParse(bHex, NumberStyles.HexNumber, NumberFormatInfo.InvariantInfo, out var b))
{
var c = new Vector3(r / 255f, g / 255f, b / 255f);
if (color == null)
{
color = c;
continue;
}
glow = c;
continue;
}
}
if (arg is "p" or "prefix" or "pre")
{
if (prefix != null)
{
ChatGui.PrintError($"Duplicate Option in Set: '{a}'", "SpotifyHonorific");
return;
}
prefix = true;
continue;
}
if (arg is "s" or "suffix")
{
if (prefix != null)
{
ChatGui.PrintError($"Duplicate Option in Set: '{a}'", "SpotifyHonorific");
return;
}
prefix = false;
continue;
}
ChatGui.PrintError($"Invalid Option in Set: '{a}'", "SpotifyHonorific");
return;
}
Config.ActivityConfigs.First().Color = color;
Config.ActivityConfigs.First().Glow = glow;
Config.ActivityConfigs.First().IsPrefix = prefix ?? false;
ChatGui.Print("Updated Title", "SpotifyHonorific");
}
else else
{ {
ChatGui.Print(CommandHelpMessage); ChatGui.Print(CommandHelpMessage);

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Dalamud.NET.Sdk/12.0.2"> <Project Sdk="Dalamud.NET.Sdk/13.0.0">
<PropertyGroup> <PropertyGroup>
<Description>Update honorific title based on spotify informations</Description> <Description>Update honorific title based on spotify informations</Description>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
@@ -9,4 +9,13 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Scriban" Version="6.0.0" /> <PackageReference Include="Scriban" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Remove="ImGui.NET" />
<Reference Include="Dalamud.Bindings.ImGui" Private="false" />
<Reference Include="Dalamud.Bindings.ImPlot" Private="false" />
<Reference Include="Dalamud.Bindings.ImGuizmo" Private="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="DalamudPackager" Version="13.0.0" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,7 +1,7 @@
using Dalamud.Interface.Utility; using Dalamud.Interface.Utility;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System.Numerics; using System.Numerics;
namespace SpotifyHonorific.Utils; namespace SpotifyHonorific.Utils;

View File

@@ -2,7 +2,7 @@ using Dalamud.Interface.Windowing;
using Dalamud.Utility; using Dalamud.Utility;
using SpotifyHonorific.Updaters; using SpotifyHonorific.Updaters;
using SpotifyHonorific.Utils; using SpotifyHonorific.Utils;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System.Numerics; using System.Numerics;
namespace SpotifyHonorific.Windows; namespace SpotifyHonorific.Windows;

View File

@@ -4,9 +4,9 @@
"net9.0-windows7.0": { "net9.0-windows7.0": {
"DalamudPackager": { "DalamudPackager": {
"type": "Direct", "type": "Direct",
"requested": "[12.0.0, )", "requested": "[13.0.0, )",
"resolved": "12.0.0", "resolved": "13.0.0",
"contentHash": "J5TJLV3f16T/E2H2P17ClWjtfEBPpq3yxvqW46eN36JCm6wR+EaoaYkqG9Rm5sHqs3/nK/vKjWWyvEs/jhKoXw==" "contentHash": "Mb3cUDSK/vDPQ8gQIeuCw03EMYrej1B4J44a1AvIJ9C759p9XeqdU9Hg4WgOmlnlPe0G7ILTD32PKSUpkQNa8w=="
}, },
"DotNet.ReproducibleBuilds": { "DotNet.ReproducibleBuilds": {
"type": "Direct", "type": "Direct",