private void CheckPythonStatus()
{
// Cross Threaded Crap
if (StatsPython.Installed)
{
InstallBox.ForeColor = Color.Green;
InstallBox.Text = "BF2 Statistics server files are currently installed.";
BF2sInstallBtn.Text = "Uninstall BF2 Statistics Python";
BF2sConfigBtn.Enabled = true;
BF2sEditMedalDataBtn.Enabled = true;
// ----------------------------------------------------------
// Try and access the stats pthon config file
// This will throw an exception if a config key is missing, or
// is improperly formated. Missing keys could be a result of an
// update to the files
// ----------------------------------------------------------
try
{
// Updated status based on Ranked Mode Status
if (StatsPython.Config.StatsEnabled)
{
StatsStatusPic.Image = Resources.check;
Tipsy.SetToolTip(StatsStatusPic, "BF2 Server Stats are Enabled (Ranked)");
}
else
{
StatsStatusPic.Image = Resources.error;
Tipsy.SetToolTip(StatsStatusPic, "BF2 Server Stats are Disabled (Non-Ranked)");
}
}
catch (Exception)
{
StatsStatusPic.Image = Resources.warning;
Tipsy.SetToolTip(StatsStatusPic, "Failed to load Stats Python Config");
}
}
else
{
InstallBox.ForeColor = Color.Red;
InstallBox.Text = "BF2 Statistics server files are currently NOT installed";
BF2sInstallBtn.Text = "Install BF2 Statistics Python";
BF2sConfigBtn.Enabled = false;
BF2sEditMedalDataBtn.Enabled = false;
StatsStatusPic.Image = Resources.error;
Tipsy.SetToolTip(StatsStatusPic, "BF2 Statistics server files are currently NOT installed");
}
}