<Project>
- <PropertyGroup>
+ <PropertyGroup Condition="$(MSBuildProjectName) != 'GatheringPathRenderer'">
<Version>4.13</Version>
</PropertyGroup>
</Project>
--- /dev/null
+<?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>
<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" />
</ItemGroup>
<Import Project="..\LLib\LLib.targets"/>
+ <Import Project="..\LLib\RenameZip.targets"/>
</Project>
{
"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"
}
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text.Encodings.Web;
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;
_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;
{
get
{
+#if DEBUG
DirectoryInfo? solutionDirectory = _pluginInterface.AssemblyLocation.Directory?.Parent?.Parent?.Parent;
if (solutionDirectory != null)
{
}
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
}
}
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)
{
--- /dev/null
+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);
+}
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;
_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;
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;
--- /dev/null
+{
+ "$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
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file