@ -172,9 +172,9 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
// For RoleMasters, merchants etc... must display name and function, and nothing else
// For RoleMasters, merchants etc... must display name and function, and nothing else
for ( uint i = 0 ; i < NumBars ; i + + )
for ( uint i = 0 ; i < NumBars ; i + + )
bars [ i ] = false ;
bars [ i ] = false ;
name = ! entityName . empty ( ) ;
name = ! entityName . empty ( ) & & pIM - > getDbProp ( dbEntry + " NPCNAME " ) - > getValueBool ( ) ;
symbol = false ;
symbol = false ;
title = true ;
title = ( entityName . empty ( ) & & pIM - > getDbProp ( dbEntry + " NPCNAME " ) - > getValueBool ( ) ) | | pIM - > getDbProp ( dbEntry + " NPCTITLE " ) - > getValueBool ( ) ;
guildName = false ;
guildName = false ;
templateName = " in_scene_user_info " ;
templateName = " in_scene_user_info " ;
rpTags = ( ! entityTag1 . empty ( ) | | ! entityTag2 . empty ( ) | | ! entityTag3 . empty ( ) | | ! entityTag4 . empty ( ) ) & & pIM - > getDbProp ( dbEntry + " RPTAGS " ) - > getValueBool ( ) ;
rpTags = ( ! entityTag1 . empty ( ) | | ! entityTag2 . empty ( ) | | ! entityTag3 . empty ( ) | | ! entityTag4 . empty ( ) ) & & pIM - > getDbProp ( dbEntry + " RPTAGS " ) - > getValueBool ( ) ;
@ -281,10 +281,9 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
info - > _Entity = entity ;
info - > _Entity = entity ;
// Some constants
// Some constants
sint barHeight , barSpace , textH ;
sint barHeight , barSpace ;
fromString ( pIM - > getDefine ( " in_scene_user_info_bar_h " ) , barHeight ) ;
fromString ( pIM - > getDefine ( " in_scene_user_info_bar_h " ) , barHeight ) ;
fromString ( pIM - > getDefine ( " in_scene_user_info_bar_space " ) , barSpace ) ;
fromString ( pIM - > getDefine ( " in_scene_user_info_bar_space " ) , barSpace ) ;
fromString ( pIM - > getDefine ( " in_scene_user_info_text_h " ) , textH ) ;
fromString ( pIM - > getDefine ( " in_scene_user_bar_length " ) , CGroupInSceneUserInfo : : _BatLength ) ;
fromString ( pIM - > getDefine ( " in_scene_user_bar_length " ) , CGroupInSceneUserInfo : : _BatLength ) ;
// Build the bars
// Build the bars
@ -309,10 +308,9 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
bitmap - > setColorRGBA ( BarColor [ i ] ) ;
bitmap - > setColorRGBA ( BarColor [ i ] ) ;
}
}
info - > _Bars [ i ] = bitmap ;
info - > _Bars [ i ] = bitmap ;
barCount + + ;
}
}
}
}
barCount + + ;
}
}
}
}
@ -345,21 +343,31 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
if ( ! barCount )
if ( ! barCount )
{
{
// Delete
// Delete
CViewBase * view = leftGroup - > getView ( " win_bot " ) ;
if ( view )
leftGroup - > delView ( view ) ;
view = leftGroup - > getView ( " win_mid " ) ;
if ( view )
leftGroup - > delView ( view ) ;
view = leftGroup - > getView ( " win_top " ) ;
if ( view )
leftGroup - > delView ( view ) ;
if ( win_jauge_mid )
if ( win_jauge_mid )
win_jauge_mid - > setActive ( false ) ;
//win_jauge_mid->setActive(false);
// leftGroup->delView (win_jauge_mid);
leftGroup - > delView ( win_jauge_mid ) ;
CViewBase * view = leftGroup - > getView ( " win_jauge_top " ) ;
view = leftGroup - > getView ( " win_jauge_top " ) ;
if ( view )
if ( view )
view - > setActive ( false ) ;
//view->setActive(false);
//leftGroup->delView (view);
leftGroup - > delView ( view ) ;
view = leftGroup - > getView ( " win_jauge_bot " ) ;
view = leftGroup - > getView ( " win_jauge_bot " ) ;
if ( view )
if ( view )
view - > setActive ( false ) ;
//view->setActive(false);
//leftGroup->delView (view);
leftGroup - > delView ( view ) ;
}
}
// Strings
// Strings
sint stringSpace = 0 ;
//sint stringSpace = 0;
sint stringCount = 0 ;
sint stringCount = 0 ;
if ( name )
if ( name )
{
{
@ -368,8 +376,8 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
info - > _Name = dynamic_cast < CViewText * > ( text ) ;
info - > _Name = dynamic_cast < CViewText * > ( text ) ;
stringCount + + ;
stringCount + + ;
}
}
else
//else
stringSpace + = textH ;
// stringSpace += textH;
if ( title )
if ( title )
{
{
CViewBase * text = leftGroup - > getView ( " info " + toString ( stringCount ) ) ;
CViewBase * text = leftGroup - > getView ( " info " + toString ( stringCount ) ) ;
@ -377,8 +385,8 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
info - > _Title = dynamic_cast < CViewText * > ( text ) ;
info - > _Title = dynamic_cast < CViewText * > ( text ) ;
stringCount + + ;
stringCount + + ;
}
}
else
//else
stringSpace + = textH ;
// stringSpace += textH;
if ( rpTags )
if ( rpTags )
{
{
@ -444,8 +452,8 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
stringCount + + ;
stringCount + + ;
}
}
}
}
else
//else
stringSpace + = textH ;
// stringSpace += textH;
// Hide guild symbol / raw material source icon?
// Hide guild symbol / raw material source icon?
if ( isForageSource )
if ( isForageSource )
@ -467,13 +475,9 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
if ( iconFilename )
if ( iconFilename )
bitmap - > setTexture ( * iconFilename ) ;
bitmap - > setTexture ( * iconFilename ) ;
}
}
leftGroup - > setW ( leftGroup - > getW ( ) + 42 ) ;
leftGroup - > invalidateCoords ( ) ;
leftGroup - > invalidateCoords ( ) ;
}
}
// Increase vertical size to let bars be seen
//leftGroup->setH( leftGroup->getH() + 42 ); // hide last bar, currently
// Set ZBias of forage interface
// Set ZBias of forage interface
info - > setZBias ( ClientCfg . ForageInterfaceZBias ) ;
info - > setZBias ( ClientCfg . ForageInterfaceZBias ) ;
@ -507,15 +511,15 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
{
{
info - > delView ( logoOver ) ;
info - > delView ( logoOver ) ;
}
}
leftGroup - > setW ( leftGroup - > getW ( ) + 42 ) ;
//leftGroup->setW( leftGroup->getW() + 42 );
leftGroup - > invalidateCoords ( ) ;
}
}
else
else
{
{
info - > delView ( logo ) ;
info - > delView ( logo ) ;
info - > delView ( logoOver ) ;
info - > delView ( logoOver ) ;
leftGroup - > setX ( 0 ) ;
//leftGroup->setX(0);
}
}
leftGroup - > invalidateCoords ( ) ;
}
}
}
}
else
else
@ -578,7 +582,6 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
if ( pPlayer = = NULL )
if ( pPlayer = = NULL )
needPvPLogo = false ;
needPvPLogo = false ;
if ( pPlayer ! = NULL & & needPvPLogo )
if ( pPlayer ! = NULL & & needPvPLogo )
{
{
if ( pvpFactionLogo )
if ( pvpFactionLogo )
@ -653,36 +656,36 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
}
}
else
else
{
{
if ( pvpFactionLogo )
CInterfaceGroup * grp = info - > getGroup ( " right_pvp " ) ;
pvpFactionLogo - > setActive ( false ) ;
if ( grp )
if ( pvpOutpostLogo )
info - > delGroup ( grp ) ;
pvpOutpostLogo - > setActive ( false ) ;
if ( pvpDuelLogo )
pvpDuelLogo - > setActive ( false ) ;
}
}
}
}
// No bar and no string ?
// No bar and no string ?
if ( ( ( stringCount = = 1 ) & & ! barCount ) | | ( stringCount = = 0 ) )
if ( ( ( stringCount = = 1 ) & & ! barCount ) | | ( stringCount = = 0 ) )
{
{
// Delete
CViewBase * bitmap = leftGroup - > getView ( " win_top " ) ;
if ( bitmap )
//leftGroup->delView (bitmap);
bitmap - > setAlpha ( 0 ) ;
bitmap = leftGroup - > getView ( " win_mid " ) ;
if ( bitmap )
//leftGroup->delView (bitmap);
bitmap - > setAlpha ( 0 ) ;
bitmap = leftGroup - > getView ( " win_bot " ) ;
if ( bitmap )
//leftGroup->delView (bitmap);
bitmap - > setAlpha ( 0 ) ;
// Anti-Bug, xmargin is not take into evaluate W
CViewBase * view = leftGroup - > getView ( " win_bot " ) ;
/*if (info->_Name)
if ( view )
info - > _Name - > setX ( 0 ) ; */
leftGroup - > delView ( view ) ;
view = leftGroup - > getView ( " win_mid " ) ;
if ( view )
leftGroup - > delView ( view ) ;
view = leftGroup - > getView ( " win_top " ) ;
if ( view )
leftGroup - > delView ( view ) ;
// Delete
view = leftGroup - > getView ( " win_jauge_top " ) ;
if ( view )
leftGroup - > delView ( view ) ;
view = leftGroup - > getView ( " win_jauge_mid " ) ;
if ( view )
leftGroup - > delView ( view ) ;
view = leftGroup - > getView ( " win_jauge_bot " ) ;
if ( view )
leftGroup - > delView ( view ) ;
}
}
// Delete remaining strings
// Delete remaining strings
@ -690,23 +693,16 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
{
{
CViewBase * text = leftGroup - > getView ( " info " + toString ( i ) ) ;
CViewBase * text = leftGroup - > getView ( " info " + toString ( i ) ) ;
if ( text )
if ( text )
leftGroup- > delView ( text ) ;
text- > setActive ( false ) ;
}
}
// Adjust win_mid
// Adjust win_mid
CViewBase * win_mid = leftGroup - > getView ( " win_mid " ) ;
CViewBase * win_mid = leftGroup - > getView ( " win_mid " ) ;
if ( win_mid )
if ( win_mid )
{
{
win_mid - > setH ( win_mid - > getH ( ) - spaceBar / 2 - stringSpace ) ;
win_mid - > setH ( win_mid - > getH ( ) - spaceBar / 2 ) ;
}
// Total height
}
sint totalHeight = info - > getH ( ) ;
totalHeight - = spaceBar + stringSpace ;
info - > setH ( totalHeight ) ;
totalHeight = leftGroup - > getH ( ) ;
totalHeight - = spaceBar + stringSpace ;
leftGroup - > setH ( totalHeight ) ;
// Set player name
// Set player name
if ( info - > _Name )
if ( info - > _Name )