← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/scriptconsole into lp:widelands

 

Tino has proposed merging lp:~widelands-dev/widelands/scriptconsole into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/scriptconsole/+merge/214439

Allow setting the window title for GameChatMenu.
=> The normal chat is now "Chat"
=> The script/debug console "Script console"

Or is there a property of the ChatProvider i can use to distinguish?
-- 
https://code.launchpad.net/~widelands-dev/widelands/scriptconsole/+merge/214439
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/scriptconsole into lp:widelands.
=== modified file 'src/wui/game_chat_menu.cc'
--- src/wui/game_chat_menu.cc	2014-03-10 19:27:00 +0000
+++ src/wui/game_chat_menu.cc	2014-04-06 14:28:42 +0000
@@ -32,9 +32,10 @@
 GameChatMenu::GameChatMenu
 	(UI::Panel                  * parent,
 	 UI::UniqueWindow::Registry & registry,
-	 ChatProvider               & chat)
+	 ChatProvider               & chat,
+	 const std::string          & title)
 :
-UI::UniqueWindow(parent, "chat", &registry, 440, 235, _("Chat")),
+UI::UniqueWindow(parent, "chat", &registry, 440, 235, title),
 m_chat(this, 5, 5, get_inner_w() - 10, get_inner_h() - 10, chat)
 {
 	if (get_usedefaultpos())

=== modified file 'src/wui/game_chat_menu.h'
--- src/wui/game_chat_menu.h	2013-07-26 20:19:36 +0000
+++ src/wui/game_chat_menu.h	2014-04-06 14:28:42 +0000
@@ -29,7 +29,7 @@
  * enter and send chat messages.
  */
 struct GameChatMenu : public UI::UniqueWindow {
-	GameChatMenu(UI::Panel *, UI::UniqueWindow::Registry &, ChatProvider &);
+	GameChatMenu(UI::Panel *, UI::UniqueWindow::Registry &, ChatProvider &, const std::string & title);
 
 	/**
 	 * Configure the menu so that it is useful for writing chat messages.

=== modified file 'src/wui/interactive_base.cc'
--- src/wui/interactive_base.cc	2014-04-06 10:48:52 +0000
+++ src/wui/interactive_base.cc	2014-04-06 14:28:42 +0000
@@ -950,7 +950,7 @@
 		case SDLK_F6:
 			if (get_display_flag(dfDebug)) {
 				new GameChatMenu
-					(this, m_debugconsole, *DebugConsole::getChatProvider());
+					(this, m_debugconsole, *DebugConsole::getChatProvider(), _("Script console"));
 			}
 			return true;
 #endif

=== modified file 'src/wui/interactive_player.cc'
--- src/wui/interactive_player.cc	2014-04-06 11:58:13 +0000
+++ src/wui/interactive_player.cc	2014-04-06 14:28:42 +0000
@@ -320,7 +320,7 @@
 	if (m_chat.window)
 		delete m_chat.window;
 	else if (m_chatProvider)
-		new GameChatMenu(this, m_chat, *m_chatProvider);
+		new GameChatMenu(this, m_chat, *m_chatProvider, _("Chat"));
 }
 
 bool Interactive_Player::can_see(Widelands::Player_Number const p) const
@@ -425,7 +425,7 @@
 				break;
 
 			if (!m_chat.window)
-				new GameChatMenu(this, m_chat, *m_chatProvider);
+				new GameChatMenu(this, m_chat, *m_chatProvider, _("Chat"));
 
 			return true;
 		default:

=== modified file 'src/wui/interactive_spectator.cc'
--- src/wui/interactive_spectator.cc	2014-04-06 11:58:13 +0000
+++ src/wui/interactive_spectator.cc	2014-04-06 14:28:42 +0000
@@ -162,7 +162,7 @@
 	if (m_chat.window)
 		delete m_chat.window;
 	else if (m_chatProvider)
-		new GameChatMenu(this, m_chat, *m_chatProvider);
+		new GameChatMenu(this, m_chat, *m_chatProvider, _("Chat"));
 }
 
 
@@ -273,7 +273,7 @@
 				break;
 
 			if (!m_chat.window)
-				new GameChatMenu(this, m_chat, *m_chatProvider);
+				new GameChatMenu(this, m_chat, *m_chatProvider, _("Chat"));
 
 			ref_cast<GameChatMenu, UI::UniqueWindow>(*m_chat.window)
 				.enter_chat_message();


Follow ups