From: <hei...@us...> - 2008-08-14 19:22:23
|
Revision: 2046 http://planeshift.svn.sourceforge.net/planeshift/?rev=2046&view=rev Author: heinchen Date: 2008-08-14 19:22:32 +0000 (Thu, 14 Aug 2008) Log Message: ----------- fixed issues with label visibility - see FS#1971 Modified Paths: -------------- trunk/docs/history.txt trunk/src/client/entitylabels.cpp trunk/src/client/entitylabels.h Modified: trunk/docs/history.txt =================================================================== --- trunk/docs/history.txt 2008-08-14 14:57:45 UTC (rev 2045) +++ trunk/docs/history.txt 2008-08-14 19:22:32 UTC (rev 2046) @@ -1,3 +1,6 @@ +*** 2008-08-14 by Andreas Heinchen +- Fix for FS#1971, patch by peeg + *** 2008-08-14 by Mike Gist - Fixed FS#2128, patch from weltall. Modified: trunk/src/client/entitylabels.cpp =================================================================== --- trunk/src/client/entitylabels.cpp 2008-08-14 14:57:45 UTC (rev 2045) +++ trunk/src/client/entitylabels.cpp 2008-08-14 19:22:32 UTC (rev 2046) @@ -332,9 +332,9 @@ { CS_ASSERT_MSG("Effects Manager must exist before loading entity labels!", psengine->GetEffectManager() ); - if (visCreatures == LABEL_NEVER && visItems == LABEL_NEVER) - return; - + if(MatchVisibility(object->GetObjectType(), LABEL_NEVER)) + return; + if(object->GetEntityLabel()) { RepaintObjectLabel( object ); @@ -442,7 +442,7 @@ continue; // Don't show labels of stuff whose label isn't always visible - if (!ShowLabel(object->GetObjectType(), LABEL_ALWAYS)) + if (!MatchVisibility(object->GetObjectType(), LABEL_ALWAYS)) continue; // Only show labels within range @@ -463,20 +463,16 @@ // Find out the object underMouse = psengine->GetMainWidget()->FindMouseOverObject(mouse.x, mouse.y); - - if(underMouse) - { - // Don't show labels of stuff whose label isn't only visible on mouse over - if(!ShowLabel(underMouse->GetObjectType(), LABEL_ONMOUSE)) - return; - } // Is this a new object? if (underMouse != lastUnderMouse) { // Hide old - if (lastUnderMouse != NULL) + if (lastUnderMouse != NULL && MatchVisibility(lastUnderMouse->GetObjectType(), LABEL_ONMOUSE)) ShowLabelOfObject(lastUnderMouse,false); + + if (underMouse != NULL && !MatchVisibility(underMouse->GetObjectType(), LABEL_ONMOUSE)) + return; // Show new if (underMouse != NULL && underMouse != celClient->GetMainPlayer()) @@ -590,7 +586,7 @@ OnObjectArrived( entities.Get(i) ); } -bool psEntityLabels::ShowLabel(GEMOBJECT_TYPE type, psEntityLabelVisib vis) +bool psEntityLabels::MatchVisibility(GEMOBJECT_TYPE type, psEntityLabelVisib vis) { if(type == GEM_ACTOR) { Modified: trunk/src/client/entitylabels.h =================================================================== --- trunk/src/client/entitylabels.h 2008-08-14 14:57:45 UTC (rev 2045) +++ trunk/src/client/entitylabels.h 2008-08-14 19:22:32 UTC (rev 2046) @@ -153,7 +153,7 @@ void DeleteLabelOfObject( GEMClientObject* object ); - bool ShowLabel(GEMOBJECT_TYPE type, psEntityLabelVisib vis); + bool MatchVisibility(GEMOBJECT_TYPE type, psEntityLabelVisib vis); /** * Configuration options */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |