Skip to content

Commit

Permalink
Work:
Browse files Browse the repository at this point in the history
-FMs stats window work
-".fmsel.cache" to constant
  • Loading branch information
FenPhoenix committed Sep 29, 2020
1 parent 7d0dc82 commit fd5c030
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 92 deletions.
3 changes: 3 additions & 0 deletions AngelLoader/Common/Paths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ internal static void CreateOrClearTempPath(string path)
internal const string NewDarkLoaderIni = "NewDarkLoader.ini";
internal const string FMSelIni = "fmsel.ini";

// A dir that goes in the installed FMs dir and isn't an FM, so we have to ignore it when finding FMs
internal const string FMSelCache = ".fmsel.cache";

#endregion

#region FM backup
Expand Down
2 changes: 1 addition & 1 deletion AngelLoader/FindFMs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ internal static List<int> Find(bool startup = false)
for (int di = 0; di < dirs.Count; di++)
{
string d = dirs[di];
if (!d.EqualsI(".fmsel.cache"))
if (!d.EqualsI(Paths.FMSelCache))
{
perGameInstFMDirsList[gi].Add(d);
perGameInstFMDirsDatesList[gi].Add(dateTimes[di]);
Expand Down
269 changes: 185 additions & 84 deletions AngelLoader/Forms/FMsListStatsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 50 additions & 1 deletion AngelLoader/Forms/FMsListStatsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,63 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AngelLoader.DataClasses;
using static AngelLoader.GameSupport;
using static AngelLoader.Misc;

namespace AngelLoader.Forms
{
public partial class FMsListStatsForm : Form
public sealed partial class FMsListStatsForm : Form
{
public FMsListStatsForm()
{
InitializeComponent();
CalculateStats();
}

private void CalculateStats()
{
FMsInDatabaseTextBox.Text = FMDataIniList.Count.ToString();
AvailableFMsTextBox.Text = FMsViewList.Count.ToString();

int t1FMs = 0;
int t2FMs = 0;
int t3FMs = 0;
int ss2FMs = 0;
int unscannedFMs = 0;
int unsupportedFMs = 0;
for (int i = 0; i < FMsViewList.Count; i++)
{
FanMission fm = FMsViewList[i];
switch (fm.Game)
{
case Game.Thief1:
t1FMs++;
break;
case Game.Thief2:
t2FMs++;
break;
case Game.Thief3:
t3FMs++;
break;
case Game.SS2:
ss2FMs++;
break;
case Game.Null:
unscannedFMs++;
break;
case Game.Unsupported:
unsupportedFMs++;
break;
}
}

T1TextBox.Text = t1FMs.ToString();
T2TextBox.Text = t2FMs.ToString();
T3TextBox.Text = t3FMs.ToString();
SS2TextBox.Text = ss2FMs.ToString();
UnscannedTextBox.Text = unscannedFMs.ToString();
UnsupportedTextBox.Text = unsupportedFMs.ToString();
}
}
}
Loading

0 comments on commit fd5c030

Please sign in to comment.