forked from liza/Questionable
GPR: Only show when on gatherer
This commit is contained in:
parent
4b06c24da5
commit
59684ce212
@ -1,5 +1,6 @@
|
||||
<Project Sdk="Dalamud.NET.Sdk/10.0.0">
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LLib\LLib.csproj" />
|
||||
<ProjectReference Include="..\Questionable.Model\Questionable.Model.csproj" />
|
||||
<ProjectReference Include="..\vendor\ECommons\ECommons\ECommons.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -14,6 +14,7 @@ using ECommons;
|
||||
using ECommons.Schedulers;
|
||||
using ECommons.SplatoonAPI;
|
||||
using GatheringPathRenderer.Windows;
|
||||
using LLib.GameData;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Gathering;
|
||||
|
||||
@ -64,6 +65,7 @@ public sealed class RendererPlugin : IDalamudPlugin
|
||||
|
||||
_pluginInterface.UiBuilder.Draw += _windowSystem.Draw;
|
||||
_clientState.TerritoryChanged += TerritoryChanged;
|
||||
_clientState.ClassJobChanged += ClassJobChanged;
|
||||
if (_clientState.IsLoggedIn)
|
||||
TerritoryChanged(_clientState.TerritoryType);
|
||||
}
|
||||
@ -174,9 +176,15 @@ public sealed class RendererPlugin : IDalamudPlugin
|
||||
|
||||
private void TerritoryChanged(ushort territoryId) => Redraw();
|
||||
|
||||
internal void Redraw()
|
||||
private void ClassJobChanged(uint classJobId) => Redraw((EClassJob)classJobId);
|
||||
|
||||
internal void Redraw() => Redraw((EClassJob)_clientState.LocalPlayer!.ClassJob.Id);
|
||||
|
||||
private void Redraw(EClassJob classJob)
|
||||
{
|
||||
Splatoon.RemoveDynamicElements("GatheringPathRenderer");
|
||||
if (!classJob.IsGatherer())
|
||||
return;
|
||||
|
||||
var elements = GetLocationsInTerritory(_clientState.TerritoryType)
|
||||
.SelectMany(location =>
|
||||
@ -289,6 +297,7 @@ public sealed class RendererPlugin : IDalamudPlugin
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_clientState.ClassJobChanged -= ClassJobChanged;
|
||||
_clientState.TerritoryChanged -= TerritoryChanged;
|
||||
_pluginInterface.UiBuilder.Draw -= _windowSystem.Draw;
|
||||
|
||||
|
@ -92,6 +92,12 @@
|
||||
"ecommons": {
|
||||
"type": "Project"
|
||||
},
|
||||
"llib": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"DalamudPackager": "[2.1.13, )"
|
||||
}
|
||||
},
|
||||
"questionable.model": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
|
Loading…
Reference in New Issue
Block a user