Skip to content

Commit 22bca65

Browse files
committed
7.1
1 parent eed31e1 commit 22bca65

File tree

24 files changed

+161
-75
lines changed

24 files changed

+161
-75
lines changed

AutoRetainer.sln

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OtterGui", "OtterGui\OtterG
2525
EndProject
2626
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ECommons.FileWriter", "ECommons.FileWriter\ECommons.FileWriter\ECommons.FileWriter.csproj", "{100B454B-F244-4125-BCD0-FBC78B31DC50}"
2727
EndProject
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFXIVClientStructs", "FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj", "{2B58FF81-C498-422F-B71D-AA0B6880C449}"
29+
EndProject
30+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropGenerator", "FFXIVClientStructs\InteropGenerator\InteropGenerator.csproj", "{C61DF2C5-A7EA-404B-8812-5771794A9F9A}"
31+
EndProject
32+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropGenerator.Runtime", "FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj", "{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}"
33+
EndProject
34+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFXIVClientStructs.Generators", "FFXIVClientStructs\FFXIVClientStructs.Generators\FFXIVClientStructs.Generators.csproj", "{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}"
35+
EndProject
2836
Global
2937
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3038
Debug|Any CPU = Debug|Any CPU
@@ -97,6 +105,38 @@ Global
97105
{100B454B-F244-4125-BCD0-FBC78B31DC50}.Release|Any CPU.Build.0 = Release|Any CPU
98106
{100B454B-F244-4125-BCD0-FBC78B31DC50}.Release|x64.ActiveCfg = Release|Any CPU
99107
{100B454B-F244-4125-BCD0-FBC78B31DC50}.Release|x64.Build.0 = Release|Any CPU
108+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
109+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Debug|Any CPU.Build.0 = Debug|Any CPU
110+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Debug|x64.ActiveCfg = Debug|Any CPU
111+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Debug|x64.Build.0 = Debug|Any CPU
112+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Release|Any CPU.ActiveCfg = Release|Any CPU
113+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Release|Any CPU.Build.0 = Release|Any CPU
114+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Release|x64.ActiveCfg = Release|Any CPU
115+
{2B58FF81-C498-422F-B71D-AA0B6880C449}.Release|x64.Build.0 = Release|Any CPU
116+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
117+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
118+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Debug|x64.ActiveCfg = Debug|Any CPU
119+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Debug|x64.Build.0 = Debug|Any CPU
120+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
121+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Release|Any CPU.Build.0 = Release|Any CPU
122+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Release|x64.ActiveCfg = Release|Any CPU
123+
{C61DF2C5-A7EA-404B-8812-5771794A9F9A}.Release|x64.Build.0 = Release|Any CPU
124+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
125+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
126+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Debug|x64.ActiveCfg = Debug|Any CPU
127+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Debug|x64.Build.0 = Debug|Any CPU
128+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
129+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Release|Any CPU.Build.0 = Release|Any CPU
130+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Release|x64.ActiveCfg = Release|Any CPU
131+
{C55843F5-DC64-4E9D-9D0D-085DD453C7EC}.Release|x64.Build.0 = Release|Any CPU
132+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
133+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
134+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Debug|x64.ActiveCfg = Debug|Any CPU
135+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Debug|x64.Build.0 = Debug|Any CPU
136+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
137+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Release|Any CPU.Build.0 = Release|Any CPU
138+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Release|x64.ActiveCfg = Release|Any CPU
139+
{808935D9-D13C-49EF-92A4-EBC5A64A8F2A}.Release|x64.Build.0 = Release|Any CPU
100140
EndGlobalSection
101141
GlobalSection(SolutionProperties) = preSolution
102142
HideSolutionNode = FALSE

