update for API 11

This commit is contained in:
2024-11-22 21:56:41 +01:00
parent 0669b2cecb
commit 5b75e305eb
2 changed files with 30 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
using Lumina.Excel; using Lumina.Excel;
using Lumina.Excel.GeneratedSheets; using Lumina.Excel.Sheets;
namespace Pilz.Dalamud.ActivityContexts; namespace Pilz.Dalamud.ActivityContexts;
@@ -36,18 +36,10 @@ public class ActivityContextManager : IDisposable
private void CheckCurrentTerritory() private void CheckCurrentTerritory()
{ {
var content = contentFinderConditionsSheet.FirstOrDefault(c => c.TerritoryType.Row == PluginServices.ClientState.TerritoryType); var content = contentFinderConditionsSheet.FirstOrDefault(c => c.TerritoryType.RowId == PluginServices.ClientState.TerritoryType);
ActivityType newActivityContext; ActivityType newActivityContext;
ZoneType newZoneType; ZoneType newZoneType;
if (content == null)
{
// No content found, so we must be on the overworld
newActivityContext = ActivityType.None;
newZoneType = ZoneType.Overworld;
}
else
{
if (content.PvP) if (content.PvP)
{ {
newActivityContext = ActivityType.PvpDuty; newActivityContext = ActivityType.PvpDuty;
@@ -58,7 +50,7 @@ public class ActivityContextManager : IDisposable
newActivityContext = ActivityType.PveDuty; newActivityContext = ActivityType.PveDuty;
// Find correct member type // Find correct member type
var memberType = content.ContentMemberType.Row; var memberType = content.ContentMemberType.RowId;
if (content.RowId == 16 || content.RowId == 15) if (content.RowId == 16 || content.RowId == 15)
memberType = 2; // Praetorium and Castrum Meridianum memberType = 2; // Praetorium and Castrum Meridianum
else if (content.RowId == 735 || content.RowId == 778) else if (content.RowId == 735 || content.RowId == 778)
@@ -74,7 +66,6 @@ public class ActivityContextManager : IDisposable
_ => ZoneType.Doungen, _ => ZoneType.Doungen,
}; };
} }
}
CurrentActivityContext = new(newActivityContext, newZoneType); CurrentActivityContext = new(newActivityContext, newZoneType);
ActivityContextChanged?.Invoke(this, CurrentActivityContext); ActivityContextChanged?.Invoke(this, CurrentActivityContext);

View File

@@ -1,4 +1,7 @@
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
using Lumina.Text.ReadOnly;
using System.Runtime.CompilerServices;
using System.Text;
namespace Pilz.Dalamud; namespace Pilz.Dalamud;
@@ -32,4 +35,10 @@ public static class Extensions
} }
} }
} }
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
public static string ParseString(this ReadOnlySeString readOnlySeString)
{
return Encoding.UTF8.GetString(readOnlySeString);
}
} }