mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +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.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.BotManager = new DiscordBotManager(this, this.Configuration.DiscordFeatureConfig);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
||||
using Serilog;
|
||||
|
||||
|
|
@ -15,15 +14,13 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
|||
{
|
||||
public abstract PayloadType Type { get; }
|
||||
|
||||
protected DataManager dataResolver;
|
||||
|
||||
public abstract void Resolve();
|
||||
|
||||
public abstract byte[] Encode();
|
||||
|
||||
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;
|
||||
if ((byte)reader.PeekChar() != START_BYTE)
|
||||
|
|
@ -35,11 +32,6 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
|||
payload = ProcessChunk(reader);
|
||||
}
|
||||
|
||||
if (payload != null)
|
||||
{
|
||||
payload.dataResolver = dataResolver;
|
||||
}
|
||||
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,16 +52,17 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
|||
|
||||
public override void Resolve()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Territory))
|
||||
{
|
||||
var terrRow = dataResolver.GetExcelSheet<TerritoryType>().GetRow((int)TerritoryTypeId);
|
||||
Territory = dataResolver.GetExcelSheet<PlaceName>().GetRow(terrRow.PlaceName).Name;
|
||||
Zone = dataResolver.GetExcelSheet<PlaceName>().GetRow(terrRow.PlaceNameZone).Name;
|
||||
// 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;
|
||||
// Zone = dataResolver.GetExcelSheet<PlaceName>().GetRow(terrRow.PlaceNameZone).Name;
|
||||
|
||||
var mapSizeFactor = dataResolver.GetExcelSheet<Map>().GetRow((int)MapId).SizeFactor;
|
||||
XCoord = ConvertRawPositionToMapCoordinate(RawX, mapSizeFactor);
|
||||
YCoord = ConvertRawPositionToMapCoordinate(RawY, mapSizeFactor);
|
||||
}
|
||||
// var mapSizeFactor = dataResolver.GetExcelSheet<Map>().GetRow((int)MapId).SizeFactor;
|
||||
// XCoord = ConvertRawPositionToMapCoordinate(RawX, mapSizeFactor);
|
||||
// YCoord = ConvertRawPositionToMapCoordinate(RawY, mapSizeFactor);
|
||||
//}
|
||||
}
|
||||
|
||||
protected override void ProcessChunkImpl(BinaryReader reader, long endOfStream)
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
|||
/// </summary>
|
||||
public class SeString
|
||||
{
|
||||
public static DataManager DataResolver { get; set; }
|
||||
|
||||
public List<Payload> Payloads { get; }
|
||||
|
||||
public SeString(List<Payload> payloads)
|
||||
|
|
@ -59,7 +57,7 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
|||
|
||||
while (stream.Position < bytes.Length)
|
||||
{
|
||||
var payload = Payload.Process(reader, DataResolver);
|
||||
var payload = Payload.Process(reader);
|
||||
if (payload != null)
|
||||
payloads.Add(payload);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue