[Scummvm-git-logs] scummvm master -> 520391b13da156403170efbb47be1f8bc30ba5b5

dreammaster noreply at scummvm.org
Sun Oct 6 19:12:26 UTC 2024


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:
520391b13d M4: RIDDLE: Added Interface trackIcons


Commit: 520391b13da156403170efbb47be1f8bc30ba5b5
    https://github.com/scummvm/scummvm/commit/520391b13da156403170efbb47be1f8bc30ba5b5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-10-06T12:12:21-07:00

Commit Message:
M4: RIDDLE: Added Interface trackIcons

Changed paths:
  A engines/m4/riddle/gui/game_menu.cpp
  A engines/m4/riddle/gui/game_menu.h
    engines/m4/module.mk
    engines/m4/riddle/gui/gui_cheapo.cpp
    engines/m4/riddle/gui/gui_cheapo.h
    engines/m4/riddle/gui/interface.cpp
    engines/m4/riddle/vars.h


diff --git a/engines/m4/module.mk b/engines/m4/module.mk
index 5bfc7399751..06b8e7b6529 100644
--- a/engines/m4/module.mk
+++ b/engines/m4/module.mk
@@ -181,6 +181,7 @@ MODULE_OBJS = \
 	burger/series_player.o \
 	burger/vars.o \
 	burger/walker.o \
+	riddle/gui/game_menu.o \
 	riddle/gui/gui_cheapo.o \
 	riddle/gui/interface.o \
 	riddle/rooms/room.o \
