GatheringPathRenderer: minor updates
This commit is contained in:
parent
1f4dc134ef
commit
1773afea46
@ -1,5 +1,5 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup Condition="$(MSBuildProjectName) != 'GatheringPathRenderer'">
|
||||||
<Version>4.13</Version>
|
<Version>4.13</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
1
GatheringPathRenderer/.gitignore
vendored
Normal file
1
GatheringPathRenderer/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/dist
|
21
GatheringPathRenderer/DalamudPackager.targets
Normal file
21
GatheringPathRenderer/DalamudPackager.targets
Normal 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>
|
@ -1,4 +1,11 @@
|
|||||||
<Project Sdk="Dalamud.NET.Sdk/11.0.0">
|
<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>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\LLib\LLib.csproj" />
|
<ProjectReference Include="..\LLib\LLib.csproj" />
|
||||||
<ProjectReference Include="..\Questionable.Model\Questionable.Model.csproj" />
|
<ProjectReference Include="..\Questionable.Model\Questionable.Model.csproj" />
|
||||||
@ -6,4 +13,5 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="..\LLib\LLib.targets"/>
|
<Import Project="..\LLib\LLib.targets"/>
|
||||||
|
<Import Project="..\LLib\RenameZip.targets"/>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"Name": "GatheringPathRenderer",
|
"Name": "GatheringPathRenderer",
|
||||||
"Author": "Liza Carvelli",
|
"Author": "Liza Carvelli",
|
||||||
"Punchline": "dev only plugin: Renders gathering location.",
|
"Punchline": "[Questionable dev plugin]: Renders gathering location.",
|
||||||
"Description": "dev only plugin: Renders gathering location (without ECommons polluting the entire normal project)."
|
"Description": "[Questionable dev plugin]: Renders gathering location using Splatoon.",
|
||||||
|
"RepoUrl": "https://git.carvel.li/liza/Questionable/src/branch/master/GatheringPathRenderer"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
@ -17,11 +18,11 @@ using ECommons.Schedulers;
|
|||||||
using ECommons.SplatoonAPI;
|
using ECommons.SplatoonAPI;
|
||||||
using GatheringPathRenderer.Windows;
|
using GatheringPathRenderer.Windows;
|
||||||
using LLib.GameData;
|
using LLib.GameData;
|
||||||
using Questionable.Model;
|
|
||||||
using Questionable.Model.Gathering;
|
using Questionable.Model.Gathering;
|
||||||
|
|
||||||
namespace GatheringPathRenderer;
|
namespace GatheringPathRenderer;
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
|
||||||
public sealed class RendererPlugin : IDalamudPlugin
|
public sealed class RendererPlugin : IDalamudPlugin
|
||||||
{
|
{
|
||||||
private const long OnTerritoryChange = -2;
|
private const long OnTerritoryChange = -2;
|
||||||
@ -56,8 +57,10 @@ public sealed class RendererPlugin : IDalamudPlugin
|
|||||||
|
|
||||||
_editorCommands = new EditorCommands(this, dataManager, commandManager, targetManager, clientState, chatGui,
|
_editorCommands = new EditorCommands(this, dataManager, commandManager, targetManager, clientState, chatGui,
|
||||||
configuration);
|
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 };
|
{ IsOpen = true };
|
||||||
|
_windowSystem.AddWindow(configWindow);
|
||||||
_windowSystem.AddWindow(_editorWindow);
|
_windowSystem.AddWindow(_editorWindow);
|
||||||
_currentClassJob = (EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId ?? EClassJob.Adventurer;
|
_currentClassJob = (EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId ?? EClassJob.Adventurer;
|
||||||
|
|
||||||
@ -78,6 +81,7 @@ public sealed class RendererPlugin : IDalamudPlugin
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
DirectoryInfo? solutionDirectory = _pluginInterface.AssemblyLocation.Directory?.Parent?.Parent?.Parent;
|
DirectoryInfo? solutionDirectory = _pluginInterface.AssemblyLocation.Directory?.Parent?.Parent?.Parent;
|
||||||
if (solutionDirectory != null)
|
if (solutionDirectory != null)
|
||||||
{
|
{
|
||||||
@ -88,6 +92,12 @@ public sealed class RendererPlugin : IDalamudPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception("Unable to resolve project path");
|
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
|
try
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
foreach (var expansionFolder in ExpansionData.ExpansionFolders.Values)
|
foreach (var expansionFolder in ExpansionData.ExpansionFolders.Values)
|
||||||
LoadFromDirectory(
|
LoadFromDirectory(
|
||||||
new DirectoryInfo(Path.Combine(PathsDirectory.FullName, expansionFolder)));
|
new DirectoryInfo(Path.Combine(PathsDirectory.FullName, expansionFolder)));
|
||||||
|
|
||||||
_pluginLog.Information(
|
_pluginLog.Information(
|
||||||
$"Loaded {_gatheringLocations.Count} gathering root locations from project directory");
|
$"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)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
33
GatheringPathRenderer/Windows/ConfigWindow.cs
Normal file
33
GatheringPathRenderer/Windows/ConfigWindow.cs
Normal 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);
|
||||||
|
}
|
@ -6,6 +6,7 @@ using System.Numerics;
|
|||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Game.ClientState.Objects.Enums;
|
using Dalamud.Game.ClientState.Objects.Enums;
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
@ -32,8 +33,8 @@ internal sealed class EditorWindow : Window
|
|||||||
_targetLocation;
|
_targetLocation;
|
||||||
|
|
||||||
public EditorWindow(RendererPlugin plugin, EditorCommands editorCommands, IDataManager dataManager,
|
public EditorWindow(RendererPlugin plugin, EditorCommands editorCommands, IDataManager dataManager,
|
||||||
ITargetManager targetManager, IClientState clientState, IObjectTable objectTable)
|
ITargetManager targetManager, IClientState clientState, IObjectTable objectTable, ConfigWindow configWindow)
|
||||||
: base("Gathering Path Editor###QuestionableGatheringPathEditor",
|
: base($"Gathering Path Editor {typeof(EditorWindow).Assembly.GetName().Version!.ToString(2)}###QuestionableGatheringPathEditor",
|
||||||
ImGuiWindowFlags.NoFocusOnAppearing | ImGuiWindowFlags.NoNavFocus | ImGuiWindowFlags.AlwaysAutoResize)
|
ImGuiWindowFlags.NoFocusOnAppearing | ImGuiWindowFlags.NoNavFocus | ImGuiWindowFlags.AlwaysAutoResize)
|
||||||
{
|
{
|
||||||
_plugin = plugin;
|
_plugin = plugin;
|
||||||
@ -48,6 +49,20 @@ internal sealed class EditorWindow : Window
|
|||||||
MinimumSize = new Vector2(300, 100),
|
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;
|
RespectCloseHotkey = false;
|
||||||
ShowCloseButton = false;
|
ShowCloseButton = false;
|
||||||
AllowPinning = false;
|
AllowPinning = false;
|
||||||
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user