* "Entity Names = Targetnames" option:

also affects Entity List
		moved from View->Show menu to prefs->display->entities
		prompt about restart on change
This commit is contained in:
Garux
2017-08-20 16:42:18 +03:00
parent 56997e1c66
commit caf093f827
5 changed files with 27 additions and 17 deletions

View File

@@ -415,6 +415,10 @@ void Entity_Construct( EGameType gameType ){
GlobalPreferenceSystem().registerPreference( "SI_ShowAngles", BoolImportStringCaller( g_showAngles ), BoolExportStringCaller( g_showAngles ) );
GlobalPreferenceSystem().registerPreference( "LightRadiuses", BoolImportStringCaller( g_lightRadii ), BoolExportStringCaller( g_lightRadii ) );
if( !g_showTargetNames ){
Static<KeyIsName>::instance().m_nameKey = "classname";
}
Entity_InitFilters();
LightType lightType = LIGHTTYPE_DEFAULT;
if ( g_gameType == eGameTypeRTCW ) {

View File

@@ -26,7 +26,7 @@
#include "eclasslib.h"
#include "generic/callback.h"
#include "nameable.h"
#include "entity.h" //g_showTargetNames
#include "entity.h"
#include <set>
@@ -117,7 +117,8 @@ public:
}
RenderableNamedEntity( NamedEntity& named, const Vector3& position, const char* exclude = 0 )
: m_named( named ), m_position( position ), m_tex( 0 ), m_exclude( exclude ) {
construct_textures( g_showTargetNames ? m_named.name() : m_named.classname() );
// construct_textures( g_showTargetNames ? m_named.name() : m_named.classname() );
construct_textures( m_named.name() );
m_named.attach( IdentifierChangedCaller( *this ) );
}
bool excluded_not() const {
@@ -261,7 +262,8 @@ public:
}
void identifierChanged( const char* value ){
delete_textures();
construct_textures( g_showTargetNames ? value : m_named.classname() );
// construct_textures( g_showTargetNames ? value : m_named.classname() );
construct_textures( value );
}
typedef MemberCaller1<RenderableNamedEntity, const char*, &RenderableNamedEntity::identifierChanged> IdentifierChangedCaller;
};