Skip to content

Commit

Permalink
refactor: remove Installed Options tab
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-is-cute committed Jan 21, 2025
1 parent ab1d302 commit c564537
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
6 changes: 0 additions & 6 deletions Model/HeliosphereMeta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ internal class HeliosphereMeta {
public Guid VariantId { get; set; }

public bool IncludeTags { get; set; }
public Dictionary<string, List<string>> SelectedOptions { get; set; }

public string? ModHash { get; set; }

Expand Down Expand Up @@ -115,7 +114,6 @@ private static async Task MigrateV1(JObject config, CancellationToken token = de

config[nameof(MetaVersion)] = 2u;
config[nameof(IncludeTags)] = true;
config[nameof(SelectedOptions)] = new JObject();
return;
}

Expand Down Expand Up @@ -153,10 +151,6 @@ private static void MigrateV2(JObject config) {
config[nameof(MetaVersion)] = 3u;
}

internal bool IsSimple() {
return this.SelectedOptions.Count == 0;
}

internal bool IsUpdate(string version) {
var currentSuccess = SemVersion.TryParse(this.Version, SemVersionStyles.Strict, out var current);
var newestSuccess = SemVersion.TryParse(version, SemVersionStyles.Strict, out var newest);
Expand Down
27 changes: 0 additions & 27 deletions Ui/Tabs/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ private void DrawPackageInfo() {
if (ImGui.BeginTabBar("package-info-tabs")) {
this.DrawActionsTab(meta);
DrawDescriptionTab(meta);
DrawInstalledOptionsTab(meta);
this.DrawVersionsTab(meta);

ImGui.EndTabBar();
Expand Down Expand Up @@ -381,32 +380,6 @@ private static void DrawDescriptionTab(HeliosphereMeta pkg) {
ImGui.EndTabItem();
}

private static void DrawInstalledOptionsTab(HeliosphereMeta pkg) {
if (!ImGui.BeginTabItem("Installed options")) {
return;
}

if (pkg.IsSimple()) {
ImGui.TextUnformatted("Simple mod - no options available.");
} else if (pkg.SelectedOptions.Count == 0) {
ImGui.TextUnformatted("No options installed.");
}

foreach (var (group, options) in pkg.SelectedOptions) {
if (!ImGui.TreeNodeEx(group)) {
continue;
}

foreach (var option in options) {
ImGui.TextUnformatted(option);
}

ImGui.TreePop();
}

ImGui.EndTabItem();
}

private void DrawVersionsTab(HeliosphereMeta pkg) {
if (!ImGui.BeginTabItem("Versions")) {
this._versionsTabVisible = false;
Expand Down

0 comments on commit c564537

Please sign in to comment.