mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 05:47:43 +01:00
* Update text-related ImGui calls * Use ImU8String for SafeTextColored * Restore wrapped calls * Update MenuItem call * Use ImGui.Text over ImGui.TextUnformatted * Add ImGui.TextColoredWrapped * Obsolete SafeText helpers * Fix obsoleted calls * SafeTextColored didn't exist before imgui-bindings * Remove %% replacements
56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using Dalamud.Bindings.ImGui;
|
|
using Dalamud.Game.ClientState.Conditions;
|
|
using Dalamud.Utility;
|
|
|
|
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
|
|
|
/// <summary>
|
|
/// Widget for displaying current character condition flags.
|
|
/// </summary>
|
|
internal class ConditionWidget : IDataWindowWidget
|
|
{
|
|
/// <inheritdoc/>
|
|
public bool Ready { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public string[]? CommandShortcuts { get; init; } = { "condition" };
|
|
|
|
/// <inheritdoc/>
|
|
public string DisplayName { get; init; } = "Condition";
|
|
|
|
/// <inheritdoc/>
|
|
public void Load()
|
|
{
|
|
this.Ready = true;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public void Draw()
|
|
{
|
|
var condition = Service<Condition>.Get();
|
|
|
|
#if DEBUG
|
|
ImGui.Text($"ptr: {Util.DescribeAddress(condition.Address)}");
|
|
#endif
|
|
|
|
ImGui.Text("Current Conditions:"u8);
|
|
ImGui.Separator();
|
|
|
|
var didAny = false;
|
|
|
|
for (var i = 0; i < Condition.MaxConditionEntries; i++)
|
|
{
|
|
var typedCondition = (ConditionFlag)i;
|
|
var cond = condition[typedCondition];
|
|
|
|
if (!cond) continue;
|
|
|
|
didAny = true;
|
|
|
|
ImGui.Text($"ID: {i} Enum: {typedCondition}");
|
|
}
|
|
|
|
if (!didAny)
|
|
ImGui.Text("None. Talk to a shop NPC or visit a market board to find out more!"u8);
|
|
}
|
|
}
|