update for API 11
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Pilz.Dalamud.ActivityContexts;
|
||||
|
||||
@@ -36,44 +36,35 @@ public class ActivityContextManager : IDisposable
|
||||
|
||||
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;
|
||||
ZoneType newZoneType;
|
||||
|
||||
if (content == null)
|
||||
if (content.PvP)
|
||||
{
|
||||
// No content found, so we must be on the overworld
|
||||
newActivityContext = ActivityType.None;
|
||||
newZoneType = ZoneType.Overworld;
|
||||
newActivityContext = ActivityType.PvpDuty;
|
||||
newZoneType = ZoneType.Pvp;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (content.PvP)
|
||||
{
|
||||
newActivityContext = ActivityType.PvpDuty;
|
||||
newZoneType = ZoneType.Pvp;
|
||||
}
|
||||
else
|
||||
{
|
||||
newActivityContext = ActivityType.PveDuty;
|
||||
newActivityContext = ActivityType.PveDuty;
|
||||
|
||||
// Find correct member type
|
||||
var memberType = content.ContentMemberType.Row;
|
||||
if (content.RowId == 16 || content.RowId == 15)
|
||||
memberType = 2; // Praetorium and Castrum Meridianum
|
||||
else if (content.RowId == 735 || content.RowId == 778)
|
||||
memberType = 127; // Bozja
|
||||
// Find correct member type
|
||||
var memberType = content.ContentMemberType.RowId;
|
||||
if (content.RowId == 16 || content.RowId == 15)
|
||||
memberType = 2; // Praetorium and Castrum Meridianum
|
||||
else if (content.RowId == 735 || content.RowId == 778)
|
||||
memberType = 127; // Bozja
|
||||
|
||||
// Check for ZoneType
|
||||
newZoneType = memberType switch
|
||||
{
|
||||
2 => ZoneType.Doungen,
|
||||
3 => ZoneType.Raid,
|
||||
4 => ZoneType.AllianceRaid,
|
||||
127 => ZoneType.Foray,
|
||||
_ => ZoneType.Doungen,
|
||||
};
|
||||
}
|
||||
// Check for ZoneType
|
||||
newZoneType = memberType switch
|
||||
{
|
||||
2 => ZoneType.Doungen,
|
||||
3 => ZoneType.Raid,
|
||||
4 => ZoneType.AllianceRaid,
|
||||
127 => ZoneType.Foray,
|
||||
_ => ZoneType.Doungen,
|
||||
};
|
||||
}
|
||||
|
||||
CurrentActivityContext = new(newActivityContext, newZoneType);
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using Lumina.Text.ReadOnly;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user