feat: get map better
This commit is contained in:
parent
7d1c63800c
commit
37c3004764
|
@ -4,6 +4,7 @@ using Dalamud.Utility;
|
|||
using FFXIVClientStructs.FFXIV.Client.Game.Housing;
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Environment;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Framework;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
|
||||
namespace Screenie;
|
||||
|
@ -27,8 +28,28 @@ public class ScreenshotMetadata {
|
|||
internal const string Unknown = "Unknown";
|
||||
|
||||
internal static ScreenshotMetadata Capture(Plugin plugin) {
|
||||
EorzeaTime eorzea;
|
||||
uint ward;
|
||||
uint plot;
|
||||
Weather? weather;
|
||||
Map? map;
|
||||
unsafe {
|
||||
var framework = Framework.Instance();
|
||||
eorzea = new EorzeaTime((ulong) framework->ClientTime.EorzeaTime);
|
||||
|
||||
var housing = HousingManager.Instance();
|
||||
ward = (uint) housing->GetCurrentWard();
|
||||
plot = (uint) housing->GetCurrentPlot();
|
||||
|
||||
var env = EnvManager.Instance();
|
||||
var weatherId = env->ActiveWeather;
|
||||
weather = plugin.DataManager.GetExcelSheet<Weather>()?.GetRow(weatherId);
|
||||
|
||||
var mapId = AgentMap.Instance()->CurrentMapId;
|
||||
map = plugin.DataManager.GetExcelSheet<Map>()?.GetRow(mapId);
|
||||
}
|
||||
|
||||
var territory = plugin.DataManager.GetExcelSheet<TerritoryType>()?.GetRow(plugin.ClientState.TerritoryType);
|
||||
var map = territory?.Map.Value;
|
||||
var offsetX = map?.OffsetX ?? 0;
|
||||
var offsetY = map?.OffsetY ?? 0;
|
||||
var scale = (float) (map?.SizeFactor ?? 0);
|
||||
|
@ -48,23 +69,6 @@ public class ScreenshotMetadata {
|
|||
.Select(chara => new Character(chara, scale, offsetX, offsetY))
|
||||
.ToArray();
|
||||
|
||||
EorzeaTime eorzea;
|
||||
uint ward;
|
||||
uint plot;
|
||||
Weather? weather;
|
||||
unsafe {
|
||||
var framework = Framework.Instance();
|
||||
eorzea = new EorzeaTime((ulong) framework->ClientTime.EorzeaTime);
|
||||
|
||||
var housing = HousingManager.Instance();
|
||||
ward = (uint) housing->GetCurrentWard();
|
||||
plot = (uint) housing->GetCurrentPlot();
|
||||
|
||||
var env = EnvManager.Instance();
|
||||
var weatherId = env->ActiveWeather;
|
||||
weather = plugin.DataManager.GetExcelSheet<Weather>()?.GetRow(weatherId);
|
||||
}
|
||||
|
||||
return new ScreenshotMetadata {
|
||||
Blake3Hash = "",
|
||||
ActiveCharacter = active,
|
||||
|
|
Loading…
Reference in New Issue