fix: use correct place names
This commit is contained in:
parent
37c3004764
commit
3431f1fa79
|
@ -13,8 +13,9 @@ namespace Screenie;
|
|||
public class ScreenshotMetadata {
|
||||
public required string Blake3Hash;
|
||||
public required Character? ActiveCharacter;
|
||||
public required string Territory;
|
||||
public required uint TerritoryId;
|
||||
public required string Location;
|
||||
public required string LocationSub;
|
||||
public required uint TerritoryType;
|
||||
public required string World;
|
||||
public required uint WorldId;
|
||||
public required DateTime CapturedAtLocal;
|
||||
|
@ -48,11 +49,11 @@ public class ScreenshotMetadata {
|
|||
var mapId = AgentMap.Instance()->CurrentMapId;
|
||||
map = plugin.DataManager.GetExcelSheet<Map>()?.GetRow(mapId);
|
||||
}
|
||||
|
||||
|
||||
var territory = plugin.DataManager.GetExcelSheet<TerritoryType>()?.GetRow(plugin.ClientState.TerritoryType);
|
||||
var offsetX = map?.OffsetX ?? 0;
|
||||
var offsetY = map?.OffsetY ?? 0;
|
||||
var scale = (float) (map?.SizeFactor ?? 0);
|
||||
var scale = map?.SizeFactor ?? 0;
|
||||
|
||||
Character? active = null;
|
||||
World? world = null;
|
||||
|
@ -72,8 +73,11 @@ public class ScreenshotMetadata {
|
|||
return new ScreenshotMetadata {
|
||||
Blake3Hash = "",
|
||||
ActiveCharacter = active,
|
||||
Territory = territory?.Name.ToDalamudString().TextValue ?? Unknown,
|
||||
TerritoryId = plugin.ClientState.TerritoryType,
|
||||
Location = map?.PlaceName.Value?.Name.ToDalamudString().TextValue
|
||||
?? territory?.PlaceName.Value?.Name.ToDalamudString().TextValue
|
||||
?? Unknown,
|
||||
LocationSub = map?.PlaceNameSub.Value?.Name.ToDalamudString().TextValue ?? Unknown,
|
||||
TerritoryType = plugin.ClientState.TerritoryType,
|
||||
World = world?.Name.ToDalamudString().TextValue ?? Unknown,
|
||||
WorldId = world?.RowId ?? 0,
|
||||
CapturedAtLocal = timeUtc.ToLocalTime(),
|
||||
|
@ -104,16 +108,16 @@ public class Character {
|
|||
this.HomeWorldId = player.HomeWorld.Id;
|
||||
this.RawPosition = player.Position;
|
||||
this.MapPosition = new Vector3(
|
||||
ConvertRawPositionToMapCoordinate(player.Position.X, scale, offsetX),
|
||||
ConvertRawPositionToMapCoordinate(player.Position.Y, scale, offsetY),
|
||||
ConvertRawPositionToMapCoordinate(player.Position.Z, scale, 0)
|
||||
ConvertRawPositionToMapCoordinate((int) player.Position.X, scale, offsetX),
|
||||
ConvertRawPositionToMapCoordinate((int) player.Position.Y, scale, offsetY),
|
||||
ConvertRawPositionToMapCoordinate((int) player.Position.Z, scale, 0)
|
||||
);
|
||||
this.Level = player.Level;
|
||||
this.Job = player.ClassJob.GameData?.Name.ToDalamudString().TextValue ?? ScreenshotMetadata.Unknown;
|
||||
this.JobId = player.ClassJob.Id;
|
||||
}
|
||||
|
||||
private static float ConvertRawPositionToMapCoordinate(float pos, float scale, short offset) {
|
||||
private static float ConvertRawPositionToMapCoordinate(int pos, float scale, short offset) {
|
||||
var num1 = scale / 100f;
|
||||
var num2 = (pos / 1000f + offset) * num1;
|
||||
return (float) (41.0 / num1 * ((num2 + 1024.0) / 2048.0) + 1.0);
|
||||
|
|
Loading…
Reference in New Issue