X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fmainframe.cpp;h=196a60df37464afe89faf0d1cb1f3246cb99a7c3;hb=c3765eb6e7f6879e5a34c48f71e5ee7bc8b8851f;hp=0baee4873e703dd6e5abd6ba448a65f9fdfdaba2;hpb=6882578a4675ab8b8609d0b0421918dc664a2c18;p=xonotic%2Fnetradiant.git diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 0baee487..196a60df 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -100,6 +100,7 @@ #include "feedback.h" #include "referencecache.h" #include "texwindow.h" +#include "filterbar.h" struct layout_globals_t @@ -138,22 +139,25 @@ void VFS_Init(){ GlobalFileSystem().initialise(); g_vfsInitialized = true; } + void VFS_Shutdown(){ if ( !g_vfsInitialized ) return; GlobalFileSystem().shutdown(); g_vfsInitialized = false; } + void VFS_Refresh(){ if ( !g_vfsInitialized ) return; GlobalFileSystem().clear(); QE_InitVFS(); GlobalFileSystem().refresh(); g_vfsInitialized = true; - // also refresg models + // also refresh models RefreshReferences(); // also refresh texture browser TextureBrowser_RefreshShaders(); } + void VFS_Restart(){ VFS_Shutdown(); VFS_Init(); @@ -164,7 +168,8 @@ class VFSModuleObserver : public ModuleObserver public: void realise(){ VFS_Init(); -} + } + void unrealise(){ VFS_Shutdown(); } @@ -175,6 +180,7 @@ VFSModuleObserver g_VFSModuleObserver; void VFS_Construct(){ Radiant_attachHomePathsObserver( g_VFSModuleObserver ); } + void VFS_Destroy(){ Radiant_detachHomePathsObserver( g_VFSModuleObserver ); } @@ -191,6 +197,7 @@ const GUID qFOLDERID_SavedGames = {0x4C5C32FF, 0xBB9D, 0x43b0, {0xB5, 0xB4, 0x2D typedef HRESULT ( WINAPI qSHGetKnownFolderPath_t )( qREFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath ); static qSHGetKnownFolderPath_t *qSHGetKnownFolderPath; #endif + void HomePaths_Realise(){ do { @@ -287,12 +294,14 @@ std::size_t m_unrealised; public: HomePathsModuleObserver() : m_unrealised( 1 ){ } + void realise(){ if ( --m_unrealised == 0 ) { HomePaths_Realise(); g_homePathObservers.realise(); } } + void unrealise(){ if ( ++m_unrealised == 1 ) { g_homePathObservers.unrealise(); @@ -305,6 +314,7 @@ HomePathsModuleObserver g_HomePathsModuleObserver; void HomePaths_Construct(){ Radiant_attachEnginePathObserver( g_HomePathsModuleObserver ); } + void HomePaths_Destroy(){ Radiant_detachEnginePathObserver( g_HomePathsModuleObserver ); } @@ -371,6 +381,59 @@ void setEnginePath( const char* path ){ } } +// Pak Path + +CopiedString g_strPakPath[g_pakPathCount] = { "", "", "", "", "" }; +ModuleObservers g_pakPathObservers[g_pakPathCount]; +std::size_t g_pakpath_unrealised[g_pakPathCount] = { 1, 1, 1, 1, 1 }; + +void Radiant_attachPakPathObserver( int num, ModuleObserver& observer ){ + g_pakPathObservers[num].attach( observer ); +} + +void Radiant_detachPakPathObserver( int num, ModuleObserver& observer ){ + g_pakPathObservers[num].detach( observer ); +} + + +void PakPath_Realise( int num ){ + if ( --g_pakpath_unrealised[num] == 0 ) { + g_pakPathObservers[num].realise(); + } +} + +const char* PakPath_get( int num ){ + std::string message = "PakPath_get: pak path " + std::to_string(num) + " not realised"; + ASSERT_MESSAGE( g_pakpath_unrealised[num] == 0, message.c_str() ); + return g_strPakPath[num].c_str(); +} + +void PakPath_Unrealise( int num ){ + if ( ++g_pakpath_unrealised[num] == 1 ) { + g_pakPathObservers[num].unrealise(); + } +} + +void setPakPath( int num, const char* path ){ + if (!g_strcmp0( path, "")) { + g_strPakPath[num] = ""; + return; + } + + StringOutputStream buffer( 256 ); + buffer << DirectoryCleaned( path ); + if ( !path_equal( buffer.c_str(), g_strPakPath[num].c_str() ) ) { + std::string message = "Changing Pak Path " + std::to_string(num); + ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", message.c_str() ); + + PakPath_Unrealise(num); + + g_strPakPath[num] = buffer.c_str(); + + PakPath_Realise(num); + } +} + // App Path @@ -394,6 +457,7 @@ const char* LocalRcPath_get( void ){ /// directory for temp files /// NOTE: on *nix this is were we check for .pid CopiedString g_strSettingsPath; + const char* SettingsPath_get(){ return g_strSettingsPath.c_str(); } @@ -420,17 +484,103 @@ struct EnginePath { } static void Import(CopiedString &self, const char *value) { - setEnginePath(value); + setEnginePath( value ); +} +}; + +struct PakPath0 { + static void Export( const CopiedString &self, const Callback &returnz ) { + returnz( self.c_str() ); + } + + static void Import( CopiedString &self, const char *value ) { + setPakPath( 0, value ); } }; +struct PakPath1 { + static void Export( const CopiedString &self, const Callback &returnz ) { + returnz( self.c_str() ); + } + + static void Import( CopiedString &self, const char *value ) { + setPakPath( 1, value ); + } +}; + +struct PakPath2 { + static void Export( const CopiedString &self, const Callback &returnz ) { + returnz( self.c_str() ); + } + + static void Import( CopiedString &self, const char *value ) { + setPakPath( 2, value ); + } +}; + +struct PakPath3 { + static void Export( const CopiedString &self, const Callback &returnz ) { + returnz( self.c_str() ); + } + + static void Import( CopiedString &self, const char *value ) { + setPakPath( 3, value ); + } +}; + +struct PakPath4 { + static void Export( const CopiedString &self, const Callback &returnz ) { + returnz( self.c_str() ); + } + + static void Import( CopiedString &self, const char *value ) { + setPakPath( 4, value ); + } +}; + +bool g_disableEnginePath = false; +bool g_disableHomePath = false; + void Paths_constructPreferences( PreferencesPage& page ){ page.appendPathEntry( "Engine Path", true, make_property(g_strEnginePath) ); + + page.appendCheckBox( + "", "Do not use Engine Path", + g_disableEnginePath + ); + + page.appendCheckBox( + "", "Do not use Home Path", + g_disableHomePath + ); + + for ( int i = 0; i < g_pakPathCount; i++ ) { + std::string label = "Pak Path " + std::to_string(i); + switch (i) { + case 0: + page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); + break; + case 1: + page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); + break; + case 2: + page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); + break; + case 3: + page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); + break; + case 4: + page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); + break; } + } +} + void Paths_constructPage( PreferenceGroup& group ){ PreferencesPage page( group.createPage( "Paths", "Path Settings" ) ); Paths_constructPreferences( page ); } + void Paths_registerPreferencesPage(){ PreferencesDialog_addSettingsPage( makeCallbackF(Paths_constructPage) ); } @@ -456,8 +606,10 @@ ui::Window BuildDialog(){ PathsDialog g_PathsDialog; +bool g_strEnginePath_was_empty_1st_start = false; + void EnginePath_verify(){ - if ( !file_exists( g_strEnginePath.c_str() ) ) { + if ( !file_exists( g_strEnginePath.c_str() ) || g_strEnginePath_was_empty_1st_start ) { g_PathsDialog.Create(); g_PathsDialog.DoModal(); g_PathsDialog.Destroy(); @@ -575,11 +727,13 @@ std::size_t m_unrealised; public: WorldspawnColourEntityClassObserver() : m_unrealised( 1 ){ } + void realise(){ if ( --m_unrealised == 0 ) { SetWorldspawnColour( g_xywindow_globals.color_brushes ); } } + void unrealise(){ if ( ++m_unrealised == 1 ) { } @@ -803,6 +957,7 @@ public: ChooseColour( const GetColourCallback& get, const SetColourCallback& set ) : m_get( get ), m_set( set ){ } + void operator()(){ Vector3 colour; m_get( colour ); @@ -812,16 +967,17 @@ void operator()(){ }; - void Colour_get( const Vector3& colour, Vector3& other ){ other = colour; } + typedef ConstReferenceCaller ColourGetCaller; void Colour_set( Vector3& colour, const Vector3& other ){ colour = other; SceneChangeNotify(); } + typedef ReferenceCaller ColourSetCaller; void BrushColour_set( const Vector3& other ){ @@ -829,6 +985,7 @@ void BrushColour_set( const Vector3& other ){ SetWorldspawnColour( g_xywindow_globals.color_brushes ); SceneChangeNotify(); } + typedef FreeCaller BrushColourSetCaller; void ClipperColour_set( const Vector3& other ){ @@ -836,16 +993,19 @@ void ClipperColour_set( const Vector3& other ){ Brush_clipperColourChanged(); SceneChangeNotify(); } + typedef FreeCaller ClipperColourSetCaller; void TextureBrowserColour_get( Vector3& other ){ other = TextureBrowser_getBackgroundColour( GlobalTextureBrowser() ); } + typedef FreeCaller TextureBrowserColourGetCaller; void TextureBrowserColour_set( const Vector3& other ){ TextureBrowser_setBackgroundColour( GlobalTextureBrowser(), other ); } + typedef FreeCaller TextureBrowserColourSetCaller; @@ -964,17 +1124,17 @@ void EntityInspector_ToggleShow(){ } - void SetClipMode( bool enable ); + void ModeChangeNotify(); typedef void ( *ToolMode )(); + ToolMode g_currentToolMode = 0; bool g_currentToolModeSupportsComponentEditing = false; ToolMode g_defaultToolMode = 0; - void SelectionSystem_DefaultMode(){ GlobalSelectionSystem().SetMode( SelectionSystem::ePrimitive ); GlobalSelectionSystem().SetComponentMode( SelectionSystem::eDefault ); @@ -1115,6 +1275,7 @@ NodeSmartReference worldspawn; public: CloneSelected( bool d ) : doMakeUnique( d ), worldspawn( Map_FindOrInsertWorldspawn( g_map ) ){ } + bool pre( const scene::Path& path, scene::Instance& instance ) const { if ( path.size() == 1 ) { return true; @@ -1136,6 +1297,7 @@ bool pre( const scene::Path& path, scene::Instance& instance ) const { return true; } + void post( const scene::Path& path, scene::Instance& instance ) const { if ( path.size() == 1 ) { return; @@ -1180,6 +1342,7 @@ struct AxisBase Vector3 x; Vector3 y; Vector3 z; + AxisBase( const Vector3& x_, const Vector3& y_, const Vector3& z_ ) : x( x_ ), y( y_ ), z( z_ ){ } @@ -1516,6 +1679,7 @@ public: SnappableSnapToGridSelected( float snap ) : m_snap( snap ){ } + bool pre( const scene::Path& path, scene::Instance& instance ) const { if ( path.top().get().visible() ) { Snappable* snappable = Node_getSnappable( path.top() ); @@ -1539,6 +1703,7 @@ public: ComponentSnappableSnapToGridSelected( float snap ) : m_snap( snap ){ } + bool pre( const scene::Path& path, scene::Instance& instance ) const { if ( path.top().get().visible() ) { ComponentSnappable* componentSnappable = Instance_getComponentSnappable( instance ); @@ -1719,7 +1884,6 @@ void ScreenUpdates_Enable(){ } - void GlobalCamera_UpdateWindow(){ if ( g_pParentWnd != 0 ) { CamWnd_Update( *g_pParentWnd->GetCamWnd() ); @@ -1776,7 +1940,7 @@ LatchedValue g_Layout_viewStyle( 0, "Window Layout" ); LatchedValue g_Layout_enableDetachableMenus( true, "Detachable Menus" ); LatchedValue g_Layout_enablePatchToolbar( true, "Patch Toolbar" ); LatchedValue g_Layout_enablePluginToolbar( true, "Plugin Toolbar" ); - +LatchedValue g_Layout_enableFilterToolbar( true, "Filter Toolbar" ); ui::MenuItem create_file_menu(){ @@ -1805,15 +1969,16 @@ ui::MenuItem create_file_menu(){ create_menu_item_with_mnemonic( menu, "_Export selected...", "ExportSelected" ); menu_separator( menu ); create_menu_item_with_mnemonic( menu, "Save re_gion...", "SaveRegion" ); - menu_separator( menu ); - create_menu_item_with_mnemonic( menu, "_Refresh models", "RefreshReferences" ); - menu_separator( menu ); +// menu_separator( menu ); +// create_menu_item_with_mnemonic( menu, "_Refresh models", "RefreshReferences" ); +// menu_separator( menu ); create_menu_item_with_mnemonic( menu, "Pro_ject settings...", "ProjectSettings" ); menu_separator( menu ); create_menu_item_with_mnemonic( menu, "_Pointfile...", "TogglePointfile" ); menu_separator( menu ); MRU_constructMenu( menu ); menu_separator( menu ); +// create_menu_item_with_mnemonic( menu, "Check for NetRadiant update (web)", "CheckForUpdate" ); // FIXME create_menu_item_with_mnemonic( menu, "E_xit", "Exit" ); return file_menu_item; @@ -1837,18 +2002,22 @@ ui::MenuItem create_edit_menu(){ create_menu_item_with_mnemonic( menu, "Duplicate, make uni_que", "CloneSelectionAndMakeUnique" ); create_menu_item_with_mnemonic( menu, "D_elete", "DeleteSelection" ); menu_separator( menu ); - create_menu_item_with_mnemonic( menu, "Pa_rent", "ParentSelection" ); + create_menu_item_with_mnemonic( menu, "Snap To Grid", "SnapToGrid" ); + //create_menu_item_with_mnemonic( menu, "Pa_rent", "ParentSelection" ); menu_separator( menu ); create_menu_item_with_mnemonic( menu, "C_lear Selection", "UnSelectSelection" ); create_menu_item_with_mnemonic( menu, "_Invert Selection", "InvertSelection" ); create_menu_item_with_mnemonic( menu, "Select i_nside", "SelectInside" ); create_menu_item_with_mnemonic( menu, "Select _touching", "SelectTouching" ); - auto 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 ); + +// auto 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( menu, "Select All Of Type", "SelectAllOfType" ); + create_menu_item_with_mnemonic( menu, "_Expand Selection To Entities", "ExpandSelectionToEntities" ); menu_separator( menu ); create_menu_item_with_mnemonic( menu, "Pre_ferences...", "Preferences" ); @@ -1900,6 +2069,7 @@ ui::MenuItem create_view_menu( MainFrame::EViewStyle style ){ create_menu_item_with_mnemonic( menu, "Entity Inspector", "ViewEntityInfo" ); } create_menu_item_with_mnemonic( menu, "_Surface Inspector", "SurfaceInspector" ); + create_menu_item_with_mnemonic( menu, "_Patch Inspector", "PatchInspector" ); create_menu_item_with_mnemonic( menu, "Entity List", "EntityList" ); menu_separator( menu ); @@ -1935,6 +2105,8 @@ ui::MenuItem create_view_menu( MainFrame::EViewStyle style ){ menu_separator( orthographic_menu ); } + create_menu_item_with_mnemonic( orthographic_menu, "Center on Selected", "CenterXYView" ); + menu_separator( orthographic_menu ); create_menu_item_with_mnemonic( orthographic_menu, "_XY 100%", "Zoom100" ); create_menu_item_with_mnemonic( orthographic_menu, "XY Zoom _In", "ZoomIn" ); create_menu_item_with_mnemonic( orthographic_menu, "XY Zoom _Out", "ZoomOut" ); @@ -1947,6 +2119,12 @@ ui::MenuItem create_view_menu( MainFrame::EViewStyle style ){ 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" ); + + 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 Blocks", "ShowBlocks" ); @@ -1966,12 +2144,14 @@ ui::MenuItem create_view_menu( MainFrame::EViewStyle style ){ } menu_separator( menu ); { - auto 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" ); +// 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_menu_item_with_mnemonic( menu, "Show Hidden", "ShowHidden" ); } menu_separator( menu ); { @@ -2146,7 +2326,7 @@ ui::MenuItem create_help_menu(){ menu_tearoff( menu ); } - create_menu_item_with_mnemonic( menu, "Manual", "OpenManual" ); +// create_menu_item_with_mnemonic( menu, "Manual", "OpenManual" ); // this creates all the per-game drop downs for the game pack helps // it will take care of hooking the Sys_OpenURL calls etc. @@ -2185,13 +2365,13 @@ void PatchInspector_registerShortcuts(){ } void Patch_registerShortcuts(){ - command_connect_accelerator( "InvertCurveTextureX" ); - command_connect_accelerator( "InvertCurveTextureY" ); +// command_connect_accelerator( "InvertCurveTextureX" ); +// command_connect_accelerator( "InvertCurveTextureY" ); command_connect_accelerator( "PatchInsertInsertColumn" ); command_connect_accelerator( "PatchInsertInsertRow" ); command_connect_accelerator( "PatchDeleteLastColumn" ); command_connect_accelerator( "PatchDeleteLastRow" ); - command_connect_accelerator( "NaturalizePatch" ); +// command_connect_accelerator( "NaturalizePatch" ); //command_connect_accelerator("CapCurrentCurve"); } @@ -2223,6 +2403,8 @@ void SelectNudge_registerShortcuts(){ //command_connect_accelerator("SelectNudgeRight"); //command_connect_accelerator("SelectNudgeUp"); //command_connect_accelerator("SelectNudgeDown"); + command_connect_accelerator( "UnSelectSelection2" ); + command_connect_accelerator( "DeleteSelection2" ); } void SnapToGrid_registerShortcuts(){ @@ -2239,17 +2421,17 @@ void SurfaceInspector_registerShortcuts(){ void register_shortcuts(){ - PatchInspector_registerShortcuts(); +// PatchInspector_registerShortcuts(); Patch_registerShortcuts(); Grid_registerShortcuts(); - XYWnd_registerShortcuts(); +// XYWnd_registerShortcuts(); CamWnd_registerShortcuts(); Manipulators_registerShortcuts(); SurfaceInspector_registerShortcuts(); TexdefNudge_registerShortcuts(); SelectNudge_registerShortcuts(); - SnapToGrid_registerShortcuts(); - SelectByType_registerShortcuts(); +// SnapToGrid_registerShortcuts(); +// SelectByType_registerShortcuts(); } void File_constructToolbar( ui::Toolbar toolbar ){ @@ -2279,7 +2461,8 @@ void Select_constructToolbar( ui::Toolbar toolbar ){ void CSG_constructToolbar( ui::Toolbar toolbar ){ toolbar_append_button( toolbar, "CSG Subtract (SHIFT + U)", "selection_csgsubtract.png", "CSGSubtract" ); toolbar_append_button( toolbar, "CSG Merge (CTRL + U)", "selection_csgmerge.png", "CSGMerge" ); - toolbar_append_button( toolbar, "Hollow", "selection_makehollow.png", "CSGHollow" ); + toolbar_append_button( toolbar, "Make Hollow", "selection_makehollow.png", "CSGHollow" ); + toolbar_append_button( toolbar, "Make Room", "selection_makeroom.png", "CSGRoom" ); } void ComponentModes_constructToolbar( ui::Toolbar toolbar ){ @@ -2469,6 +2652,7 @@ static gboolean notify( ui::Window window, gpointer dummy, MainWindowActive* sel return FALSE; } + public: void connect( ui::Window toplevel_window ){ toplevel_window.connect( "notify::is-active", G_CALLBACK( notify ), this ); @@ -2659,11 +2843,11 @@ ui::Window create_splash(){ gtk_window_set_decorated(window, false); gtk_window_set_resizable(window, false); gtk_window_set_modal(window, true); - gtk_window_set_default_size(window, -1, -1); - gtk_window_set_position(window, GTK_WIN_POS_CENTER); + gtk_window_set_default_size( window, -1, -1 ); + gtk_window_set_position( window, GTK_WIN_POS_CENTER ); gtk_container_set_border_width(window, 0); - auto image = new_local_image("splash.png"); + auto image = new_local_image( "splash.png" ); image.show(); window.add(image); @@ -2745,11 +2929,24 @@ void MainFrame::Create(){ auto main_toolbar = create_main_toolbar( CurrentStyle() ); vbox.pack_start( main_toolbar, FALSE, FALSE, 0 ); - auto plugin_toolbar = create_plugin_toolbar(); - if ( !g_Layout_enablePluginToolbar.m_value ) { - plugin_toolbar.hide(); + if ( g_Layout_enablePluginToolbar.m_value || g_Layout_enableFilterToolbar.m_value ){ + auto PFbox = ui::HBox( FALSE, 3 ); + vbox.pack_start( PFbox, FALSE, FALSE, 0 ); + PFbox.show(); + if ( g_Layout_enablePluginToolbar.m_value ){ + auto plugin_toolbar = create_plugin_toolbar(); + if ( g_Layout_enableFilterToolbar.m_value ){ + PFbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 ); + } + else{ + PFbox.pack_start( plugin_toolbar, TRUE, TRUE, 0 ); + } + } + if ( g_Layout_enableFilterToolbar.m_value ){ + ui::Toolbar filter_toolbar = create_filter_toolbar(); + PFbox.pack_start( filter_toolbar, TRUE, TRUE, 0 ); + } } - vbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 ); ui::Widget main_statusbar = create_main_statusbar(reinterpret_cast(m_pStatusLabel)); vbox.pack_end(main_statusbar, FALSE, TRUE, 2); @@ -2784,42 +2981,37 @@ void MainFrame::Create(){ if ( CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft ) { { - ui::Widget vsplit = ui::VPaned(ui::New); - m_vSplit = vsplit; - vbox.pack_start( vsplit, TRUE, TRUE, 0 ); - vsplit.show(); - - // console - ui::Widget console_window = Console_constructWindow( window ); - gtk_paned_pack2( GTK_PANED( vsplit ), console_window, FALSE, TRUE ); - + ui::Widget hsplit = ui::HPaned(ui::New); + m_vSplit = hsplit; + vbox.pack_start( hsplit, TRUE, TRUE, 0 ); + hsplit.show(); { - ui::Widget hsplit = ui::HPaned(ui::New); - hsplit.show(); - m_hSplit = hsplit; - gtk_paned_add1( GTK_PANED( vsplit ), hsplit ); + ui::Widget vsplit = ui::VPaned(ui::New); + vsplit.show(); + m_vSplit = vsplit; + ui::Widget vsplit2 = ui::VPaned(ui::New); + vsplit2.show(); + m_vSplit = vsplit2; + if ( CurrentStyle() == eRegular ){ + gtk_paned_add1( GTK_PANED( hsplit ), vsplit ); + gtk_paned_add2( GTK_PANED( hsplit ), vsplit2 ); + } + else{ + gtk_paned_add2( GTK_PANED( hsplit ), vsplit ); + gtk_paned_add1( GTK_PANED( hsplit ), vsplit2 ); + } + // console + ui::Widget console_window = Console_constructWindow( window ); + gtk_paned_pack2( GTK_PANED( vsplit ), console_window, FALSE, TRUE ); + // xy m_pXYWnd = new XYWnd(); m_pXYWnd->SetViewType( XY ); ui::Widget xy_window = ui::Widget(create_framed_widget( m_pXYWnd->GetWidget( ) )); + gtk_paned_add1( GTK_PANED( vsplit ), xy_window ); { - ui::Widget vsplit2 = ui::VPaned(ui::New); - vsplit2.show(); - m_vSplit2 = vsplit2; - - if ( CurrentStyle() == eRegular ) { - gtk_paned_add1( GTK_PANED( hsplit ), xy_window ); - gtk_paned_add2( GTK_PANED( hsplit ), vsplit2 ); - } - else - { - gtk_paned_add1( GTK_PANED( hsplit ), vsplit2 ); - gtk_paned_add2( GTK_PANED( hsplit ), xy_window ); - } - - // camera m_pCamWnd = NewCamWnd(); GlobalCamera_setCamWnd( *m_pCamWnd ); @@ -3064,8 +3256,11 @@ int getFarClipDistance(){ } float ( *GridStatus_getGridSize )() = GetGridSize; + int ( *GridStatus_getRotateIncrement )() = getRotateIncrement; + int ( *GridStatus_getFarClipDistance )() = getFarClipDistance; + bool ( *GridStatus_getTextureLockEnabled )(); void MainFrame::SetGridStatus(){ @@ -3145,6 +3340,10 @@ void Layout_constructPreferences( PreferencesPage& page ){ "", "Plugin Toolbar", make_property( g_Layout_enablePluginToolbar ) ); + page.appendCheckBox( + "", "Filter Toolbar", + make_property( g_Layout_enableFilterToolbar ) + ); } void Layout_constructPage( PreferenceGroup& group ){ @@ -3182,9 +3381,13 @@ void MainFrame_Construct(){ GlobalCommands_insert( "PasteToCamera", makeCallbackF(PasteToCamera), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) ); GlobalCommands_insert( "CloneSelection", makeCallbackF(Selection_Clone), Accelerator( GDK_KEY_space ) ); GlobalCommands_insert( "CloneSelectionAndMakeUnique", makeCallbackF(Selection_Clone_MakeUnique), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "DeleteSelection", makeCallbackF(deleteSelection), Accelerator( GDK_KEY_BackSpace ) ); +// GlobalCommands_insert( "DeleteSelection", makeCallbackF(deleteSelection), Accelerator( GDK_KEY_BackSpace ) ); + GlobalCommands_insert( "DeleteSelection2", makeCallbackF(deleteSelection), Accelerator( GDK_KEY_BackSpace ) ); + GlobalCommands_insert( "DeleteSelection", makeCallbackF(deleteSelection), Accelerator( 'Z' ) ); GlobalCommands_insert( "ParentSelection", makeCallbackF(Scene_parentSelected) ); - GlobalCommands_insert( "UnSelectSelection", makeCallbackF(Selection_Deselect), Accelerator( GDK_KEY_Escape ) ); +// GlobalCommands_insert( "UnSelectSelection", makeCallbackF(Selection_Deselect), Accelerator( GDK_KEY_Escape ) ); + GlobalCommands_insert( "UnSelectSelection2", makeCallbackF(Selection_Deselect), Accelerator( GDK_KEY_Escape ) ); + GlobalCommands_insert( "UnSelectSelection", makeCallbackF(Selection_Deselect), Accelerator( 'C' ) ); GlobalCommands_insert( "InvertSelection", makeCallbackF(Select_Invert), Accelerator( 'I' ) ); GlobalCommands_insert( "SelectInside", makeCallbackF(Select_Inside) ); GlobalCommands_insert( "SelectTouching", makeCallbackF(Select_Touching) ); @@ -3247,8 +3450,9 @@ void MainFrame_Construct(){ GlobalCommands_insert( "CSGSubtract", makeCallbackF(CSG_Subtract), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CSGMerge", makeCallbackF(CSG_Merge), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "CSGMerge", makeCallbackF(CSG_Merge), Accelerator( 'U', (GdkModifierType) GDK_CONTROL_MASK ) ); GlobalCommands_insert( "CSGHollow", makeCallbackF(CSG_MakeHollow) ); + GlobalCommands_insert( "CSGRoom", makeCallbackF(CSG_MakeRoom) ); Grid_registerCommands(); @@ -3284,6 +3488,7 @@ void MainFrame_Construct(){ GlobalPreferenceSystem().registerPreference( "DetachableMenus", make_property_string( g_Layout_enableDetachableMenus.m_latched ) ); GlobalPreferenceSystem().registerPreference( "PatchToolBar", make_property_string( g_Layout_enablePatchToolbar.m_latched ) ); GlobalPreferenceSystem().registerPreference( "PluginToolBar", make_property_string( g_Layout_enablePluginToolbar.m_latched ) ); + GlobalPreferenceSystem().registerPreference( "FilterToolBar", make_property_string( g_Layout_enableFilterToolbar.m_latched ) ); GlobalPreferenceSystem().registerPreference( "QE4StyleWindows", make_property_string( g_Layout_viewStyle.m_latched ) ); GlobalPreferenceSystem().registerPreference( "XYHeight", make_property_string( g_layout_globals.nXYHeight ) ); GlobalPreferenceSystem().registerPreference( "XYWidth", make_property_string( g_layout_globals.nXYWidth ) ); @@ -3301,7 +3506,10 @@ void MainFrame_Construct(){ GlobalPreferenceSystem().registerPreference( "YZWnd", make_property(g_posYZWnd) ); GlobalPreferenceSystem().registerPreference( "XZWnd", make_property(g_posXZWnd) ); + GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) ); + if ( g_strEnginePath.empty() ) { + g_strEnginePath_was_empty_1st_start = true; const char* ENGINEPATH_ATTRIBUTE = #if GDEF_OS_WINDOWS "enginepath_win32" @@ -3316,14 +3524,22 @@ void MainFrame_Construct(){ StringOutputStream path( 256 ); path << DirectoryCleaned( g_pGameDescription->getRequiredKeyValue( ENGINEPATH_ATTRIBUTE ) ); g_strEnginePath = path.c_str(); + GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) ); } - GlobalPreferenceSystem().registerPreference( "EnginePath", make_property_string( g_strEnginePath ) ); + GlobalPreferenceSystem().registerPreference( "DisableEnginePath", make_property_string( g_disableEnginePath ) ); + GlobalPreferenceSystem().registerPreference( "DisableHomePath", make_property_string( g_disableHomePath ) ); + + for ( int i = 0; i < g_pakPathCount; i++ ) { + std::string label = "PakPath" + std::to_string( i ); + GlobalPreferenceSystem().registerPreference( label.c_str(), make_property_string( g_strPakPath[i] ) ); + } g_Layout_viewStyle.useLatched(); g_Layout_enableDetachableMenus.useLatched(); g_Layout_enablePatchToolbar.useLatched(); g_Layout_enablePluginToolbar.useLatched(); + g_Layout_enableFilterToolbar.useLatched(); Layout_registerPreferencesPage(); Paths_registerPreferencesPage();