menus...
* view->show: +Entity Names = Targetnames (option to draw targetnames, not classnames; def = no)
This commit is contained in:
parent
93ca259313
commit
87d5b6efe5
|
|
@ -126,6 +126,8 @@ virtual void setLightRadii( bool lightRadii ) = 0;
|
||||||
virtual bool getLightRadii() = 0;
|
virtual bool getLightRadii() = 0;
|
||||||
virtual void setShowNames( bool showNames ) = 0;
|
virtual void setShowNames( bool showNames ) = 0;
|
||||||
virtual bool getShowNames() = 0;
|
virtual bool getShowNames() = 0;
|
||||||
|
virtual void setShowTargetNames( bool showNames ) = 0;
|
||||||
|
virtual bool getShowTargetNames() = 0;
|
||||||
virtual void setShowAngles( bool showAngles ) = 0;
|
virtual void setShowAngles( bool showAngles ) = 0;
|
||||||
virtual bool getShowAngles() = 0;
|
virtual bool getShowAngles() = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ EntityCreator::KeyValueChangedFunc KeyValue::m_entityKeyValueChanged = 0;
|
||||||
Counter* EntityKeyValues::m_counter = 0;
|
Counter* EntityKeyValues::m_counter = 0;
|
||||||
|
|
||||||
bool g_showNames = true;
|
bool g_showNames = true;
|
||||||
|
bool g_showTargetNames = false;
|
||||||
bool g_showAngles = true;
|
bool g_showAngles = true;
|
||||||
bool g_newLightDraw = true;
|
bool g_newLightDraw = true;
|
||||||
bool g_lightRadii = true;
|
bool g_lightRadii = true;
|
||||||
|
|
@ -264,6 +265,12 @@ void setShowNames( bool showNames ){
|
||||||
bool getShowNames(){
|
bool getShowNames(){
|
||||||
return g_showNames;
|
return g_showNames;
|
||||||
}
|
}
|
||||||
|
void setShowTargetNames( bool showNames ){
|
||||||
|
g_showTargetNames = showNames;
|
||||||
|
}
|
||||||
|
bool getShowTargetNames(){
|
||||||
|
return g_showTargetNames;
|
||||||
|
}
|
||||||
void setShowAngles( bool showAngles ){
|
void setShowAngles( bool showAngles ){
|
||||||
g_showAngles = showAngles;
|
g_showAngles = showAngles;
|
||||||
}
|
}
|
||||||
|
|
@ -368,6 +375,7 @@ void Entity_Construct( EGameType gameType ){
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalPreferenceSystem().registerPreference( "SI_ShowNames", BoolImportStringCaller( g_showNames ), BoolExportStringCaller( g_showNames ) );
|
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( "SI_ShowAngles", BoolImportStringCaller( g_showAngles ), BoolExportStringCaller( g_showAngles ) );
|
||||||
GlobalPreferenceSystem().registerPreference( "NewLightStyle", BoolImportStringCaller( g_newLightDraw ), BoolExportStringCaller( g_newLightDraw ) );
|
GlobalPreferenceSystem().registerPreference( "NewLightStyle", BoolImportStringCaller( g_newLightDraw ), BoolExportStringCaller( g_newLightDraw ) );
|
||||||
GlobalPreferenceSystem().registerPreference( "LightRadiuses", BoolImportStringCaller( g_lightRadii ), BoolExportStringCaller( g_lightRadii ) );
|
GlobalPreferenceSystem().registerPreference( "LightRadiuses", BoolImportStringCaller( g_lightRadii ), BoolExportStringCaller( g_lightRadii ) );
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ void Entity_Construct( EGameType gameType = eGameTypeQuake3 );
|
||||||
void Entity_Destroy();
|
void Entity_Destroy();
|
||||||
|
|
||||||
extern bool g_showNames;
|
extern bool g_showNames;
|
||||||
|
extern bool g_showTargetNames;
|
||||||
extern bool g_showAngles;
|
extern bool g_showAngles;
|
||||||
extern bool g_newLightDraw;
|
extern bool g_newLightDraw;
|
||||||
extern bool g_lightRadii;
|
extern bool g_lightRadii;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
#include "eclasslib.h"
|
#include "eclasslib.h"
|
||||||
#include "generic/callback.h"
|
#include "generic/callback.h"
|
||||||
#include "nameable.h"
|
#include "nameable.h"
|
||||||
|
#include "entity.h" //g_showTargetNames
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
|
@ -62,6 +63,9 @@ const char* name() const {
|
||||||
}
|
}
|
||||||
return m_name.c_str();
|
return m_name.c_str();
|
||||||
}
|
}
|
||||||
|
const char* classname() const {
|
||||||
|
return m_entity.getEntityClass().name();
|
||||||
|
}
|
||||||
void attach( const NameCallback& callback ){
|
void attach( const NameCallback& callback ){
|
||||||
m_changed.insert( callback );
|
m_changed.insert( callback );
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +96,7 @@ RenderableNamedEntity( const NamedEntity& named, const Vector3& position )
|
||||||
}
|
}
|
||||||
void render( RenderStateFlags state ) const {
|
void render( RenderStateFlags state ) const {
|
||||||
glRasterPos3fv( vector3_to_array( m_position ) );
|
glRasterPos3fv( vector3_to_array( m_position ) );
|
||||||
GlobalOpenGL().drawString( m_named.name() );
|
GlobalOpenGL().drawString( g_showTargetNames ? m_named.name() : m_named.classname() );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1994,6 +1994,7 @@ GtkMenuItem* create_view_menu( MainFrame::EViewStyle style ){
|
||||||
}
|
}
|
||||||
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Entity _Angles", "ShowAngles" );
|
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, "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" );
|
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Light Radiuses", "ShowLightRadiuses" );
|
||||||
|
|
||||||
menu_separator( menu_in_menu );
|
menu_separator( menu_in_menu );
|
||||||
|
|
|
||||||
|
|
@ -2840,6 +2840,18 @@ void ShowNamesToggle(){
|
||||||
XY_UpdateAllWindows();
|
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 ){
|
void ShowAnglesExport( const BoolImportCallback& importer ){
|
||||||
importer( GlobalEntityCreator().getShowAngles() );
|
importer( GlobalEntityCreator().getShowAngles() );
|
||||||
}
|
}
|
||||||
|
|
@ -2951,6 +2963,7 @@ void XYShow_registerCommands(){
|
||||||
|
|
||||||
GlobalToggles_insert( "ShowAngles", FreeCaller<ShowAnglesToggle>(), ToggleItem::AddCallbackCaller( g_show_angles ) );
|
GlobalToggles_insert( "ShowAngles", FreeCaller<ShowAnglesToggle>(), ToggleItem::AddCallbackCaller( g_show_angles ) );
|
||||||
GlobalToggles_insert( "ShowNames", FreeCaller<ShowNamesToggle>(), ToggleItem::AddCallbackCaller( g_show_names ) );
|
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( "ShowBlocks", FreeCaller<ShowBlocksToggle>(), ToggleItem::AddCallbackCaller( g_show_blocks ) );
|
||||||
GlobalToggles_insert( "ShowCoordinates", FreeCaller<ShowCoordinatesToggle>(), ToggleItem::AddCallbackCaller( g_show_coordinates ) );
|
GlobalToggles_insert( "ShowCoordinates", FreeCaller<ShowCoordinatesToggle>(), ToggleItem::AddCallbackCaller( g_show_coordinates ) );
|
||||||
GlobalToggles_insert( "ShowWindowOutline", FreeCaller<ShowOutlineToggle>(), ToggleItem::AddCallbackCaller( g_show_outline ) );
|
GlobalToggles_insert( "ShowWindowOutline", FreeCaller<ShowOutlineToggle>(), ToggleItem::AddCallbackCaller( g_show_outline ) );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user