From 5b9b179e9623c8b6935976ac537b2f9a1996486a Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 24 Oct 2018 14:57:21 +0200 Subject: Scoring type configuration support Fixes michzimny/aktywator#43 --- Aktywator/Bws.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Aktywator/Bws.cs') diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs index e89996f..c112158 100644 --- a/Aktywator/Bws.cs +++ b/Aktywator/Bws.cs @@ -250,7 +250,7 @@ namespace Aktywator settings = new List(); settings.Add(new Setting("ShowResults", main.xShowResults, this, new Version(2, 0, 0), new Version(1, 3, 1))); settings.Add(new Setting("RepeatResults", main.xRepeatResults, this, null, null)); - settings.Add(new Setting("ShowPercentage", main.xShowPercentage, this, null, null)); + settings.Add(new Setting("ShowPercentage", main.xShowPercentage, this, new Version(3, 6, 0), new Version(3, 0, 1))); settings.Add(new Setting("GroupSections", main.xGroupSections, this, new Version(2, 1, 10), new Version(1, 3, 1))); settings.Add(new Setting("ShowPairNumbers", main.xShowPairNumbers, this, null, null)); settings.Add(new Setting("IntermediateResults", main.xIntermediateResults, this, null, new Version(1, 4, 1))); @@ -347,6 +347,7 @@ namespace Aktywator settings.Add(new Setting("BM2ValidateLeadCard", "bit", "false")); settings.Add(new Setting("BM2TDCall", "bit", "false")); settings.Add(new Setting("BM2ShowPlayerNames", "integer", "0")); + settings.Add(new Setting("ScoringType", "integer", "1", "`Section`")); foreach (Setting s in settings) { @@ -525,6 +526,10 @@ namespace Aktywator int.TryParse(Setting.load("BM2ResultsOverview", this, errors, section), out resultsOverview); main.xResultsOverview.SelectedIndex = resultsOverview; + int scoringType = 1; + Int32.TryParse(Setting.load("ScoringType", this, errors, section, "`Section`", "`ID`"), out scoringType); + main.setScoringType(scoringType); + main.checkRecordsForSectionGroups(); if (section == null && main.cbSettingsSection.Items.Count > 2) @@ -584,6 +589,7 @@ namespace Aktywator Setting.save("BM2PINcode", "'" + main.xPINcode.Text + "'", this, errors, section); Setting.save("BM2ResultsOverview", main.xResultsOverview.SelectedIndex.ToString(), this, errors, section); Setting.saveSectionGroups(this.sql, main.xGroupSections.Checked, (this.getMySQLDatabaseForSection() != null) ? Convert.ToInt32(main.numTeamsTableOffset.Value) : 0); + Setting.saveScoringType(this.sql, main.getScoringType(), section); this.loadSettings(); } -- cgit v1.2.3