From: Andrew C. <ac...@us...> - 2003-07-26 12:26:41
|
Update of /cvsroot/planeshift/planeshift/src/client/paws In directory sc8-pr-cvs1:/tmp/cvs-serv3784/src/client/paws Modified Files: inventorywindow.cpp Log Message: Changes for new server system Index: inventorywindow.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/inventorywindow.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** inventorywindow.cpp 26 Jun 2003 17:23:19 -0000 1.7 --- inventorywindow.cpp 26 Jul 2003 06:31:00 -0000 1.8 *************** *** 152,201 **** { ClearInventory(); - - csRef<iDocumentSystem> xml = - CS_QUERY_REGISTRY (windowManager->GetObjectRegistry(), iDocumentSystem); - - CS_ASSERT( xml ); - psGUIInventoryMessage incomming(me); ! csRef<iDocument> invList = xml->CreateDocument(); ! ! const char* error = invList->Parse( incomming.commandData); ! if ( error ) ! { ! Error2("Error in XML: %s", error ); ! return; ! } ! ! csRef<iDocumentNode> root = invList->GetRoot(); ! csRef<iDocumentNode> topNode = root->GetNode("L"); ! csRef<iDocumentNodeIterator> iter = topNode->GetNodes(); ! ! while ( iter->HasNext() ) { ! csRef<iDocumentNode> item = iter->Next(); ! ! csString slotName; ! csString imageName; ! ! slotName = item->GetAttributeValue("SLT"); ! imageName = item->GetAttributeValue("IMG"); ! int stackCount = item->GetAttributeValueAsInt("C"); ! ! if ( imageName.Length() != 0 ) { ! pawsItemSlot* itemSlot = (pawsItemSlot*)FindWidget( slotName ); ! itemSlot->ClearOut(); ! if ( itemSlot != NULL ) { ! itemSlot->PlaceItem( imageName ); ! itemSlot->SetStackCount( stackCount ); } } ! } ! ! ! break; } --- 152,171 ---- { ClearInventory(); psGUIInventoryMessage incomming(me); ! for ( int z = 0; z < incomming.totalItems; z++ ) { ! if ( incomming.items[z].iconImage.Length() != 0 ) { ! pawsItemSlot* itemSlot = (pawsItemSlot*)FindWidget( incomming.items[z].slot ); ! if ( itemSlot ) { ! itemSlot->ClearOut(); ! itemSlot->PlaceItem( incomming.items[z].iconImage ); ! itemSlot->SetStackCount( incomming.items[z].stackcount ); } } ! } ! break; } *************** *** 331,341 **** if ( floatingSlot->HasItem() ) { ! char commandData[100]; ! ! sprintf( commandData, "<V S=\"%s\" />", floatingSlot->GetName() ); ! psGUIInventoryMessage out( 0, ! commandData, ! psGUIInventoryMessage::VIEW ); ! msgHandler->SendMessage( out.msg ); } --- 301,307 ---- if ( floatingSlot->HasItem() ) { ! psGUIInventoryMessage out( psGUIInventoryMessage::REQUEST_DESCRIPTION, 100 ); ! out.ViewSlot( floatingSlot->GetName() ); ! msgHandler->SendMessage( out.msg ); } *************** *** 389,398 **** slot->Swap( floatingSlot ); - char commandData[100]; - sprintf(commandData, "<M F=\"%s\" T=\"%s\" />", floatingSlot->GetName(), slot->GetName() ); - psGUIInventoryMessage outgoing( 0, - commandData, psGUIInventoryMessage::MOVE_ITEM); - msgHandler->SendMessage(outgoing.msg); maxDropCount = 0; return true; } --- 355,364 ---- slot->Swap( floatingSlot ); maxDropCount = 0; + + psGUIInventoryMessage outgoing( psGUIInventoryMessage::MOVE_ITEM, 100 ); + outgoing.Move( floatingSlot->GetName(), slot->GetName() ); + msgHandler->SendMessage( outgoing.msg ); + return true; } *************** *** 423,428 **** sprintf( commandData, "<D F=\"%s\" C=\"%d\" />", floatingSlot->GetName(), dropCount ); ! psGUIInventoryMessage dropMessage(0, commandData, ! psGUIInventoryMessage::DROP_ITEM); printf("DROP: %s\n", commandData); --- 389,395 ---- sprintf( commandData, "<D F=\"%s\" C=\"%d\" />", floatingSlot->GetName(), dropCount ); ! // TODO ! //psGUIInventoryMessage dropMessage(0, commandData, ! // psGUIInventoryMessage::DROP_ITEM); printf("DROP: %s\n", commandData); *************** *** 431,435 **** CS_ASSERT( slot ); slot->ClearOut(); ! msgHandler->SendMessage( dropMessage.msg ); floatingSlot->ClearOut(); --- 398,402 ---- CS_ASSERT( slot ); slot->ClearOut(); ! //msgHandler->SendMessage( dropMessage.msg ); floatingSlot->ClearOut(); |