Skip to content

Commit 420dd17

Browse files
committed
In Combat Only option
1 parent 9a5bda7 commit 420dd17

10 files changed

Lines changed: 39 additions & 12 deletions

StatusTimers/Config/StatusTimerOverlayConfig.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,20 @@ public bool SelfAppliedStatusesOnly
623623
}
624624
} = true;
625625

626+
[JsonProperty]
627+
public bool InCombatOnly
628+
{
629+
get => field;
630+
set
631+
{
632+
if (InCombatOnly != value)
633+
{
634+
field = value;
635+
Notify(nameof(InCombatOnly));
636+
}
637+
}
638+
} = false;
639+
626640
public class NodePartConfig
627641
{
628642
public bool IsVisible { get; set; }

StatusTimers/Nodes/FunctionalNodes/ColorInputRowNode.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// File: StatusTimers/Nodes/FunctionalNodes/ColorInputRowNode.cs
22

33
using KamiToolKit.Nodes;
4+
using Lumina.Text.ReadOnly;
45
using System;
56

67
namespace StatusTimers.Nodes.FunctionalNodes;
@@ -42,10 +43,10 @@ public string Label
4243
set => _labelNode.String = value;
4344
}
4445

45-
public string LabelTooltip
46+
public ReadOnlySeString LabelTooltip
4647
{
47-
get => _labelNode.TooltipString;
48-
set => _labelNode.TooltipString = value;
48+
get => _labelNode.TextTooltip;
49+
set => _labelNode.TextTooltip = value;
4950
}
5051

5152
public int Value

StatusTimers/Nodes/FunctionalNodes/ColorPreviewNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public ColorPreviewNode()
3232
{
3333
IsVisible = true,
3434
TexturePath = GetAlphaTexturePath(),
35-
WrapMode = WrapMode.Tile,
35+
WrapMode = WrapMode.Stretch,
3636
};
3737
_alphaLayer.AttachNode(this);
3838

StatusTimers/Nodes/FunctionalNodes/StatusFilterButtonGroupNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public StatusFilterButtonGroupNode(Func<StatusTimerOverlayConfig> getConfig, Act
3838
Height = 30,
3939
Width = 30,
4040
IsVisible = true,
41-
Tooltip = "Export Filter List",
41+
TextTooltip = "Export Filter List",
4242
TexturePath = Path.Combine(GlobalServices.PluginInterface.AssemblyLocation.Directory?.FullName!, @"Media\Icons\upload.png"),
4343
OnClick = () => FilterListHelper.TryExportFilterListToClipboard(getConfig().FilterList)
4444
};
@@ -49,7 +49,7 @@ public StatusFilterButtonGroupNode(Func<StatusTimerOverlayConfig> getConfig, Act
4949
Height = 30,
5050
Width = 30,
5151
IsVisible = true,
52-
TooltipString = " Import Filter List \n(hold shift to confirm)",
52+
TextTooltip = " Import Filter List \n(hold shift to confirm)",
5353
TexturePath = Path.Combine(GlobalServices.PluginInterface.AssemblyLocation.Directory?.FullName!, @"Media\Icons\download.png"),
5454
OnClick = () => FilterListHelper.TryImportFilterListFromClipboard(getConfig(), onChanged)
5555
};

StatusTimers/Nodes/LayoutNodes/FunctionalSectionNode.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ public FunctionalSectionNode(Func<StatusTimerOverlayConfig> getConfig, NodeKind
9696
});
9797
}
9898

99+
AddNode(new CheckboxOptionNode {
100+
String = "Only show when in combat",
101+
IsChecked = getConfig().InCombatOnly,
102+
OnClick = isChecked => getConfig().InCombatOnly = isChecked
103+
});
104+
99105
RecalculateLayout();
100106
}
101107
}

StatusTimers/Nodes/LayoutNodes/ImportExportResetNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public ImportExportResetNode(
3232
Height = 30,
3333
Width = 30,
3434
IsVisible = true,
35-
Tooltip = " Import Configuration\n(hold shift to confirm)",
35+
TextTooltip = " Import Configuration\n(hold shift to confirm)",
3636
TexturePath = Path.Combine(GlobalServices.PluginInterface.AssemblyLocation.Directory?.FullName!, @"Media\Icons\download.png"),
3737
OnClick = () => ImportExportResetHelper.TryImportConfigFromClipboard(
3838
getOverlay(), getConfig(), onConfigChanged, closeWindow)
@@ -43,7 +43,7 @@ public ImportExportResetNode(
4343
Height = 30,
4444
Width = 30,
4545
IsVisible = true,
46-
Tooltip = "Export Configuration",
46+
TextTooltip = "Export Configuration",
4747
TexturePath = Path.Combine(GlobalServices.PluginInterface.AssemblyLocation.Directory?.FullName!, @"Media\Icons\upload.png"),
4848
OnClick = () => ImportExportResetHelper.TryExportConfigToClipboard(getConfig())
4949
});
@@ -54,7 +54,7 @@ public ImportExportResetNode(
5454
Height = 32,
5555
Width = 100,
5656
String = "Reset",
57-
Tooltip = " Reset configuration\n(hold button to confirm)",
57+
TextTooltip = " Reset configuration\n(hold button to confirm)",
5858
OnClick = () => ImportExportResetHelper.TryResetConfig(
5959
getConfig(), kind, onConfigChanged, closeWindow)
6060
});

StatusTimers/Nodes/LayoutNodes/VisualSectionNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public VisualSectionNode(
2525
String = "Locked",
2626
IsChecked = overlay.IsLocked,
2727
OnClick = isChecked => { overlay.IsLocked = isChecked; },
28-
Tooltip = "When locked, the overlay cannot be moved or resized."
28+
TextTooltip = "When locked, the overlay cannot be moved or resized."
2929
},
3030
new CheckboxOptionNode {
3131
String = "Preview Mode",
3232
IsChecked = overlay.IsPreviewEnabled,
3333
OnClick = isChecked => { overlay.IsPreviewEnabled = isChecked; },
34-
Tooltip = "When enabled, will show random statuses to test with."
34+
TextTooltip = "When enabled, will show random statuses to test with."
3535
},
3636
20
3737
));

StatusTimers/Services/Services.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace StatusTimers.Services;
1212
public class Services {
1313
[PluginService] public static IClientState ClientState { get; private set; } = null!;
1414
[PluginService] public static ICommandManager CommandManager { get; private set; } = null!;
15+
[PluginService] public static ICondition Condition { get; private set; } = null!;
1516
[PluginService] public static IDalamudPluginInterface PluginInterface { get; private set; } = null!;
1617
[PluginService] public static IDataManager DataManager { get; private set; } = null!;
1718
[PluginService] public static IFramework Framework { get; private set; } = null!;

StatusTimers/Services/StatusDataSourceManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using System.Linq;
9+
using Dalamud.Game.ClientState.Conditions;
910

1011
namespace StatusTimers.Services;
1112

@@ -40,6 +41,10 @@ public class StatusDataSourceManager<TKey>(
4041
private DateTime _lastDummyUpdateTime;
4142

4243
public List<StatusInfo> FetchAndProcessStatuses(StatusTimerOverlayConfig overlayConfig) {
44+
if (overlayConfig.InCombatOnly && !Services.Condition[ConditionFlag.InCombat]) {
45+
return [];
46+
}
47+
4348
IReadOnlyList<StatusInfo> current;
4449

4550
if (getIsPreviewEnabled()) {

0 commit comments

Comments
 (0)