From 067227bbe0e8ca34fff7cf4ddac72175f94ec8b9 Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 18 Nov 2018 01:31:30 +0100 Subject: Game summary at the end of the session available Fixes #51 --- Aktywator/Bws.cs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'Aktywator/Bws.cs') diff --git a/Aktywator/Bws.cs b/Aktywator/Bws.cs index 8c12537..79e5121 100644 --- a/Aktywator/Bws.cs +++ b/Aktywator/Bws.cs @@ -385,8 +385,8 @@ namespace Aktywator } catch (OleDbException) { - } - + } + try { sql.query("CREATE TABLE PlayerNames (ID integer, Name text(18));"); @@ -540,6 +540,10 @@ namespace Aktywator this.sectionGroupWarning(); } + int ranking = 0; + Int32.TryParse(Setting.load("BM2Ranking", this, errors, section), out ranking); + main.xShowRecap.Checked = (ranking > 0) && (Setting.load("BM2GameSummary", this, errors, section).ToUpper().Equals("TRUE")); + if (errors.Length > 0) { MessageBox.Show("Nie można uzyskać dostępu do pól: \n" + errors.ToString() + ".\nPrawdopodobnie te pola nie istnieją.", @@ -602,6 +606,25 @@ namespace Aktywator Setting.saveSectionGroups(this.sql, main.xGroupSections.Checked, 0); Setting.saveScoringType(this.sql, 1, section); } + if (main.xShowRecap.Checked) + { + if (this.getMySQLDatabaseForSection() != null) + { + Setting.saveScoringType(this.sql, 4, section); + Setting.save("BM2SummaryPoints", "0", this, errors, section); + } + else + { + Setting.save("BM2SummaryPoints", "1", this, errors, section); + } + Setting.save("BM2Ranking", "2", this, errors, section); + Setting.save("BM2GameSummary", "true", this, errors, section); + } + else + { + Setting.save("BM2Ranking", "0", this, errors, section); + Setting.save("BM2GameSummary", "false", this, errors, section); + } this.loadSettings(); } -- cgit v1.2.3