From: <rds...@us...> - 2007-12-08 23:05:44
|
Revision: 401 http://planeshift.svn.sourceforge.net/planeshift/?rev=401&view=rev Author: rdschulz Date: 2007-12-08 15:05:26 -0800 (Sat, 08 Dec 2007) Log Message: ----------- *** 2007-12-08 by Roland Schulz - fix for bt#2432 - annoying message on mouseclick when dead, thanks to Wired_Crawler. - Deferred label rendering when label mode = visible on mouseover by Vornne. Modified Paths: -------------- trunk/docs/history.txt trunk/src/client/entitylabels.cpp trunk/src/client/gui/psmainwidget.cpp Modified: trunk/docs/history.txt =================================================================== --- trunk/docs/history.txt 2007-12-08 17:03:56 UTC (rev 400) +++ trunk/docs/history.txt 2007-12-08 23:05:26 UTC (rev 401) @@ -1,3 +1,8 @@ +*** 2007-12-08 by Roland Schulz +- fix for bt#2432 - annoying message on mouseclick when dead, thanks to + Wired_Crawler. +- Deferred label rendering when label mode = visible on mouseover by Vornne. + *** 2007-12-08 by Sasha Levin - Patch by f8ejf to improve /target. Modified: trunk/src/client/entitylabels.cpp =================================================================== --- trunk/src/client/entitylabels.cpp 2007-12-08 17:03:56 UTC (rev 400) +++ trunk/src/client/entitylabels.cpp 2007-12-08 23:05:26 UTC (rev 401) @@ -224,8 +224,7 @@ csString guild( actor->GetGuildName() ); csString guild2( psengine->GetGuildName() ); - if ( guild.Length() ) - if ( guild.Length() ) + if ( guild2.Length() && guild.Length() == guild2.Length() ) { // If same guild, indicate with color if (guild == guild2) @@ -278,6 +277,16 @@ void psEntityLabels::CreateLabelOfObject(GEMClientObject *object) { + if (!object) + { + Debug1( LOG_ANY, 0, "NULL object passed to psEntityLabels::CreateLabelOfObject" ); + return; + } + + // Don't make labels for the player or action locations + if (object->GetEntity() == celClient->GetMainActor() || object->GetObjectType() == GEM_ACTION_LOC) + return; + iMeshWrapper* mesh = object->pcmesh->GetMesh(); // Has it got a mesh to attach to? @@ -296,7 +305,6 @@ psEffect* effect = effectMgr->FindEffect(id); object->SetEntityLabel(effect); - effectMgr->ShowEffect(id,false); // Hide until told to show // Update text SetObjectText(object); @@ -319,22 +327,10 @@ { CS_ASSERT_MSG("Effects Manager must exist before loading entity labels!", psengine->GetEffectManager() ); - if (visibility == LABEL_NEVER) + if (visibility == LABEL_NEVER || visibility == LABEL_ONMOUSE) return; - if (!object) - { - Debug1( LOG_ANY, 0, "NULL object passed to psEntityLabels::OnObjectArried" ); - return; - } - - // Action location? - if (object->GetObjectType() == GEM_ACTION_LOC) - return; - - DeleteLabelOfObject(object); // just to be sure - if ( object->GetEntity() != celClient->GetMainActor() ) - CreateLabelOfObject( object ); + CreateLabelOfObject( object ); } @@ -478,9 +474,16 @@ inline void psEntityLabels::ShowLabelOfObject(GEMClientObject* object, bool show) { - psEffect* effect = object->GetEntityLabel(); - if (effect != NULL) - psengine->GetEffectManager()->ShowEffect(effect->GetUniqueID(),show); + if (object->GetEntityLabel() == NULL) + { + CreateLabelOfObject(object); + } + + psEffect* entityLabel = object->GetEntityLabel(); + if (entityLabel != NULL) + { + psengine->GetEffectManager()->ShowEffect(entityLabel->GetUniqueID(),show); + } } void psEntityLabels::RepaintAllLabels() Modified: trunk/src/client/gui/psmainwidget.cpp =================================================================== --- trunk/src/client/gui/psmainwidget.cpp 2007-12-08 17:03:56 UTC (rev 400) +++ trunk/src/client/gui/psmainwidget.cpp 2007-12-08 23:05:26 UTC (rev 401) @@ -296,6 +296,13 @@ if (!bar) return false;// no gui loaded, so nothing here can be done. + // ignore mouse clicks if character is dead + if( psengine->GetCelClient() && psengine->GetCelClient()->GetMainPlayer() + && !psengine->GetCelClient()->GetMainPlayer()->IsAlive() ) + { + return false; + } + // Check to see if we are dropping an item if ( psengine->GetSlotManager() && psengine->GetSlotManager()->IsDragging() ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |