]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
Backing out r347 and r345. Keeping r346.
[xonotic/netradiant.git] / radiant / mainframe.cpp
index 6de34669aefe05b64e4751d33844eaca3b58bc2e..493520f0c584e1962f88bb9686b1b87c06db7502 100644 (file)
@@ -54,9 +54,6 @@ extern "C" {
 // globals
 CString g_strAppPath;                   ///< holds the full path of the executable
 CString g_strDTDPath;                   ///< path to the DTD files
-/*!
-see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=297 for the two below
-*/
 CString g_pidFile;                      ///< the global .pid file (only for global part of the startup)
 CString g_pidGameFile;                  ///< the game-specific .pid file
 CString g_strBitmapsPath;               // directory where the bitmaps are stored
@@ -125,6 +122,7 @@ SCommandInfo g_Commands[] =
   {"CSGMerge", 'U', 0x04, ID_SELECTION_CSGMERGE, "menu_selection_csgmerge"},
   {"CSGSubtract", 'U', 0x01, ID_SELECTION_CSGSUBTRACT, "menu_selection_csgsubstract"},
   //  {"ViewGroups", 'G', 0x00, ID_VIEW_GROUPS, "menu_view_groups"}, (temporary disabled)
+  {"SelectFuncGroup", 'G', 0x00, ID_SELECT_FUNC_GROUP, "menu_select_func_group"},
   {"HideSelected", 'H', 0x00, ID_VIEW_HIDESHOW_HIDESELECTED, "menu_view_hideshow_hideselected"},
   {"ShowHidden", 'H', 0x01, ID_VIEW_HIDESHOW_SHOWHIDDEN, "menu_view_hideshow_showhidden"},
   {"BendMode", 'B', 0x00, ID_PATCH_BEND, "menu_patch_bend"},
@@ -427,6 +425,7 @@ gint HandleCommand (GtkWidget *widget, gpointer data)
     case ID_TOGGLECONSOLE: g_pParentWnd->OnToggleconsole (); break;
     case ID_VIEW_ENTITY: g_pParentWnd->OnViewEntity (); break;
     case ID_VIEW_GROUPS: g_pParentWnd->OnViewGroups (); break;
+       case ID_SELECT_FUNC_GROUP: g_pParentWnd->OnSelectFuncGroup(); break;
     case ID_TOGGLEVIEW: g_pParentWnd->OnToggleview (); break;
     case ID_TOGGLEVIEW_YZ: g_pParentWnd->OnToggleviewYz (); break;
     case ID_TOGGLEVIEW_XZ: g_pParentWnd->OnToggleviewXz (); break;
@@ -743,7 +742,6 @@ static gint mainframe_keypress (GtkWidget* widget, GdkEventKey* event, gpointer
 {
   unsigned int code = gdk_keyval_to_upper(event->keyval);
 
-  // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=924
   if(code == GDK_ISO_Left_Tab) {
     code = GDK_Tab;
   }
@@ -752,7 +750,6 @@ static gint mainframe_keypress (GtkWidget* widget, GdkEventKey* event, gpointer
   Sys_Printf("key: %d (keyval: %d) (ctrl: %d)\n", code, event->keyval, event->state & GDK_CONTROL_MASK);
 #endif
 
-  // BUG: http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=865
   // return only if Texture Viewport  is in main window, otherwise if Tex viewport is in it's own window
   // the Filter GtkEntry won't release focus
   if ( g_pParentWnd->GetTexWnd()->m_pFilter == gtk_window_get_focus(GTK_WINDOW(widget)) )
@@ -1205,6 +1202,7 @@ void MainFrame::create_main_menu (GtkWidget *window, GtkWidget *vbox)
                     GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTPARTIALTALL);
   create_menu_item_with_mnemonic (menu_in_menu, _("Select _Inside"),
                     GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECTINSIDE);
+  create_menu_item_with_mnemonic (menu_in_menu, "Select Func _Group", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_FUNC_GROUP);
 #ifndef QUAKE3
   create_menu_item_with_mnemonic (menu_in_menu, _("Nudge Left"),
                     GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_SELECT_NUDGELEFT);
@@ -1424,8 +1422,7 @@ void MainFrame::create_main_menu (GtkWidget *window, GtkWidget *vbox)
                            GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_NEXTLEAKSPOT);
   item = create_menu_item_with_mnemonic (menu, _("Previous leak spot"),
                            GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_PREVIOUSLEAKSPOT);
-  // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394
-//  create_menu_item_with_mnemonic (menu, _("_Print XY View"), GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_PRINTXY);
+  create_menu_item_with_mnemonic (menu, _("_Print XY View"), GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_PRINTXY);
   item = create_menu_item_with_mnemonic (menu, _("_Select Entity Color..."),
                            GTK_SIGNAL_FUNC (HandleCommand), ID_MISC_SELECTENTITYCOLOR);
   g_object_set_data (G_OBJECT (window), "menu_misc_selectentitycolor", item);
@@ -3230,9 +3227,6 @@ void MainFrame::OnSleep()
 */
     Sys_Printf("Done.\n");
 
-    // bring back the GL font
-    gtk_glwidget_create_font (m_pCamWnd->GetWidget ());
-
     g_bScreenUpdates = true;
 
     Sys_Printf("Dispatching wake msg...");
@@ -3830,7 +3824,7 @@ void MainFrame::SetButtonMenuStates()
   item  = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_view_opengllighting"));
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_PrefsDlg.m_bGLLighting) ? TRUE : FALSE);
   item  = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_snaptogrid"));
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (!g_PrefsDlg.m_bNoClamp) ? TRUE : FALSE);
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (g_PrefsDlg.m_bSnap) ? TRUE : FALSE);
 
   item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "tb_view_cubicclipping"));
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), (g_PrefsDlg.m_bCubicClipping) ? TRUE : FALSE);
@@ -4664,7 +4658,7 @@ void MainFrame::OnPrefs()
     GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_snaptogrid"));
     g_bIgnoreCommands++;
     gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
