Adding check to WorldToScreen for coordinates being in front, plus documentation

This commit is contained in:
pmgr 2020-04-29 15:39:26 +01:00
parent 143b8a15fc
commit 87bf498097
2 changed files with 18 additions and 9 deletions

View file

@ -108,9 +108,7 @@ namespace Dalamud.Interface
stateString +=
$" HomeWorld: {pc.HomeWorld.GameData.Name} CurrentWorld: {pc.CurrentWorld.GameData.Name} FC: {pc.CompanyTag}\n";
if (this.drawActors) {
var screenCoords = this.dalamud.Framework.Gui.WorldToScreen(actor.Position);
if (this.drawActors && this.dalamud.Framework.Gui.WorldToScreen(actor.Position, out var screenCoords)) {
ImGui.PushID("ActorWindow" + i);
ImGui.SetNextWindowPos(new Vector2(screenCoords.X, screenCoords.Y));
ImGui.SetNextWindowBgAlpha(0.35f);