Skip to content

Commit

Permalink
[UI] Fix Current Dimensions (in pixels)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiClone committed Sep 23, 2024
1 parent 2d0d1c9 commit 96d6e90
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public void DrawMigration4to5() {
}
ImGui.End();
}
public void DrawConfig(float x_size, float y_size) {
public void DrawConfig(GCDBar bar) {
if (Migration4to5) DrawMigration4to5();
if (!configEnabled) return;
var scale = ImGui.GetIO().FontGlobalScale;
Expand Down Expand Up @@ -448,7 +448,8 @@ public void DrawConfig(float x_size, float y_size) {
ImGui.Checkbox("Move/resize GCDBar", ref BarWindowMoveable);
if (BarWindowMoveable) {
ImGui.TextDisabled("\tWindow being edited, may ignore further visibility options.");
ImGui.TextDisabled("\tCurent Dimensions (in pixels): " + ((int)(x_size * BarWidthRatio + 2 * BarBorderSizeInt)).ToString()+ "x" +((int)(y_size * BarHeightRatio + 2 * BarBorderSizeInt)).ToString());
var barSize = bar.GetBarSize();
ImGui.TextDisabled($"Current Dimensions (in pixels): {barSize.X}x{barSize.Y}");
}
ImGui.Checkbox("Roll GCDs", ref BarRollGCDs);
if (ImGui.IsItemHovered()){
Expand Down
1 change: 1 addition & 0 deletions src/GCDTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public GCDTracker() {
var abilityManager = AbilityManager.Instance;
var gcdBar = new GCDBar(config, helper, abilityManager);

ui.bar = gcdBar;
ui.Windows = new(){
gcdBar,
new GCDWheel(config, helper, abilityManager),
Expand Down
2 changes: 2 additions & 0 deletions src/UI/GCDBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ private void TriggerQueueAlert() {
go.ActivateAlertIfNeeded(EventType.BarHeightPulse, conf.pulseBarHeightAtQueue, EventCause.Queuelock);
}

public Vector2 GetBarSize() => new (bar_v.Width, bar_v.Height);

public bool ShouldDraw(bool inCombat, bool noUI) {
bool shouldShowBar = conf.BarEnabled && !noUI;
conf.EnabledGBJobs.TryGetValue(DataStore.ClientState.LocalPlayer.ClassJob.Id, out var enabledJobGB);
Expand Down
4 changes: 2 additions & 2 deletions src/UI/PluginUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace GCDTracker.UI {
public class PluginUI(Configuration conf) {
public bool IsVisible { get; set; }
public ComboTracker ct;
public GCDBar bar;
public GCDHelper helper;
public Configuration conf = conf;

Expand All @@ -21,7 +21,7 @@ public class PluginUI(Configuration conf) {
public List<IWindow> Windows;

public void Draw() {
conf.DrawConfig(w_size.X, w_size.Y);
conf.DrawConfig(bar);

if (DataStore.ClientState.LocalPlayer == null)
return;
Expand Down

0 comments on commit 96d6e90

Please sign in to comment.