GatheringPathRenderer: minor updates

This commit is contained in:
Liza 2025-01-09 19:34:16 +01:00
parent 1f4dc134ef
commit 1773afea46
Signed by: liza
GPG Key ID: 2C41B84815CF6445
9 changed files with 241 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<PropertyGroup Condition="$(MSBuildProjectName) != 'GatheringPathRenderer'">
<Version>4.13</Version>
</PropertyGroup>
</Project>

1
GatheringPathRenderer/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/dist

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Target Name="PackagePluginDebug" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">
<DalamudPackager
ProjectDir="$(ProjectDir)"
OutputPath="$(OutputPath)"
AssemblyName="$(AssemblyName)"
MakeZip="false"
VersionComponents="2"/>
</Target>
<Target Name="PackagePlugin" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
<DalamudPackager
ProjectDir="$(ProjectDir)"
OutputPath="$(OutputPath)"
AssemblyName="$(AssemblyName)"
MakeZip="true"
VersionComponents="2"
Exclude="GatheringPathRenderer.deps.json;ECommons.xml;ECommons.pdb;LLib.pdb"/>
</Target>
</Project>

View File

@ -1,4 +1,11 @@
<Project Sdk="Dalamud.NET.Sdk/11.0.0">
<PropertyGroup>
<Version>0.1</Version>
<OutputPath>dist</OutputPath>
<PathMap Condition="$(SolutionDir) != ''">$(SolutionDir)=X:\</PathMap>
<Platforms>x64</Platforms>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LLib\LLib.csproj" />
<ProjectReference Include="..\Questionable.Model\Questionable.Model.csproj" />
@ -6,4 +13,5 @@
</ItemGroup>
<Import Project="..\LLib\LLib.targets"/>
<Import Project="..\LLib\RenameZip.targets"/>
</Project>

View File

@ -1,6 +1,7 @@
{
"Name": "GatheringPathRenderer",
"Author": "Liza Carvelli",
"Punchline": "dev only plugin: Renders gathering location.",
"Description": "dev only plugin: Renders gathering location (without ECommons polluting the entire normal project)."
"Punchline": "[Questionable dev plugin]: Renders gathering location.",
"Description": "[Questionable dev plugin]: Renders gathering location using Splatoon.",
"RepoUrl": "https://git.carvel.li/liza/Questionable/src/branch/master/GatheringPathRenderer"
}

View File

@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text.Encodings.Web;
@ -17,11 +18,11 @@ using ECommons.Schedulers;
using ECommons.SplatoonAPI;
using GatheringPathRenderer.Windows;
using LLib.GameData;
using Questionable.Model;
using Questionable.Model.Gathering;
namespace GatheringPathRenderer;
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
public sealed class RendererPlugin : IDalamudPlugin
{
private const long OnTerritoryChange = -2;
@ -56,8 +57,10 @@ public sealed class RendererPlugin : IDalamudPlugin
_editorCommands = new EditorCommands(this, dataManager, commandManager, targetManager, clientState, chatGui,
configuration);
_editorWindow = new EditorWindow(this, _editorCommands, dataManager, targetManager, clientState, objectTable)
var configWindow = new ConfigWindow(pluginInterface, configuration);
_editorWindow = new EditorWindow(this, _editorCommands, dataManager, targetManager, clientState, objectTable, configWindow)
{ IsOpen = true };
_windowSystem.AddWindow(configWindow);
_windowSystem.AddWindow(_editorWindow);
_currentClassJob = (EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId ?? EClassJob.Adventurer;
@ -78,6 +81,7 @@ public sealed class RendererPlugin : IDalamudPlugin
{
get
{
#if DEBUG
DirectoryInfo? solutionDirectory = _pluginInterface.AssemblyLocation.Directory?.Parent?.Parent?.Parent;
if (solutionDirectory != null)
{
@ -88,6 +92,12 @@ public sealed class RendererPlugin : IDalamudPlugin
}
throw new Exception("Unable to resolve project path");
#else
var allPluginsDirectory = _pluginInterface.ConfigFile.Directory ?? throw new Exception("Unknown directory for plugin configs");
return allPluginsDirectory
.CreateSubdirectory("Questionable")
.CreateSubdirectory("GatheringPaths");
#endif
}
}
@ -103,12 +113,18 @@ public sealed class RendererPlugin : IDalamudPlugin
try
{
#if DEBUG
foreach (var expansionFolder in ExpansionData.ExpansionFolders.Values)
LoadFromDirectory(
new DirectoryInfo(Path.Combine(PathsDirectory.FullName, expansionFolder)));
_pluginLog.Information(
$"Loaded {_gatheringLocations.Count} gathering root locations from project directory");
#else
LoadFromDirectory(PathsDirectory);
_pluginLog.Information(
$"Loaded {_gatheringLocations.Count} gathering root locations from {PathsDirectory.FullName} directory");
#endif
}
catch (Exception e)
{

View File

@ -0,0 +1,33 @@
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
using ImGuiNET;
namespace GatheringPathRenderer.Windows;
internal sealed class ConfigWindow : Window
{
private readonly IDalamudPluginInterface _pluginInterface;
private readonly Configuration _configuration;
public ConfigWindow(IDalamudPluginInterface pluginInterface, Configuration configuration)
: base("Gathering Path Config", ImGuiWindowFlags.AlwaysAutoResize)
{
_pluginInterface = pluginInterface;
_configuration = configuration;
AllowPinning = false;
AllowClickthrough = false;
}
public override void Draw()
{
string authorName = _configuration.AuthorName;
if (ImGui.InputText("Author name for new files", ref authorName, 256))
{
_configuration.AuthorName = authorName;
Save();
}
}
private void Save() => _pluginInterface.SavePluginConfig(_configuration);
}

View File

@ -6,6 +6,7 @@ using System.Numerics;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Interface;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin.Services;
@ -32,8 +33,8 @@ internal sealed class EditorWindow : Window
_targetLocation;
public EditorWindow(RendererPlugin plugin, EditorCommands editorCommands, IDataManager dataManager,
ITargetManager targetManager, IClientState clientState, IObjectTable objectTable)
: base("Gathering Path Editor###QuestionableGatheringPathEditor",
ITargetManager targetManager, IClientState clientState, IObjectTable objectTable, ConfigWindow configWindow)
: base($"Gathering Path Editor {typeof(EditorWindow).Assembly.GetName().Version!.ToString(2)}###QuestionableGatheringPathEditor",
ImGuiWindowFlags.NoFocusOnAppearing | ImGuiWindowFlags.NoNavFocus | ImGuiWindowFlags.AlwaysAutoResize)
{
_plugin = plugin;
@ -48,6 +49,20 @@ internal sealed class EditorWindow : Window
MinimumSize = new Vector2(300, 100),
};
TitleBarButtons.Add(new TitleBarButton
{
Icon = FontAwesomeIcon.Cog,
IconOffset = new Vector2(1.5f, 1),
Click = _ => configWindow.IsOpen = true,
Priority = int.MinValue,
ShowTooltip = () =>
{
ImGui.BeginTooltip();
ImGui.Text("Open Configuration");
ImGui.EndTooltip();
}
});
RespectCloseHotkey = false;
ShowCloseButton = false;
AllowPinning = false;

View File

@ -0,0 +1,138 @@
{
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": "liza",
"Steps": [
{
"TerritoryId": 1190,
"InteractionType": "None"
}
],
"Groups": [
{
"Nodes": [
{
"DataId": 34920,
"Locations": [
{
"Position": {
"X": 192.6021,
"Y": 12.31054,
"Z": 631.2545
}
},
{
"Position": {
"X": 194.8373,
"Y": 12.50387,
"Z": 646.5401
}
},
{
"Position": {
"X": 180.8447,
"Y": 12.43262,
"Z": 610.7131
}
}
]
},
{
"DataId": 34919,
"Locations": [
{
"Position": {
"X": 186.171,
"Y": 12.54104,
"Z": 634.9042
}
}
]
}
]
},
{
"Nodes": [
{
"DataId": 34917,
"Locations": [
{
"Position": {
"X": 39.45634,
"Y": -0.06042051,
"Z": 502.3853
}
}
]
},
{
"DataId": 34918,
"Locations": [
{
"Position": {
"X": 46.03248,
"Y": -0.7049216,
"Z": 491.6059
}
},
{
"Position": {
"X": 36.15481,
"Y": -0.0501074,
"Z": 505.9388
}
},
{
"Position": {
"X": 24.72226,
"Y": 0.5922582,
"Z": 528.0809
}
}
]
}
]
},
{
"Nodes": [
{
"DataId": 34922,
"Locations": [
{
"Position": {
"X": 2.302937,
"Y": -4.586716,
"Z": 687.4797
}
},
{
"Position": {
"X": 30.02284,
"Y": -2.447479,
"Z": 704.4326
}
},
{
"Position": {
"X": 41.59287,
"Y": -0.8454803,
"Z": 692.0099
}
}
]
},
{
"DataId": 34921,
"Locations": [
{
"Position": {
"X": 18.47237,
"Y": -2.987581,
"Z": 690.8011
}
}
]
}
]
}
]
}