From: tomtt <to...@us...> - 2007-06-23 18:13:38
|
Update of /cvsroot/planeshift/planeshift/src/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28757 Modified Files: pawsbookreadingwindow.cpp Log Message: Added displaying craft info option to book reading window. Index: pawsbookreadingwindow.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/gui/pawsbookreadingwindow.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pawsbookreadingwindow.cpp 8 Jun 2007 12:02:54 -0000 1.10 --- pawsbookreadingwindow.cpp 23 Jun 2007 18:13:39 -0000 1.11 *************** *** 52,58 **** if ( !msgHandler ) return false; if ( !msgHandler->Subscribe( this, MSGTYPE_READ_BOOK ) ) return false; // Store some of our children for easy access later on. - name = dynamic_cast<pawsTextBox*> (FindWidget("ItemName")); if ( !name ) return false; --- 52,58 ---- if ( !msgHandler ) return false; if ( !msgHandler->Subscribe( this, MSGTYPE_READ_BOOK ) ) return false; + if ( !msgHandler->Subscribe( this, MSGTYPE_CRAFT_INFO ) ) return false; // Store some of our children for easy access later on. name = dynamic_cast<pawsTextBox*> (FindWidget("ItemName")); if ( !name ) return false; *************** *** 63,66 **** --- 63,67 ---- writeButton = dynamic_cast<pawsWidget*> (FindWidget("WriteButton")); //if ( !writeButton ) return false; + return true; } *************** *** 68,82 **** void pawsBookReadingWindow::HandleMessage( MsgEntry* me ) { ! Show(); ! psReadBookTextMessage mesg( me ); ! description->SetText( mesg.text ); ! name->SetText( mesg.name ); ! slotID = mesg.slotID; ! containerID = mesg.containerID; ! if( writeButton ){ ! if( mesg.canWrite ) writeButton->Show(); ! else writeButton->Hide(); } - } --- 69,100 ---- void pawsBookReadingWindow::HandleMessage( MsgEntry* me ) { ! switch ( me->GetType() ) ! { ! case MSGTYPE_READ_BOOK: ! { ! Show(); ! psReadBookTextMessage mesg( me ); ! description->SetText( mesg.text ); ! name->SetText( mesg.name ); ! slotID = mesg.slotID; ! containerID = mesg.containerID; ! if( writeButton ){ ! if( mesg.canWrite ) writeButton->Show(); ! else writeButton->Hide(); ! } ! break; ! } ! case MSGTYPE_CRAFT_INFO: ! { ! Show(); ! writeButton->Hide(); ! psMsgCraftingInfo mesg(me); ! csString text(mesg.craftInfo); ! if (text) ! description->SetText(text.GetData()); ! name->SetText( "You discover you can do the following:" ); ! break; ! } } } |