Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6870 for code/branches/chat2


Ignore:
Timestamp:
May 10, 2010, 1:47:44 PM (15 years ago)
Author:
smerkli
Message:

Chatbox light added, trigger with n in game.

Location:
code/branches/chat2
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/branches/chat2/data/gui/layouts/ChatBox-inputonly.layout

    r6866 r6870  
    22
    33<GUILayout >
    4     <Window Type="DefaultWindow" Name="Root" >
     4    <Window Type="DefaultWindow" Name="orxonox/ChatBox-inputonly/Root" >
    55        <Property Name="InheritsAlpha" Value="False" />
    66        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    77        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
    8         <Window Type="MenuWidgets/FrameWindow" Name="/ChatBox" >
    9             <Property Name="Text" Value="Chat" />
    10             <Property Name="InheritsAlpha" Value="False" />
     8        <Window Type="MenuWidgets/Editbox" Name="orxonox/ChatBox-inputonly/input" >
     9            <Property Name="Text" Value="" />
     10            <Property Name="AlwaysOnTop" Value="True" />
     11            <Property Name="MaxTextLength" Value="1073741823" />
    1112            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    12             <Property Name="TitlebarEnabled" Value="True" />
    13             <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.03,0},{0.6,0},{0.69375,0}}" />
    14             <Window Type="MenuWidgets/Listbox" Name="orxonox/ChatBox/history" >
    15                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    16                 <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0.078,0},{0.98,0},{1,-30}}" />
    17             </Window>
    18             <Window Type="MenuWidgets/Editbox" Name="orxonox/ChatBox/input" >
    19                 <Property Name="Text" Value="" />
    20                 <Property Name="MaxTextLength" Value="1073741823" />
    21                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    22                 <Property Name="UnifiedAreaRect" Value="{{0.02,0},{1,-30},{0.98,0},{1,-5}}" />
    23             </Window>
     13            <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0,5},{0.98,0},{0,30}}" />
    2414        </Window>
    2515    </Window>
  • code/branches/chat2/data/gui/layouts/ChatBox.layout

    r6846 r6870  
    22
    33<GUILayout >
    4     <Window Type="DefaultWindow" Name="Root" >
     4    <Window Type="DefaultWindow" Name="orxonox/ChatBox/Root" >
    55        <Property Name="InheritsAlpha" Value="False" />
    66        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
  • code/branches/chat2/data/gui/scripts/ChatBox-inputonly.lua

    r6866 r6870  
    1 -- ChatBox.lua
     1-- ChatBox-inputonly.lua
    22
    3 local P = createMenuSheet("ChatBox")
     3local P = createMenuSheet("ChatBox-inputonly")
    44return P
    55
  • code/branches/chat2/src/orxonox/ChatInputHandler.cc

    r6846 r6870  
    4646  SetConsoleCommandAlias( ChatInputHandler, activate_static, "startchat",
    4747    true );
     48  SetConsoleCommandAlias( ChatInputHandler, activate_small_static,
     49    "startchat_small", true );
    4850
    4951
     
    5860    assert( this->inpbuf != NULL );
    5961
    60     /* MARK add generation of ChatBox thingy here */
     62    /* generate chatbox ui and chatbox-inputonly ui */
    6163    GUIManager::getInstance().loadGUI( "ChatBox" );
     64    GUIManager::getInstance().loadGUI( "ChatBox-inputonly" );
    6265
    6366    /* configure the input buffer */
     
    6669    this->inputState = InputManager::getInstance().createInputState( "chatinput", false, false, InputStatePriority::Dynamic );
    6770    this->inputState->setKeyHandler(this->inpbuf);
    68 
    69     //[> set console shortcut <]
    70     //this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(
    71       //&ChatInputHandler::activate, this), "startchat"), false);
    7271  }
    7372
     
    9998    /* get window pointers */
    10099    input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" );
     100    inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" );
     101
    101102    CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" );
    102103    lb_history = dynamic_cast<CEGUI::Listbox*>(history);
     
    109110  /* activate, deactivate */
    110111  void ChatInputHandler::activate_static()
    111   { ChatInputHandler::getInstance().activate(); }
    112  
    113   void ChatInputHandler::activate()
     112  { ChatInputHandler::getInstance().activate( true ); }
     113
     114  void ChatInputHandler::activate_small_static()
     115  { ChatInputHandler::getInstance().activate( false ); }
     116
     117  void ChatInputHandler::activate( bool full )
    114118  {
    115119    /* start listening */
     
    118122
    119123    /* MARK add spawning of chat widget stuff here.*/
    120     GUIManager::getInstance().showGUI( "ChatBox" );
     124    if( full )
     125      GUIManager::getInstance().showGUI( "ChatBox" );
     126    else
     127      GUIManager::getInstance().showGUI( "ChatBox-inputonly" );
    121128  }
    122129
     
    128135    /* MARK add un-spawning of chat widget stuff here. */
    129136    GUIManager::getInstance().hideGUI( "ChatBox" );
     137    GUIManager::getInstance().hideGUI( "ChatBox-inputonly" );
    130138  }
    131139
     
    146154    /* set the text */
    147155    this->input->setProperty( "Text", left + "|" + right );
     156    this->inputonly->setProperty( "Text", left + "|" + right );
    148157  }
    149158
  • code/branches/chat2/src/orxonox/ChatInputHandler.h

    r6846 r6870  
    7373
    7474      /* cegui stuff */
    75       CEGUI::Window *input;
     75      CEGUI::Window *input, *inputonly;
    7676      CEGUI::Listbox *lb_history;
    7777
     
    8383      /* start listening, stop listening */
    8484      static void activate_static();
    85       void activate();
     85      static void activate_small_static();
     86      void activate( bool full );
    8687      void deactivate();
    8788
Note: See TracChangeset for help on using the changeset viewer.