diff --git a/engines/m4/riddle/gui/game_menu.cpp b/engines/m4/riddle/gui/game_menu.cpp
new file mode 100644
index 00000000000..0783d5c7339
--- /dev/null
+++ b/engines/m4/riddle/gui/game_menu.cpp
@@ -0,0 +1,57 @@
+/* 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 "m4/riddle/gui/game_menu.h"
+#include "m4/riddle/vars.h"
+#include "graphics/thumbnail.h"
+#include "m4/adv_r/other.h"
+#include "m4/adv_r/adv_background.h"
+#include "m4/adv_r/adv_control.h"
+#include "m4/adv_r/adv_player.h"
+#include "m4/core/errors.h"
+#include "m4/core/imath.h"
+#include "m4/gui/gui_event.h"
+#include "m4/gui/hotkeys.h"
+#include "m4/graphics/gr_line.h"
+#include "m4/graphics/gr_sprite.h"
+#include "m4/graphics/krn_pal.h"
+#include "m4/gui/gui_sys.h"
+#include "m4/gui/gui_vmng.h"
+#include "m4/mem/mem.h"
+#include "m4/platform/keys.h"
+#include "m4/m4.h"
+
+namespace M4 {
+namespace Riddle {
+namespace GUI {
+
+void CreateGameMenu(RGB8 *myPalette) {
+	if ((!player_commands_allowed()) || (!INTERFACE_VISIBLE) ||
+		_G(pal_fade_in_progress) || _G(menuSystemInitialized)) {
+		return;
+	}
+
+	warning("TODO: Create game menu");
+}
+
+} // namespace GUI
+} // namespace Riddle
+} // namespace M4
diff --git a/engines/m4/riddle/gui/game_menu.h b/engines/m4/riddle/gui/game_menu.h
new file mode 100644
index 00000000000..663c2596fd2
--- /dev/null
+++ b/engines/m4/riddle/gui/game_menu.h
@@ -0,0 +1,38 @@
+
+/* 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 M4_RIDDLE_GUI_GAME_MENU_H
+#define M4_RIDDLE_GUI_GAME_MENU_H
+
+#include "m4/m4_types.h"
+
+namespace M4 {
+namespace Riddle {
+namespace GUI {
+
+extern void CreateGameMenu(RGB8 *myPalette);
+
+} // namespace GUI
+} // namespace Riddle
+} // namespace M4
+
+#endif
diff --git a/engines/m4/riddle/gui/gui_cheapo.cpp b/engines/m4/riddle/gui/gui_cheapo.cpp
index 18a3d2fa1c5..e46d64649b7 100644
--- a/engines/m4/riddle/gui/gui_cheapo.cpp
+++ b/engines/m4/riddle/gui/gui_cheapo.cpp
@@ -111,6 +111,11 @@ void Inventory::set_scroll(int32 new_scroll) {
 	_must_redraw_all = true;
 }
 
+void Inventory::toggleFlag() {
+	_flag1 = !_flag1;
+	_must_redraw_all = true;
+}
+
 bool Inventory::remove(const Common::String &name) {
 	int iter;
 	for (iter = 0; iter < _num_cells; iter++) {
diff --git a/engines/m4/riddle/gui/gui_cheapo.h b/engines/m4/riddle/gui/gui_cheapo.h
index 427e027598b..4fcc9c62425 100644
--- a/engines/m4/riddle/gui/gui_cheapo.h
+++ b/engines/m4/riddle/gui/gui_cheapo.h
@@ -70,6 +70,7 @@ private:
 	int16 _tag = 0;
 	int16 _num_cells = 0;
 	bool _right_arrow_visible = false;
+	bool _flag1 = false;
 
 	int16 cell_pos_x(int16 index);
 	int16 cell_pos_y(int16 index);
@@ -101,6 +102,7 @@ public:
 	bool need_left() const;
 	bool need_right() const;
 	void set_scroll(int32 new_scroll);
+	void toggleFlag();
 };
 
 } // namespace GUI
diff --git a/engines/m4/riddle/gui/interface.cpp b/engines/m4/riddle/gui/interface.cpp
index f62dca28895..56d776a9e67 100644
--- a/engines/m4/riddle/gui/interface.cpp
+++ b/engines/m4/riddle/gui/interface.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "m4/riddle/gui/interface.h"
+#include "m4/riddle/gui/game_menu.h"
 #include "m4/riddle/gui/gui_cheapo.h"
 #include "m4/riddle/riddle.h"
 #include "m4/riddle/vars.h"
@@ -266,10 +267,6 @@ void Interface::refresh_left_arrow() {
 }
 
 void Interface::trackIcons() {
-#ifdef TODO
-	KernelTriggerType oldMode = _G(kernel).trigger_mode;
-	_G(kernel).trigger_mode = KT_DAEMON;
-
 	switch (_interfaceBox->_highlight_index) {
 	case 4:
 		t_cb();
@@ -282,6 +279,7 @@ void Interface::trackIcons() {
 	case 6:
 		mouse_set_sprite(_arrow);
 		_iconSelected = false;
+		_inventory->toggleFlag();
 
 		if (_btnScrollRight->is_hidden())
 			refresh_right_arrow();
@@ -299,6 +297,11 @@ void Interface::trackIcons() {
 		break;
 
 	case 8:
+		// Game menu
+		GUI::CreateGameMenu(_G(master_palette));
+		break;
+
+	case 9:
 		if (!_btnScrollLeft->is_hidden()) {
 			if (_inventory->need_left()) {
 				_inventory->_scroll = (_inventory->_scroll <= 0) ? 0 :
@@ -308,12 +311,10 @@ void Interface::trackIcons() {
 			refresh_right_arrow();
 			refresh_left_arrow();
 			_inventory->_must_redraw_all = true;
-		} else {
-			return;
 		}
 		break;
 
-	case 9:
+	case 10:
 		if (!_btnScrollRight->is_hidden()) {
 			if (_inventory->need_right())
 				_inventory->_scroll += _inventory->_cells_v;
@@ -321,37 +322,12 @@ void Interface::trackIcons() {
 			refresh_right_arrow();
 			refresh_left_arrow();
 			_inventory->_must_redraw_all = true;
-		} else {
-			return;
 		}
 		break;
 
-	case 10:
-		term_message("Abduct/Fail Button Pressed");
-
-		if (_G(game).section_id == 1) {
-			term_message("Abduct me now!");
-			_G(wilbur_should) = 10017;
-			kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION);
-		} else if (_G(game).section_id == 7) {
-			_G(walker).wilbur_speech("999w023");
-		} else {
-			term_message("Fail me now!");
-			_G(wilbur_should) = 10015;
-			kernel_trigger_dispatch_now(gCHANGE_WILBUR_ANIMATION);
-		}
-		break;
-
-	case 11:
-		// Game menu
-		other_save_game_for_resurrection();
-		CreateGameMenu(_G(master_palette));
+	default:
 		break;
-
 	}
-
-	_G(kernel).trigger_mode = oldMode;
-#endif
 }
 
 ControlStatus Interface::trackHotspots(int event, int x, int y) {
diff --git a/engines/m4/riddle/vars.h b/engines/m4/riddle/vars.h
index a40fe9481e6..907c7de8798 100644
--- a/engines/m4/riddle/vars.h
+++ b/engines/m4/riddle/vars.h
@@ -53,6 +53,7 @@ public:
 	Riddle::Walker _walker;
 	Riddle::Hotkeys _hotkeys;
 	Riddle::GUI::Interface _interface;
+	bool _menuSystemInitialized = false;
 	int _global301 = 0;
 	int _flag1 = 0;
 	bool _kittyScreaming = false;




More information about the Scummvm-git-logs mailing list