From bc832533c336bb62e7f6b3a04ce9b23683228b25 Mon Sep 17 00:00:00 2001 From: namespace Date: Thu, 12 Oct 2006 19:10:05 +0000 Subject: [PATCH] - Updated help menu web links (removed map-center.com, added ETB documentation) (Shaderman) - Added check for existing worldspawn if a new one should be added with the entity menu (Shaderman) - Fixed Entity -> Ungroup (Topsun) - Fixed hotkey collision ALT+M (filter botclip/Modify menu). New Modify shortcut = ALT+O (Shaderman) - Updated Window Layout images (Shaderman) - Fixed (TODO) XYWindow: save show-workzone option (Shaderman) - Fixed (TODO) Toolbar: add shortcut to tooltips for toolbar buttons (Shaderman) - Fixed (TODO) GUI: detachable submenus (Shaderman) git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@117 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- CHANGES | 11 +++++++ TODO | 4 --- radiant/brushmanip.cpp | 4 +++ radiant/camwindow.cpp | 2 +- radiant/entity.cpp | 38 ++++++++++------------- radiant/help.cpp | 2 ++ radiant/mainframe.cpp | 58 +++++++++++++++++++++++++---------- radiant/patchmanip.cpp | 16 +++++++++- radiant/pluginmenu.cpp | 2 ++ radiant/xywindow.cpp | 15 ++++++++- setup/data/tools/global.xlink | 2 +- 11 files changed, 108 insertions(+), 46 deletions(-) diff --git a/CHANGES b/CHANGES index a511c44..68946c2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,17 @@ This is the changelog for developers, != changelog for the end user that we distribute with the binaries. (see changelog) +12/10/2006 +namespace +- Updated help menu web links (removed map-center.com, added ETB documentation) (Shaderman) +- Added check for existing worldspawn if a new one should be added with the entity menu (Shaderman) +- Fixed Entity -> Ungroup (Topsun) +- Fixed hotkey collision ALT+M (filter botclip/Modify menu). New Modify shortcut = ALT+O (Shaderman) +- Updated Window Layout images (Shaderman) +- Fixed (TODO) XYWindow: save show-workzone option (Shaderman) +- Fixed (TODO) Toolbar: add shortcut to tooltips for toolbar buttons (Shaderman) +- Fixed (TODO) GUI: detachable submenus (Shaderman) + 09/10/2006 namespace - Added option to toggle the camera window stats on/off (Shaderman) diff --git a/TODO b/TODO index b21c149..aeb5796 100644 --- a/TODO +++ b/TODO @@ -56,7 +56,6 @@ Shaders: handle doom3 materials with multiple bumpmaps stage - use first stage, Brush: warn when a brush is dragged into a configuration with <0 volume Textures: add option to give new brushes a specific texture instead of the last selected. ? QE-tool: click anywhere on xy view to drag entity instead of requiring clicking directly on entity. -Camera: option to toggle stats on/off. UserDocs: how to use multi-vertex selection - replaces vertex-edit-splits-faces option: UserDocs: how to use parent-selection: Parent-selection works like Maya: it allows you to 'reparent' brushes @@ -66,7 +65,6 @@ Textures: add anisotropic filtering. Preferences: allow preference settings to be shared across games. Preferences: add colour 'theme' files using prefs format. Preferences: sensible default size for prefs window. -GUI: detachable submenus. Doom3: add model browser. Doom3: s_diversity light key. HalfLife: enable HL-mode on linux/osx. @@ -94,7 +92,6 @@ Selection: add rotate increment for rotate manipulator. Selection: visibly distinguish between entity and brush selections Selection: need 'add to selection' and 'subtract from selection' modifiers Selection: Finish scale manipulator. -Toolbar: add shortcut to tooltips for toolbar buttons FaceCopy/PasteTexture: Make face-copy/paste-texture shortcuts customisable. Manual: add documentation about search paths for .ent/.def/.fgd, shaders etc for each game. Halflife: add support for cstrike fgd. @@ -119,7 +116,6 @@ Patch: fix bobtoolz merge-patches feature Patch: fix insert/remove rows/cols indicated by current selected patch vertices. Autosave/Snapshots: Add support for multi-file maps. Quake2: Q2 hint transparency support -XYWindow: save show-workzone option Shortcuts: make shortcut list editable within radiant. Shortcuts: convert shortcuts.ini to xml. Shortcuts: warn when duplicate shortcuts are registered diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index 7b1d08b..a19095e 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -1397,6 +1397,8 @@ void Brush_constructMenu(GtkMenu* menu) menu_separator (menu); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "CSG"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Make _Hollow", "CSGHollow"); create_menu_item_with_mnemonic(menu_in_menu, "CSG _Subtract", "CSGSubtract"); create_menu_item_with_mnemonic(menu_in_menu, "CSG _Merge", "CSGMerge"); @@ -1404,6 +1406,8 @@ void Brush_constructMenu(GtkMenu* menu) menu_separator(menu); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Clipper"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Clip selection", "ClipSelected"); create_menu_item_with_mnemonic(menu_in_menu, "Split selection", "SplitSelected"); diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index f1b2297..9e882b1 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1792,7 +1792,7 @@ void Camera_ToggleFarClip() void CamWnd_constructToolbar(GtkToolbar* toolbar) { - toolbar_append_toggle_button(toolbar, "Cubic clip the camera view", "view_cubicclipping.bmp", "ToggleCubicClip"); + toolbar_append_toggle_button(toolbar, "Cubic clip the camera view (\\)", "view_cubicclipping.bmp", "ToggleCubicClip"); } void CamWnd_registerShortcuts() diff --git a/radiant/entity.cpp b/radiant/entity.cpp index 6fb499f..c2a3109 100644 --- a/radiant/entity.cpp +++ b/radiant/entity.cpp @@ -130,35 +130,29 @@ void Scene_EntitySetClassname_Selected(const char* classname) } -class EntityUngroupVisitor : public SelectionSystem::Visitor -{ - const scene::Path& m_parent; -public: - EntityUngroupVisitor(const scene::Path& parent) : m_parent(parent) - { - } - void visit(scene::Instance& instance) const - { - if(Node_getEntity(instance.path().top()) != 0 - && node_is_group(instance.path().top())) - { - if(m_parent.top().get_pointer() != instance.path().top().get_pointer()) - { - parentBrushes(instance.path().top(), m_parent.top()); - Path_deleteTop(instance.path()); - } - } - } -}; - void Entity_ungroupSelected() { + if (GlobalSelectionSystem().countSelected() < 1) return; + UndoableCommand undo("ungroupSelectedEntities"); scene::Path world_path(makeReference(GlobalSceneGraph().root())); world_path.push(makeReference(Map_FindOrInsertWorldspawn(g_map))); - GlobalSelectionSystem().foreachSelected(EntityUngroupVisitor(world_path)); + scene::Instance &instance = GlobalSelectionSystem().ultimateSelected(); + scene::Path path = instance.path(); + + if (!Node_isEntity(path.top())) path.pop(); + + if(Node_getEntity(path.top()) != 0 + && node_is_group(path.top())) + { + if(world_path.top().get_pointer() != path.top().get_pointer()) + { + parentBrushes(path.top(), world_path.top()); + Path_deleteTop(path); + } + } } diff --git a/radiant/help.cpp b/radiant/help.cpp index d2e5fbb..363b1f0 100644 --- a/radiant/help.cpp +++ b/radiant/help.cpp @@ -62,6 +62,8 @@ void process_xlink(const char* filename, const char *menu_name, const char *base globalOutputStream() << "Processing .xlink file '" << filename << "'\n"; // create sub menu GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic(menu, menu_name); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); // start walking the nodes, find the 'links' one xmlNodePtr pNode = pDoc->children; while (pNode && strcmp((const char*)pNode->name, "links")) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 6d3f754..9eb022c 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -920,8 +920,12 @@ GtkMenuItem* create_colours_menu() { GtkMenuItem* colours_menu_item = new_sub_menu_item_with_mnemonic("Colors"); GtkMenu* menu_in_menu = GTK_MENU(gtk_menu_item_get_submenu(colours_menu_item)); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); GtkMenu* menu_3 = create_sub_menu_with_mnemonic(menu_in_menu, "Themes"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_3); create_menu_item_with_mnemonic(menu_3, "QE4 Original", "ColorSchemeOriginal"); create_menu_item_with_mnemonic(menu_3, "Q3Radiant Original", "ColorSchemeQER"); @@ -1984,6 +1988,8 @@ GtkMenuItem* create_edit_menu() create_menu_item_with_mnemonic(menu, "Select _touching", "SelectTouching"); GtkMenu* convert_menu = create_sub_menu_with_mnemonic(menu, "E_xpand Selection"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (convert_menu); create_menu_item_with_mnemonic(convert_menu, "To Whole _Entities", "ExpandSelectionToEntities"); menu_separator(menu); @@ -2046,6 +2052,8 @@ GtkMenuItem* create_view_menu(MainFrame::EViewStyle style) menu_separator(menu); { GtkMenu* camera_menu = create_sub_menu_with_mnemonic (menu, "Camera"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (camera_menu); create_menu_item_with_mnemonic(camera_menu, "_Center", "CenterView"); create_menu_item_with_mnemonic(camera_menu, "_Up Floor", "UpFloor"); create_menu_item_with_mnemonic(camera_menu, "_Down Floor", "DownFloor"); @@ -2062,6 +2070,8 @@ GtkMenuItem* create_view_menu(MainFrame::EViewStyle style) menu_separator(menu); { GtkMenu* orthographic_menu = create_sub_menu_with_mnemonic(menu, "Orthographic"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (orthographic_menu); if(style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating) { create_menu_item_with_mnemonic(orthographic_menu, "_Next (XY, YZ, XY)", "NextView"); @@ -2080,6 +2090,8 @@ GtkMenuItem* create_view_menu(MainFrame::EViewStyle style) { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Show"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (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 Blocks", "ShowBlocks"); @@ -2092,17 +2104,23 @@ GtkMenuItem* create_view_menu(MainFrame::EViewStyle style) { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Filter"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); Filters_constructMenu(menu_in_menu); } 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"); } menu_separator(menu); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Region"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_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"); @@ -2124,13 +2142,15 @@ GtkMenuItem* create_view_menu(MainFrame::EViewStyle style) GtkMenuItem* create_selection_menu() { // Selection menu - GtkMenuItem* selection_menu_item = new_sub_menu_item_with_mnemonic("_Modify"); + GtkMenuItem* selection_menu_item = new_sub_menu_item_with_mnemonic("M_odify"); GtkMenu* menu = GTK_MENU(gtk_menu_item_get_submenu(selection_menu_item)); if (g_Layout_enableDetachableMenus.m_value) menu_tearoff (menu); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Components"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_check_menu_item_with_mnemonic(menu_in_menu, "_Edges", "DragEdges"); create_check_menu_item_with_mnemonic(menu_in_menu, "_Vertices", "DragVertices"); create_check_menu_item_with_mnemonic(menu_in_menu, "_Faces", "DragFaces"); @@ -2140,6 +2160,8 @@ GtkMenuItem* create_selection_menu() { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic(menu, "Nudge"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Nudge Left", "SelectNudgeLeft"); create_menu_item_with_mnemonic(menu_in_menu, "Nudge Right", "SelectNudgeRight"); create_menu_item_with_mnemonic(menu_in_menu, "Nudge Up", "SelectNudgeUp"); @@ -2147,12 +2169,16 @@ GtkMenuItem* create_selection_menu() } { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Rotate"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Rotate X", "RotateSelectionX"); create_menu_item_with_mnemonic(menu_in_menu, "Rotate Y", "RotateSelectionY"); create_menu_item_with_mnemonic(menu_in_menu, "Rotate Z", "RotateSelectionZ"); } { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Flip"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Flip _X", "MirrorSelectionX"); create_menu_item_with_mnemonic(menu_in_menu, "Flip _Y", "MirrorSelectionY"); create_menu_item_with_mnemonic(menu_in_menu, "Flip _Z", "MirrorSelectionZ"); @@ -2387,8 +2413,8 @@ void register_shortcuts() void File_constructToolbar(GtkToolbar* toolbar) { - toolbar_append_button(toolbar, "Open an existing map", "file_open.bmp", "OpenMap"); - toolbar_append_button(toolbar, "Save the active map", "file_save.bmp", "SaveMap"); + toolbar_append_button(toolbar, "Open an existing map (CTRL + O)", "file_open.bmp", "OpenMap"); + toolbar_append_button(toolbar, "Save the active map (CTRL + S)", "file_save.bmp", "SaveMap"); } void RotateFlip_constructToolbar(GtkToolbar* toolbar) @@ -2409,22 +2435,22 @@ void Select_constructToolbar(GtkToolbar* toolbar) void CSG_constructToolbar(GtkToolbar* toolbar) { - toolbar_append_button(toolbar, "CSG Subtract", "selection_csgsubtract.bmp", "CSGSubtract"); - toolbar_append_button(toolbar, "CSG Merge", "selection_csgmerge.bmp", "CSGMerge"); + toolbar_append_button(toolbar, "CSG Subtract (SHIFT + U)", "selection_csgsubtract.bmp", "CSGSubtract"); + toolbar_append_button(toolbar, "CSG Merge (CTRL + U)", "selection_csgmerge.bmp", "CSGMerge"); toolbar_append_button(toolbar, "Hollow", "selection_makehollow.bmp", "CSGHollow"); } void ComponentModes_constructToolbar(GtkToolbar* toolbar) { - toolbar_append_toggle_button(toolbar, "Select Vertices", "modify_vertices.bmp", "DragVertices"); - toolbar_append_toggle_button(toolbar, "Select Edges", "modify_edges.bmp", "DragEdges"); - toolbar_append_toggle_button(toolbar, "Select Faces", "modify_faces.bmp", "DragFaces"); + toolbar_append_toggle_button(toolbar, "Select Vertices (V)", "modify_vertices.bmp", "DragVertices"); + toolbar_append_toggle_button(toolbar, "Select Edges (E)", "modify_edges.bmp", "DragEdges"); + toolbar_append_toggle_button(toolbar, "Select Faces (F)", "modify_faces.bmp", "DragFaces"); } void Clipper_constructToolbar(GtkToolbar* toolbar) { - toolbar_append_toggle_button(toolbar, "Clipper", "view_clipper.bmp", "ToggleClipper"); + toolbar_append_toggle_button(toolbar, "Clipper (X)", "view_clipper.bmp", "ToggleClipper"); } void XYWnd_constructToolbar(GtkToolbar* toolbar) @@ -2434,10 +2460,10 @@ void XYWnd_constructToolbar(GtkToolbar* toolbar) void Manipulators_constructToolbar(GtkToolbar* toolbar) { - toolbar_append_toggle_button(toolbar, "Translate", "select_mousetranslate.bmp", "MouseTranslate"); - toolbar_append_toggle_button(toolbar, "Rotate", "select_mouserotate.bmp", "MouseRotate"); + toolbar_append_toggle_button(toolbar, "Translate (W)", "select_mousetranslate.bmp", "MouseTranslate"); + toolbar_append_toggle_button(toolbar, "Rotate (R)", "select_mouserotate.bmp", "MouseRotate"); toolbar_append_toggle_button(toolbar, "Scale", "select_mousescale.bmp", "MouseScale"); - toolbar_append_toggle_button(toolbar, "Resize", "select_mouseresize.bmp", "MouseDrag"); + toolbar_append_toggle_button(toolbar, "Resize (Q)", "select_mouseresize.bmp", "MouseDrag"); Clipper_constructToolbar(toolbar); } @@ -2492,13 +2518,13 @@ GtkToolbar* create_main_toolbar(MainFrame::EViewStyle style) gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - toolbar_append_toggle_button(toolbar, "Texture Lock", "texture_lock.bmp", "TogTexLock"); + toolbar_append_toggle_button(toolbar, "Texture Lock (SHIFT +T)", "texture_lock.bmp", "TogTexLock"); gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - GtkButton* g_view_entities_button = toolbar_append_button(toolbar, "Entities", "entities.bmp", "ToggleEntityInspector"); - GtkButton* g_view_console_button = toolbar_append_button(toolbar, "Console", "console.bmp", "ToggleConsole"); - GtkButton* g_view_textures_button = toolbar_append_button(toolbar, "Texture Browser", "texture_browser.bmp", "ToggleTextures"); + GtkButton* g_view_entities_button = toolbar_append_button(toolbar, "Entities (N)", "entities.bmp", "ToggleEntityInspector"); + GtkButton* g_view_console_button = toolbar_append_button(toolbar, "Console (O)", "console.bmp", "ToggleConsole"); + GtkButton* g_view_textures_button = toolbar_append_button(toolbar, "Texture Browser (T)", "texture_browser.bmp", "ToggleTextures"); // TODO: call light inspector //GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.bmp", "ToggleLightInspector"); diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 1d08fd4..d30cb56 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -732,7 +732,7 @@ void Patch_registerCommands() void Patch_constructToolbar(GtkToolbar* toolbar) { - toolbar_append_button(toolbar, "Put caps on the current patch", "curve_cap.bmp", "CapCurrentCurve"); + toolbar_append_button(toolbar, "Put caps on the current patch (SHIFT + C)", "curve_cap.bmp", "CapCurrentCurve"); } void Patch_constructMenu(GtkMenu* menu) @@ -740,6 +740,8 @@ void Patch_constructMenu(GtkMenu* menu) create_menu_item_with_mnemonic(menu, "Cylinder", "PatchCylinder"); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "More Cylinders"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Dense Cylinder", "PatchDenseCylinder"); create_menu_item_with_mnemonic(menu_in_menu, "Very Dense Cylinder", "PatchVeryDenseCylinder"); create_menu_item_with_mnemonic(menu_in_menu, "Square Cylinder", "PatchSquareCylinder"); @@ -749,6 +751,8 @@ void Patch_constructMenu(GtkMenu* menu) create_menu_item_with_mnemonic(menu, "Bevel", "PatchBevel"); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "More End caps, Bevels"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Square Endcap", "PatchSquareBevel"); create_menu_item_with_mnemonic(menu_in_menu, "Square Bevel", "PatchSquareEndcap"); } @@ -759,6 +763,8 @@ void Patch_constructMenu(GtkMenu* menu) menu_separator (menu); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Insert"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Insert (2) Columns", "PatchInsertInsertColumn"); create_menu_item_with_mnemonic(menu_in_menu, "Add (2) Columns", "PatchInsertAddColumn"); menu_separator (menu_in_menu); @@ -767,6 +773,8 @@ void Patch_constructMenu(GtkMenu* menu) } { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Delete"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "First (2) Columns", "PatchDeleteFirstColumn"); create_menu_item_with_mnemonic(menu_in_menu, "Last (2) Columns", "PatchDeleteLastColumn"); menu_separator (menu_in_menu); @@ -776,8 +784,12 @@ void Patch_constructMenu(GtkMenu* menu) menu_separator (menu); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Matrix"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Invert", "InvertCurve"); GtkMenu* menu_3 = create_sub_menu_with_mnemonic (menu_in_menu, "Re-disperse"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_3); create_menu_item_with_mnemonic(menu_3, "Rows", "RedisperseRows"); create_menu_item_with_mnemonic(menu_3, "Columns", "RedisperseCols"); create_menu_item_with_mnemonic(menu_in_menu, "Transpose", "MatrixTranspose"); @@ -788,6 +800,8 @@ void Patch_constructMenu(GtkMenu* menu) menu_separator (menu); { GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Overlay"); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (menu_in_menu); create_menu_item_with_mnemonic(menu_in_menu, "Set", "MakeOverlayPatch"); create_menu_item_with_mnemonic(menu_in_menu, "Clear", "ClearPatchOverlays"); } diff --git a/radiant/pluginmenu.cpp b/radiant/pluginmenu.cpp index fb5c55b..0fe758e 100644 --- a/radiant/pluginmenu.cpp +++ b/radiant/pluginmenu.cpp @@ -59,6 +59,8 @@ void PlugInMenu_Add(GtkMenu* plugin_menu, IPlugIn* pPlugIn) if (nCount > 0) { menu = gtk_menu_new(); + if (g_Layout_enableDetachableMenus.m_value) + menu_tearoff (GTK_MENU(menu)); while (nCount > 0) { menuText = pPlugIn->getCommandTitle(--nCount); diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index b59384b..4fcdf93 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -1114,7 +1114,19 @@ void XYWnd::NewBrushDrag(int x, int y) void entitycreate_activated(GtkWidget* item) { - g_pParentWnd->ActiveXY()->OnEntityCreate(gtk_label_get_text(GTK_LABEL(GTK_BIN(item)->child))); + scene::Node* world_node = Map_FindWorldspawn(g_map); + const char* entity_name = gtk_label_get_text(GTK_LABEL(GTK_BIN(item)->child)); + + if(!(world_node && string_equal(entity_name, "worldspawn"))) + { + g_pParentWnd->ActiveXY()->OnEntityCreate(entity_name); + } else { + GlobalRadiant().m_pfnMessageBox(GTK_WIDGET(MainFrame_getWindow()), "There's already a worldspawn in your map!" + "", + "Info", + eMB_OK, + eMB_ICONDEFAULT); + } } void EntityClassMenu_addItem(GtkMenu* menu, const char* name) @@ -2791,6 +2803,7 @@ void XYWindow_Construct() GlobalPreferenceSystem().registerPreference("SI_ShowOutlines", BoolImportStringCaller(g_xywindow_globals_private.show_outline), BoolExportStringCaller(g_xywindow_globals_private.show_outline)); GlobalPreferenceSystem().registerPreference("SI_ShowAxis", BoolImportStringCaller(g_xywindow_globals_private.show_axis), BoolExportStringCaller(g_xywindow_globals_private.show_axis)); GlobalPreferenceSystem().registerPreference("CamXYUpdate", BoolImportStringCaller(g_xywindow_globals_private.m_bCamXYUpdate), BoolExportStringCaller(g_xywindow_globals_private.m_bCamXYUpdate)); + GlobalPreferenceSystem().registerPreference("ShowWorkzone", BoolImportStringCaller(g_xywindow_globals_private.d_show_work), BoolExportStringCaller(g_xywindow_globals_private.d_show_work)); GlobalPreferenceSystem().registerPreference("SI_AxisColors0", Vector3ImportStringCaller(g_xywindow_globals.AxisColorX), Vector3ExportStringCaller(g_xywindow_globals.AxisColorX)); GlobalPreferenceSystem().registerPreference("SI_AxisColors1", Vector3ImportStringCaller(g_xywindow_globals.AxisColorY), Vector3ExportStringCaller(g_xywindow_globals.AxisColorY)); diff --git a/setup/data/tools/global.xlink b/setup/data/tools/global.xlink index c6766cd..8fbd043 100644 --- a/setup/data/tools/global.xlink +++ b/setup/data/tools/global.xlink @@ -3,8 +3,8 @@ - +