[Orxonox-commit 2154] r6870 - in code/branches/chat2: data/gui/layouts data/gui/scripts src/orxonox

smerkli at orxonox.net smerkli at orxonox.net
Mon May 10 13:47:45 CEST 2010


Author: smerkli
Date: 2010-05-10 13:47:44 +0200 (Mon, 10 May 2010)
New Revision: 6870

Added:
   code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout
   code/branches/chat2/data/gui/scripts/ChatBox-inputonly.lua
Modified:
   code/branches/chat2/data/gui/layouts/ChatBox.layout
   code/branches/chat2/src/orxonox/ChatInputHandler.cc
   code/branches/chat2/src/orxonox/ChatInputHandler.h
Log:
Chatbox light added, trigger with n in game.

Copied: code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout (from rev 6866, code/branches/chat2/data/gui/layouts/ChatBox.layout)
===================================================================
--- code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout	                        (rev 0)
+++ code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout	2010-05-10 11:47:44 UTC (rev 6870)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="orxonox/ChatBox-inputonly/Root" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="MenuWidgets/Editbox" Name="orxonox/ChatBox-inputonly/input" >
+            <Property Name="Text" Value="" />
+            <Property Name="AlwaysOnTop" Value="True" />
+            <Property Name="MaxTextLength" Value="1073741823" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0,5},{0.98,0},{0,30}}" />
+        </Window>
+    </Window>
+</GUILayout>

Modified: code/branches/chat2/data/gui/layouts/ChatBox.layout
===================================================================
--- code/branches/chat2/data/gui/layouts/ChatBox.layout	2010-05-10 11:28:19 UTC (rev 6869)
+++ code/branches/chat2/data/gui/layouts/ChatBox.layout	2010-05-10 11:47:44 UTC (rev 6870)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <GUILayout >
-    <Window Type="DefaultWindow" Name="Root" >
+    <Window Type="DefaultWindow" Name="orxonox/ChatBox/Root" >
         <Property Name="InheritsAlpha" Value="False" />
         <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
         <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />

Copied: code/branches/chat2/data/gui/scripts/ChatBox-inputonly.lua (from rev 6866, code/branches/chat2/data/gui/scripts/ChatBox.lua)
===================================================================
--- code/branches/chat2/data/gui/scripts/ChatBox-inputonly.lua	                        (rev 0)
+++ code/branches/chat2/data/gui/scripts/ChatBox-inputonly.lua	2010-05-10 11:47:44 UTC (rev 6870)
@@ -0,0 +1,5 @@
+-- ChatBox-inputonly.lua
+
+local P = createMenuSheet("ChatBox-inputonly")
+return P
+

Modified: code/branches/chat2/src/orxonox/ChatInputHandler.cc
===================================================================
--- code/branches/chat2/src/orxonox/ChatInputHandler.cc	2010-05-10 11:28:19 UTC (rev 6869)
+++ code/branches/chat2/src/orxonox/ChatInputHandler.cc	2010-05-10 11:47:44 UTC (rev 6870)
@@ -45,6 +45,8 @@
   ManageScopedSingleton( ChatInputHandler, ScopeID::Graphics, false );
   SetConsoleCommandAlias( ChatInputHandler, activate_static, "startchat",
     true );
+  SetConsoleCommandAlias( ChatInputHandler, activate_small_static, 
+    "startchat_small", true );
 
 
   /* constructor */
@@ -57,18 +59,15 @@
     this->inpbuf = new InputBuffer();
     assert( this->inpbuf != NULL );
 
-    /* MARK add generation of ChatBox thingy here */
+    /* generate chatbox ui and chatbox-inputonly ui */
     GUIManager::getInstance().loadGUI( "ChatBox" );
+    GUIManager::getInstance().loadGUI( "ChatBox-inputonly" );
 
     /* configure the input buffer */
     configureInputBuffer();
 
     this->inputState = InputManager::getInstance().createInputState( "chatinput", false, false, InputStatePriority::Dynamic );
     this->inputState->setKeyHandler(this->inpbuf);
-
-    //[> set console shortcut <]
-    //this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(
-      //&ChatInputHandler::activate, this), "startchat"), false);
   }
 
   void ChatInputHandler::configureInputBuffer()
@@ -98,6 +97,8 @@
 
     /* get window pointers */
     input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" );
+    inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" );
+
     CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" );
     lb_history = dynamic_cast<CEGUI::Listbox*>(history); 
 
@@ -108,16 +109,22 @@
 
   /* activate, deactivate */
   void ChatInputHandler::activate_static()
-  { ChatInputHandler::getInstance().activate(); }
-  
-  void ChatInputHandler::activate()
+  { ChatInputHandler::getInstance().activate( true ); }
+
+  void ChatInputHandler::activate_small_static()
+  { ChatInputHandler::getInstance().activate( false ); }
+
+  void ChatInputHandler::activate( bool full )
   {
     /* start listening */
     //COUT(0) << "chatinput activated." << std::endl;
     InputManager::getInstance().enterState("chatinput");
 
     /* MARK add spawning of chat widget stuff here.*/
-    GUIManager::getInstance().showGUI( "ChatBox" );
+    if( full )
+      GUIManager::getInstance().showGUI( "ChatBox" );
+    else
+      GUIManager::getInstance().showGUI( "ChatBox-inputonly" );
   }
 
   void ChatInputHandler::deactivate() 
@@ -127,6 +134,7 @@
 
     /* MARK add un-spawning of chat widget stuff here. */
     GUIManager::getInstance().hideGUI( "ChatBox" );
+    GUIManager::getInstance().hideGUI( "ChatBox-inputonly" );
   }
 
   /* callbacks for InputBuffer */
@@ -145,6 +153,7 @@
       
     /* set the text */
     this->input->setProperty( "Text", left + "|" + right );
+    this->inputonly->setProperty( "Text", left + "|" + right );
   }
 
   void ChatInputHandler::addline()

Modified: code/branches/chat2/src/orxonox/ChatInputHandler.h
===================================================================
--- code/branches/chat2/src/orxonox/ChatInputHandler.h	2010-05-10 11:28:19 UTC (rev 6869)
+++ code/branches/chat2/src/orxonox/ChatInputHandler.h	2010-05-10 11:47:44 UTC (rev 6870)
@@ -72,7 +72,7 @@
       static ChatInputHandler* singletonPtr_s;
 
       /* cegui stuff */
-      CEGUI::Window *input;
+      CEGUI::Window *input, *inputonly;
       CEGUI::Listbox *lb_history;
 
     public:
@@ -82,7 +82,8 @@
 
       /* start listening, stop listening */
       static void activate_static();
-      void activate();
+      static void activate_small_static();
+      void activate( bool full );
       void deactivate();
 
       /* callbacks for input handler */




More information about the Orxonox-commit mailing list