AutoRetainer/AutoRetainer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ public AutoRetainer(IDalamudPluginInterface pi)
8282
{
8383
P = this;
8484
ECommonsMain.Init(pi, this, Module.DalamudReflector);
85+
#if CUSTOMCS
86+
PluginLog.Warning($"Using custom FFXIVClientStructs");
87+
var gameVersion = DalamudReflector.TryGetDalamudStartInfo(out var ver) ? ver.GameVersion.ToString() : "unknown";
88+
InteropGenerator.Runtime.Resolver.GetInstance.Setup(Svc.SigScanner.SearchBase, gameVersion, new(Svc.PluginInterface.ConfigDirectory.FullName + "/cs.json"));
89+
FFXIVClientStructs.Interop.Generated.Addresses.Register();
90+
InteropGenerator.Runtime.Resolver.GetInstance.Resolve();
91+
#endif
8592
PunishLibMain.Init(pi, Name, PunishOption.DefaultKoFi); // Default button
8693
var cnt = FFXIVInstanceMonitor.GetFFXIVCNT();
8794
PluginLog.Information($"FFXIV instances: {cnt}");

AutoRetainer/AutoRetainer.csproj

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<Authors>Puni.sh</Authors>
5-
<Version>4.4.2.0</Version>
5+
<Version>4.4.2.4</Version>
66
</PropertyGroup>
77

88
<PropertyGroup>
@@ -23,6 +23,7 @@
2323
<Nullable>disable</Nullable>
2424
<NoWarn>CS1591;CS0419</NoWarn>
2525
<Deterministic>true</Deterministic>
26+
<CustomCS>true</CustomCS>
2627
</PropertyGroup>
2728

2829
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
@@ -48,6 +49,22 @@
4849
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
4950
</PropertyGroup>
5051

52+
<ItemGroup Condition="'$(CustomCS)' != 'true'">
53+
<Reference Include="FFXIVClientStructs">
54+
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
55+
<Private>False</Private>
56+
</Reference>
57+
</ItemGroup>
58+
59+
<PropertyGroup Condition="'$(CustomCS)'=='true'">
60+
<DefineConstants>CUSTOMCS</DefineConstants>
61+
</PropertyGroup>
62+
<ItemGroup Condition="'$(CustomCS)'=='true'">
63+
<ProjectReference Include="..\FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj" />
64+
<ProjectReference Include="..\FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj" />
65+
<ProjectReference Include="..\FFXIVClientStructs\InteropGenerator\InteropGenerator.csproj" />
66+
</ItemGroup>
67+
5168
<ItemGroup>
5269
<PackageReference Include="DalamudPackager" Version="2.1.13" />
5370
<PackageReference Include="NotificationMasterAPI" Version="1.0.0.1" />
@@ -71,10 +88,6 @@
7188
<HintPath>$(DalamudLibPath)Lumina.Excel.dll</HintPath>
7289
<Private>False</Private>
7390
</Reference>
74-
<Reference Include="FFXIVClientStructs">
75-
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
76-
<Private>False</Private>
77-
</Reference>
7891
<Reference Include="ImGuiScene">
7992
<HintPath>$(DalamudLibPath)ImGuiScene.dll</HintPath>
8093
<Private>False</Private>
@@ -83,6 +96,10 @@
8396
<HintPath>$(DalamudLibPath)PInvoke.User32.dll</HintPath>
8497
<Private>False</Private>
8598
</Reference>
99+
<Reference Include="Dalamud.Common">
100+
<HintPath>$(DalamudLibPath)Dalamud.Common.dll</HintPath>
101+
<Private>False</Private>
102+
</Reference>
86103
</ItemGroup>
87104

88105
<ItemGroup>

AutoRetainer/Helpers/Censor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Lumina.Misc;
2+
using System.Xml.Linq;
23

34
namespace AutoRetainer.Helpers;
45

@@ -16,6 +17,8 @@ internal static class Censor
1617

1718
internal static string Character(string name, string world)
1819
{
20+
name ??= string.Empty;
21+
world ??= string.Empty;
1922
if(C.NoNames)
2023
{
2124
var n1 = Crc32.Get(Seed + name) % Adjectives.Length;
@@ -31,6 +34,7 @@ internal static string Character(string name, string world)
3134

3235
internal static string Character(string name)
3336
{
37+
name ??= string.Empty;
3438
if(C.NoNames)
3539
{
3640
if(name.Contains('@'))
@@ -50,6 +54,7 @@ internal static string Character(string name)
5054

5155
internal static string World(string world)
5256
{
57+
world ??= string.Empty;
5358
if(C.NoNames)
5459
{
5560
var w = Crc32.Get(Seed + world) % Worlds.Length;

AutoRetainer/Helpers/Utils.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -537,20 +537,6 @@ internal static string GetAdditionalDataKey(ulong cid, string name, bool create
537537
return key;
538538
}
539539

540-
public static SubmarineExplorationPretty Pretty(this SubmarineExploration row)
541-
{
542-
return (SubmarineExplorationPretty)row;
543-
}
544-
545-
public static SubmarineExplorationPretty GetPretty(this Lumina.Excel.ExcelSheet<SubmarineExploration> row, uint value)
546-
{
547-
if(row.TryGetRow(value, out var ret))
548-
{
549-
return ret;
550-
}
551-
return null;
552-
}
553-
554540
public static string UpperCaseStr(ReadOnlySeString s, sbyte article = 0)
555541
{
556542
if(article == 1)
@@ -739,7 +725,7 @@ internal static IGameObject GetEntranceAtLocation(Vector3 pos)
739725
if(IsAddonReady(addon))
740726
{
741727
var textNode = addon->UldManager.NodeList[15]->GetAsAtkTextNode();
742-
var text = MemoryHelper.ReadSeString(&textNode->NodeText).ExtractText();
728+
var text = GenericHelpers.ReadSeString(&textNode->NodeText).ExtractText();
743729
if(compare(text))
744730
{
745731
PluginLog.Verbose($"SelectYesno {text} addon {i} by predicate");
@@ -767,7 +753,7 @@ internal static IGameObject GetEntranceAtLocation(Vector3 pos)
767753
if(IsAddonReady(addon))
768754
{
769755
var textNode = addon->UldManager.NodeList[15]->GetAsAtkTextNode();
770-
var text = MemoryHelper.ReadSeString(&textNode->NodeText).ExtractText().Replace(" ", "").Replace("\n", "");
756+
var text = GenericHelpers.ReadSeString(&textNode->NodeText).ExtractText().Replace(" ", "").Replace("\n", "");
771757
if(text.ContainsAny(s.Select(x => x.Replace(" ", "").Replace("\n", ""))))
772758
{
773759
PluginLog.Verbose($"SelectYesno {s.Print()} addon {i}");

AutoRetainer/Internal/InventoryManagement/NpcSaleManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public static unsafe class NpcSaleManager
1414
internal static List<(uint ID, uint Quantity)> CapturedInventoryState = [];
1515
public static void EnqueueIfItemsPresent()
1616
{
17+
DuoLog.Error("NpcSaleManager Unsupported");
18+
return;
1719
if(GetValidNPC() == null) return;
1820
if(!C.IMEnableNpcSell) return;
1921
foreach(var type in InventorySpaceManager.GetAllowedToSellInventoryTypes())

AutoRetainer/Internal/Memory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ internal void SelectRoutePointUnsafe(int which)
107107
}
108108
}
109109

110+
//48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 8B F2 8B E9
111+
//let it fail for now
110112
private delegate void SellItemDelegate(uint a1, InventoryType a2);
111113
[EzHook("48 89 5C 24 ?? 48 89 6C 24 ?? 56 48 83 EC 20 8B E9", false)]
112114
private EzHook<SellItemDelegate> SellItemHook;

AutoRetainer/Modules/GcHandin/AutoGCHandin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private static bool HandleYesno()
111111
{
112112
if(addon->YesButton->IsEnabled)
113113
{
114-
var str = MemoryHelper.ReadSeString(&addon->PromptText->NodeText).ExtractText().Replace(" ", "");
114+
var str = GenericHelpers.ReadSeString(&addon->PromptText->NodeText).ExtractText().Replace(" ", "");
115115
DebugLog($"SelectYesno encountered: {str}");
116116
//102434 Do you really want to trade a high-quality item?
117117
if(str.Equals(Svc.Data.GetExcelSheet<Lumina.Excel.Sheets.Addon>().GetRow(102434).Text.ExtractText().Replace(" ", "")))
@@ -252,7 +252,7 @@ internal static bool IsSelectedFilterValid(AtkUnitBase* addon)
252252
var step1 = addon->UldManager.NodeList[14];
253253
var step2 = step1->GetAsAtkComponentNode()->Component->UldManager.NodeList[1];
254254
var step3 = step2->GetAsAtkComponentNode()->Component->UldManager.NodeList[2];
255-
var text = MemoryHelper.ReadSeString(&step3->GetAsAtkTextNode()->NodeText).ExtractText();
255+
var text = GenericHelpers.ReadSeString(&step3->GetAsAtkTextNode()->NodeText).ExtractText();
256256
//4619 Hide Armoury Chest Items
257257
//4618 Hide Gear Set Items
258258
//4617 Show All Items

AutoRetainer/Modules/GcHandin/GCContinuation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static void EnqueueDeliveryClose()
5656
{
5757
if(TryGetAddonByName<AtkUnitBase>("ShopExchangeCurrencyDialog", out var addon) && IsAddonReady(addon) && TryGetAddonByName<AtkUnitBase>("GrandCompanyExchange", out var gca) && IsAddonReady(gca))
5858
{
59-
var num = MemoryHelper.ReadSeString(&gca->UldManager.NodeList[52]->GetAsAtkTextNode()->NodeText).ExtractText().Replace(" ", "").Replace(",", "").Replace(".", "").ParseInt();
59+
var num = GenericHelpers.ReadSeString(&gca->UldManager.NodeList[52]->GetAsAtkTextNode()->NodeText).ExtractText().Replace(" ", "").Replace(",", "").Replace(".", "").ParseInt();
6060
if(num != null && EzThrottler.Throttle("GC SetMaxVenturesExchange"))
6161
{
6262
var numeric = (AtkComponentNumericInput*)addon->UldManager.NodeList[8]->GetComponent();

AutoRetainer/Modules/Multi/TaskNeoHET.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,24 @@ public static bool CloseFCChest()
165165

166166
public static IGameObject GetHouseEntranceFromMarkers(IEnumerable<uint> markers)
167167
{
168-
var hud = AgentHUD.Instance();
168+
var entrance = Svc.Objects.Where(x => x.IsTargetable && x.Name.ToString().EqualsIgnoreCaseAny([.. Lang.Entrance, Lang.ApartmentEntrance])).OrderBy(Player.DistanceTo).FirstOrDefault();
169+
PluginLog.Warning($"Temporary HUD bypass is being applied");
170+
return entrance;
171+
/*var hud = AgentHUD.Instance();
169172
if(hud->MapMarkers.Where(x => x.IconId.EqualsAny(markers)).OrderBy(x => Player.DistanceTo(new Vector2(x.X, x.Z))).TryGetFirst(out var marker))
170173
{
171174
var mpos = new Vector2(marker.X, marker.Z);
172175
var entrance = Svc.Objects.Where(x => x.IsTargetable && x.Name.ToString().EqualsIgnoreCaseAny([.. Lang.Entrance, Lang.ApartmentEntrance])).OrderBy(x => Vector2.Distance(x.Position.ToVector2(), mpos)).FirstOrDefault(x => Vector2.Distance(mpos, x.Position.ToVector2()) < ValidPlayerToApartmentDistance);
173176
return entrance;
174177
}
175-
return null;
178+
return null;*/
176179
}
177180

178181
public static bool IsInMarkerHousingPlot(IEnumerable<uint> markers)
179182
{
180183
if(HousingManager.Instance()->GetCurrentPlot() < 0) return false;
184+
PluginLog.Warning($"Temporary HUD bypass is being applied (2)");
185+
return true;
181186
var hud = AgentHUD.Instance();
182187
if(hud->MapMarkers.Where(x => x.IconId.EqualsAny(markers)).TryGetFirst(x => Player.DistanceTo(new Vector2(x.X, x.Z)) < ValidPlayerToApartmentDistance, out var marker))
183188
{

AutoRetainer/Modules/Voyage/VoyageCalculator/Build.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ public RouteBuild(Items hull, Items stern, Items bow, Items bridge)
120120
public int OriginalSub = 0;
121121

122122
public int OptimizedDistance = 0;
123-
public List<SubmarineExplorationPretty> OptimizedRoute = [];
123+
public List<SubmarineExploration> OptimizedRoute = [];
124124
public SubmarineBuild GetSubmarineBuild => new(this);
125125
public static RouteBuild Empty => new();
126126

127-
public int FuelCost => OptimizedRoute.Any() ? OptimizedRoute.Select(p => (int)p.Row.CeruleumTankReq).Sum() : 0;
127+
public int FuelCost => OptimizedRoute.Any() ? OptimizedRoute.Select(p => (int)p.CeruleumTankReq).Sum() : 0;
128128

129129
public string HullIdentifier => ToIdentifier((ushort)Hull);
130130
public string SternIdentifier => ToIdentifier((ushort)Stern);
@@ -151,7 +151,7 @@ public void ChangeMap(int newMap)
151151
OptimizedRoute = [];
152152
}
153153

154-
public void UpdateOptimized((int Distance, List<SubmarineExplorationPretty> Points) optimized)
154+
public void UpdateOptimized((int Distance, List<SubmarineExploration> Points) optimized)
155155
{
156156
OptimizedDistance = optimized.Distance;
157157
OptimizedRoute = optimized.Points;
@@ -187,7 +187,7 @@ public int VoyageDamage()
187187
{
188188
var damaged = 0;
189189
foreach(var sector in OptimizedRoute)
190-
damaged += (335 + sector.Row.RankReq - PartSheet.GetRow((uint)part)!.Rank) * 7;
190+
damaged += (335 + sector.RankReq - PartSheet.GetRow((uint)part)!.Rank) * 7;
191191

192192
if(highestDamage < damaged)
193193
highestDamage = damaged;

AutoRetainer/Modules/Voyage/VoyageCalculator/CurrentSubmarine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static void GetBestExps()
5757
var best = calc.FindBestPath(x);
5858
if(best != null)
5959
{
60-
DuoLog.Information($"Map {x}: {best.Value.path.Select(z => $"{z}/{Svc.Data.GetExcelSheet<SubmarineExploration>().GetPretty(z).Row.Location}").Print()}, {best.Value.duration}, {best.Value.exp} / ");
60+
DuoLog.Information($"Map {x}: {best.Value.path.Select(z => $"{z}/{Svc.Data.GetExcelSheet<SubmarineExploration>().GetRowOrDefault(z)?.Location}").Print()}, {best.Value.duration}, {best.Value.exp} / ");
6161
}
6262
}
6363
VoyageMain.WaitOverlay.IsProcessing = false;

AutoRetainer/Modules/Voyage/VoyageCalculator/SubmarineExplorationPretty.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,32 @@
77

88
namespace AutoRetainer.Modules.Voyage.VoyageCalculator;
99

10-
public class SubmarineExplorationPretty
10+
public static class SubmarineSheetUtils
1111
{
12-
public Vector3 Position { get; private set; }
13-
public SubmarineExploration Row { get; private set; }
14-
15-
public SubmarineExplorationPretty(SubmarineExploration sheet)
12+
public static Vector3 Position(this SubmarineExploration Row)
1613
{
17-
sheet = Row;
18-
Position = new Vector3(sheet.X, sheet.Y, sheet.Z);
14+
return new(Row.X, Row.Y, Row.Z);
1915
}
20-
21-
public static implicit operator SubmarineExplorationPretty(SubmarineExploration sheet) => new(sheet);
2216

23-
public uint GetSurveyTime(float speed)
17+
public static uint GetSurveyTime(this SubmarineExploration Row, float speed)
2418
{
2519
if(speed < 1)
2620
speed = 1;
2721
return (uint)Math.Floor(Row.SurveyDurationmin * 7000 / (speed * 100) * 60);
2822
}
2923

30-
public uint GetVoyageTime(SubmarineExploration other, float speed)
24+
public static uint GetVoyageTime(this SubmarineExploration Row, SubmarineExploration other, float speed)
3125
{
3226
if(speed < 1)
3327
speed = 1;
34-
return (uint)Math.Floor(Vector3.Distance(Position, ((SubmarineExplorationPretty)other).Position) * 3990 / (speed * 100) * 60);
28+
return (uint)Math.Floor(Vector3.Distance(Row.Position(), other.Position()) * 3990 / (speed * 100) * 60);
3529
}
3630

37-
public uint GetDistance(SubmarineExploration other)
31+
public static uint GetDistance(this SubmarineExploration Row, SubmarineExploration other)
3832
{
39-
return (uint)Math.Floor(Vector3.Distance(Position, ((SubmarineExplorationPretty)other).Position) * 0.035);
33+
return (uint)Math.Floor(Vector3.Distance(Row.Position(), other.Position()) * 0.035);
4034
}
4135

42-
public string ConvertDestination() => Utils.UpperCaseStr(Row.Destination);
43-
public string FancyDestination() => $"[{Svc.Data.GetExcelSheet<SubmarineExploration>(ClientLanguage.Japanese).GetRow(Row.RowId).Location}] " + Utils.UpperCaseStr(Row.Destination);
36+
public static string ConvertDestination(this SubmarineExploration Row) => Utils.UpperCaseStr(Row.Destination);
37+
public static string FancyDestination(this SubmarineExploration Row) => $"[{Svc.Data.GetExcelSheet<SubmarineExploration>(ClientLanguage.Japanese).GetRow(Row.RowId).Location}] " + Utils.UpperCaseStr(Row.Destination);
4438
}

AutoRetainer/Modules/Voyage/VoyageCalculator/Voyage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,17 @@ public static (uint Distance, List<SubmarineExploration> Points) PathWalker((Sub
201201

202202
public static uint BestDistance(SubmarineExploration pointA, SubmarineExploration pointB)
203203
{
204-
return pointA.Pretty().GetDistance(pointB);
204+
return pointA.GetDistance(pointB);
205205
}
206206

207207
public static uint VoyageTime(SubmarineExploration pointA, SubmarineExploration pointB, short speed)
208208
{
209-
return pointA.Pretty().GetVoyageTime(pointB, speed);
209+
return pointA.GetVoyageTime(pointB, speed);
210210
}
211211

212212
public static uint SurveyTime(SubmarineExploration point, short speed)
213213
{
214-
return point.Pretty().GetSurveyTime(speed);
214+
return point.GetSurveyTime(speed);
215215
}
216216
#endregion
217217
}

0 commit comments

Comments
 (0)