}
-#define NUM_TOOLBARBUTTONS 14
+#define NUM_TOOLBARBUTTONS 13
std::size_t ToolbarButtonCount( void ) {
return NUM_TOOLBARBUTTONS;
switch ( mIndex ) {
case 0: return "bobtoolz_cleanup.png";
case 1: return "bobtoolz_poly.png";
- case 2: return "bobtoolz_caulk.png";
- case 3: return "";
- case 4: return "bobtoolz_treeplanter.png";
- case 5: return "bobtoolz_trainpathplot.png";
- case 6: return "bobtoolz_dropent.png";
- case 7: return "";
- case 8: return "bobtoolz_merge.png";
- case 9: return "bobtoolz_split.png";
- case 10: return "bobtoolz_splitrow.png";
- case 11: return "bobtoolz_splitcol.png";
- case 12: return "";
- case 13: return "bobtoolz_turnedge.png";
+// case 2: return "bobtoolz_caulk.png";
+ case 2: return "";
+ case 3: return "bobtoolz_treeplanter.png";
+ case 4: return "bobtoolz_trainpathplot.png";
+ case 5: return "bobtoolz_dropent.png";
+ case 6: return "";
+ case 7: return "bobtoolz_merge.png";
+ case 8: return "bobtoolz_split.png";
+ case 9: return "bobtoolz_splitrow.png";
+ case 10: return "bobtoolz_splitcol.png";
+ case 11: return "";
+ case 12: return "bobtoolz_turnedge.png";
}
return NULL;
}
virtual EType getType() const {
switch ( mIndex ) {
- case 3: return eSpace;
- case 4: return eToggleButton;
- case 7: return eSpace;
- case 12: return eSpace;
+ case 2: return eSpace;
+ case 3: return eToggleButton;
+ case 6: return eSpace;
+ case 11: return eSpace;
default: return eButton;
}
}
switch ( mIndex ) {
case 0: return "Cleanup";
case 1: return "Polygons";
- case 2: return "Caulk";
- case 4: return "Tree Planter";
- case 5: return "Plot Splines";
- case 6: return "Drop Entity";
- case 8: return "Merge 2 Patches";
- case 9: return "Split Patch";
- case 10: return "Split Patch Rows";
- case 11: return "Split Patch Columns";
- case 13: return "Flip Terrain";
+// case 2: return "Caulk";
+ case 3: return "Tree Planter";
+ case 4: return "Plot Splines";
+ case 5: return "Drop Entity";
+ case 7: return "Merge 2 Patches";
+ case 8: return "Split Patch";
+ case 9: return "Split Patch Rows";
+ case 10: return "Split Patch Columns";
+ case 12: return "Flip Terrain";
}
return NULL;
}
switch ( mIndex ) {
case 0: return "Brush Cleanup";
case 1: return "Polygons";
- case 2: return "Caulk selection";
- case 4: return "Tree Planter";
- case 5: return "Plot Splines";
- case 6: return "Drop Entity";
- case 8: return "Merge 2 Patches";
- case 9: return "Split Patch";
- case 10: return "Split Patch Rows";
- case 11: return "Split Patch Columns";
- case 13: return "Flip Terrain (Turn Edge)";
+// case 2: return "Caulk selection";
+ case 3: return "Tree Planter";
+ case 4: return "Plot Splines";
+ case 5: return "Drop Entity";
+ case 7: return "Merge 2 Patches";
+ case 8: return "Split Patch";
+ case 9: return "Split Patch Rows";
+ case 10: return "Split Patch Columns";
+ case 12: return "Flip Terrain (Turn Edge)";
}
return NULL;
}
switch ( mIndex ) {
case 0: DoFixBrushes(); break;
case 1: DoPolygonsTB(); break;
- case 2: DoCaulkSelection(); break;
- case 4: DoTreePlanter(); break;
- case 5: DoTrainPathPlot(); break;
- case 6: DoDropEnts(); break;
- case 8: DoMergePatches(); break;
- case 9: DoSplitPatch(); break;
- case 10: DoSplitPatchRows(); break;
- case 11: DoSplitPatchCols(); break;
- case 13: DoFlipTerrain(); break;
+// case 2: DoCaulkSelection(); break;
+ case 3: DoTreePlanter(); break;
+ case 4: DoTrainPathPlot(); break;
+ case 5: DoDropEnts(); break;
+ case 7: DoMergePatches(); break;
+ case 8: DoSplitPatch(); break;
+ case 9: DoSplitPatchRows(); break;
+ case 10: DoSplitPatchCols(); break;
+ case 12: DoFlipTerrain(); break;
}
}
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0, width, 0, height, -100, 100 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
glDisable( GL_DEPTH_TEST );
Cam_Draw
==============
*/
-
+/*
void ShowStatsToggle(){
g_camwindow_globals_private.m_showStats ^= 1;
}
ShowStatsExportCaller g_show_stats_caller;
BoolExportCallback g_show_stats_callback( g_show_stats_caller );
ToggleItem g_show_stats( g_show_stats_callback );
+*/
+BoolExportCaller g_show_stats_caller( g_camwindow_globals_private.m_showStats );
+ToggleItem g_show_stats( g_show_stats_caller );
+void ShowStatsToggle(){
+ g_camwindow_globals_private.m_showStats ^= 1;
+ g_show_stats.update();
+ UpdateAllWindows();
+}
void CamWnd::Cam_Draw(){
glViewport( 0, 0, m_Camera.width, m_Camera.height );
break;
}
- if ( !g_xywindow_globals.m_bNoStipple ) {
+// if ( !g_xywindow_globals.m_bNoStipple ) {
globalstate |= RENDER_LINESTIPPLE | RENDER_POLYGONSTIPPLE;
- }
+// }
{
CamRenderer renderer( globalstate, m_state_select2, m_state_select1, m_view.getViewer() );
GlobalShortcuts_insert( "CameraFreeMoveLeft2", Accelerator( GDK_Left ) );
GlobalShortcuts_insert( "CameraFreeMoveRight2", Accelerator( GDK_Right ) );
- GlobalToggles_insert( "ShowStats", ShowStatsToggleCaller(), ToggleItem::AddCallbackCaller( g_show_stats ) );
+ GlobalToggles_insert( "ShowStats", FreeCaller<ShowStatsToggle>(), ToggleItem::AddCallbackCaller( g_show_stats ) );
GlobalPreferenceSystem().registerPreference( "ShowStats", BoolImportStringCaller( g_camwindow_globals_private.m_showStats ), BoolExportStringCaller( g_camwindow_globals_private.m_showStats ) );
GlobalPreferenceSystem().registerPreference( "MoveSpeed", IntImportStringCaller( g_camwindow_globals_private.m_nMoveSpeed ), IntExportStringCaller( g_camwindow_globals_private.m_nMoveSpeed ) );
}
return 0;
}
-
+/*
void LightRadiiImport( EntityCreator& self, bool value ){
self.setLightRadii( value );
}
void Entity_registerPreferencesPage(){
PreferencesDialog_addDisplayPage( FreeCaller1<PreferenceGroup&, Entity_constructPage>() );
}
+*/
-
+void ShowLightRadiiExport( const BoolImportCallback& importer ){
+ importer( GlobalEntityCreator().getLightRadii() );
+}
+typedef FreeCaller1<const BoolImportCallback&, ShowLightRadiiExport> ShowLightRadiiExportCaller;
+ShowLightRadiiExportCaller g_show_lightradii_caller;
+ToggleItem g_show_lightradii_item( g_show_lightradii_caller );
+void ToggleShowLightRadii(){
+ GlobalEntityCreator().setLightRadii( !GlobalEntityCreator().getLightRadii() );
+ g_show_lightradii_item.update();
+ UpdateAllWindows();
+}
void Entity_constructMenu( GtkMenu* menu ){
create_menu_item_with_mnemonic( menu, "_Regroup", "GroupSelection" );
GlobalCommands_insert( "GroupSelection", FreeCaller<Entity_groupSelected>() );
GlobalCommands_insert( "UngroupSelection", FreeCaller<Entity_ungroupSelected>() );
+ GlobalToggles_insert( "ShowLightRadiuses", FreeCaller<ToggleShowLightRadii>(), ToggleItem::AddCallbackCaller( g_show_lightradii_item ) );
+
GlobalPreferenceSystem().registerPreference( "SI_Colors5", Vector3ImportStringCaller( g_entity_globals.color_entity ), Vector3ExportStringCaller( g_entity_globals.color_entity ) );
GlobalPreferenceSystem().registerPreference( "LastLightIntensity", IntImportStringCaller( g_iLastLightIntensity ), IntExportStringCaller( g_iLastLightIntensity ) );
- Entity_registerPreferencesPage();
+// Entity_registerPreferencesPage();
}
void Entity_Destroy(){
return FALSE;
}
+gboolean Region_button_press( GtkWidget *widget, GdkEventButton *event, gpointer data ){
+ if ( event->button == 3 && event->type == GDK_BUTTON_PRESS ) {
+ GlobalCommands_find( "RegionOff" ).m_callback();
+ ToggleActions = 0;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+gboolean Hide_button_press( GtkWidget *widget, GdkEventButton *event, gpointer data ){
+ if ( event->button == 3 && event->type == GDK_BUTTON_PRESS ) {
+ GlobalCommands_find( "ShowHidden" ).m_callback();
+ ToggleActions = 0;
+ return TRUE;
+ }
+ return FALSE;
+}
GtkToolbar* create_filter_toolbar(){
- GtkToolbar* filter_toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
- gtk_widget_show( GTK_WIDGET( filter_toolbar ) );
- g_signal_connect( G_OBJECT( filter_toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 );
+ GtkToolbar* toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
+ gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
+// gtk_toolbar_set_show_arrow( toolbar, TRUE );
+ gtk_widget_show( GTK_WIDGET( toolbar ) );
+ g_signal_connect( G_OBJECT( toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 );
GtkToggleButton* button;
- toolbar_append_toggle_button( filter_toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" );
+ toolbar_append_toggle_button( toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" );
- button = toolbar_append_toggle_button( filter_toolbar, "Structural (CTRL + SHIFT + D)\nRightClick: MakeStructural", "f-structural.png", "FilterStructural" );
+ button = toolbar_append_toggle_button( toolbar, "Structural (CTRL + SHIFT + D)\nRightClick: MakeStructural", "f-structural.png", "FilterStructural" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Structural_button_press ), 0 );
- button = toolbar_append_toggle_button( filter_toolbar, "Details (CTRL + D)\nRightClick: MakeDetail", "f-details.png", "FilterDetails" );
+ button = toolbar_append_toggle_button( toolbar, "Details (CTRL + D)\nRightClick: MakeDetail", "f-details.png", "FilterDetails" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Detail_button_press ), 0 );
- button = toolbar_append_toggle_button( filter_toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" );
+ button = toolbar_append_toggle_button( toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Func_Groups_button_press ), 0 );
- toolbar_append_toggle_button( filter_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
- gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
+ toolbar_append_toggle_button( toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
+ gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
- button = toolbar_append_toggle_button( filter_toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
+ button = toolbar_append_toggle_button( toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 );
- toolbar_append_toggle_button( filter_toolbar, "Translucent (ALT + 4)", "f-translucent.png", "FilterTranslucent" );
+ toolbar_append_toggle_button( toolbar, "Translucent (ALT + 4)", "f-translucent.png", "FilterTranslucent" );
- button = toolbar_append_toggle_button( filter_toolbar, "Liquids (ALT + 5)\nRightClick: toggle tex\n\twaterCaulk\n\tlavaCaulk\n\tslimeCaulk", "f-liquids.png", "FilterLiquids" );
+ button = toolbar_append_toggle_button( toolbar, "Liquids (ALT + 5)\nRightClick: toggle tex\n\twaterCaulk\n\tlavaCaulk\n\tslimeCaulk", "f-liquids.png", "FilterLiquids" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Liquids_button_press ), 0 );
- button = toolbar_append_toggle_button( filter_toolbar, "Caulk (ALT + 6)\nRightClick: tex Caulk", "f-caulk.png", "FilterCaulk" );
+ button = toolbar_append_toggle_button( toolbar, "Caulk (ALT + 6)\nRightClick: tex Caulk", "f-caulk.png", "FilterCaulk" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Caulk_button_press ), 0 );
- button = toolbar_append_toggle_button( filter_toolbar, "Clips (ALT + 7)\nRightClick: toggle tex\n\tplayerClip\n\tweapClip", "f-clip.png", "FilterClips" );
+ button = toolbar_append_toggle_button( toolbar, "Clips (ALT + 7)\nRightClick: toggle tex\n\tplayerClip\n\tweapClip", "f-clip.png", "FilterClips" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Clip_button_press ), 0 );
- button = toolbar_append_toggle_button( filter_toolbar, "HintsSkips (CTRL + H)\nRightClick: toggle tex\n\thint\n\thintLocal\n\thintSkip", "f-hint.png", "FilterHintsSkips" );
+ button = toolbar_append_toggle_button( toolbar, "HintsSkips (CTRL + H)\nRightClick: toggle tex\n\thint\n\thintLocal\n\thintSkip", "f-hint.png", "FilterHintsSkips" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Hint_button_press ), 0 );
- //toolbar_append_toggle_button( filter_toolbar, "Paths (ALT + 8)", "texture_lock.png", "FilterPaths" );
- gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
- toolbar_append_toggle_button( filter_toolbar, "Entities (ALT + 2)", "f-entities.png", "FilterEntities" );
- toolbar_append_toggle_button( filter_toolbar, "Lights (ALT + 0)", "f-lights.png", "FilterLights" );
- toolbar_append_toggle_button( filter_toolbar, "Models (SHIFT + M)", "f-models.png", "FilterModels" );
+ //toolbar_append_toggle_button( toolbar, "Paths (ALT + 8)", "texture_lock.png", "FilterPaths" );
+ gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ toolbar_append_toggle_button( toolbar, "Entities (ALT + 2)", "f-entities.png", "FilterEntities" );
+ toolbar_append_toggle_button( toolbar, "Lights (ALT + 0)", "f-lights.png", "FilterLights" );
+ toolbar_append_toggle_button( toolbar, "Models (SHIFT + M)", "f-models.png", "FilterModels" );
- button = toolbar_append_toggle_button( filter_toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
+ button = toolbar_append_toggle_button( toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Trigger_button_press ), 0 );
- //toolbar_append_toggle_button( filter_toolbar, "Decals (SHIFT + D)", "f-decals.png", "FilterDecals" );
- gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
- toolbar_append_button( filter_toolbar, "InvertFilters", "f-invert.png", "InvertFilters" );
+ //toolbar_append_toggle_button( toolbar, "Decals (SHIFT + D)", "f-decals.png", "FilterDecals" );
+ gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ //toolbar_append_button( toolbar, "InvertFilters", "f-invert.png", "InvertFilters" );
+
+ toolbar_append_button( toolbar, "ResetFilters", "f-reset.png", "ResetFilters" );
+
+ gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ button = toolbar_append_toggle_button( toolbar, "Region Set Selection (CTRL + SHIFT + R)\nRightClick: Region Off", "f-region.png", "RegionSetSelection" );
+ g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Region_button_press ), 0 );
+
+ button = toolbar_append_toggle_button( toolbar, "Hide Selected (H)\nRightClick: Show Hidden (SHIFT + H)", "f-hide.png", "HideSelected" );
+ g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Hide_button_press ), 0 );
- toolbar_append_button( filter_toolbar, "ResetFilters", "f-reset.png", "ResetFilters" );
- return filter_toolbar;
+ return toolbar;
}
g_xywindow_globals.color_gridback = Vector3( 1.0f, 1.0f, 1.0f );
g_xywindow_globals.color_gridminor = Vector3( 0.75f, 0.75f, 0.75f );
g_xywindow_globals.color_gridmajor = Vector3( 0.5f, 0.5f, 0.5f );
- g_xywindow_globals.color_gridminor_alt = Vector3( 0.5f, 0.0f, 0.0f );
- g_xywindow_globals.color_gridmajor_alt = Vector3( 1.0f, 0.0f, 0.0f );
g_xywindow_globals.color_gridblock = Vector3( 0.0f, 0.0f, 1.0f );
g_xywindow_globals.color_gridtext = Vector3( 0.0f, 0.0f, 0.0f );
g_xywindow_globals.color_selbrushes = Vector3( 1.0f, 0.0f, 0.0f );
ChooseColour m_xyback;
ChooseColour m_gridmajor;
ChooseColour m_gridminor;
-ChooseColour m_gridmajor_alt;
-ChooseColour m_gridminor_alt;
ChooseColour m_gridtext;
ChooseColour m_gridblock;
ChooseColour m_cameraback;
m_xyback( ColourGetCaller( g_xywindow_globals.color_gridback ), ColourSetCaller( g_xywindow_globals.color_gridback ) ),
m_gridmajor( ColourGetCaller( g_xywindow_globals.color_gridmajor ), ColourSetCaller( g_xywindow_globals.color_gridmajor ) ),
m_gridminor( ColourGetCaller( g_xywindow_globals.color_gridminor ), ColourSetCaller( g_xywindow_globals.color_gridminor ) ),
- m_gridmajor_alt( ColourGetCaller( g_xywindow_globals.color_gridmajor_alt ), ColourSetCaller( g_xywindow_globals.color_gridmajor_alt ) ),
- m_gridminor_alt( ColourGetCaller( g_xywindow_globals.color_gridminor_alt ), ColourSetCaller( g_xywindow_globals.color_gridminor_alt ) ),
m_gridtext( ColourGetCaller( g_xywindow_globals.color_gridtext ), ColourSetCaller( g_xywindow_globals.color_gridtext ) ),
m_gridblock( ColourGetCaller( g_xywindow_globals.color_gridblock ), ColourSetCaller( g_xywindow_globals.color_gridblock ) ),
m_cameraback( ColourGetCaller( g_camwindow_globals.color_cameraback ), ColourSetCaller( g_camwindow_globals.color_cameraback ) ),
menu_separator( menu_in_menu );
create_menu_item_with_mnemonic( menu_in_menu, "_Texture Background...", "ChooseTextureBackgroundColor" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Camera Background...", "ChooseCameraBackgroundColor" );
create_menu_item_with_mnemonic( menu_in_menu, "Grid Background...", "ChooseGridBackgroundColor" );
create_menu_item_with_mnemonic( menu_in_menu, "Grid Major...", "ChooseGridMajorColor" );
create_menu_item_with_mnemonic( menu_in_menu, "Grid Minor...", "ChooseGridMinorColor" );
- create_menu_item_with_mnemonic( menu_in_menu, "Grid Major Small...", "ChooseSmallGridMajorColor" );
- create_menu_item_with_mnemonic( menu_in_menu, "Grid Minor Small...", "ChooseSmallGridMinorColor" );
create_menu_item_with_mnemonic( menu_in_menu, "Grid Text...", "ChooseGridTextColor" );
create_menu_item_with_mnemonic( menu_in_menu, "Grid Block...", "ChooseGridBlockColor" );
- create_menu_item_with_mnemonic( menu_in_menu, "Default Brush...", "ChooseBrushColor" );
- create_menu_item_with_mnemonic( menu_in_menu, "Camera Background...", "ChooseCameraBackgroundColor" );
- create_menu_item_with_mnemonic( menu_in_menu, "Selected Brush...", "ChooseSelectedBrushColor" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Default Brush (2D)...", "ChooseBrushColor" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Selected Brush and Sizing (2D)...", "ChooseSelectedBrushColor" );
create_menu_item_with_mnemonic( menu_in_menu, "Selected Brush (Camera)...", "ChooseCameraSelectedBrushColor" );
create_menu_item_with_mnemonic( menu_in_menu, "Clipper...", "ChooseClipperColor" );
- create_menu_item_with_mnemonic( menu_in_menu, "Active View name...", "ChooseOrthoViewNameColor" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Active View Name and Outline...", "ChooseOrthoViewNameColor" );
return colours_menu_item;
}
LatchedInt g_Layout_viewStyle( 0, "Window Layout" );
LatchedBool g_Layout_enableDetachableMenus( true, "Detachable Menus" );
+LatchedBool g_Layout_enableMainToolbar( true, "Main Toolbar" );
LatchedBool g_Layout_enablePatchToolbar( true, "Patch Toolbar" );
LatchedBool g_Layout_enablePluginToolbar( true, "Plugin Toolbar" );
LatchedBool g_Layout_enableFilterToolbar( true, "Filter Toolbar" );
if ( g_Layout_enableDetachableMenus.m_value ) {
menu_tearoff( menu_in_menu );
}
- create_menu_item_with_mnemonic( menu_in_menu, "Show Size Info", "ToggleSizePaint" );
- create_menu_item_with_mnemonic( menu_in_menu, "Show Crosshair", "ToggleCrosshairs" );
- create_menu_item_with_mnemonic( menu_in_menu, "Show Grid", "ToggleGrid" );
+ 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 Light Radiuses", "ShowLightRadiuses" );
menu_separator( menu_in_menu );
- create_check_menu_item_with_mnemonic( menu_in_menu, "Show _Angles", "ShowAngles" );
- create_check_menu_item_with_mnemonic( menu_in_menu, "Show _Names", "ShowNames" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Size Info", "ToggleSizePaint" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Crosshair", "ToggleCrosshairs" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Grid", "ToggleGrid" );
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Blocks", "ShowBlocks" );
create_check_menu_item_with_mnemonic( menu_in_menu, "Show C_oordinates", "ShowCoordinates" );
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Window Outline", "ShowWindowOutline" );
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Axes", "ShowAxes" );
create_check_menu_item_with_mnemonic( menu_in_menu, "Show Workzone", "ShowWorkzone" );
- create_check_menu_item_with_mnemonic( menu_in_menu, "Show Stats", "ShowStats" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Show Camera Stats", "ShowStats" );
}
{
}
menu_separator( menu );
{
-// GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "Hide/Show" );
-// if ( g_Layout_enableDetachableMenus.m_value ) {
-// menu_tearoff( menu_in_menu );
-// }
-// create_menu_item_with_mnemonic( menu_in_menu, "Hide Selected", "HideSelected" );
-// create_menu_item_with_mnemonic( menu_in_menu, "Show Hidden", "ShowHidden" );
- create_menu_item_with_mnemonic( menu, "Hide Selected", "HideSelected" );
+ create_check_menu_item_with_mnemonic( menu, "Hide Selected", "HideSelected" );
create_menu_item_with_mnemonic( menu, "Show Hidden", "ShowHidden" );
}
menu_separator( menu );
create_menu_item_with_mnemonic( menu_in_menu, "_Off", "RegionOff" );
create_menu_item_with_mnemonic( menu_in_menu, "_Set XY", "RegionSetXY" );
create_menu_item_with_mnemonic( menu_in_menu, "Set _Brush", "RegionSetBrush" );
- create_menu_item_with_mnemonic( menu_in_menu, "Set Se_lected Brushes", "RegionSetSelection" );
+ create_check_menu_item_with_mnemonic( menu_in_menu, "Set Se_lected Brushes", "RegionSetSelection" );
}
- command_connect_accelerator( "CenterXYView" );
+ //command_connect_accelerator( "CenterXYView" );
return view_menu_item;
}
GtkToolbar* toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
gtk_toolbar_set_orientation( toolbar, GTK_ORIENTATION_HORIZONTAL );
gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
-
+// gtk_toolbar_set_show_arrow( toolbar, TRUE );
+ //gtk_orientable_set_orientation( GTK_ORIENTABLE( toolbar ), GTK_ORIENTATION_HORIZONTAL );
+ //toolbar_append_space( toolbar );
gtk_widget_show( GTK_WIDGET( toolbar ) );
File_constructToolbar( toolbar );
-
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ gtk_toolbar_append_space( toolbar );
UndoRedo_constructToolbar( toolbar );
-
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ gtk_toolbar_append_space( toolbar );
RotateFlip_constructToolbar( toolbar );
-
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ gtk_toolbar_append_space( toolbar );
Select_constructToolbar( toolbar );
-
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ gtk_toolbar_append_space( toolbar );
CSG_constructToolbar( toolbar );
-
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ gtk_toolbar_append_space( toolbar );
ComponentModes_constructToolbar( toolbar );
+ gtk_toolbar_append_space( toolbar );
if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
-
XYWnd_constructToolbar( toolbar );
+ gtk_toolbar_append_space( toolbar );
}
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
-
CamWnd_constructToolbar( toolbar );
-
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
+ gtk_toolbar_append_space( toolbar );
Manipulators_constructToolbar( toolbar );
+ gtk_toolbar_append_space( toolbar );
if ( g_Layout_enablePatchToolbar.m_value ) {
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
-
Patch_constructToolbar( toolbar );
+ gtk_toolbar_append_space( toolbar );
}
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
-
toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT + T)", "texture_lock.png", "TogTexLock" );
+ gtk_toolbar_append_space( toolbar );
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
-
- GtkButton* g_view_entities_button = toolbar_append_button( toolbar, "Entities (N)", "entities.png", "ToggleEntityInspector" );
+ toolbar_append_button( toolbar, "Entities (N)", "entities.png", "ToggleEntityInspector" );
// disable the console and texture button in the regular layouts
if ( style != MainFrame::eRegular && style != MainFrame::eRegularLeft ) {
- GtkButton* g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" );
- GtkButton* g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" );
+ toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" );
+ toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" );
}
// TODO: call light inspector
//GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.png", "ToggleLightInspector");
- gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
- GtkButton* g_refresh_models_button = toolbar_append_button( toolbar, "Refresh Models", "refresh_models.png", "RefreshReferences" );
+ gtk_toolbar_append_space( toolbar );
+ toolbar_append_button( toolbar, "Refresh Models", "refresh_models.png", "RefreshReferences" );
return toolbar;
}
GtkMenuBar* main_menu = create_main_menu( CurrentStyle() );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( main_menu ), FALSE, FALSE, 0 );
- GtkToolbar* main_toolbar = create_main_toolbar( CurrentStyle() );
- gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( main_toolbar ), FALSE, FALSE, 0 );
-
-
+ if( g_Layout_enableMainToolbar.m_value ){
+ GtkToolbar* main_toolbar = create_main_toolbar( CurrentStyle() );
+ gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( main_toolbar ), FALSE, FALSE, 0 );
+ }
if ( g_Layout_enablePluginToolbar.m_value || g_Layout_enableFilterToolbar.m_value ){
LatchedBoolImportCaller( g_Layout_enableDetachableMenus ),
BoolExportCaller( g_Layout_enableDetachableMenus.m_latched )
);
+ page.appendCheckBox(
+ "", "Main Toolbar",
+ LatchedBoolImportCaller( g_Layout_enableMainToolbar ),
+ BoolExportCaller( g_Layout_enableMainToolbar.m_latched )
+ );
if ( !string_empty( g_pGameDescription->getKeyValue( "no_patch" ) ) ) {
page.appendCheckBox(
"", "Patch Toolbar",
GlobalCommands_insert( "ToggleEntityInspector", FreeCaller<EntityInspector_ToggleShow>(), Accelerator( 'N' ) );
GlobalCommands_insert( "EntityList", FreeCaller<EntityList_toggleShown>(), Accelerator( 'L' ) );
- GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "HideSelected", FreeCaller<HideSelected>(), Accelerator( 'H' ) );
+// GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
+// GlobalCommands_insert( "HideSelected", FreeCaller<HideSelected>(), Accelerator( 'H' ) );
+ Hide_registerCommands();
GlobalToggles_insert( "DragVertices", FreeCaller<SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
GlobalToggles_insert( "DragEdges", FreeCaller<SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
GlobalCommands_insert( "ChooseGridBackgroundColor", makeCallback( g_ColoursMenu.m_xyback ) );
GlobalCommands_insert( "ChooseGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor ) );
GlobalCommands_insert( "ChooseGridMinorColor", makeCallback( g_ColoursMenu.m_gridminor ) );
- GlobalCommands_insert( "ChooseSmallGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor_alt ) );
- GlobalCommands_insert( "ChooseSmallGridMinorColor", makeCallback( g_ColoursMenu.m_gridminor_alt ) );
GlobalCommands_insert( "ChooseGridTextColor", makeCallback( g_ColoursMenu.m_gridtext ) );
GlobalCommands_insert( "ChooseGridBlockColor", makeCallback( g_ColoursMenu.m_gridblock ) );
GlobalCommands_insert( "ChooseBrushColor", makeCallback( g_ColoursMenu.m_brush ) );
GlobalSelectionSystem().addSelectionChangeCallback( ComponentModeSelectionChangedCaller() );
GlobalPreferenceSystem().registerPreference( "DetachableMenus", BoolImportStringCaller( g_Layout_enableDetachableMenus.m_latched ), BoolExportStringCaller( g_Layout_enableDetachableMenus.m_latched ) );
+ GlobalPreferenceSystem().registerPreference( "MainToolBar", BoolImportStringCaller( g_Layout_enableMainToolbar.m_latched ), BoolExportStringCaller( g_Layout_enableMainToolbar.m_latched ) );
GlobalPreferenceSystem().registerPreference( "PatchToolBar", BoolImportStringCaller( g_Layout_enablePatchToolbar.m_latched ), BoolExportStringCaller( g_Layout_enablePatchToolbar.m_latched ) );
GlobalPreferenceSystem().registerPreference( "PluginToolBar", BoolImportStringCaller( g_Layout_enablePluginToolbar.m_latched ), BoolExportStringCaller( g_Layout_enablePluginToolbar.m_latched ) );
GlobalPreferenceSystem().registerPreference( "FilterToolBar", BoolImportStringCaller( g_Layout_enableFilterToolbar.m_latched ), BoolExportStringCaller( g_Layout_enableFilterToolbar.m_latched ) );
g_Layout_viewStyle.useLatched();
g_Layout_enableDetachableMenus.useLatched();
+ g_Layout_enableMainToolbar.useLatched();
g_Layout_enablePatchToolbar.useLatched();
g_Layout_enablePluginToolbar.useLatched();
g_Layout_enableFilterToolbar.useLatched();
===========================================================
*/
-bool region_active;
+bool region_active = false;
+
+BoolExportCaller g_region_caller( region_active );
+ToggleItem g_region_item( g_region_caller );
+
Vector3 region_mins( g_MinWorldCoord, g_MinWorldCoord, g_MinWorldCoord );
Vector3 region_maxs( g_MaxWorldCoord, g_MaxWorldCoord, g_MaxWorldCoord );
*/
void Map_RegionOff(){
region_active = false;
+ g_region_item.update();
region_maxs[0] = g_MaxWorldCoord - 64;
region_mins[0] = g_MinWorldCoord + 64;
void Map_ApplyRegion( void ){
region_active = true;
+ g_region_item.update();
Scene_Exclude_Region( false );
}
if ( GlobalSelectionSystem().countSelected() != 0
&& GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive ) {
region_active = true;
+ g_region_item.update();
Select_GetBounds( region_mins, region_maxs );
Scene_Exclude_Selected( false );
GlobalCommands_insert( "RegionOff", FreeCaller<RegionOff>() );
GlobalCommands_insert( "RegionSetXY", FreeCaller<RegionXY>() );
GlobalCommands_insert( "RegionSetBrush", FreeCaller<RegionBrush>() );
- GlobalCommands_insert( "RegionSetSelection", FreeCaller<RegionSelected>(), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ //GlobalCommands_insert( "RegionSetSelection", FreeCaller<RegionSelected>(), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalToggles_insert( "RegionSetSelection", FreeCaller<RegionSelected>(), ToggleItem::AddCallbackCaller( g_region_item ), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalPreferenceSystem().registerPreference( "LastMap", CopiedStringImportStringCaller( g_strLastMap ), CopiedStringExportStringCaller( g_strLastMap ) );
GlobalPreferenceSystem().registerPreference( "LoadLastMap", BoolImportStringCaller( g_bLoadLastMap ), BoolExportStringCaller( g_bLoadLastMap ) );
GtkImage* new_plugin_image( const char* filename ){
{
StringOutputStream fullpath( 256 );
- fullpath << GameToolsPath_get() << g_pluginsDir << "bitmaps/" << filename;
+ fullpath << AppPath_get() << g_pluginsDir << "bitmaps/" << filename;
GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() );
if ( image != 0 ) {
return image;
{
StringOutputStream fullpath( 256 );
- fullpath << AppPath_get() << g_pluginsDir << "bitmaps/" << filename;
+ fullpath << GameToolsPath_get() << g_pluginsDir << "bitmaps/" << filename;
GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() );
if ( image != 0 ) {
return image;
toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
gtk_toolbar_set_orientation( toolbar, GTK_ORIENTATION_HORIZONTAL );
gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
+// gtk_toolbar_set_show_arrow( toolbar, TRUE );
gtk_widget_show( GTK_WIDGET( toolbar ) );
g_plugin_toolbar = toolbar;
StringOutputStream name( 256 );
name << StringRange( mapname, path_get_filename_base_end( mapname ) ) << ".bsp";
- build_set_variable( "MapFile", mapname );
+ if( region_active ){
+ StringOutputStream name( 256 );
+ name << StringRange( mapname, path_get_filename_base_end( mapname ) ) << ".reg";
+ build_set_variable( "MapFile", name.c_str() );
+ }
+ else{
+ build_set_variable( "MapFile", mapname );
+ }
+
build_set_variable( "BspFile", name.c_str() );
}
#include "preferences.h"
#include "xywindow.h"
+#include "camwindow.h"
state.m_sort = OpenGLState::eSortFullbright;
}
else if ( string_equal( name + 1, "CAM_HIGHLIGHT" ) ) {
- state.m_colour[0] = 1;
- state.m_colour[1] = 0;
- state.m_colour[2] = 0;
+ state.m_colour[0] = g_camwindow_globals.color_selbrushes3d[0];
+ state.m_colour[1] = g_camwindow_globals.color_selbrushes3d[1];
+ state.m_colour[2] = g_camwindow_globals.color_selbrushes3d[2];
state.m_colour[3] = 0.3f;
state.m_state = RENDER_FILL | RENDER_DEPTHTEST | RENDER_CULLFACE | RENDER_BLEND | RENDER_COLOURWRITE | RENDER_DEPTHWRITE;
state.m_sort = OpenGLState::eSortHighlight;
SceneChangeNotify();
}
+
+#include "commands.h"
+#include "dialog.h"
+
inline void hide_node( scene::Node& node, bool hide ){
hide
? node.enable( scene::Node::eHidden )
: node.disable( scene::Node::eHidden );
}
+bool g_nodes_be_hidden = false;
+
+BoolExportCaller g_hidden_caller( g_nodes_be_hidden );
+ToggleItem g_hidden_item( g_hidden_caller );
+
class HideSelectedWalker : public scene::Graph::Walker
{
bool m_hide;
Selectable* selectable = Instance_getSelectable( instance );
if ( selectable != 0
&& selectable->isSelected() ) {
+ g_nodes_be_hidden = m_hide;
hide_node( path.top(), m_hide );
}
return true;
void HideSelected(){
Select_Hide();
GlobalSelectionSystem().setSelectedAll( false );
+ g_hidden_item.update();
}
void Select_ShowAllHidden(){
Scene_Hide_All( false );
SceneChangeNotify();
+ g_nodes_be_hidden = false;
+ g_hidden_item.update();
+}
+
+void Hide_registerCommands(){
+ GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalToggles_insert( "HideSelected", FreeCaller<HideSelected>(), ToggleItem::AddCallbackCaller( g_hidden_item ), Accelerator( 'H' ) );
}
void HideSelected();
void Select_ShowAllHidden();
+void Hide_registerCommands();
// updating workzone to a given brush (depends on current view)
Scale m_scale;
public:
static Shader* m_state;
+bool m_bPreferPointEntsIn2D;
private:
EManipulatorMode m_manipulator_mode;
Manipulator* m_manipulator;
};
RadiantSelectionSystem() :
+ m_bPreferPointEntsIn2D( true ),
m_undo_begun( false ),
m_mode( ePrimitive ),
m_componentmode( eDefault ),
SelectionVolume volume( scissored );
SelectionPool selector;
- if ( face ) {
- Scene_TestSelect_Component( selector, volume, scissored, eFace );
- }
- else
- {
- Scene_TestSelect( selector, volume, scissored, Mode(), ComponentMode() );
- }
+ SelectionPool selector_point_ents;
+ const bool prefer_point_ents = m_bPreferPointEntsIn2D && Mode() == ePrimitive && !view.fill() && !face
+ && ( modifier == RadiantSelectionSystem::eReplace || modifier == RadiantSelectionSystem::eSelect || modifier == RadiantSelectionSystem::eDeselect );
- if ( !selector.failed() ) {
+ if( prefer_point_ents ){
+ Scene_TestSelect( selector_point_ents, volume, scissored, eEntity, ComponentMode() );
+ }
+ if( prefer_point_ents && !selector_point_ents.failed() ){
switch ( modifier )
{
- case RadiantSelectionSystem::eToggle:
- {
- SelectableSortedSet::iterator best = selector.begin();
- // toggle selection of the object with least depth
- if ( ( *best ).second->isSelected() ) {
- ( *best ).second->setSelected( false );
- }
- else{
- ( *best ).second->setSelected( true );
- }
- }
- break;
// if cycle mode not enabled, enable it
case RadiantSelectionSystem::eReplace:
{
// select closest
- ( *selector.begin() ).second->setSelected( true );
- }
- break;
- // select the next object in the list from the one already selected
- case RadiantSelectionSystem::eCycle:
- {
- bool CycleSelectionOccured = false;
- SelectionPool::iterator i = selector.begin();
- while ( i != selector.end() )
- {
- if ( ( *i ).second->isSelected() ) {
- deselectComponentsOrAll( face );
- ++i;
- if ( i != selector.end() ) {
- i->second->setSelected( true );
- }
- else
- {
- selector.begin()->second->setSelected( true );
- }
- CycleSelectionOccured = true;
- break;
- }
- ++i;
- }
- if( !CycleSelectionOccured ){
- deselectComponentsOrAll( face );
- ( *selector.begin() ).second->setSelected( true );
- }
+ ( *selector_point_ents.begin() ).second->setSelected( true );
}
break;
case RadiantSelectionSystem::eSelect:
{
- SelectionPool::iterator best = selector.begin();
+ SelectionPool::iterator best = selector_point_ents.begin();
if( !( *best ).second->isSelected() ){
( *best ).second->setSelected( true );
}
SelectionPool::iterator i = best;
++i;
- while ( i != selector.end() )
+ while ( i != selector_point_ents.end() )
{
if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
if( !( *i ).second->isSelected() ){
break;
case RadiantSelectionSystem::eDeselect:
{
- SelectionPool::iterator best = selector.begin();
+ SelectionPool::iterator best = selector_point_ents.begin();
if( ( *best ).second->isSelected() ){
( *best ).second->setSelected( false );
}
SelectionPool::iterator i = best;
++i;
- while ( i != selector.end() )
+ while ( i != selector_point_ents.end() )
{
if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
if( ( *i ).second->isSelected() ){
break;
}
}
- else if( modifier == eCycle ){
- deselectComponentsOrAll( face );
+ else{
+ if ( face ){
+ Scene_TestSelect_Component( selector, volume, scissored, eFace );
+ }
+ else{
+ Scene_TestSelect( selector, volume, scissored, Mode(), ComponentMode() );
+ }
+
+ if ( !selector.failed() ) {
+ switch ( modifier )
+ {
+ case RadiantSelectionSystem::eToggle:
+ {
+ SelectableSortedSet::iterator best = selector.begin();
+ // toggle selection of the object with least depth
+ if ( ( *best ).second->isSelected() ) {
+ ( *best ).second->setSelected( false );
+ }
+ else{
+ ( *best ).second->setSelected( true );
+ }
+ }
+ break;
+ // if cycle mode not enabled, enable it
+ case RadiantSelectionSystem::eReplace:
+ {
+ // select closest
+ ( *selector.begin() ).second->setSelected( true );
+ }
+ break;
+ // select the next object in the list from the one already selected
+ case RadiantSelectionSystem::eCycle:
+ {
+ bool CycleSelectionOccured = false;
+ SelectionPool::iterator i = selector.begin();
+ while ( i != selector.end() )
+ {
+ if ( ( *i ).second->isSelected() ) {
+ deselectComponentsOrAll( face );
+ ++i;
+ if ( i != selector.end() ) {
+ i->second->setSelected( true );
+ }
+ else
+ {
+ selector.begin()->second->setSelected( true );
+ }
+ CycleSelectionOccured = true;
+ break;
+ }
+ ++i;
+ }
+ if( !CycleSelectionOccured ){
+ deselectComponentsOrAll( face );
+ ( *selector.begin() ).second->setSelected( true );
+ }
+ }
+ break;
+ case RadiantSelectionSystem::eSelect:
+ {
+ SelectionPool::iterator best = selector.begin();
+ if( !( *best ).second->isSelected() ){
+ ( *best ).second->setSelected( true );
+ }
+ SelectionPool::iterator i = best;
+ ++i;
+ while ( i != selector.end() )
+ {
+ if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
+ if( !( *i ).second->isSelected() ){
+ ( *i ).second->setSelected( true );
+ }
+ }
+ else{
+ break;
+ }
+ ++i;
+ }
+ }
+ break;
+ case RadiantSelectionSystem::eDeselect:
+ {
+ SelectionPool::iterator best = selector.begin();
+ if( ( *best ).second->isSelected() ){
+ ( *best ).second->setSelected( false );
+ }
+ SelectionPool::iterator i = best;
+ ++i;
+ while ( i != selector.end() )
+ {
+ if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
+ if( ( *i ).second->isSelected() ){
+ ( *i ).second->setSelected( false );
+ }
+ }
+ else{
+ break;
+ }
+ ++i;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else if( modifier == eCycle ){
+ deselectComponentsOrAll( face );
+ }
}
}
}
SelectionVolume volume( scissored );
SelectionPool selector;
- if ( face ) {
- Scene_TestSelect_Component( selector, volume, scissored, eFace );
- }
- else
- {
- Scene_TestSelect( selector, volume, scissored, Mode(), ComponentMode() );
- }
+ SelectionPool selector_point_ents;
+ const bool prefer_point_ents = m_bPreferPointEntsIn2D && Mode() == ePrimitive && !view.fill() && !face;
- if ( !selector.failed() ) {
- SelectableSortedSet::iterator best = selector.begin();
+ if( prefer_point_ents ){
+ Scene_TestSelect( selector_point_ents, volume, scissored, eEntity, ComponentMode() );
+ }
+ if( prefer_point_ents && !selector_point_ents.failed() ){
+ SelectableSortedSet::iterator best = selector_point_ents.begin();
const bool wasSelected = ( *best ).second->isSelected();
( *best ).second->setSelected( !wasSelected );
SelectableSortedSet::iterator i = best;
++i;
- while ( i != selector.end() )
+ while ( i != selector_point_ents.end() )
{
if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
( *i ).second->setSelected( !wasSelected );
}
return !wasSelected;
}
- else{
- return true;
+ else{//do primitives, if ents failed
+ if ( face ){
+ Scene_TestSelect_Component( selector, volume, scissored, eFace );
+ }
+ else{
+ Scene_TestSelect( selector, volume, scissored, Mode(), ComponentMode() );
+ }
+ if ( !selector.failed() ){
+ SelectableSortedSet::iterator best = selector.begin();
+ const bool wasSelected = ( *best ).second->isSelected();
+ ( *best ).second->setSelected( !wasSelected );
+ SelectableSortedSet::iterator i = best;
+ ++i;
+ while ( i != selector.end() )
+ {
+ if( ( *i ).first.equalEpsilon( ( *best ).first, 0.25f, 0.000001f ) ){
+ ( *i ).second->setSelected( !wasSelected );
+ }
+ else{
+ break;
+ }
+ ++i;
+ }
+ return !wasSelected;
+ }
+ else{
+ return true;
+ }
}
}
}
}
}
-
+#include "map.h"
class testselect_entity_visible : public scene::Graph::Walker
{
: m_selector( selector ), m_test( test ){
}
bool pre( const scene::Path& path, scene::Instance& instance ) const {
+ if( path.top().get_pointer() == Map_GetWorldspawn( g_map ) ||
+ node_is_group( path.top().get() ) ){
+ return false;
+ }
Selectable* selectable = Instance_getSelectable( instance );
if ( selectable != 0
&& Node_isEntity( path.top() ) ) {
#endif
}
+#include "preferencesystem.h"
+#include "preferences.h"
+
+void SelectionSystem_constructPreferences( PreferencesPage& page ){
+ page.appendCheckBox( "", "Prefer point entities in 2D", getSelectionSystem().m_bPreferPointEntsIn2D );
+}
+void SelectionSystem_constructPage( PreferenceGroup& group ){
+ PreferencesPage page( group.createPage( "Selection", "Selection System Settings" ) );
+ SelectionSystem_constructPreferences( page );
+}
+void SelectionSystem_registerPreferencesPage(){
+ PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, SelectionSystem_constructPage>() );
+}
+
+
void SelectionSystem_OnBoundsChanged(){
getSelectionSystem().pivotChanged();
}
-
SignalHandlerId SelectionSystem_boundsChanged;
void SelectionSystem_Construct(){
SelectionSystem_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( FreeCaller<SelectionSystem_OnBoundsChanged>() );
GlobalShaderCache().attachRenderable( getSelectionSystem() );
+
+ GlobalPreferenceSystem().registerPreference( "PreferPointEntsIn2D", BoolImportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ), BoolExportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ) );
+ SelectionSystem_registerPreferencesPage();
}
void SelectionSystem_Destroy(){
d_showgrid( true ),
show_names( false ),
- show_coordinates( true ),
+ show_coordinates( false ),
show_angles( true ),
show_outline( false ),
show_axis( true ),
void xy_update_xor_rectangle( XYWnd& self, rect_t area ){
if ( GTK_WIDGET_VISIBLE( self.GetWidget() ) ) {
rectangle_t rect = rectangle_from_area( area.min, area.max, self.Width(), self.Height() );
- int nDim1 = ( self.GetViewType() == YZ ) ? 1 : 0;
- int nDim2 = ( self.GetViewType() == XY ) ? 1 : 2;
- rect.x /= self.Scale();
- rect.y /= self.Scale();
- rect.w /= self.Scale();
- rect.h /= self.Scale();
- rect.x += self.GetOrigin()[nDim1];
- rect.y += self.GetOrigin()[nDim2];
+// int nDim1 = ( self.GetViewType() == YZ ) ? 1 : 0;
+// int nDim2 = ( self.GetViewType() == XY ) ? 1 : 2;
+// rect.x /= self.Scale();
+// rect.y /= self.Scale();
+// rect.w /= self.Scale();
+// rect.h /= self.Scale();
+// rect.x += self.GetOrigin()[nDim1];
+// rect.y += self.GetOrigin()[nDim2];
self.m_XORRectangle.set( rect );
}
}
gboolean xywnd_button_press( GtkWidget* widget, GdkEventButton* event, XYWnd* xywnd ){
if ( event->type == GDK_BUTTON_PRESS ) {
- g_pParentWnd->SetActiveXY( xywnd );
+ if( !xywnd->Active() ){
+ g_pParentWnd->SetActiveXY( xywnd );
+ }
xywnd->ButtonState_onMouseDown( buttons_for_event_button( event ) );
gboolean xywnd_focus_in( GtkWidget* widget, GdkEventFocus* event, XYWnd* xywnd ){
if ( event->type == GDK_FOCUS_CHANGE ) {
if ( event->in ) {
- g_pParentWnd->SetActiveXY( xywnd );
+ if( !xywnd->Active() ){
+ g_pParentWnd->SetActiveXY( xywnd );
+ }
}
}
return FALSE;
}
gboolean xywnd_wheel_scroll( GtkWidget* widget, GdkEventScroll* event, XYWnd* xywnd ){
+ if( !xywnd->Active() ){
+ g_pParentWnd->SetActiveXY( xywnd );
+ }
if ( event->direction == GDK_SCROLL_UP ) {
xywnd->ZoomInWithMouse( (int)event->x, (int)event->y );
}
g_signal_connect( G_OBJECT( m_gl_widget ), "button_press_event", G_CALLBACK( xywnd_button_press ), this );
g_signal_connect( G_OBJECT( m_gl_widget ), "button_release_event", G_CALLBACK( xywnd_button_release ), this );
- g_signal_connect( G_OBJECT( m_gl_widget ), "focus_in_event", G_CALLBACK( xywnd_focus_in ), this );
+ g_signal_connect( G_OBJECT( m_gl_widget ), "focus_in_event", G_CALLBACK( xywnd_focus_in ), this ); //works only in floating views layout
g_signal_connect( G_OBJECT( m_gl_widget ), "motion_notify_event", G_CALLBACK( DeferredMotion::gtk_motion ), &m_deferred_motion );
g_signal_connect( G_OBJECT( m_gl_widget ), "scroll_event", G_CALLBACK( xywnd_wheel_scroll ), this );
const int w = ( m_nWidth / 2 / m_fScale );
const int h = ( m_nHeight / 2 / m_fScale );
- const Vector3& colourX = ( m_viewType == YZ ) ? g_xywindow_globals.AxisColorY : g_xywindow_globals.AxisColorX;
- const Vector3& colourY = ( m_viewType == XY ) ? g_xywindow_globals.AxisColorY : g_xywindow_globals.AxisColorZ;
+ Vector3 colourX = ( m_viewType == YZ ) ? g_xywindow_globals.AxisColorY : g_xywindow_globals.AxisColorX;
+ Vector3 colourY = ( m_viewType == XY ) ? g_xywindow_globals.AxisColorY : g_xywindow_globals.AxisColorZ;
+ if( !Active() ){
+ float grayX = vector3_dot( colourX, Vector3( 0.2989, 0.5870, 0.1140 ) );
+ float grayY = vector3_dot( colourY, Vector3( 0.2989, 0.5870, 0.1140 ) );
+ colourX[0] = colourX[1] = colourX[2] = grayX;
+ colourY[0] = colourY[1] = colourY[2] = grayY;
+ }
// draw two lines with corresponding axis colors to highlight current view
// horizontal line: nDim1 color
}
}
+void XYWnd::RenderActive( void ){
+ if ( glwidget_make_current( m_gl_widget ) != FALSE ) {
+ if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) {
+ GlobalOpenGL_debugAssertNoErrors();
+ glDrawBuffer( GL_FRONT );
+
+ if ( g_xywindow_globals_private.show_outline ) {
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho( 0, m_nWidth, 0, m_nHeight, 0, 1 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+
+ if( !Active() ){ //sorta erase
+ glColor3fv( vector3_to_array( g_xywindow_globals.color_gridmajor ) );
+ }
+ // four view mode doesn't colorize
+ else if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit ) {
+ glColor3fv( vector3_to_array( g_xywindow_globals.color_viewname ) );
+ }
+ else
+ {
+ switch ( m_viewType )
+ {
+ case YZ:
+ glColor3fv( vector3_to_array( g_xywindow_globals.AxisColorX ) );
+ break;
+ case XZ:
+ glColor3fv( vector3_to_array( g_xywindow_globals.AxisColorY ) );
+ break;
+ case XY:
+ glColor3fv( vector3_to_array( g_xywindow_globals.AxisColorZ ) );
+ break;
+ }
+ }
+ glBegin( GL_LINE_LOOP );
+ glVertex2f( 0.5, 0.5 );
+ glVertex2f( m_nWidth - 0.5, 1 );
+ glVertex2f( m_nWidth - 0.5, m_nHeight - 0.5 );
+ glVertex2f( 0.5, m_nHeight - 0.5 );
+ glEnd();
+ }
+ // we do this part (the old way) only if show_axis is disabled
+ if ( !g_xywindow_globals_private.show_axis ) {
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho( 0, m_nWidth, 0, m_nHeight, 0, 1 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+
+ if ( Active() ) {
+ glColor3fv( vector3_to_array( g_xywindow_globals.color_viewname ) );
+ }
+ else{
+ glColor4fv( vector4_to_array( Vector4( g_xywindow_globals.color_gridtext, 1.0f ) ) );
+ }
+
+ glDisable( GL_BLEND );
+ glRasterPos2f( 35, m_nHeight - 20 );
+
+ GlobalOpenGL().drawString( ViewType_getTitle( m_viewType ) );
+ }
+ else{
+ // clear
+ glViewport( 0, 0, m_nWidth, m_nHeight );
+ // set up viewpoint
+ glMatrixMode( GL_PROJECTION );
+ glLoadMatrixf( reinterpret_cast<const float*>( &m_projection ) );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ glScalef( m_fScale, m_fScale, 1 );
+ int nDim1 = ( m_viewType == YZ ) ? 1 : 0;
+ int nDim2 = ( m_viewType == XY ) ? 1 : 2;
+ glTranslatef( -m_vOrigin[nDim1], -m_vOrigin[nDim2], 0 );
+
+ glDisable( GL_LINE_STIPPLE );
+ glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+ glDisableClientState( GL_NORMAL_ARRAY );
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisable( GL_TEXTURE_2D );
+ glDisable( GL_LIGHTING );
+ glDisable( GL_COLOR_MATERIAL );
+ glDisable( GL_DEPTH_TEST );
+ glDisable( GL_TEXTURE_1D );
+ glDisable( GL_BLEND );
+
+ XYWnd::XY_DrawAxis();
+ }
+
+ glDrawBuffer( GL_BACK );
+ GlobalOpenGL_debugAssertNoErrors();
+ glwidget_make_current( m_gl_widget );
+ }
+ }
+}
+
void XYWnd::XY_DrawBackground( void ){
glPushAttrib( GL_ALL_ATTRIB_BITS );
GlobalOpenGL().drawString( text );
}
+ }
+ // we do this part (the old way) only if show_axis is disabled
+ if ( !g_xywindow_globals_private.show_axis ) {
if ( Active() ) {
glColor3fv( vector3_to_array( g_xywindow_globals.color_viewname ) );
}
+ else{
+ glColor4fv( vector4_to_array( Vector4( g_xywindow_globals.color_gridtext, 1.0f ) ) );
+ }
- // we do this part (the old way) only if show_axis is disabled
- if ( !g_xywindow_globals_private.show_axis ) {
- glRasterPos2f( m_vOrigin[nDim1] - w + 35 / m_fScale, m_vOrigin[nDim2] + h - 20 / m_fScale );
+ glRasterPos2f( m_vOrigin[nDim1] - w + 35 / m_fScale, m_vOrigin[nDim2] + h - 20 / m_fScale );
- GlobalOpenGL().drawString( ViewType_getTitle( m_viewType ) );
- }
+ GlobalOpenGL().drawString( ViewType_getTitle( m_viewType ) );
}
XYWnd::XY_DrawAxis();
-void ToggleShowCrosshair(){
- g_bCrossHairs ^= 1;
- XY_UpdateAllWindows();
-}
-
-void ToggleShowSizeInfo(){
- g_xywindow_globals_private.m_bSizePaint = !g_xywindow_globals_private.m_bSizePaint;
- XY_UpdateAllWindows();
-}
-
-void ToggleShowGrid(){
- g_xywindow_globals_private.d_showgrid = !g_xywindow_globals_private.d_showgrid;
- XY_UpdateAllWindows();
-}
-
ToggleShown g_xy_top_shown( true );
void XY_Top_Shown_Construct( GtkWindow* parent ){
-void ShowNamesToggle(){
- GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() );
- XY_UpdateAllWindows();
-}
-typedef FreeCaller<ShowNamesToggle> ShowNamesToggleCaller;
void ShowNamesExport( const BoolImportCallback& importer ){
importer( GlobalEntityCreator().getShowNames() );
}
typedef FreeCaller1<const BoolImportCallback&, ShowNamesExport> ShowNamesExportCaller;
-
-void ShowAnglesToggle(){
- GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() );
+ShowNamesExportCaller g_show_names_caller;
+ToggleItem g_show_names( g_show_names_caller );
+void ShowNamesToggle(){
+ GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() );
+ g_show_names.update();
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowAnglesToggle> ShowAnglesToggleCaller;
+
void ShowAnglesExport( const BoolImportCallback& importer ){
importer( GlobalEntityCreator().getShowAngles() );
}
typedef FreeCaller1<const BoolImportCallback&, ShowAnglesExport> ShowAnglesExportCaller;
+ShowAnglesExportCaller g_show_angles_caller;
+ToggleItem g_show_angles( g_show_angles_caller );
+void ShowAnglesToggle(){
+ GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() );
+ g_show_angles.update();
+ XY_UpdateAllWindows();
+}
+BoolExportCaller g_show_blocks_caller( g_xywindow_globals_private.show_blocks );
+ToggleItem g_show_blocks( g_show_blocks_caller );
void ShowBlocksToggle(){
g_xywindow_globals_private.show_blocks ^= 1;
+ g_show_blocks.update();
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowBlocksToggle> ShowBlocksToggleCaller;
-void ShowBlocksExport( const BoolImportCallback& importer ){
- importer( g_xywindow_globals_private.show_blocks );
-}
-typedef FreeCaller1<const BoolImportCallback&, ShowBlocksExport> ShowBlocksExportCaller;
+BoolExportCaller g_show_coordinates_caller( g_xywindow_globals_private.show_coordinates );
+ToggleItem g_show_coordinates( g_show_coordinates_caller );
void ShowCoordinatesToggle(){
g_xywindow_globals_private.show_coordinates ^= 1;
+ g_show_coordinates.update();
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowCoordinatesToggle> ShowCoordinatesToggleCaller;
-void ShowCoordinatesExport( const BoolImportCallback& importer ){
- importer( g_xywindow_globals_private.show_coordinates );
-}
-typedef FreeCaller1<const BoolImportCallback&, ShowCoordinatesExport> ShowCoordinatesExportCaller;
+BoolExportCaller g_show_outline_caller( g_xywindow_globals_private.show_outline );
+ToggleItem g_show_outline( g_show_outline_caller );
void ShowOutlineToggle(){
g_xywindow_globals_private.show_outline ^= 1;
+ g_show_outline.update();
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowOutlineToggle> ShowOutlineToggleCaller;
-void ShowOutlineExport( const BoolImportCallback& importer ){
- importer( g_xywindow_globals_private.show_outline );
-}
-typedef FreeCaller1<const BoolImportCallback&, ShowOutlineExport> ShowOutlineExportCaller;
+BoolExportCaller g_show_axes_caller( g_xywindow_globals_private.show_axis );
+ToggleItem g_show_axes( g_show_axes_caller );
void ShowAxesToggle(){
g_xywindow_globals_private.show_axis ^= 1;
+ g_show_axes.update();
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowAxesToggle> ShowAxesToggleCaller;
-void ShowAxesExport( const BoolImportCallback& importer ){
- importer( g_xywindow_globals_private.show_axis );
-}
-typedef FreeCaller1<const BoolImportCallback&, ShowAxesExport> ShowAxesExportCaller;
+
+BoolExportCaller g_show_workzone_caller( g_xywindow_globals_private.d_show_work );
+ToggleItem g_show_workzone( g_show_workzone_caller );
void ShowWorkzoneToggle(){
g_xywindow_globals_private.d_show_work ^= 1;
+ g_show_workzone.update();
+ XY_UpdateAllWindows();
+}
+
+/*
+void ShowAxesToggle(){
+ g_xywindow_globals_private.show_axis ^= 1;
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowWorkzoneToggle> ShowWorkzoneToggleCaller;
-void ShowWorkzoneExport( const BoolImportCallback& importer ){
- importer( g_xywindow_globals_private.d_show_work );
+typedef FreeCaller<ShowAxesToggle> ShowAxesToggleCaller;
+void ShowAxesExport( const BoolImportCallback& importer ){
+ importer( g_xywindow_globals_private.show_axis );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowWorkzoneExport> ShowWorkzoneExportCaller;
+typedef FreeCaller1<const BoolImportCallback&, ShowAxesExport> ShowAxesExportCaller;
-ShowNamesExportCaller g_show_names_caller;
-BoolExportCallback g_show_names_callback( g_show_names_caller );
-ToggleItem g_show_names( g_show_names_callback );
+ShowAxesExportCaller g_show_axes_caller;
+BoolExportCallback g_show_axes_callback( g_show_axes_caller );
+ToggleItem g_show_axes( g_show_axes_callback );
+*/
-ShowAnglesExportCaller g_show_angles_caller;
-BoolExportCallback g_show_angles_callback( g_show_angles_caller );
-ToggleItem g_show_angles( g_show_angles_callback );
+/*
+BoolExportCaller g_texdef_movelock_caller( g_brush_texturelock_enabled );
+ToggleItem g_texdef_movelock_item( g_texdef_movelock_caller );
-ShowBlocksExportCaller g_show_blocks_caller;
-BoolExportCallback g_show_blocks_callback( g_show_blocks_caller );
-ToggleItem g_show_blocks( g_show_blocks_callback );
+void Texdef_ToggleMoveLock(){
+ g_brush_texturelock_enabled = !g_brush_texturelock_enabled;
+ g_texdef_movelock_item.update();
+}
+*/
-ShowCoordinatesExportCaller g_show_coordinates_caller;
-BoolExportCallback g_show_coordinates_callback( g_show_coordinates_caller );
-ToggleItem g_show_coordinates( g_show_coordinates_callback );
+BoolExportCaller g_show_size_caller( g_xywindow_globals_private.m_bSizePaint );
+ToggleItem g_show_size_item( g_show_size_caller );
+void ToggleShowSizeInfo(){
+ g_xywindow_globals_private.m_bSizePaint = !g_xywindow_globals_private.m_bSizePaint;
+ g_show_size_item.update();
+ XY_UpdateAllWindows();
+}
-ShowOutlineExportCaller g_show_outline_caller;
-BoolExportCallback g_show_outline_callback( g_show_outline_caller );
-ToggleItem g_show_outline( g_show_outline_callback );
+BoolExportCaller g_show_crosshair_caller( g_bCrossHairs );
+ToggleItem g_show_crosshair_item( g_show_crosshair_caller );
+void ToggleShowCrosshair(){
+ g_bCrossHairs ^= 1;
+ g_show_crosshair_item.update();
+ XY_UpdateAllWindows();
+}
-ShowAxesExportCaller g_show_axes_caller;
-BoolExportCallback g_show_axes_callback( g_show_axes_caller );
-ToggleItem g_show_axes( g_show_axes_callback );
+BoolExportCaller g_show_grid_caller( g_xywindow_globals_private.d_showgrid );
+ToggleItem g_show_grid_item( g_show_grid_caller );
+void ToggleShowGrid(){
+ g_xywindow_globals_private.d_showgrid = !g_xywindow_globals_private.d_showgrid;
+ g_show_grid_item.update();
+ XY_UpdateAllWindows();
+}
-ShowWorkzoneExportCaller g_show_workzone_caller;
-BoolExportCallback g_show_workzone_callback( g_show_workzone_caller );
-ToggleItem g_show_workzone( g_show_workzone_callback );
void XYShow_registerCommands(){
- GlobalToggles_insert( "ShowAngles", ShowAnglesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_angles ) );
- GlobalToggles_insert( "ShowNames", ShowNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_names ) );
- GlobalToggles_insert( "ShowBlocks", ShowBlocksToggleCaller(), ToggleItem::AddCallbackCaller( g_show_blocks ) );
- GlobalToggles_insert( "ShowCoordinates", ShowCoordinatesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_coordinates ) );
- GlobalToggles_insert( "ShowWindowOutline", ShowOutlineToggleCaller(), ToggleItem::AddCallbackCaller( g_show_outline ) );
- GlobalToggles_insert( "ShowAxes", ShowAxesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_axes ) );
- GlobalToggles_insert( "ShowWorkzone", ShowWorkzoneToggleCaller(), ToggleItem::AddCallbackCaller( g_show_workzone ) );
+ GlobalToggles_insert( "ToggleSizePaint", FreeCaller<ToggleShowSizeInfo>(), ToggleItem::AddCallbackCaller( g_show_size_item ), Accelerator( 'J' ) );
+ GlobalToggles_insert( "ToggleCrosshairs", FreeCaller<ToggleShowCrosshair>(), ToggleItem::AddCallbackCaller( g_show_crosshair_item ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalToggles_insert( "ToggleGrid", FreeCaller<ToggleShowGrid>(), ToggleItem::AddCallbackCaller( g_show_grid_item ), Accelerator( '0' ) );
+
+ GlobalToggles_insert( "ShowAngles", FreeCaller<ShowAnglesToggle>(), ToggleItem::AddCallbackCaller( g_show_angles ) );
+ GlobalToggles_insert( "ShowNames", FreeCaller<ShowNamesToggle>(), ToggleItem::AddCallbackCaller( g_show_names ) );
+ 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 ) );
+ GlobalToggles_insert( "ShowAxes", FreeCaller<ShowAxesToggle>(), ToggleItem::AddCallbackCaller( g_show_axes ) );
+ GlobalToggles_insert( "ShowWorkzone", FreeCaller<ShowWorkzoneToggle>(), ToggleItem::AddCallbackCaller( g_show_workzone ) );
}
void XYWnd_registerShortcuts(){
void Orthographic_constructPreferences( PreferencesPage& page ){
- page.appendCheckBox( "", "Solid selection boxes", g_xywindow_globals.m_bNoStipple );
- page.appendCheckBox( "", "Display size info", g_xywindow_globals_private.m_bSizePaint );
+ page.appendCheckBox( "", "Solid selection boxes ( no stipple )", g_xywindow_globals.m_bNoStipple );
+ //page.appendCheckBox( "", "Display size info", g_xywindow_globals_private.m_bSizePaint );
page.appendCheckBox( "", "Chase mouse during drags", g_xywindow_globals_private.m_bChaseMouse );
page.appendCheckBox( "", "Update views on camera move", g_xywindow_globals_private.m_bCamXYUpdate );
}
void XYWindow_Construct(){
- GlobalCommands_insert( "ToggleCrosshairs", FreeCaller<ToggleShowCrosshair>(), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "ToggleSizePaint", FreeCaller<ToggleShowSizeInfo>(), Accelerator( 'J' ) );
- GlobalCommands_insert( "ToggleGrid", FreeCaller<ToggleShowGrid>(), Accelerator( '0' ) );
+// GlobalCommands_insert( "ToggleCrosshairs", FreeCaller<ToggleShowCrosshair>(), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
+// GlobalCommands_insert( "ToggleSizePaint", FreeCaller<ToggleShowSizeInfo>(), Accelerator( 'J' ) );
+// GlobalCommands_insert( "ToggleGrid", FreeCaller<ToggleShowGrid>(), Accelerator( '0' ) );
GlobalToggles_insert( "ToggleView", ToggleShown::ToggleCaller( g_xy_top_shown ), ToggleItem::AddCallbackCaller( g_xy_top_shown.m_item ), Accelerator( 'V', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalToggles_insert( "ToggleSideView", ToggleShown::ToggleCaller( g_yz_side_shown ), ToggleItem::AddCallbackCaller( g_yz_side_shown.m_item ) );
GlobalPreferenceSystem().registerPreference( "SI_Colors6", Vector3ImportStringCaller( g_xywindow_globals.color_gridblock ), Vector3ExportStringCaller( g_xywindow_globals.color_gridblock ) );
GlobalPreferenceSystem().registerPreference( "SI_Colors7", Vector3ImportStringCaller( g_xywindow_globals.color_gridtext ), Vector3ExportStringCaller( g_xywindow_globals.color_gridtext ) );
GlobalPreferenceSystem().registerPreference( "SI_Colors8", Vector3ImportStringCaller( g_xywindow_globals.color_brushes ), Vector3ExportStringCaller( g_xywindow_globals.color_brushes ) );
- GlobalPreferenceSystem().registerPreference( "SI_Colors14", Vector3ImportStringCaller( g_xywindow_globals.color_gridmajor_alt ), Vector3ExportStringCaller( g_xywindow_globals.color_gridmajor_alt ) );
+ GlobalPreferenceSystem().registerPreference( "SI_Colors9", Vector3ImportStringCaller( g_xywindow_globals.color_viewname ), Vector3ExportStringCaller( g_xywindow_globals.color_viewname ) );
+ GlobalPreferenceSystem().registerPreference( "SI_Colors10", Vector3ImportStringCaller( g_xywindow_globals.color_clipper ), Vector3ExportStringCaller( g_xywindow_globals.color_clipper ) );
+ GlobalPreferenceSystem().registerPreference( "SI_Colors11", Vector3ImportStringCaller( g_xywindow_globals.color_selbrushes ), Vector3ExportStringCaller( g_xywindow_globals.color_selbrushes ) );
GlobalPreferenceSystem().registerPreference( "XZVIS", makeBoolStringImportCallback( ToggleShownImportBoolCaller( g_xz_front_shown ) ), makeBoolStringExportCallback( ToggleShownExportBoolCaller( g_xz_front_shown ) ) );
void ZoomOut();
void ZoomInWithMouse( int pointx, int pointy );
+void RenderActive();
void SetActive( bool b ){
m_bActive = b;
+ RenderActive();
};
bool Active(){
return m_bActive;
Vector3 color_selbrushes;
Vector3 color_clipper;
Vector3 color_viewname;
- Vector3 color_gridminor_alt;
- Vector3 color_gridmajor_alt;
Vector3 AxisColorX;
Vector3 AxisColorY;
Vector3 AxisColorZ;
color_selbrushes( 1.f, 0.f, 0.f ),
color_clipper( 0.f, 0.f, 1.f ),
color_viewname( 0.5f, 0.f, 0.75f ),
- color_gridminor_alt( 0.f, 0.f, 0.f ),
- color_gridmajor_alt( 0.f, 0.f, 0.f ),
AxisColorX( 1.f, 0.f, 0.f ),
AxisColorY( 0.f, 1.f, 0.f ),
AxisColorZ( 0.f, 0.f, 1.f ),
m_bRightClick( true ),
- m_bNoStipple( false ),
+ m_bNoStipple( true ),
m_bImprovedWheelZoom( true ){
}