-                                    (!g_PrefsDlg.m_bNoClamp) ? TRUE : FALSE);
+                                    (g_PrefsDlg.m_bSnap) ? TRUE : FALSE);
     g_bIgnoreCommands--;
   }
 }
@@ -5613,7 +5607,6 @@ void MainFrame::OnSelectionMakeStructural()
 
 void MainFrame::OnBspCommand (unsigned int nID)
 {
-  // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=503
   // make sure we don't attempt to region compile a map with the camera outside the region
   if (region_active)
   {
@@ -5693,12 +5686,12 @@ void MainFrame::OnGrid (unsigned int nID)
 
 void MainFrame::OnSnaptogrid()
 {
-  g_PrefsDlg.m_bNoClamp ^= 1;
+  g_PrefsDlg.m_bSnap ^= 1;
   g_PrefsDlg.SavePrefs ();
 
   GtkWidget *item = GTK_WIDGET (g_object_get_data (G_OBJECT (m_pWidget), "menu_snaptogrid"));
   g_bIgnoreCommands++;
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bNoClamp ? FALSE : TRUE);
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_PrefsDlg.m_bSnap ? TRUE : FALSE);
   g_bIgnoreCommands--;
 }
 
@@ -5768,7 +5761,6 @@ void MainFrame::OnTexturesLoad()
        // FIXME
        // check if that works with fs_game (I suspect some more design is needed)
        // see how this is done in 1.2?
-       // http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=507
   strcpy (def_path, g_pGameDescription->mEnginePath.GetBuffer());
   strcat (def_path, g_pGameDescription->mBaseGame.GetBuffer());
   strcat (def_path, "/");
@@ -6211,7 +6203,7 @@ void MainFrame::OnMiscPreviousleakspot()
 
 void MainFrame::OnMiscPrintxy()
 {
-//  WXY_Print();
+  WXY_Print();
 }
 
 void MainFrame::OnMiscSelectentitycolor()
@@ -7082,7 +7074,24 @@ void MainFrame::OnPatchTab()
   }
 }
 
-void MainFrame::OnCameraForward(bool keydown)
+void MainFrame::OnSelectFuncGroup() 
+{
+       // check to see if the selected brush is part of a func group
+       // if it is, deselect everything and reselect the next brush 
+       // in the group
+       brush_t *b2, *b = selected_brushes.next;
+       entity_t * e;
+       if (b != &selected_brushes)
+       {
+               if (strcmpi(b->owner->eclass->name, "worldspawn") != 0)
+               {
+                       e = b->owner;
+                       Select_SelectGroup(e);
+               }
+       }
+}
+
+void MainFrame::OnCameraForward(bool keydown) 
 {
   if (g_PrefsDlg.m_bCamDiscrete && (m_pCamWnd && !m_pCamWnd->m_bFreeMove) )
   {