fix: use other algorithm
This commit is contained in:
parent
3431f1fa79
commit
0818c77a4e
|
@ -108,9 +108,9 @@ public class Character {
|
||||||
this.HomeWorldId = player.HomeWorld.Id;
|
this.HomeWorldId = player.HomeWorld.Id;
|
||||||
this.RawPosition = player.Position;
|
this.RawPosition = player.Position;
|
||||||
this.MapPosition = new Vector3(
|
this.MapPosition = new Vector3(
|
||||||
ConvertRawPositionToMapCoordinate((int) player.Position.X, scale, offsetX),
|
ConvertMapCoordinateToRawPosition(player.Position.X, scale, offsetX),
|
||||||
ConvertRawPositionToMapCoordinate((int) player.Position.Y, scale, offsetY),
|
ConvertMapCoordinateToRawPosition(player.Position.Y, scale, offsetY),
|
||||||
ConvertRawPositionToMapCoordinate((int) player.Position.Z, scale, 0)
|
ConvertMapCoordinateToRawPosition(player.Position.Z, scale, 0)
|
||||||
);
|
);
|
||||||
this.Level = player.Level;
|
this.Level = player.Level;
|
||||||
this.Job = player.ClassJob.GameData?.Name.ToDalamudString().TextValue ?? ScreenshotMetadata.Unknown;
|
this.Job = player.ClassJob.GameData?.Name.ToDalamudString().TextValue ?? ScreenshotMetadata.Unknown;
|
||||||
|
@ -122,6 +122,11 @@ public class Character {
|
||||||
var num2 = (pos / 1000f + offset) * num1;
|
var num2 = (pos / 1000f + offset) * num1;
|
||||||
return (float) (41.0 / num1 * ((num2 + 1024.0) / 2048.0) + 1.0);
|
return (float) (41.0 / num1 * ((num2 + 1024.0) / 2048.0) + 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int ConvertMapCoordinateToRawPosition(float pos, float scale, short offset) {
|
||||||
|
var num = scale / 100f;
|
||||||
|
return (int) ((float) ((pos - 1.0) * num / 41.0 * 2048.0 - 1024.0) / num * 1000f) - offset * 1000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct EorzeaTime {
|
public struct EorzeaTime {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user