Skip to content

Commit

Permalink
Manager: Fix hiding icon column by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Sejsel committed May 3, 2024
1 parent 05abd15 commit bdd3f2f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 28 deletions.
2 changes: 1 addition & 1 deletion ArcdpsLogManager/ArcdpsLogManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Each new log data update causes a revision increase.
See LogDataUpdater for the updates.
-->
<Version>1.11.1.0</Version>
<Version>1.11.1.1</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DebounceThrottle" Version="2.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,8 @@

namespace GW2Scratch.ArcdpsLogManager.Configuration.Migrations;

public class MaxVersionSettingsMigration : ISettingsMigration
public class MaxVersionSettingsMigration(Version maxVersion, Action<StoredSettings> migration) : ISettingsMigration
{
private readonly Version maxVersion;
private readonly Action<StoredSettings> migration;

public MaxVersionSettingsMigration(Version minVersion, Action<StoredSettings> migration)
{
this.maxVersion = minVersion;
this.migration = migration;
}

public bool Applies(Version version)
{
return version < maxVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@

namespace GW2Scratch.ArcdpsLogManager.Configuration.Migrations;

public class NullVersionSettingsMigration : ISettingsMigration
public class NullVersionSettingsMigration(Action<StoredSettings> migration) : ISettingsMigration
{
private readonly Action<StoredSettings> migration;

public NullVersionSettingsMigration(Action<StoredSettings> migration)
{
this.migration = migration;
}

public bool Applies(Version version)
{
return version == null;
Expand Down
11 changes: 6 additions & 5 deletions ArcdpsLogManager/Configuration/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ public static class Settings

private static readonly object WriteLock = new object();

private static readonly List<ISettingsMigration> Migrations = new List<ISettingsMigration>()
{
// Null version is pre-1.4.0.0
new NullVersionSettingsMigration(settings => settings.HiddenLogListColumns.Add("Instabilities"))
};
private static readonly List<ISettingsMigration> Migrations =
[
new NullVersionSettingsMigration(settings => settings.HiddenLogListColumns.Add("Instabilities")),
// Adds the icon column to hidden
new MaxVersionSettingsMigration(new Version(1, 11, 1, 0), settings => settings.HiddenLogListColumns.Add(""))
];

private static StoredSettings Values => Stored.Value;

Expand Down
18 changes: 15 additions & 3 deletions ArcdpsLogManager/Configuration/StoredSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ public class StoredSettings
public bool DpsReportAutoUpload { get; set; } = false;
public bool DpsReportUploadDetailedWvw { get; set; } = false;
public int? MinimumLogDurationSeconds { get; set; } = null;
public List<string> HiddenLogListColumns { get; set; } = new List<string>() {"Character", "Map ID", "Game Version", "arcdps Version", "Instabilities", "Scale"};
public List<string> IgnoredUpdateVersions { get; set; } = new List<string>();
public List<string> PlayerAccountNames { get; set; } = new List<string>();

public List<string> HiddenLogListColumns { get; set; } =
[
"Character",
"Map ID",
"Game Version",
"arcdps Version",
"Instabilities",
"Scale",
""
];

public List<string> IgnoredUpdateVersions { get; set; } = [];
public List<string> PlayerAccountNames { get; set; } = [];

public List<EncounterCategory> WeeklyClearGroups { get; set; } =
[EncounterCategory.Raids, EncounterCategory.StrikeEndOfDragons, EncounterCategory.StrikeSecretsOfTheObscure];
}
1 change: 0 additions & 1 deletion ArcdpsLogManager/Sections/LogList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ private GridView<LogData> ConstructLogGridView(LogDetailPanel detailPanel, Multi
{
HeaderText = "",
DataCell = encounterIconCell,
Visible = false,
});

gridView.Columns.Add(new GridColumn()
Expand Down

0 comments on commit bdd3f2f

Please sign in to comment.