Update of /cvsroot/planeshift/planeshift/src/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28607/src/client Modified Files: cmdusers.cpp cmdusers.h pscelclient.cpp psclientchar.cpp psclientchar.h psengine.cpp psengine.h Log Message: - Fixed so that the context command use the same function as select. - Changes a lot of \t til spaces according to ps code standard. Index: cmdusers.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/cmdusers.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** cmdusers.cpp 24 Jan 2005 02:07:48 -0000 1.87 --- cmdusers.cpp 24 Jan 2005 04:54:13 -0000 1.88 *************** *** 95,98 **** --- 95,99 ---- cmdsource->Subscribe("/target", this); cmdsource->Subscribe("/target_clear", this); + cmdsource->Subscribe("/target_context", this); cmdsource->Subscribe("/tip", this); cmdsource->Subscribe("/motd", this); *************** *** 149,157 **** cmdsource->Unsubscribe("/target_prev_nearest_npc", this); cmdsource->Unsubscribe("/target", this); cmdsource->Unsubscribe("/target_clear", this); ! cmdsource->Unsubscribe("/tip", this ); ! cmdsource->Unsubscribe("/motd", this ); ! cmdsource->Unsubscribe("/challenge", this ); ! cmdsource->Unsubscribe("/yield", this ); cmdsource->Unsubscribe("/picklock",this); cmdsource->Unsubscribe("/targetinfo",this); --- 150,159 ---- cmdsource->Unsubscribe("/target_prev_nearest_npc", this); cmdsource->Unsubscribe("/target", this); + cmdsource->Unsubscribe("/target_context",this); cmdsource->Unsubscribe("/target_clear", this); ! cmdsource->Unsubscribe("/tip", this ); ! cmdsource->Unsubscribe("/motd", this ); ! cmdsource->Unsubscribe("/challenge", this ); ! cmdsource->Unsubscribe("/yield", this ); cmdsource->Unsubscribe("/picklock",this); cmdsource->Unsubscribe("/targetinfo",this); *************** *** 331,335 **** GEMClientObject *object = FindEntityWithName(words[1]); if (object) ! UpdateTarget(object); } else if (words[0] == "/use" || --- 333,343 ---- GEMClientObject *object = FindEntityWithName(words[1]); if (object) ! psengine->GetCharManager()->SetTarget(object,"select"); ! } ! else if (words[0] == "/target_context") ! { ! GEMClientObject *object = FindEntityWithName(words[1]); ! if (object) ! psengine->GetCharManager()->SetTarget(object,"context"); } else if (words[0] == "/use" || *************** *** 346,377 **** } else if(words[0] == "/targetinfo") ! { ! pawsDetailWindow* detail = (pawsDetailWindow*)psengine->GetPAWS()->FindWidget("DetailWindow"); ! detail->RequestDetails(); ! return NULL; } ! else if (words[0] == "/advisormode" ) ! { ! csString pPerson = ""; ! csString pText = ""; ! if ( words.GetCount() > 1 ) ! pText = words.GetTail( 1 ); ! psAdviceMessage advice(0,words[0],pPerson, pText); ! msgqueue->SendMessage(advice.msg); ! return NULL; ! } ! else if (words[0] == "/list_advice_requests" ) ! { ! csString pPerson = ""; ! csString pText = ""; ! psAdviceMessage advice(0,words[0],pPerson, pText); ! msgqueue->SendMessage(advice.msg); ! return NULL; ! } ! else if (words[0] == "/advisor" ) ! { csString pPerson = ""; csString pText( words.GetTail( 1 ) ); --- 354,385 ---- } else if(words[0] == "/targetinfo") ! { ! pawsDetailWindow* detail = (pawsDetailWindow*)psengine->GetPAWS()->FindWidget("DetailWindow"); ! detail->RequestDetails(); ! return NULL; } ! else if (words[0] == "/advisormode" ) ! { ! csString pPerson = ""; ! csString pText = ""; ! if ( words.GetCount() > 1 ) ! pText = words.GetTail( 1 ); ! psAdviceMessage advice(0,words[0],pPerson, pText); ! msgqueue->SendMessage(advice.msg); ! return NULL; ! } ! else if (words[0] == "/list_advice_requests" ) ! { ! csString pPerson = ""; ! csString pText = ""; ! psAdviceMessage advice(0,words[0],pPerson, pText); ! msgqueue->SendMessage(advice.msg); ! return NULL; ! } ! else if (words[0] == "/advisor" ) ! { csString pPerson = ""; csString pText( words.GetTail( 1 ) ); *************** *** 426,440 **** object = NULL; ! UpdateTarget(object); ! } ! ! void psUserCommands::UpdateTarget(GEMClientObject *object) ! { ! psengine->GetCharManager()->SetTarget(object); } - - - // Starting from startingEntity, this function returns the next nearest or // furthest PC or NPC. If startingEntity is NULL, it returns the the nearest --- 434,440 ---- object = NULL; ! psengine->GetCharManager()->SetTarget(object,"select"); } // Starting from startingEntity, this function returns the next nearest or // furthest PC or NPC. If startingEntity is NULL, it returns the the nearest Index: cmdusers.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/cmdusers.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cmdusers.h 3 Jan 2005 06:59:34 -0000 1.10 --- cmdusers.h 24 Jan 2005 04:54:13 -0000 1.11 *************** *** 62,67 **** EntityTypes entityType); - void UpdateTarget(GEMClientObject *object); - public: SCF_DECLARE_IBASE; --- 62,65 ---- Index: pscelclient.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/pscelclient.cpp,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** pscelclient.cpp 24 Jan 2005 02:07:48 -0000 1.210 --- pscelclient.cpp 24 Jan 2005 04:54:13 -0000 1.211 *************** *** 334,338 **** { widget->Hide(); ! psengine->GetCharManager()->SetTarget(0, false); } } --- 334,338 ---- { widget->Hide(); ! psengine->GetCharManager()->SetTarget(NULL, "select"); } } *************** *** 383,387 **** // Apply new target name ! psengine->GetCharManager()->SetTarget(object); // we don't have a label over our own char --- 383,387 ---- // Apply new target name ! psengine->GetCharManager()->SetTarget(object,"select"); // we don't have a label over our own char Index: psclientchar.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psclientchar.cpp,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** psclientchar.cpp 24 Jan 2005 02:07:48 -0000 1.126 --- psclientchar.cpp 24 Jan 2005 04:54:13 -0000 1.127 *************** *** 212,216 **** } ! void psClientCharManager::SetTarget(GEMClientObject * newTarget, bool informServer) { if (target != newTarget) --- 212,216 ---- } ! void psClientCharManager::SetTarget(GEMClientObject * newTarget, char * action) { if (target != newTarget) *************** *** 222,247 **** if (infoWindow) infoWindow->SetTarget(target); ! // delete the old target effect ! psengine->GetEffectManager()->DeleteEffect(targetEffect); ! targetEffect = 0; ! if (target) ! { ! // render the target effect ! iMeshWrapper * targetMesh = target->pcmesh->GetMesh(); ! if (targetMesh) ! targetEffect = psengine->GetEffectManager()->RenderEffect("target", csVector3(0,0,0), targetMesh); ! if (informServer) ! { ! // notify the server of selection ! CS_ID mappedID = target->GetEntity()->GetID(); ! psUserActionMessage action(0, mappedID, "select"); ! ! psengine->GetMsgHandler()->SendMessage(action.msg); ! } ! } } } --- 222,245 ---- if (infoWindow) infoWindow->SetTarget(target); + } ! // delete the old target effect ! psengine->GetEffectManager()->DeleteEffect(targetEffect); ! targetEffect = 0; ! CS_ID mappedID = 0; ! if (target) ! { ! // render the target effect ! iMeshWrapper * targetMesh = target->pcmesh->GetMesh(); ! if (targetMesh) ! targetEffect = psengine->GetEffectManager()->RenderEffect("target", csVector3(0,0,0), targetMesh); ! // notify the server of selection ! mappedID = target->GetEntity()->GetID(); } + + psUserActionMessage userAction(0, mappedID, action); + psengine->GetMsgHandler()->SendMessage(userAction.msg); } *************** *** 610,615 **** csString maleModel = node->GetAttributeValue( "male" ); csString femaleModel = node->GetAttributeValue( "female" ); ! bool mavailable = node->GetAttributeValueAsBool("male_available"); ! bool favailable = node->GetAttributeValueAsBool("female_available"); RaceDefinition* race = new RaceDefinition; --- 608,613 ---- csString maleModel = node->GetAttributeValue( "male" ); csString femaleModel = node->GetAttributeValue( "female" ); ! bool mavailable = node->GetAttributeValueAsBool("male_available"); ! bool favailable = node->GetAttributeValueAsBool("female_available"); RaceDefinition* race = new RaceDefinition; Index: psclientchar.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psclientchar.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** psclientchar.h 24 Jan 2005 02:07:49 -0000 1.63 --- psclientchar.h 24 Jan 2005 04:54:13 -0000 1.64 *************** *** 77,82 **** * @param newTarget The new target of the character, 0 to select nothing. * @param informServer true if the server should be informed of the new target. */ ! void SetTarget(GEMClientObject * newTarget, bool informServer = true); /**Gets the target of the character. --- 77,83 ---- * @param newTarget The new target of the character, 0 to select nothing. * @param informServer true if the server should be informed of the new target. + * @param the action string to send to the server */ ! void SetTarget(GEMClientObject * newTarget, char * action); /**Gets the target of the character. Index: psengine.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psengine.cpp,v retrieving revision 1.456 retrieving revision 1.457 diff -C2 -d -r1.456 -r1.457 *** psengine.cpp 20 Jan 2005 12:07:36 -0000 1.456 --- psengine.cpp 24 Jan 2005 04:54:13 -0000 1.457 *************** *** 1603,1606 **** --- 1603,1607 ---- } } + // ---------------------------------------------------------------------------- Index: psengine.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psengine.h,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** psengine.h 20 Jan 2005 12:07:37 -0000 1.142 --- psengine.h 24 Jan 2005 04:54:13 -0000 1.143 *************** *** 135,139 **** iNetManager* GetNetManager(); psSlotManager* GetSlotManager() { return slotManager;} ! ClientCacheManager* GetCacheManager() { return cachemanager; } psClientCharManager * GetCharManager() { return charmanager; } --- 135,139 ---- iNetManager* GetNetManager(); psSlotManager* GetSlotManager() { return slotManager;} ! ClientCacheManager* GetCacheManager() { return cachemanager; } psClientCharManager * GetCharManager() { return charmanager; } *************** *** 445,453 **** void PreloadModels(); ! void PreloadItemsDir(); ! void PreloadSubDir(const char* dirname); bool modelsLoaded; // Tells if the models are finished loading yet. size_t modelToLoad; // Keeps a count of the models loaded so far. ! csArray<csString> modelnames; psCharControlManager* charControl; --- 445,453 ---- void PreloadModels(); ! void PreloadItemsDir(); ! void PreloadSubDir(const char* dirname); bool modelsLoaded; // Tells if the models are finished loading yet. size_t modelToLoad; // Keeps a count of the models loaded so far. ! csArray<csString> modelnames; psCharControlManager* charControl; |