fix: make table work properly
This commit is contained in:
parent
30c4a2abb1
commit
6134ac0c55
|
@ -1,4 +1,5 @@
|
||||||
using ImGuiNET;
|
using System.Numerics;
|
||||||
|
using ImGuiNET;
|
||||||
using Lumina.Excel.GeneratedSheets;
|
using Lumina.Excel.GeneratedSheets;
|
||||||
using Lumina.Text;
|
using Lumina.Text;
|
||||||
|
|
||||||
|
@ -39,6 +40,8 @@ internal class PluginUi : IDisposable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.SetNextWindowSize(new Vector2(780, 450), ImGuiCond.FirstUseEver);
|
||||||
|
|
||||||
if (!ImGui.Begin(this.Plugin.Name, ref this._visible)) {
|
if (!ImGui.Begin(this.Plugin.Name, ref this._visible)) {
|
||||||
ImGui.End();
|
ImGui.End();
|
||||||
return;
|
return;
|
||||||
|
@ -75,41 +78,37 @@ internal class PluginUi : IDisposable {
|
||||||
ImGui.SetNextItemWidth(-1);
|
ImGui.SetNextItemWidth(-1);
|
||||||
ImGui.InputTextWithHint("##search", hint, ref this._searchText, 64);
|
ImGui.InputTextWithHint("##search", hint, ref this._searchText, 64);
|
||||||
|
|
||||||
if (ImGui.BeginChild("##titles")) {
|
if (ImGui.BeginTable("##titles-table", 3, ImGuiTableFlags.ScrollY, ImGui.GetContentRegionAvail())) {
|
||||||
if (ImGui.BeginTable("##titles-table", 3)) {
|
ImGui.TableSetupColumn("Title", ImGuiTableColumnFlags.WidthFixed);
|
||||||
ImGui.TableSetupColumn("Title", ImGuiTableColumnFlags.WidthFixed);
|
ImGui.TableSetupColumn("Achievement", ImGuiTableColumnFlags.WidthFixed);
|
||||||
ImGui.TableSetupColumn("Achievement", ImGuiTableColumnFlags.WidthFixed);
|
ImGui.TableSetupColumn("Category", ImGuiTableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Category", ImGuiTableColumnFlags.WidthStretch);
|
ImGui.TableSetupScrollFreeze(0, 1);
|
||||||
ImGui.TableSetupScrollFreeze(0, 1);
|
|
||||||
|
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
foreach (var title in titles) {
|
foreach (var title in titles) {
|
||||||
ImGui.TableNextRow();
|
ImGui.TableNextRow();
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
if (title.Unlocked) {
|
if (title.Unlocked) {
|
||||||
const ImGuiSelectableFlags flags = ImGuiSelectableFlags.SpanAllColumns
|
const ImGuiSelectableFlags flags = ImGuiSelectableFlags.SpanAllColumns
|
||||||
| ImGuiSelectableFlags.AllowItemOverlap;
|
| ImGuiSelectableFlags.AllowItemOverlap;
|
||||||
// TODO: detect current title?
|
// TODO: detect current title?
|
||||||
if (ImGui.Selectable(title.Text, false, flags)) {
|
if (ImGui.Selectable(title.Text, false, flags)) {
|
||||||
this.Plugin.Functions.SetTitle(title.Row.RowId);
|
this.Plugin.Functions.SetTitle(title.Row.RowId);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ImGui.TextDisabled(title.Text);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
ImGui.TableNextColumn();
|
ImGui.TextDisabled(title.Text);
|
||||||
ImGui.TextUnformatted(title.Achievement?.Name?.RawString ?? "???");
|
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
|
||||||
ImGui.TextUnformatted(title.Achievement?.AchievementCategory.Value?.AchievementKind.Value?.Name?.RawString ?? "???");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.EndTable();
|
ImGui.TableNextColumn();
|
||||||
|
ImGui.TextUnformatted(title.Achievement?.Name?.RawString ?? "???");
|
||||||
|
|
||||||
|
ImGui.TableNextColumn();
|
||||||
|
ImGui.TextUnformatted(title.Achievement?.AchievementCategory.Value?.AchievementKind.Value?.Name?.RawString ?? "???");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.EndChild();
|
ImGui.EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.End();
|
ImGui.End();
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- <Dalamud>$(AppData)\XIVLauncher\addon\Hooks\dev</Dalamud>-->
|
<Dalamud>$(AppData)\XIVLauncher\addon\Hooks\dev</Dalamud>
|
||||||
<Dalamud>/home/ascclemens/dalamud</Dalamud>
|
<!-- <Dalamud>$(DALAMUD_HOME)</Dalamud>-->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(IsCI)' == 'true'">
|
<PropertyGroup Condition="'$(IsCI)' == 'true'">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user