register_shortcuts();
- 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 );
-
-
+ auto main_menu = create_main_menu( CurrentStyle() );
+ vbox.pack_start( main_menu, FALSE, FALSE, 0 );
+ 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_enableFilterToolbar.m_value ) {
- auto space = [&]() {
- auto btn = gtk_separator_tool_item_new();
- gtk_widget_show(GTK_WIDGET(btn));
- gtk_container_add(GTK_CONTAINER(plugin_toolbar), GTK_WIDGET(btn));
- };
-
- space();
- toolbar_append_toggle_button( plugin_toolbar, "World (ALT + 1)", "f-world.bmp", "FilterWorldBrushes" );
- toolbar_append_toggle_button( plugin_toolbar, "Details (CTRL + D)", "f-details.bmp", "FilterDetails" );
- toolbar_append_toggle_button( plugin_toolbar, "Structural (CTRL + SHIFT + D)", "f-structural.bmp", "FilterStructural" );
- toolbar_append_toggle_button( plugin_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
- space();
- toolbar_append_toggle_button( plugin_toolbar, "Areaportals (ALT + 3)", "f-areaportal.bmp", "FilterAreaportals" );
- toolbar_append_toggle_button( plugin_toolbar, "Translucent (ALT + 4)", "f-translucent.bmp", "FilterTranslucent" );
- toolbar_append_toggle_button( plugin_toolbar, "Liquids (ALT + 5)", "f-liquids.bmp", "FilterLiquids" );
- toolbar_append_toggle_button( plugin_toolbar, "Caulk (ALT + 6)", "f-caulk.bmp", "FilterCaulk" );
- toolbar_append_toggle_button( plugin_toolbar, "Clips (ALT + 7)", "f-clip.bmp", "FilterClips" );
- toolbar_append_toggle_button( plugin_toolbar, "HintsSkips (CTRL + H)", "f-hint.bmp", "FilterHintsSkips" );
- //toolbar_append_toggle_button( plugin_toolbar, "Paths (ALT + 8)", "texture_lock.bmp", "FilterPaths" );
- space();
- toolbar_append_toggle_button( plugin_toolbar, "Entities (ALT + 2)", "f-entities.bmp", "FilterEntities" );
- toolbar_append_toggle_button( plugin_toolbar, "Lights (ALT + 0)", "lightinspector.png", "FilterLights" );
- toolbar_append_toggle_button( plugin_toolbar, "Models (SHIFT + M)", "f-models.bmp", "FilterModels" );
- toolbar_append_toggle_button( plugin_toolbar, "Triggers (CTRL + SHIFT + T)", "f-triggers.bmp", "FilterTriggers" );
- // toolbar_append_toggle_button( plugin_toolbar, "Decals (SHIFT + D)", "f-decals.bmp", "FilterDecals" );
- space();
- toolbar_append_button( plugin_toolbar, "InvertFilters", "f-invert.bmp", "InvertFilters" );
- toolbar_append_button( plugin_toolbar, "ResetFilters", "f-reset.bmp", "ResetFilters" );
+ if ( g_Layout_enablePluginToolbar.m_value || g_Layout_enableFilterToolbar.m_value ){
- GtkWidget* PFbox = gtk_hbox_new( FALSE, 3 );
- gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( PFbox ), FALSE, FALSE, 0 );
- gtk_widget_show( PFbox );
++ auto PFbox = ui::HBox( FALSE, 3 );
++ vbox.pack_start( PFbox, FALSE, FALSE, 0 );
++ PFbox.show();
+ if ( g_Layout_enablePluginToolbar.m_value ){
- GtkToolbar* plugin_toolbar = create_plugin_toolbar();
++ auto plugin_toolbar = create_plugin_toolbar();
+ if ( g_Layout_enableFilterToolbar.m_value ){
- gtk_box_pack_start( GTK_BOX( PFbox ), GTK_WIDGET( plugin_toolbar ), FALSE, FALSE, 0 );
++ PFbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 );
+ }
+ else{
- gtk_box_pack_start( GTK_BOX( PFbox ), GTK_WIDGET( plugin_toolbar ), TRUE, TRUE, 0 );
++ PFbox.pack_start( plugin_toolbar, TRUE, TRUE, 0 );
+ }
+ }
+ if ( g_Layout_enableFilterToolbar.m_value ){
- GtkToolbar* filter_toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
- gtk_widget_show( GTK_WIDGET( filter_toolbar ) );
++ auto filter_toolbar = create_filter_toolbar();
++ filter_toolbar.show();
++
++ auto space = [&]() {
++ auto btn = gtk_separator_tool_item_new();
++ gtk_widget_show(GTK_WIDGET(btn));
++ gtk_container_add(GTK_CONTAINER(filter_toolbar), GTK_WIDGET(btn));
++ };
+
+ toolbar_append_toggle_button( filter_toolbar, "World (ALT + 1)", "f-world.bmp", "FilterWorldBrushes" );
+ toolbar_append_toggle_button( filter_toolbar, "Details (CTRL + D)", "f-details.bmp", "FilterDetails" );
+ toolbar_append_toggle_button( filter_toolbar, "Structural (CTRL + SHIFT + D)", "f-structural.bmp", "FilterStructural" );
- toolbar_append_toggle_button( filter_toolbar, "Patches (CTRL + P)", "patch_wireframe.bmp", "FilterPatches" );
- gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++ toolbar_append_toggle_button( filter_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
++ space();
+ toolbar_append_toggle_button( filter_toolbar, "Areaportals (ALT + 3)", "f-areaportal.bmp", "FilterAreaportals" );
+ toolbar_append_toggle_button( filter_toolbar, "Translucent (ALT + 4)", "f-translucent.bmp", "FilterTranslucent" );
+ toolbar_append_toggle_button( filter_toolbar, "Liquids (ALT + 5)", "f-liquids.bmp", "FilterLiquids" );
+ toolbar_append_toggle_button( filter_toolbar, "Caulk (ALT + 6)", "f-caulk.bmp", "FilterCaulk" );
+ toolbar_append_toggle_button( filter_toolbar, "Clips (ALT + 7)", "f-clip.bmp", "FilterClips" );
+ toolbar_append_toggle_button( filter_toolbar, "HintsSkips (CTRL + H)", "f-hint.bmp", "FilterHintsSkips" );
+ //toolbar_append_toggle_button( filter_toolbar, "Paths (ALT + 8)", "texture_lock.bmp", "FilterPaths" );
- gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++ space();
+ toolbar_append_toggle_button( filter_toolbar, "Entities (ALT + 2)", "f-entities.bmp", "FilterEntities" );
- toolbar_append_toggle_button( filter_toolbar, "Lights (ALT + 0)", "lightinspector.bmp", "FilterLights" );
++ toolbar_append_toggle_button( filter_toolbar, "Lights (ALT + 0)", "lightinspector.png", "FilterLights" );
+ toolbar_append_toggle_button( filter_toolbar, "Models (SHIFT + M)", "f-models.bmp", "FilterModels" );
+ toolbar_append_toggle_button( filter_toolbar, "Triggers (CTRL + SHIFT + T)", "f-triggers.bmp", "FilterTriggers" );
+ //toolbar_append_toggle_button( filter_toolbar, "Decals (SHIFT + D)", "f-decals.bmp", "FilterDecals" );
- gtk_toolbar_append_space( GTK_TOOLBAR( filter_toolbar ) );
++ space();
+ toolbar_append_button( filter_toolbar, "InvertFilters", "f-invert.bmp", "InvertFilters" );
+ toolbar_append_button( filter_toolbar, "ResetFilters", "f-reset.bmp", "ResetFilters" );
+
- gtk_box_pack_start( GTK_BOX( PFbox ), GTK_WIDGET( filter_toolbar ), TRUE, TRUE, 0 );
++ PFbox.pack_start( filter_toolbar, FALSE, FALSE, 0 );
+ }
}
- vbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 );
- /*GtkToolbar* plugin_toolbar = create_plugin_toolbar();
- if ( !g_Layout_enablePluginToolbar.m_value ) {
- gtk_widget_hide( GTK_WIDGET( plugin_toolbar ) );
- }*/
- if ( g_Layout_enableFilterToolbar.m_value ) {
- }
-
-
-
-
- GtkWidget* main_statusbar = create_main_statusbar( m_pStatusLabel );
- gtk_box_pack_end( GTK_BOX( vbox ), main_statusbar, FALSE, TRUE, 2 );
+ ui::Widget main_statusbar = create_main_statusbar(reinterpret_cast<ui::Widget *>(m_pStatusLabel));
+ vbox.pack_end(main_statusbar, FALSE, TRUE, 2);
GroupDialog_constructWindow( window );
g_page_entity = GroupDialog_addPage( "Entities", EntityInspector_constructWindow( GroupDialog_getWindow() ), RawStringExportCaller( "Entities" ) );
STARTUPSHADERS_COMMON,
};
-void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
+void TextureBrowser_hideUnusedExport( const Callback<void(bool)> & importer );
+
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
+
+void TextureBrowser_showShadersExport( const Callback<void(bool)> & importer );
+
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
+
++void TextureBrowser_showTexturesExport( const Callback<void(bool)> & importer );
+
-void TextureBrowser_showShadersExport( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
++typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
+
-void TextureBrowser_showTexturesExport( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
+void TextureBrowser_showShaderlistOnly( const Callback<void(bool)> & importer );
-void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
-void TextureBrowser_fixedSize( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_fixedSize> TextureBrowserFixedSizeExport;
+void TextureBrowser_fixedSize( const Callback<void(bool)> & importer );
-void TextureBrowser_filterNotex( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterNotex> TextureBrowserFilterNotexExport;
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_fixedSize> TextureBrowserFixedSizeExport;
-void TextureBrowser_enableAlpha( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_enableAlpha> TextureBrowserEnableAlphaExport;
+void TextureBrowser_filterMissing( const Callback<void(bool)> & importer );
+
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterMissing> TextureBrowserFilterMissingExport;
+
+void TextureBrowser_filterFallback( const Callback<void(bool)> & importer );
+
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterFallback> TextureBrowserFilterFallbackExport;
+
+void TextureBrowser_enableAlpha( const Callback<void(bool)> & importer );
+
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_enableAlpha> TextureBrowserEnableAlphaExport;
class TextureBrowser
{
std::set<CopiedString> m_found_shaders;
ToggleItem m_hideunused_item;
+ToggleItem m_hidenotex_item;
ToggleItem m_showshaders_item;
+ ToggleItem m_showtextures_item;
ToggleItem m_showshaderlistonly_item;
ToggleItem m_fixedsize_item;
ToggleItem m_filternotex_item;
}
TextureBrowser() :
- m_texture_scroll( 0 ),
+ m_texture_scroll( ui::null ),
m_hideunused_item( TextureBrowserHideUnusedExport() ),
+ m_hidenotex_item( TextureBrowserFilterFallbackExport() ),
m_showshaders_item( TextureBrowserShowShadersExport() ),
+ m_showtextures_item( TextureBrowserShowTexturesExport() ),
m_showshaderlistonly_item( TextureBrowserShowShaderlistOnlyExport() ),
m_fixedsize_item( TextureBrowserFixedSizeExport() ),
- m_filternotex_item( TextureBrowserFilterNotexExport() ),
+ m_filternotex_item( TextureBrowserFilterMissingExport() ),
m_enablealpha_item( TextureBrowserEnableAlphaExport() ),
m_heightChanged( true ),
m_originInvalid( true ),
}
}
-CopiedString g_notex;
-CopiedString g_shadernotex;
-
// if texture_showinuse jump over non in-use textures
- bool Texture_IsShown( IShader* shader, bool show_shaders, bool hideUnused ){
+ bool Texture_IsShown( IShader* shader, bool show_shaders, bool show_textures, bool hideUnused ){
- // filter notex / shadernotex images
- if ( g_TextureBrowser_filterNotex && ( string_equal( g_notex.c_str(), shader->getTexture()->name ) || string_equal( g_shadernotex.c_str(), shader->getTexture()->name ) ) ) {
- return false;
+ // filter missing shaders
+ // ugly: filter on built-in fallback name after substitution
+ if ( g_TextureBrowser_filterMissing ) {
+ if ( isMissing( shader->getTexture()->name ) ) {
+ return false;
+ }
+ }
+ // filter the fallback (notex/shadernotex) for missing shaders or editor image
+ if ( g_TextureBrowser_filterFallback ) {
+ if ( isNotex( shader->getName() ) ) {
+ return false;
+ }
+ if ( isNotex( shader->getTexture()->name ) ) {
+ return false;
+ }
}
if ( g_TextureBrowser_currentDirectory == "Untagged" ) {
public:
void realise(){
m_realiseCallbacks();
+ /* texturebrowser tree update on vfs restart */
TextureBrowser_constructTreeStore();
}
+
void unrealise(){
}
+
void insert( const SignalHandler& handler ){
m_realiseCallbacks.connectLast( handler );
}
bool TextureBrowser_hideUnused();
-void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer ){
+void TextureBrowser_hideUnusedExport( const Callback<void(bool)> & importer ){
importer( TextureBrowser_hideUnused() );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
-void TextureBrowser_showShadersExport( const BoolImportCallback& importer ){
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
+
+void TextureBrowser_showShadersExport( const Callback<void(bool)> & importer ){
importer( GlobalTextureBrowser().m_showShaders );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
-void TextureBrowser_showTexturesExport( const BoolImportCallback& importer ){
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
+
++void TextureBrowser_showTexturesExport( const Callback<void(bool)> & importer ){
+ importer( GlobalTextureBrowser().m_showTextures );
+ }
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
+
-void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer ){
++typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showTexturesExport> TextureBrowserShowTexturesExport;
++
+void TextureBrowser_showShaderlistOnly( const Callback<void(bool)> & importer ){
importer( g_TextureBrowser_shaderlistOnly );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
-void TextureBrowser_fixedSize( const BoolImportCallback& importer ){
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
+
+void TextureBrowser_fixedSize( const Callback<void(bool)> & importer ){
importer( g_TextureBrowser_fixedSize );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_fixedSize> TextureBrowser_FixedSizeExport;
-void TextureBrowser_filterNotex( const BoolImportCallback& importer ){
- importer( g_TextureBrowser_filterNotex );
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_fixedSize> TextureBrowser_FixedSizeExport;
+
+void TextureBrowser_filterMissing( const Callback<void(bool)> & importer ){
+ importer( g_TextureBrowser_filterMissing );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterNotex> TextureBrowser_filterNotexExport;
-void TextureBrowser_enableAlpha( const BoolImportCallback& importer ){
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterMissing> TextureBrowser_filterMissingExport;
+
+void TextureBrowser_filterFallback( const Callback<void(bool)> & importer ){
+ importer( g_TextureBrowser_filterFallback );
+}
+
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_filterFallback> TextureBrowser_filterFallbackExport;
+
+void TextureBrowser_enableAlpha( const Callback<void(bool)> & importer ){
importer( g_TextureBrowser_enableAlpha );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_enableAlpha> TextureBrowser_enableAlphaExport;
+
+typedef FreeCaller<void(const Callback<void(bool)> &), TextureBrowser_enableAlpha> TextureBrowser_enableAlphaExport;
void TextureBrowser_SetHideUnused( TextureBrowser& textureBrowser, bool hideUnused ){
if ( hideUnused ) {
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glDisable( GL_DEPTH_TEST );
++
+ //glDisable( GL_BLEND );
if ( g_TextureBrowser_enableAlpha ) {
glEnable( GL_BLEND );
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
create_check_menu_item_with_mnemonic( menu, "Hide _Unused", "ShowInUse" );
- create_menu_item_with_mnemonic( menu, "Show All", "ShowAllTextures" );
+ if ( string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
+ create_check_menu_item_with_mnemonic( menu, "Hide Image Missing", "FilterMissing" );
+ }
+
+ // hide notex and shadernotex on texture browser: no one wants to apply them
+ create_check_menu_item_with_mnemonic( menu, "Hide Fallback", "FilterFallback" );
+
menu_separator( menu );
- create_menu_item_with_mnemonic( menu, "Show All", "ShowAllTextures" );
// we always want to show shaders but don't want a "Show Shaders" menu for doom3 and .wad file games
if ( g_pGameDescription->mGameType == "doom3" || !string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
if ( g_TextureBrowser.m_tags ) {
create_menu_item_with_mnemonic( menu, "Show Untagged", "ShowUntagged" );
}
- if ( string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
- create_check_menu_item_with_mnemonic( menu, "Hide Image Missing", "FilterNotex" );
- menu_separator( menu );
- }
+ if ( g_pGameDescription->mGameType != "doom3" && string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ) {
+ create_check_menu_item_with_mnemonic( menu, "ShaderList Only", "ToggleShowShaderlistOnly" );
+ }
+ menu_separator( menu );
create_check_menu_item_with_mnemonic( menu, "Fixed Size", "FixedSize" );
create_check_menu_item_with_mnemonic( menu, "Transparency", "EnableAlpha" );
BuildStoreAvailableTags( g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser );
}
-void RefreshShaders(){
+void TextureBrowser_RefreshShaders(){
- ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
- GlobalShaderSystem().refresh();
- UpdateAllWindows();
+
+ /* When shaders are refreshed, forces reloading the textures as well.
+ Previously it would at best only display shaders, at worst mess up some textured objects. */
+
- GtkTreeSelection* selection = gtk_tree_view_get_selection((GtkTreeView*)GlobalTextureBrowser().m_treeViewTree);
+ auto selection = gtk_tree_view_get_selection(GlobalTextureBrowser().m_treeViewTree);
GtkTreeModel* model = NULL;
GtkTreeIter iter;
if ( gtk_tree_selection_get_selected (selection, &model, &iter) )
TextureBrowser_ShowDirectory( GlobalTextureBrowser(), dirName );
TextureBrowser_queueDraw( GlobalTextureBrowser() );
}
-
++
+ else{
+ ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
+ GlobalShaderSystem().refresh();
+ UpdateAllWindows();
+ }
}
void TextureBrowser_ToggleShowShaders(){
void TextureClipboard_textureSelected( const char* shader );
void TextureBrowser_Construct(){
- GlobalCommands_insert( "ShaderInfo", FreeCaller<TextureBrowser_shaderInfo>() );
- GlobalCommands_insert( "ShowUntagged", FreeCaller<TextureBrowser_showUntagged>() );
- GlobalCommands_insert( "AddTag", FreeCaller<TextureBrowser_addTag>() );
- GlobalCommands_insert( "RenameTag", FreeCaller<TextureBrowser_renameTag>() );
- GlobalCommands_insert( "DeleteTag", FreeCaller<TextureBrowser_deleteTag>() );
- GlobalCommands_insert( "CopyTag", FreeCaller<TextureBrowser_copyTag>() );
- GlobalCommands_insert( "PasteTag", FreeCaller<TextureBrowser_pasteTag>() );
- GlobalCommands_insert( "RefreshShaders", FreeCaller<RefreshShaders>() );
- GlobalToggles_insert( "ShowInUse", FreeCaller<TextureBrowser_ToggleHideUnused>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
- GlobalCommands_insert( "ShowAllTextures", FreeCaller<TextureBrowser_showAll>(), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "ToggleTextures", FreeCaller<TextureBrowser_toggleShow>(), Accelerator( 'T' ) );
- GlobalToggles_insert( "ToggleShowShaders", FreeCaller<TextureBrowser_ToggleShowShaders>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
- GlobalToggles_insert( "ToggleShowTextures", FreeCaller<TextureBrowser_ToggleShowTextures>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showtextures_item ) );
- GlobalToggles_insert( "ToggleShowShaderlistOnly", FreeCaller<TextureBrowser_ToggleShowShaderListOnly>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
- GlobalToggles_insert( "FixedSize", FreeCaller<TextureBrowser_FixedSize>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
- GlobalToggles_insert( "FilterNotex", FreeCaller<TextureBrowser_FilterNotex>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
- GlobalToggles_insert( "EnableAlpha", FreeCaller<TextureBrowser_EnableAlpha>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
-
- GlobalPreferenceSystem().registerPreference( "TextureScale",
- makeSizeStringImportCallback( TextureBrowserSetScaleCaller( g_TextureBrowser ) ),
- SizeExportStringCaller( g_TextureBrowser.m_textureScale )
- );
- GlobalPreferenceSystem().registerPreference( "UniformTextureSize",
- makeIntStringImportCallback(UniformTextureSizeImportCaller(g_TextureBrowser)),
- IntExportStringCaller(g_TextureBrowser.m_uniformTextureSize) );
- GlobalPreferenceSystem().registerPreference( "UniformTextureMinSize",
- makeIntStringImportCallback(UniformTextureMinSizeImportCaller(g_TextureBrowser)),
- IntExportStringCaller(g_TextureBrowser.m_uniformTextureMinSize) );
- GlobalPreferenceSystem().registerPreference( "TextureScrollbar",
- makeBoolStringImportCallback( TextureBrowserImportShowScrollbarCaller( g_TextureBrowser ) ),
- BoolExportStringCaller( GlobalTextureBrowser().m_showTextureScrollbar )
- );
- GlobalPreferenceSystem().registerPreference( "ShowShaders", BoolImportStringCaller( GlobalTextureBrowser().m_showShaders ), BoolExportStringCaller( GlobalTextureBrowser().m_showShaders ) );
- GlobalPreferenceSystem().registerPreference( "ShowTextures", BoolImportStringCaller( GlobalTextureBrowser().m_showTextures ), BoolExportStringCaller( GlobalTextureBrowser().m_showTextures ) );
- GlobalPreferenceSystem().registerPreference( "ShowShaderlistOnly", BoolImportStringCaller( g_TextureBrowser_shaderlistOnly ), BoolExportStringCaller( g_TextureBrowser_shaderlistOnly ) );
- GlobalPreferenceSystem().registerPreference( "FixedSize", BoolImportStringCaller( g_TextureBrowser_fixedSize ), BoolExportStringCaller( g_TextureBrowser_fixedSize ) );
- GlobalPreferenceSystem().registerPreference( "FilterNotex", BoolImportStringCaller( g_TextureBrowser_filterNotex ), BoolExportStringCaller( g_TextureBrowser_filterNotex ) );
- GlobalPreferenceSystem().registerPreference( "EnableAlpha", BoolImportStringCaller( g_TextureBrowser_enableAlpha ), BoolExportStringCaller( g_TextureBrowser_enableAlpha ) );
- GlobalPreferenceSystem().registerPreference( "LoadShaders", IntImportStringCaller( reinterpret_cast<int&>( GlobalTextureBrowser().m_startupShaders ) ), IntExportStringCaller( reinterpret_cast<int&>( GlobalTextureBrowser().m_startupShaders ) ) );
- GlobalPreferenceSystem().registerPreference( "WheelMouseInc", SizeImportStringCaller( GlobalTextureBrowser().m_mouseWheelScrollIncrement ), SizeExportStringCaller( GlobalTextureBrowser().m_mouseWheelScrollIncrement ) );
- GlobalPreferenceSystem().registerPreference( "SI_Colors0", Vector3ImportStringCaller( GlobalTextureBrowser().color_textureback ), Vector3ExportStringCaller( GlobalTextureBrowser().color_textureback ) );
+ GlobalCommands_insert( "ShaderInfo", makeCallbackF(TextureBrowser_shaderInfo) );
+ GlobalCommands_insert( "ShowUntagged", makeCallbackF(TextureBrowser_showUntagged) );
+ GlobalCommands_insert( "AddTag", makeCallbackF(TextureBrowser_addTag) );
+ GlobalCommands_insert( "RenameTag", makeCallbackF(TextureBrowser_renameTag) );
+ GlobalCommands_insert( "DeleteTag", makeCallbackF(TextureBrowser_deleteTag) );
+ GlobalCommands_insert( "CopyTag", makeCallbackF(TextureBrowser_copyTag) );
+ GlobalCommands_insert( "PasteTag", makeCallbackF(TextureBrowser_pasteTag) );
+ GlobalCommands_insert( "RefreshShaders", makeCallbackF(VFS_Refresh) );
+ GlobalToggles_insert( "ShowInUse", makeCallbackF(TextureBrowser_ToggleHideUnused), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
+ GlobalCommands_insert( "ShowAllTextures", makeCallbackF(TextureBrowser_showAll), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "ToggleTextures", makeCallbackF(TextureBrowser_toggleShow), Accelerator( 'T' ) );
+ GlobalToggles_insert( "ToggleShowShaders", makeCallbackF(TextureBrowser_ToggleShowShaders), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
- GlobalToggles_insert( "ToggleShowShaderlistOnly", makeCallbackF(TextureBrowser_ToggleShowShaderListOnly), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
++ GlobalToggles_insert( "ToggleShowTextures", makeCallbackF(TextureBrowser_ToggleShowTextures), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showtextures_item ) );
++ GlobalToggles_insert( "ToggleShowShaderlistOnly", makeCallbackF(TextureBrowser_ToggleShowShaderListOnly),
++ ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
+ GlobalToggles_insert( "FixedSize", makeCallbackF(TextureBrowser_FixedSize), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
+ GlobalToggles_insert( "FilterMissing", makeCallbackF(TextureBrowser_FilterMissing), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
+ GlobalToggles_insert( "FilterFallback", makeCallbackF(TextureBrowser_FilterFallback), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) );
+ GlobalToggles_insert( "EnableAlpha", makeCallbackF(TextureBrowser_EnableAlpha), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
+
+ GlobalPreferenceSystem().registerPreference( "TextureScale", make_property_string<TextureScale>(g_TextureBrowser) );
+ GlobalPreferenceSystem().registerPreference( "UniformTextureSize", make_property_string<UniformTextureSize>(g_TextureBrowser) );
+ GlobalPreferenceSystem().registerPreference( "UniformTextureMinSize", make_property_string<UniformTextureMinSize>(g_TextureBrowser) );
+ GlobalPreferenceSystem().registerPreference( "TextureScrollbar", make_property_string<TextureBrowser_ShowScrollbar>(GlobalTextureBrowser()));
+ GlobalPreferenceSystem().registerPreference( "ShowShaders", make_property_string( GlobalTextureBrowser().m_showShaders ) );
++ GlobalPreferenceSystem().registerPreference( "ShowTextures", make_property_string( GlobalTextureBrowser().m_showTextures ) );
+ GlobalPreferenceSystem().registerPreference( "ShowShaderlistOnly", make_property_string( g_TextureBrowser_shaderlistOnly ) );
+ GlobalPreferenceSystem().registerPreference( "FixedSize", make_property_string( g_TextureBrowser_fixedSize ) );
+ GlobalPreferenceSystem().registerPreference( "FilterMissing", make_property_string( g_TextureBrowser_filterMissing ) );
+ GlobalPreferenceSystem().registerPreference( "EnableAlpha", make_property_string( g_TextureBrowser_enableAlpha ) );
+ GlobalPreferenceSystem().registerPreference( "LoadShaders", make_property_string( reinterpret_cast<int&>( GlobalTextureBrowser().m_startupShaders ) ) );
+ GlobalPreferenceSystem().registerPreference( "WheelMouseInc", make_property_string( GlobalTextureBrowser().m_mouseWheelScrollIncrement ) );
+ GlobalPreferenceSystem().registerPreference( "SI_Colors0", make_property_string( GlobalTextureBrowser().color_textureback ) );
g_TextureBrowser.shader = texdef_name_default();