* view->show: +Entity Names = Targetnames (option to draw targetnames, not classnames; def = no)
virtual bool getLightRadii() = 0;
virtual void setShowNames( bool showNames ) = 0;
virtual bool getShowNames() = 0;
+virtual void setShowTargetNames( bool showNames ) = 0;
+virtual bool getShowTargetNames() = 0;
virtual void setShowAngles( bool showAngles ) = 0;
virtual bool getShowAngles() = 0;
Counter* EntityKeyValues::m_counter = 0;
bool g_showNames = true;
+bool g_showTargetNames = false;
bool g_showAngles = true;
bool g_newLightDraw = true;
bool g_lightRadii = true;
bool getShowNames(){
return g_showNames;
}
+void setShowTargetNames( bool showNames ){
+ g_showTargetNames = showNames;
+}
+bool getShowTargetNames(){
+ return g_showTargetNames;
+}
void setShowAngles( bool showAngles ){
g_showAngles = showAngles;
}
}
GlobalPreferenceSystem().registerPreference( "SI_ShowNames", BoolImportStringCaller( g_showNames ), BoolExportStringCaller( g_showNames ) );
+ GlobalPreferenceSystem().registerPreference( "SI_ShowTargetNames", BoolImportStringCaller( g_showTargetNames ), BoolExportStringCaller( g_showTargetNames ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowAngles", BoolImportStringCaller( g_showAngles ), BoolExportStringCaller( g_showAngles ) );
GlobalPreferenceSystem().registerPreference( "NewLightStyle", BoolImportStringCaller( g_newLightDraw ), BoolExportStringCaller( g_newLightDraw ) );
GlobalPreferenceSystem().registerPreference( "LightRadiuses", BoolImportStringCaller( g_lightRadii ), BoolExportStringCaller( g_lightRadii ) );
void Entity_Destroy();
extern bool g_showNames;
+extern bool g_showTargetNames;
extern bool g_showAngles;
extern bool g_newLightDraw;
extern bool g_lightRadii;
#include "eclasslib.h"
#include "generic/callback.h"
#include "nameable.h"
+#include "entity.h" //g_showTargetNames
#include <set>
}
return m_name.c_str();
}
+const char* classname() const {
+ return m_entity.getEntityClass().name();
+}
void attach( const NameCallback& callback ){
m_changed.insert( callback );
}
}
void render( RenderStateFlags state ) const {
glRasterPos3fv( vector3_to_array( m_position ) );
- GlobalOpenGL().drawString( m_named.name() );
+ GlobalOpenGL().drawString( g_showTargetNames ? m_named.name() : m_named.classname() );
}
};
}
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Entity _Angles", "ShowAngles" );
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Entity _Names", "ShowNames" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Entity Names = Targetnames", "ShowTargetNames" );
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Light Radiuses", "ShowLightRadiuses" );
menu_separator( menu_in_menu );
XY_UpdateAllWindows();
}
+void ShowTargetNamesExport( const BoolImportCallback& importer ){
+ importer( GlobalEntityCreator().getShowTargetNames() );
+}
+typedef FreeCaller1<const BoolImportCallback&, ShowTargetNamesExport> ShowTargetNamesExportCaller;
+ShowTargetNamesExportCaller g_show_targetnames_caller;
+ToggleItem g_show_targetnames( g_show_targetnames_caller );
+void ShowTargetNamesToggle(){
+ GlobalEntityCreator().setShowTargetNames( !GlobalEntityCreator().getShowTargetNames() );
+ g_show_targetnames.update();
+ XY_UpdateAllWindows();
+}
+
void ShowAnglesExport( const BoolImportCallback& importer ){
importer( GlobalEntityCreator().getShowAngles() );
}
GlobalToggles_insert( "ShowAngles", FreeCaller<ShowAnglesToggle>(), ToggleItem::AddCallbackCaller( g_show_angles ) );
GlobalToggles_insert( "ShowNames", FreeCaller<ShowNamesToggle>(), ToggleItem::AddCallbackCaller( g_show_names ) );
+ GlobalToggles_insert( "ShowTargetNames", FreeCaller<ShowTargetNamesToggle>(), ToggleItem::AddCallbackCaller( g_show_targetnames ) );
GlobalToggles_insert( "ShowBlocks", FreeCaller<ShowBlocksToggle>(), ToggleItem::AddCallbackCaller( g_show_blocks ) );
GlobalToggles_insert( "ShowCoordinates", FreeCaller<ShowCoordinatesToggle>(), ToggleItem::AddCallbackCaller( g_show_coordinates ) );
GlobalToggles_insert( "ShowWindowOutline", FreeCaller<ShowOutlineToggle>(), ToggleItem::AddCallbackCaller( g_show_outline ) );