mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-02 05:43:40 +01:00
feat(DtrBar): allow for swapping draw direction
This commit is contained in:
parent
bab7f33e96
commit
f6206bc913
3 changed files with 33 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
|
|
@ -142,10 +142,13 @@ namespace Dalamud.Game.Gui.Dtr
|
|||
|
||||
var collisionNode = dtr->UldManager.NodeList[1];
|
||||
if (collisionNode == null) return;
|
||||
var runningXPos = collisionNode->X;
|
||||
|
||||
var configuration = Service<DalamudConfiguration>.Get();
|
||||
|
||||
// If we are drawing backwards, we should start from the right side of the collision node. That is,
|
||||
// collisionNode->X + collisionNode->Width.
|
||||
var runningXPos = configuration.DtrSwapDirection ? collisionNode->X + collisionNode->Width : collisionNode->X;
|
||||
|
||||
for (var i = 0; i < this.entries.Count; i++)
|
||||
{
|
||||
var data = this.entries[i];
|
||||
|
|
@ -178,8 +181,18 @@ namespace Dalamud.Game.Gui.Dtr
|
|||
|
||||
if (!isHide)
|
||||
{
|
||||
runningXPos -= data.TextNode->AtkResNode.Width + configuration.DtrSpacing;
|
||||
data.TextNode->AtkResNode.SetPositionFloat(runningXPos, 2);
|
||||
var elementWidth = data.TextNode->AtkResNode.Width + configuration.DtrSpacing;
|
||||
|
||||
if (configuration.DtrSwapDirection)
|
||||
{
|
||||
data.TextNode->AtkResNode.SetPositionFloat(runningXPos, 2);
|
||||
runningXPos += elementWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
runningXPos -= elementWidth;
|
||||
data.TextNode->AtkResNode.SetPositionFloat(runningXPos, 2);
|
||||
}
|
||||
}
|
||||
|
||||
this.entries[i] = data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue