← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~mxsscott/widelands/955908 into lp:widelands

 

Mark Scott has proposed merging lp:~mxsscott/widelands/955908 into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #955908 in widelands: "Open stockstatistics with a button"
  https://bugs.launchpad.net/widelands/+bug/955908

For more details, see:
https://code.launchpad.net/~mxsscott/widelands/955908/+merge/144037

For interactive players, provide key 'i' to open the stock statistics window.

'i' was chosen because 's' was already in use. i = Inventory [en] or Inventar [de].
-- 
https://code.launchpad.net/~mxsscott/widelands/955908/+merge/144037
Your team Widelands Developers is requested to review the proposed merge of lp:~mxsscott/widelands/955908 into lp:widelands.
=== modified file 'src/logic/building.h'
--- src/logic/building.h	2013-01-17 21:44:05 +0000
+++ src/logic/building.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004, 2006-2011 by the Widelands Development Team
+ * Copyright (C) 2002-2004, 2006-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -37,7 +37,7 @@
 
 namespace UI {class Window;}
 struct BuildingHints;
-struct Interactive_GameBase;
+class Interactive_GameBase;
 struct Profile;
 class IPicture;
 

=== modified file 'src/logic/ship.h'
--- src/logic/ship.h	2013-01-17 21:44:05 +0000
+++ src/logic/ship.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2011 by the Widelands Development Team
+ * Copyright (C) 2010-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -25,7 +25,7 @@
 #include "graphic/diranimations.h"
 
 namespace UI {class Window;}
-struct Interactive_GameBase;
+class Interactive_GameBase;
 
 namespace Widelands {
 

=== modified file 'src/wui/game_main_menu_save_game.h'
--- src/wui/game_main_menu_save_game.h	2012-02-15 21:25:34 +0000
+++ src/wui/game_main_menu_save_game.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004, 2006, 2008, 2010-2011 by the Widelands Development Team
+ * Copyright (C) 2002-2004, 2006, 2008-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -31,7 +31,7 @@
 
 #include "ref_cast.h"
 
-struct Interactive_GameBase;
+class Interactive_GameBase;
 
 struct SaveWarnMessageBox;
 struct Game_Main_Menu_Save_Game : public UI::UniqueWindow {

=== modified file 'src/wui/general_statistics_menu.h'
--- src/wui/general_statistics_menu.h	2012-02-15 21:25:34 +0000
+++ src/wui/general_statistics_menu.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004, 2006-2008 by the Widelands Development Team
+ * Copyright (C) 2002-2004, 2006-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -29,7 +29,7 @@
 #include "ui_basic/unique_window.h"
 #include "ui_basic/box.h"
 
-struct Interactive_GameBase;
+class Interactive_GameBase;
 namespace UI {
 struct Radiogroup;
 }

=== modified file 'src/wui/interactive_gamebase.h'
--- src/wui/interactive_gamebase.h	2012-12-17 20:01:04 +0000
+++ src/wui/interactive_gamebase.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2003, 2006-2011 by the Widelands Development Team
+ * Copyright (C) 2002-2003, 2006-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -30,8 +30,10 @@
 
 enum PlayerType {NONE, OBSERVER, PLAYING, VICTORIOUS, DEFEATED};
 
-struct Interactive_GameBase : public Interactive_Base {
-	struct Game_Main_Menu_Windows {
+class Interactive_GameBase : public Interactive_Base {
+public:
+	class Game_Main_Menu_Windows {
+	public:
 		UI::UniqueWindow::Registry loadgame;
 		UI::UniqueWindow::Registry savegame;
 		UI::UniqueWindow::Registry readme;

=== modified file 'src/wui/interactive_player.cc'
--- src/wui/interactive_player.cc	2012-12-13 10:41:22 +0000
+++ src/wui/interactive_player.cc	2013-01-20 21:36:23 +0000
@@ -211,6 +211,10 @@
 		(boost::lambda::new_ptr<GameMessageMenu>(),
 		 boost::ref(*this),
 		 boost::ref(m_message_menu));
+	m_mainm_windows.stock.constr = boost::lambda::bind
+		(boost::lambda::new_ptr<Stock_Menu>(),
+		 boost::ref(*this),
+		 boost::ref(m_mainm_windows.stock));
 
 #ifdef DEBUG //  only in debug builds
 	addCommand
@@ -388,6 +392,7 @@
 /**
  * Global in-game keypresses:
  * \li Space: toggles buildhelp
+ * \li i: show stock (inventory)
  * \li m: show minimap
  * \li o: show objectives window
  * \li c: toggle census
@@ -399,12 +404,16 @@
 */
 bool Interactive_Player::handle_key(bool const down, SDL_keysym const code)
 {
-	if (down)
+	if (down) {
 		switch (code.sym) {
 		case SDLK_SPACE:
 			toggle_buildhelp();
 			return true;
 
+		case SDLK_i:
+			m_mainm_windows.stock.toggle();
+			return true;
+
 		case SDLK_m:
 			toggle_minimap();
 			return true;
@@ -453,6 +462,7 @@
 		default:
 			break;
 		}
+	}
 
 	return Interactive_GameBase::handle_key(down, code);
 }

=== modified file 'src/wui/soldiercapacitycontrol.h'
--- src/wui/soldiercapacitycontrol.h	2012-02-15 21:25:34 +0000
+++ src/wui/soldiercapacitycontrol.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004, 2006-2010 by the Widelands Development Team
+ * Copyright (C) 2002-2004, 2006-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -20,7 +20,7 @@
 #ifndef _SOLDIERCAPACITYCONTROL_H_
 #define _SOLDIERCAPACITYCONTROL_H_
 
-struct Interactive_GameBase;
+class Interactive_GameBase;
 
 namespace UI {
 struct Panel;

=== modified file 'src/wui/soldierlist.h'
--- src/wui/soldierlist.h	2012-02-15 21:25:34 +0000
+++ src/wui/soldierlist.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2004, 2006-2010 by the Widelands Development Team
+ * Copyright (C) 2002-2004, 2006-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -20,7 +20,7 @@
 #ifndef _SOLDIERLIST_H_
 #define _SOLDIERLIST_H_
 
-struct Interactive_GameBase;
+class Interactive_GameBase;
 
 namespace UI {
 struct Panel;

=== modified file 'src/wui/waresqueuedisplay.h'
--- src/wui/waresqueuedisplay.h	2012-11-24 16:22:10 +0000
+++ src/wui/waresqueuedisplay.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 by the Widelands Development Team
+ * Copyright (C) 2010-2013 by the Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -28,7 +28,7 @@
 #include "ui_basic/radiobutton.h"
 #include "ui_basic/button.h"
 
-struct Interactive_GameBase;
+class Interactive_GameBase;
 
 namespace UI {
 struct Panel;

=== modified file 'src/wui/watchwindow.h'
--- src/wui/watchwindow.h	2012-02-15 21:25:34 +0000
+++ src/wui/watchwindow.h	2013-01-20 21:36:23 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2004, 2008 by The Widelands Development Team
+ * Copyright (C) 2002, 2004, 2008-2009, 2011-2013 by The Widelands Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -22,7 +22,7 @@
 
 #include "logic/widelands_geometry.h"
 
-struct Interactive_GameBase;
+class Interactive_GameBase;
 
 void show_watch_window(Interactive_GameBase &, Widelands::Coords);
 


Follow ups