fix: use agentmap directly for offsets

This commit is contained in:
Anna 2024-02-17 23:55:36 -05:00
parent 3f84307b61
commit 4bc2f0d841
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 14 additions and 4 deletions

View File

@ -3,10 +3,12 @@ using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.Game.Housing;
using FFXIVClientStructs.FFXIV.Client.Game.Object;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.FFXIV.Client.Graphics.Environment;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using Lumina.Excel.GeneratedSheets;
using Map = Lumina.Excel.GeneratedSheets.Map;
namespace Screenie;
@ -33,6 +35,9 @@ public class ScreenshotMetadata {
EorzeaTime eorzea;
uint ward;
uint plot;
short offsetX;
short offsetY;
float scale;
Weather? weather;
Map? map;
unsafe {
@ -56,14 +61,19 @@ public class ScreenshotMetadata {
var weatherId = env->ActiveWeather;
weather = plugin.DataManager.GetExcelSheet<Weather>()?.GetRow(weatherId);
var mapId = AgentMap.Instance()->CurrentMapId;
var agentMap = AgentMap.Instance();
offsetX = agentMap->CurrentOffsetX;
offsetY = agentMap->CurrentOffsetY;
scale = agentMap->CurrentMapSizeFactorFloat;
var mapId = agentMap->CurrentMapId;
map = plugin.DataManager.GetExcelSheet<Map>()?.GetRow(mapId);
var territoryInfo = TerritoryInfo.Instance();
Plugin.Log.Info(plugin.DataManager.GetExcelSheet<PlaceName>()?.GetRow(territoryInfo->AreaPlaceNameID)?.Name.ToDalamudString().TextValue ?? "???");
Plugin.Log.Info(plugin.DataManager.GetExcelSheet<PlaceName>()?.GetRow(territoryInfo->SubAreaPlaceNameID)?.Name.ToDalamudString().TextValue ?? "???");
}
var territory = plugin.DataManager.GetExcelSheet<TerritoryType>()?.GetRow(plugin.ClientState.TerritoryType);
var offsetX = map?.OffsetX ?? 0;
var offsetY = map?.OffsetY ?? 0;
var scale = map?.SizeFactor ?? 0;
Character? active = null;
World? world = null;