Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd23b9e381 | |||
| f299e04189 | |||
| 023418599e | |||
| b124838915 | |||
| 726ecc5688 | |||
| 561811cd1f |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user