mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Remove temp lumina injection; needs to happen somehow, but can hopefully be done a bit more cleanly.
This commit is contained in:
parent
8fbac95b6b
commit
15e8844514
4 changed files with 12 additions and 24 deletions
|
|
@ -88,9 +88,6 @@ namespace Dalamud {
|
||||||
this.Data = new DataManager(this.StartInfo.Language);
|
this.Data = new DataManager(this.StartInfo.Language);
|
||||||
this.Data.Initialize();
|
this.Data.Initialize();
|
||||||
|
|
||||||
// FIXME: need a better way to get this into the string payloads
|
|
||||||
Game.Chat.SeStringHandling.SeString.DataResolver = this.Data;
|
|
||||||
|
|
||||||
this.ClientState = new ClientState(this, info, this.SigScanner);
|
this.ClientState = new ClientState(this, info, this.SigScanner);
|
||||||
|
|
||||||
this.BotManager = new DiscordBotManager(this, this.Configuration.DiscordFeatureConfig);
|
this.BotManager = new DiscordBotManager(this, this.Configuration.DiscordFeatureConfig);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Dalamud.Data;
|
|
||||||
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
|
|
@ -15,15 +14,13 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
{
|
{
|
||||||
public abstract PayloadType Type { get; }
|
public abstract PayloadType Type { get; }
|
||||||
|
|
||||||
protected DataManager dataResolver;
|
|
||||||
|
|
||||||
public abstract void Resolve();
|
public abstract void Resolve();
|
||||||
|
|
||||||
public abstract byte[] Encode();
|
public abstract byte[] Encode();
|
||||||
|
|
||||||
protected abstract void ProcessChunkImpl(BinaryReader reader, long endOfStream);
|
protected abstract void ProcessChunkImpl(BinaryReader reader, long endOfStream);
|
||||||
|
|
||||||
public static Payload Process(BinaryReader reader, DataManager dataResolver)
|
public static Payload Process(BinaryReader reader)
|
||||||
{
|
{
|
||||||
Payload payload = null;
|
Payload payload = null;
|
||||||
if ((byte)reader.PeekChar() != START_BYTE)
|
if ((byte)reader.PeekChar() != START_BYTE)
|
||||||
|
|
@ -35,11 +32,6 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
payload = ProcessChunk(reader);
|
payload = ProcessChunk(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload != null)
|
|
||||||
{
|
|
||||||
payload.dataResolver = dataResolver;
|
|
||||||
}
|
|
||||||
|
|
||||||
return payload;
|
return payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,16 +52,17 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
|
|
||||||
public override void Resolve()
|
public override void Resolve()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Territory))
|
// TODO: add once lumina DI is figured out
|
||||||
{
|
//if (string.IsNullOrEmpty(Territory))
|
||||||
var terrRow = dataResolver.GetExcelSheet<TerritoryType>().GetRow((int)TerritoryTypeId);
|
//{
|
||||||
Territory = dataResolver.GetExcelSheet<PlaceName>().GetRow(terrRow.PlaceName).Name;
|
// var terrRow = dataResolver.GetExcelSheet<TerritoryType>().GetRow((int)TerritoryTypeId);
|
||||||
Zone = dataResolver.GetExcelSheet<PlaceName>().GetRow(terrRow.PlaceNameZone).Name;
|
// Territory = dataResolver.GetExcelSheet<PlaceName>().GetRow(terrRow.PlaceName).Name;
|
||||||
|
// Zone = dataResolver.GetExcelSheet<PlaceName>().GetRow(terrRow.PlaceNameZone).Name;
|
||||||
|
|
||||||
var mapSizeFactor = dataResolver.GetExcelSheet<Map>().GetRow((int)MapId).SizeFactor;
|
// var mapSizeFactor = dataResolver.GetExcelSheet<Map>().GetRow((int)MapId).SizeFactor;
|
||||||
XCoord = ConvertRawPositionToMapCoordinate(RawX, mapSizeFactor);
|
// XCoord = ConvertRawPositionToMapCoordinate(RawX, mapSizeFactor);
|
||||||
YCoord = ConvertRawPositionToMapCoordinate(RawY, mapSizeFactor);
|
// YCoord = ConvertRawPositionToMapCoordinate(RawY, mapSizeFactor);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ProcessChunkImpl(BinaryReader reader, long endOfStream)
|
protected override void ProcessChunkImpl(BinaryReader reader, long endOfStream)
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SeString
|
public class SeString
|
||||||
{
|
{
|
||||||
public static DataManager DataResolver { get; set; }
|
|
||||||
|
|
||||||
public List<Payload> Payloads { get; }
|
public List<Payload> Payloads { get; }
|
||||||
|
|
||||||
public SeString(List<Payload> payloads)
|
public SeString(List<Payload> payloads)
|
||||||
|
|
@ -59,7 +57,7 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
|
|
||||||
while (stream.Position < bytes.Length)
|
while (stream.Position < bytes.Length)
|
||||||
{
|
{
|
||||||
var payload = Payload.Process(reader, DataResolver);
|
var payload = Payload.Process(reader);
|
||||||
if (payload != null)
|
if (payload != null)
|
||||||
payloads.Add(payload);
|
payloads.Add(payload);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue