[Scummvm-git-logs] scummvm master -> fd2dd9253f9e0fa9b5e7e20ec55a1a0ac4389f33
dreammaster
noreply at scummvm.org
Sat Jan 18 09:15:44 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fd2dd9253f GOT: Add missing Skill Level dialog
Commit: fd2dd9253f9e0fa9b5e7e20ec55a1a0ac4389f33
https://github.com/scummvm/scummvm/commit/fd2dd9253f9e0fa9b5e7e20ec55a1a0ac4389f33
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-01-18T01:15:27-08:00
Commit Message:
GOT: Add missing Skill Level dialog
Thanks for Strangerke pointing out I'd completely overlooked it.
Changed paths:
A engines/got/views/dialogs/skill_level.cpp
A engines/got/views/dialogs/skill_level.h
engines/got/module.mk
engines/got/views/dialogs/options_menu.cpp
engines/got/views/views.h
diff --git a/engines/got/module.mk b/engines/got/module.mk
index 1f13935e8da..a4b52280ddf 100644
--- a/engines/got/module.mk
+++ b/engines/got/module.mk
@@ -62,7 +62,8 @@ MODULE_OBJS = \
views/dialogs/select_scroll.o \
views/dialogs/select_slow.o \
views/dialogs/set_music.o \
- views/dialogs/set_sound.o
+ views/dialogs/set_sound.o \
+ views/dialogs/skill_level.o
# This module can be built as a plugin
ifeq ($(ENABLE_GOT), DYNAMIC_PLUGIN)
diff --git a/engines/got/views/dialogs/options_menu.cpp b/engines/got/views/dialogs/options_menu.cpp
index fe8970d63c4..8c6f7e7a1de 100644
--- a/engines/got/views/dialogs/options_menu.cpp
+++ b/engines/got/views/dialogs/options_menu.cpp
@@ -38,7 +38,7 @@ void OptionsMenu::selected() {
addView("SetSound");
break;
case 1:
- // skill level (difficulty level)
+ addView("SkillLevel");
break;
case 2:
g_engine->saveGameDialog();
diff --git a/engines/got/views/dialogs/skill_level.cpp b/engines/got/views/dialogs/skill_level.cpp
new file mode 100644
index 00000000000..a14a8326167
--- /dev/null
+++ b/engines/got/views/dialogs/skill_level.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "got/views/dialogs/skill_level.h"
+#include "got/got.h"
+
+namespace Got {
+namespace Views {
+namespace Dialogs {
+
+static const char *OPTIONS[] = {
+ "Easy Enemies", "Normal Enemies", "Tough Enemies", nullptr
+};
+
+SkillLevel::SkillLevel() : SelectOption("SkillLevel", "Set Skill Level", OPTIONS) {
+}
+
+bool SkillLevel::msgFocus(const FocusMessage &msg) {
+ _selectedItem = _G(setup)._difficultyLevel;
+ return true;
+}
+
+void SkillLevel::selected() {
+ _G(setup)._difficultyLevel = _selectedItem;
+ _G(last_setup) = _G(setup);
+}
+
+} // namespace Dialogs
+} // namespace Views
+} // namespace Got
diff --git a/engines/got/views/dialogs/skill_level.h b/engines/got/views/dialogs/skill_level.h
new file mode 100644
index 00000000000..30cbb97d1c0
--- /dev/null
+++ b/engines/got/views/dialogs/skill_level.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef GOT_VIEWS_DIALOGS_SKILL_LEVEL_H
+#define GOT_VIEWS_DIALOGS_SKILL_LEVEL_H
+
+#include "got/views/dialogs/select_option.h"
+
+namespace Got {
+namespace Views {
+namespace Dialogs {
+
+class SkillLevel : public SelectOption {
+public:
+ SkillLevel();
+ virtual ~SkillLevel() {
+ }
+
+ bool msgFocus(const FocusMessage &msg) override;
+ void selected() override;
+};
+
+} // namespace Dialogs
+} // namespace Views
+} // namespace Got
+
+#endif
diff --git a/engines/got/views/views.h b/engines/got/views/views.h
index 8291ecd06cd..60d67b150b5 100644
--- a/engines/got/views/views.h
+++ b/engines/got/views/views.h
@@ -37,6 +37,7 @@
#include "got/views/dialogs/select_slow.h"
#include "got/views/dialogs/set_music.h"
#include "got/views/dialogs/set_sound.h"
+#include "got/views/dialogs/skill_level.h"
#include "got/views/game.h"
#include "got/views/opening.h"
#include "got/views/part_title.h"
@@ -70,6 +71,7 @@ struct Views {
Dialogs::SelectSlow _selectSlow;
Dialogs::SetMusic _setMusic;
Dialogs::SetSound _setSound;
+ Dialogs::SkillLevel _skillLevel;
};
} // namespace Views
More information about the Scummvm-git-logs
mailing list