Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
tiny adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
atenfyr committed Jan 20, 2021
1 parent 22c541c commit 04d3c2c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
7 changes: 7 additions & 0 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,19 @@ private void Form1_Load(object sender, EventArgs e)

// Initial resize of the menu to fit the table if necessary
AMLUtils.InvokeUI(ForceTableToFit);

AMLUtils.InvokeUI(ForceResize);
AMLUtils.InvokeUI(ForceResize);
}

private void playButton_Click(object sender, EventArgs e)
{
if (ModManager.CurrentlyAggregatingIndexFiles)
{
this.ShowBasicButton("Please wait until online mod aggregation is complete.", "OK", null, null);
return;
}

ModManager.FullUpdate();

if (!Program.CommandLineOptions.ServerMode)
Expand Down
5 changes: 4 additions & 1 deletion ModHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,10 @@ public void UpdateAvailableVersionsFromIndexFiles()
}
}

public bool CurrentlyAggregatingIndexFiles = false;
public void AggregateIndexFiles()
{
CurrentlyAggregatingIndexFiles = true;
if (GlobalIndexFile == null) GlobalIndexFile = new Dictionary<string, IndexMod>();
List<string> DuplicateURLs = new List<string>();
foreach (Mod mod in Mods)
Expand All @@ -501,6 +503,7 @@ public void AggregateIndexFiles()
}

UpdateAvailableVersionsFromIndexFiles();
CurrentlyAggregatingIndexFiles = false;
}

public void SortVersions()
Expand Down Expand Up @@ -841,7 +844,7 @@ public void ApplyProfile(ModProfile prof, bool disableAllMods = true)
ModLookup[entry.Key].Priority = entry.Value.Priority;
ModLookup[entry.Key].IsOptional = entry.Value.IsOptional;
ModLookup[entry.Key].ForceLatest = entry.Value.ForceLatest;
if (entry.Value.ForceLatest || !ModLookup[entry.Key].AvailableVersions.Contains(ModLookup[entry.Key].InstalledVersion))
if (entry.Value.ForceLatest || !ModLookup[entry.Key].AllModData.ContainsKey(ModLookup[entry.Key].InstalledVersion))
{
ModLookup[entry.Key].InstalledVersion = ModLookup[entry.Key].AvailableVersions[0];
}
Expand Down
11 changes: 7 additions & 4 deletions TableHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ internal class ColumnData
{
public string Name;
public ColumnType Type;
public DataGridViewAutoSizeColumnMode OverrideSizeMode;

public ColumnData(string Name, ColumnType Type)
public ColumnData(string Name, ColumnType Type, DataGridViewAutoSizeColumnMode OverrideSizeMode = DataGridViewAutoSizeColumnMode.NotSet)
{
this.Name = Name;
this.Type = Type;
this.OverrideSizeMode = OverrideSizeMode;
}
}

Expand Down Expand Up @@ -71,7 +73,8 @@ private void AddColumns(List<ColumnData> ourColumns)
}

dgc.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
if (i >= (ourColumns.Count - 1)) dgc.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
if (columnData.OverrideSizeMode != DataGridViewAutoSizeColumnMode.NotSet) dgc.AutoSizeMode = columnData.OverrideSizeMode;
//if (i >= (ourColumns.Count - 1)) dgc.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

dgc.SortMode = DataGridViewColumnSortMode.NotSortable;
GridView.Columns.Add(dgc);
Expand Down Expand Up @@ -125,8 +128,8 @@ private void RefreshInternal()
new ColumnData("Version", ColumnType.ComboBox),
new ColumnData("Author", ColumnType.Text),
new ColumnData("Game Build", ColumnType.Text),
ShouldContainOptionalColumn() ? new ColumnData("Optional?", ColumnType.CheckBox) : null,
new ColumnData("", ColumnType.Text)
ShouldContainOptionalColumn() ? new ColumnData("Optional?", ColumnType.CheckBox, DataGridViewAutoSizeColumnMode.ColumnHeader) : null,
//new ColumnData("", ColumnType.Text)
});

List<DataGridViewRow> newRows = new List<DataGridViewRow>();
Expand Down

0 comments on commit 04d3c2c

Please sign in to comment.