[gbrainy/difficulty] Remove difficulty from client
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbrainy/difficulty] Remove difficulty from client
- Date: Sat, 3 Sep 2022 18:03:46 +0000 (UTC)
commit c8b4e334d76c7854c90d7f326ba3eac431200fe8
Author: Jordi Mas <jmas softcatala org>
Date: Sat Sep 3 19:48:16 2022 +0200
Remove difficulty from client
src/Clients/Classical/Dialogs/PdfExportDialog.cs | 31 +--------
src/Clients/Classical/Dialogs/PreferencesDialog.cs | 28 --------
.../Classical/Dialogs/ui/PdfExportDialog.ui | 78 ---------------------
.../Classical/Dialogs/ui/PreferencesDialog.ui | 81 ----------------------
src/Clients/Classical/gbrainy.cs | 2 -
src/Core/Main/GameTips.cs | 16 ++---
src/Core/Views/WelcomeView.cs | 5 --
7 files changed, 8 insertions(+), 233 deletions(-)
---
diff --git a/src/Clients/Classical/Dialogs/PdfExportDialog.cs
b/src/Clients/Classical/Dialogs/PdfExportDialog.cs
index 2c23e9d5..9eb900f6 100644
--- a/src/Clients/Classical/Dialogs/PdfExportDialog.cs
+++ b/src/Clients/Classical/Dialogs/PdfExportDialog.cs
@@ -30,9 +30,6 @@ namespace gbrainy.Clients.Classical.Dialogs
[Builder.Object] Gtk.Box hbox_file;
[Builder.Object] Gtk.SpinButton games_spinbutton;
[Builder.Object] Gtk.CheckButton colorblindcheckbutton;
- [Builder.Object] Gtk.RadioButton rb_easy;
- [Builder.Object] Gtk.RadioButton rb_medium;
- [Builder.Object] Gtk.RadioButton rb_master;
[Builder.Object] Gtk.CheckButton checkbox_logic;
[Builder.Object] Gtk.CheckButton checkbox_calculation;
[Builder.Object] Gtk.CheckButton checkbox_verbal;
@@ -51,18 +48,6 @@ namespace gbrainy.Clients.Classical.Dialogs
games_spinbutton.Value = 10;
checkbox_logic.Active = checkbox_calculation.Active = checkbox_verbal.Active = true;
- // Use defaults from Preferences
- switch ((GameDifficulty) Preferences.Get <int> (Preferences.DifficultyKey)) {
- case GameDifficulty.Easy:
- rb_easy.Active = rb_easy.HasFocus = true;
- break;
- case GameDifficulty.Medium:
- rb_medium.Active = rb_medium.HasFocus = true;
- break;
- case GameDifficulty.Master:
- rb_master.Active = rb_master.HasFocus = true;
- break;
- }
// File selection
string def_file;
string def_dir = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
@@ -108,18 +93,6 @@ namespace gbrainy.Clients.Classical.Dialogs
}
}
- GameDifficulty Difficulty {
- get {
- if (rb_easy.Active)
- return GameDifficulty.Easy;
-
- if (rb_master.Active)
- return GameDifficulty.Master;
-
- return GameDifficulty.Medium;
- }
- }
-
void OnOK (object sender, EventArgs args)
{
GameSession.Types types = GameSession.Types.None;
@@ -142,12 +115,11 @@ namespace gbrainy.Clients.Classical.Dialogs
GeneratePdf (types,
(int) games_spinbutton.Value,
sides,
- Difficulty,
colorblindcheckbutton.Active,
file.Filename);
}
- void GeneratePdf (GameSession.Types types, int num_games, int gamespage, GameDifficulty
difficulty, bool colorblind, string filename)
+ void GeneratePdf (GameSession.Types types, int num_games, int gamespage, bool colorblind,
string filename)
{
Game [] games;
GameSession session;
@@ -158,7 +130,6 @@ namespace gbrainy.Clients.Classical.Dialogs
session = new GameSession (Translations);
session.GameManager = manager;
session.PlayList.ColorBlind = colorblind;
- session.PlayList.Difficulty = difficulty;
session.PlayList.GameType = types;
for (int n = 0; n < num_games; n++)
diff --git a/src/Clients/Classical/Dialogs/PreferencesDialog.cs
b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
index 11a44ec1..86b3bd59 100644
--- a/src/Clients/Classical/Dialogs/PreferencesDialog.cs
+++ b/src/Clients/Classical/Dialogs/PreferencesDialog.cs
@@ -31,9 +31,6 @@ namespace gbrainy.Clients.Classical.Dialogs
[Builder.Object] Gtk.SpinButton minplayedspinbutton;
[Builder.Object] Gtk.CheckButton prefcheckbutton;
[Builder.Object] Gtk.CheckButton colorblindcheckbutton;
- [Builder.Object] Gtk.RadioButton rb_easy;
- [Builder.Object] Gtk.RadioButton rb_medium;
- [Builder.Object] Gtk.RadioButton rb_master;
[Builder.Object] Gtk.ComboBox themes_combobox;
[Builder.Object] Gtk.CheckButton englishcheckbutton;
[Builder.Object] Gtk.CheckButton usesoundscheckbutton;
@@ -52,18 +49,6 @@ namespace gbrainy.Clients.Classical.Dialogs
englishcheckbutton.Active = Preferences.Get <bool> (Preferences.EnglishKey);
usesoundscheckbutton.Active = Preferences.Get <bool> (Preferences.SoundsKey);
- switch ((GameDifficulty) Preferences.Get <int> (Preferences.DifficultyKey)) {
- case GameDifficulty.Easy:
- rb_easy.Active = rb_easy.HasFocus = true;
- break;
- case GameDifficulty.Medium:
- rb_medium.Active = rb_medium.HasFocus = true;
- break;
- case GameDifficulty.Master:
- rb_master.Active = rb_master.HasFocus = true;
- break;
- }
-
ListStore store = new ListStore (typeof (string), typeof (Theme)); // DisplayName,
theme reference
CellRenderer layout_cell = new CellRendererText ();
themes_combobox.Model = store;
@@ -89,18 +74,6 @@ namespace gbrainy.Clients.Classical.Dialogs
}
}
- private GameDifficulty Difficulty {
- get {
- if (rb_easy.Active)
- return GameDifficulty.Easy;
-
- if (rb_master.Active)
- return GameDifficulty.Master;
-
- return GameDifficulty.Medium;
- }
- }
-
public bool NewThemeSet {set; get; }
private void OnCleanHistory (object sender, EventArgs args)
@@ -121,7 +94,6 @@ namespace gbrainy.Clients.Classical.Dialogs
{
Preferences.Set <int> (Preferences.MemQuestionTimeKey, (int) prefspinbutton.Value);
Preferences.Set <bool> (Preferences.MemQuestionWarnKey, prefcheckbutton.Active);
- Preferences.Set <int> (Preferences.DifficultyKey, (int) Difficulty);
Preferences.Set <int> (Preferences.MaxStoredGamesKey, (int)
maxstoredspinbutton.Value);
Preferences.Set <int> (Preferences.MinPlayedGamesKey, (int)
minplayedspinbutton.Value);
Preferences.Set <bool> (Preferences.ColorBlindKey, colorblindcheckbutton.Active);
diff --git a/src/Clients/Classical/Dialogs/ui/PdfExportDialog.ui
b/src/Clients/Classical/Dialogs/ui/PdfExportDialog.ui
index 6d164b46..6d02a363 100644
--- a/src/Clients/Classical/Dialogs/ui/PdfExportDialog.ui
+++ b/src/Clients/Classical/Dialogs/ui/PdfExportDialog.ui
@@ -211,84 +211,6 @@
<property name="position">3</property>
</packing>
</child>
- <child>
- <object class="GtkBox" id="vbox_dificfulty">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="label27">
- <property name="height_request">25</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Difficulty Level</b></property>
- <property name="use_markup">True</property>
- <property name="single_line_mode">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="rb_easy">
- <property name="label" translatable="yes">Easy</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0.5</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="rb_medium">
- <property name="label" translatable="yes">Medium</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0.5</property>
- <property name="draw_indicator">True</property>
- <property name="group">rb_easy</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="rb_master">
- <property name="label" translatable="yes">Master</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0.5</property>
- <property name="draw_indicator">True</property>
- <property name="group">rb_easy</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
<child>
<object class="GtkBox" id="vbox_ngames">
<property name="visible">True</property>
diff --git a/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
b/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
index 0d4ab3c8..30205d76 100644
--- a/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
+++ b/src/Clients/Classical/Dialogs/ui/PreferencesDialog.ui
@@ -209,87 +209,6 @@
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkBox" id="vbox11">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="label27">
- <property name="height_request">25</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Difficulty Level</b></property>
- <property name="use_markup">True</property>
- <property name="single_line_mode">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="rb_easy">
- <property name="label" translatable="yes">Easy</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0.5</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="rb_medium">
- <property name="label" translatable="yes">Medium</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0.5</property>
- <property name="draw_indicator">True</property>
- <property name="group">rb_easy</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="rb_master">
- <property name="label" translatable="yes">Master</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0.5</property>
- <property name="draw_indicator">True</property>
- <property name="group">rb_easy</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
<child>
<object class="GtkBox" id="vbox9">
<property name="visible">True</property>
diff --git a/src/Clients/Classical/gbrainy.cs b/src/Clients/Classical/gbrainy.cs
index bf865d58..1ba257ae 100644
--- a/src/Clients/Classical/gbrainy.cs
+++ b/src/Clients/Classical/gbrainy.cs
@@ -100,7 +100,6 @@ namespace gbrainy.Clients.Classical
session.DrawRequest += SessionDrawRequest;
session.UpdateUIElement += SessionUpdateUIElement;
session.SynchronizingObject = new GtkSynchronize ();
- session.Difficulty = (GameDifficulty) Preferences.Get <int>
(Preferences.DifficultyKey);
BuildUI ();
}
@@ -536,7 +535,6 @@ namespace gbrainy.Clients.Classical
dialog = new PreferencesDialog (Translations, session.PlayerHistory);
if ((Gtk.ResponseType) dialog.Run () == ResponseType.Ok) {
- session.Difficulty = (GameDifficulty) Preferences.Get <int>
(Preferences.DifficultyKey);
session.PlayList.ColorBlind = Preferences.Get <bool>
(Preferences.ColorBlindKey);
if (dialog.NewThemeSet == true)
diff --git a/src/Core/Main/GameTips.cs b/src/Core/Main/GameTips.cs
index 9b5ddd9c..33254aba 100644
--- a/src/Core/Main/GameTips.cs
+++ b/src/Core/Main/GameTips.cs
@@ -33,7 +33,7 @@ namespace gbrainy.Core.Main
}
public int Count {
- get { return 16; }
+ get { return 15; }
}
// Gets a random tip from the list
@@ -70,20 +70,18 @@ namespace gbrainy.Core.Main
case 7: // Translators: Custom Game Selection is a menu option
return Translations.GetString ("Use the 'Custom Game Selection' to choose
exactly which games you want to play.");
case 8:
- return Translations.GetString ("Use the Settings to adjust the difficulty
level of the game.");
- case 9:
return Translations.GetString ("Association of elements is a common technique
for remembering things.");
- case 10:
+ case 9:
return Translations.GetString ("Grouping elements into categories is a common
technique for remembering things.");
- case 11:
+ case 10:
return Translations.GetString ("Build acronyms using the first letter of each
fact to be remembered.");
- case 12:
+ case 11:
return Translations.GetString ("The enjoyment obtained from a puzzle is
proportional to the time spent on it.");
- case 13:
+ case 11:
return Translations.GetString ("Think of breaking down every problem into
simpler components.");
- case 14:
+ case 13:
return Translations.GetString ("When answering verbal analogies pay attention
to the verb tense.");
- case 15:
+ case 14:
return Translations.GetString ("When you go shopping, try to perform
calculations without the use of a calculator.");
default:
throw new InvalidOperationException ();
diff --git a/src/Core/Views/WelcomeView.cs b/src/Core/Views/WelcomeView.cs
index fbb7b0d8..bfc641a5 100644
--- a/src/Core/Views/WelcomeView.cs
+++ b/src/Core/Views/WelcomeView.cs
@@ -145,11 +145,6 @@ namespace gbrainy.Core.Views
Translations.GetString ("gbrainy is a brain teaser game and trainer to have
fun and to keep your brain trained. It includes:"),
1 - 0.05);
- y = 0.22 + space * 3;
- gr.DrawStringWithWrapping (0.05, y + 0.17, Translations.GetString ("Use the Settings
to adjust the difficulty level of the game."),
- 1 - 0.05);
- gr.Stroke ();
-
foreach (Toolkit.Container container in containers)
container.Draw (gr, area_width, area_height, rtl);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]