Compare commits

...

2 Commits

Author SHA1 Message Date
Anna 6a5470f719
chore: update version to 0.3.3 2022-01-05 14:57:28 -05:00
Anna 620e5266c2
feat: update for 6.0 2022-01-05 14:56:56 -05:00
4 changed files with 66 additions and 20 deletions

View File

@ -1,10 +1,11 @@
<Project>
<Target Name="PackagePlugin" AfterTargets="Build" Condition="'$(Configuration)' == 'Release Illegal' or '$(Configuration)' == 'Release Official'">
<DalamudPackager
ProjectDir="$(ProjectDir)"
OutputPath="$(OutputPath)"
AssemblyName="$(AssemblyName)"
VersionComponents="3"
MakeZip="true"/>
<Target Name="PackagePlugin"
AfterTargets="Build"
Condition="'$(Configuration)' == 'Release Illegal' or '$(Configuration)' == 'Release Official'">
<DalamudPackager ProjectDir="$(ProjectDir)"
OutputPath="$(OutputPath)"
AssemblyName="$(AssemblyName)"
VersionComponents="3"
MakeZip="true" />
</Target>
</Project>
</Project>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5-windows</TargetFramework>
<Version>0.3.2</Version>
<Version>0.3.3</Version>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@ -53,8 +53,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.4"/>
<PackageReference Include="DalamudPackager" Version="2.1.5"/>
<PackageReference Include="F23.StringSimilarity" Version="4.1.0"/>
<PackageReference Include="XivCommon" Version="3.2.0"/>
<PackageReference Include="XivCommon" Version="4.0.0-alpha.2"/>
</ItemGroup>
</Project>

View File

@ -11,6 +11,9 @@ namespace RoleplayersToolbox.Tools.Housing {
[44] = 1966110, // Lavender South Subdivision
[45] = 1966110,
},
[HousingArea.Goblet] = new() {
[4] = 1966113, // Goblet Exchange
},
[HousingArea.Shirogane] = new() {
[5] = 1966135, // Southern Shirogane
},

View File

@ -240,6 +240,7 @@ namespace RoleplayersToolbox.Tools.Housing {
this.HighlightSelectString();
this.HighlightResidentialTeleport();
this.HighlightWorldTravel();
this.HighlightTeleportTown();
}
private void ClearIfNear() {
@ -297,7 +298,7 @@ namespace RoleplayersToolbox.Tools.Housing {
}
private unsafe void ClearFlag() {
var mapAgent = (IntPtr) this.Plugin.Common.Functions.GetFramework()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.Map);
var mapAgent = (IntPtr) FFXIVClientStructs.FFXIV.Client.System.Framework.Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.Map);
if (mapAgent != IntPtr.Zero) {
*(byte*) (mapAgent + AgentMapFlagSetOffset) = 0;
}
@ -400,7 +401,7 @@ namespace RoleplayersToolbox.Tools.Housing {
}
var select = (AddonSelectString*) addon;
var list = select->PopupMenu.List;
var list = select->PopupMenu.PopupMenu.List;
if (list == null) {
return;
}
@ -416,13 +417,6 @@ namespace RoleplayersToolbox.Tools.Housing {
return text == " Visit Another World Server.";
}
// TODO: figure out how to use HousingAethernet.Order with current one missing
var placeName = this.Destination?.ClosestAethernet?.PlaceName?.Value?.Name?.ToString();
var currentWard = this.Plugin.Common.Functions.Housing.Location?.Ward;
if (currentWard == this.Destination?.Ward && placeName != null && text.StartsWith(placeName) && text.Length == placeName.Length + 1) {
return true;
}
// ReSharper disable once InvertIf
if (this.Destination?.Ward != null && this.Plugin.ClientState.TerritoryType == this.Destination?.Area?.CityStateTerritoryType()) {
switch (text) {
@ -447,6 +441,54 @@ namespace RoleplayersToolbox.Tools.Housing {
}
}
private unsafe void HighlightTeleportTown() {
var player = this.Plugin.ClientState.LocalPlayer;
if (player == null) {
return;
}
var world = this.Destination?.World;
if (world?.RowId != player.CurrentWorld.Id) {
return;
}
var addon = this.Plugin.GameGui.GetAddonByName("TelepotTown", 1);
if (addon == IntPtr.Zero) {
return;
}
var unit = (AtkUnitBase*) addon;
var root = unit->RootNode;
if (root == null) {
return;
}
var windowNode = root->ChildNode;
var list = windowNode->PrevSiblingNode->PrevSiblingNode;
var treeNode = (AtkComponentNode*) list->ChildNode;
var collisionNode = treeNode->Component->UldManager.RootNode;
var child = collisionNode->PrevSiblingNode;
while (child != null) {
var component = (AtkComponentNode*) child;
if (child->Type != (NodeType) 1020 || component->Component->UldManager.NodeListSize != 7) {
goto End;
}
var childCollisionNode = component->Component->UldManager.RootNode;
var textNode = (AtkTextNode*) childCollisionNode->PrevSiblingNode->PrevSiblingNode->PrevSiblingNode;
var text = textNode->NodeText.ToString();
var placeName = this.Destination?.ClosestAethernet?.PlaceName?.Value?.Name?.ToString();
var currentWard = this.Plugin.Common.Functions.Housing.Location?.Ward;
HighlightIf(&textNode->AtkResNode, currentWard == this.Destination?.Ward && placeName != null && text == placeName);
End:
child = child->PrevSiblingNode;
}
}
private unsafe void HighlightWorldTravel() {
var player = this.Plugin.ClientState.LocalPlayer;
if (player == null) {