From: Andrew C. <ac...@us...> - 2003-08-22 10:12:32
|
Update of /cvsroot/planeshift/planeshift/src/client In directory sc8-pr-cvs1:/tmp/cvs-serv24318/src/client Modified Files: cmdutil.cpp cmdutil.h psnetmanager.cpp Log Message: Added callbacks to the yesno window and removed dialog manager stuff from cmdutils Index: cmdutil.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/cmdutil.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** cmdutil.cpp 18 Aug 2003 22:23:27 -0000 1.15 --- cmdutil.cpp 20 Aug 2003 18:28:52 -0000 1.16 *************** *** 11,14 **** --- 11,18 ---- #include "util/delimitedstring.h" + + #include "paws/pspawsmanager.h" + #include "paws/pawsyesnobox.h" + SCF_IMPLEMENT_IBASE( psUtilityCommands ) SCF_IMPLEMENTS_INTERFACE( iNetSubscriber ) *************** *** 19,30 **** psUtilityCommands::psUtilityCommands(MsgHandler *mh, CmdHandler *ch, ! iObjectRegistry* obj, ! iDialogManager *dialogmgr) : psCmdBase(mh,ch,obj) { SCF_CONSTRUCT_IBASE(0); ! ! this->dialogmgr = dialogmgr; ! cmdsource->Subscribe("/quit","This exits you from the game.",CmdHandler::VISIBLE_TO_USER,this); // create new guild (requires list of names) cmdsource->Subscribe("/echo","This repeats what you type in the chat window without sending it to anyone else",CmdHandler::INVISIBLE_TO_USER,this); // create new guild (requires list of names) --- 23,31 ---- psUtilityCommands::psUtilityCommands(MsgHandler *mh, CmdHandler *ch, ! iObjectRegistry* obj) : psCmdBase(mh,ch,obj) { SCF_CONSTRUCT_IBASE(0); ! cmdsource->Subscribe("/quit","This exits you from the game.",CmdHandler::VISIBLE_TO_USER,this); // create new guild (requires list of names) cmdsource->Subscribe("/echo","This repeats what you type in the chat window without sending it to anyone else",CmdHandler::INVISIBLE_TO_USER,this); // create new guild (requires list of names) *************** *** 68,74 **** return "No commands for confirm box are specified."; ! if (!dialogmgr->CreateConfirm(psUtilityCommands::HandleConfirmButton,this,text)) ! return "Could not create confirm box!"; ! return NULL; // successful } --- 69,78 ---- return "No commands for confirm box are specified."; ! csRef<iPSEngine> engine = CS_QUERY_REGISTRY( objreg, iPSEngine ); ! pawsYesNoBox* confirm = (pawsYesNoBox*)engine->GetPAWS()->FindWidget("YesNoWindow"); ! confirm->SetCallBack( psUtilityCommands::HandleConfirmButton,this, text ); ! confirm->Show(); ! engine->GetPAWS()->SetModalWidget( confirm ); ! return NULL; // successful } Index: cmdutil.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/cmdutil.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cmdutil.h 20 Jun 2003 21:06:30 -0000 1.5 --- cmdutil.h 20 Aug 2003 18:28:52 -0000 1.6 *************** *** 11,15 **** #include "net/cmdbase.h" #include "util/psstring.h" - #include "iclient/idmngr.h" class psUtilityCommands : public psCmdBase --- 11,14 ---- *************** *** 17,21 **** protected: psString text,yescommands,nocommands; - iDialogManager *dialogmgr; public: --- 16,19 ---- *************** *** 24,29 **** psUtilityCommands(MsgHandler *mh, CmdHandler *ch, ! iObjectRegistry* obj, ! iDialogManager *dialogmgr); virtual ~psUtilityCommands(); --- 22,26 ---- psUtilityCommands(MsgHandler *mh, CmdHandler *ch, ! iObjectRegistry* obj); virtual ~psUtilityCommands(); Index: psnetmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psnetmanager.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** psnetmanager.cpp 19 Aug 2003 04:14:57 -0000 1.41 --- psnetmanager.cpp 20 Aug 2003 18:28:52 -0000 1.42 *************** *** 51,55 **** { if (connected) ! Disconnect(); if (connection) delete connection; --- 51,55 ---- { if (connected) ! Disconnect(); if (connection) delete connection; *************** *** 76,90 **** groupcmds = csPtr<psGroupCommands> (new psGroupCommands(msghandler, cmdhandler, object_reg)); ! utilcmds = csPtr<psUtilityCommands> ! (new psUtilityCommands(msghandler, cmdhandler, object_reg, dmgr)); ! admincmds = csPtr<psAdminCommands> ! (new psAdminCommands(msghandler, cmdhandler, object_reg)); csRef<iPSEngine> psengine; psengine = CS_QUERY_REGISTRY(object_reg, iPSEngine); if (!psengine) ! return false; ! authclient = csPtr<psAuthenticationClient> ! (new psAuthenticationClient(GetMsgHandler(), psengine)); return true; --- 76,87 ---- groupcmds = csPtr<psGroupCommands> (new psGroupCommands(msghandler, cmdhandler, object_reg)); ! utilcmds = csPtr<psUtilityCommands> (new psUtilityCommands(msghandler, cmdhandler, object_reg)); ! admincmds = csPtr<psAdminCommands> (new psAdminCommands(msghandler, cmdhandler, object_reg)); csRef<iPSEngine> psengine; psengine = CS_QUERY_REGISTRY(object_reg, iPSEngine); if (!psengine) ! return false; ! authclient = csPtr<psAuthenticationClient> (new psAuthenticationClient(GetMsgHandler(), psengine)); return true; *************** *** 114,123 **** { if (connected) ! Disconnect(); if (!connection->Connect(server,port)) { ! errormsg = "Couldn't resolve server hostname."; ! return false; } --- 111,120 ---- { if (connected) ! Disconnect(); if (!connection->Connect(server,port)) { ! errormsg = "Couldn't resolve server hostname."; ! return false; } |