delete duplicate code, enable search in find/replace dialog in selected in component mode

This commit is contained in:
Garux
2018-11-23 16:50:27 +03:00
parent 7b28489554
commit adc6adf50e
3 changed files with 20 additions and 39 deletions

View File

@@ -491,13 +491,8 @@ void operator()( Patch& patch ) const {
}
};
namespace{
bool DoingSearch( const char *repl ){
return ( repl == NULL || ( strcmp( "textures/", repl ) == 0 ) );
}
}
void Scene_PatchFindReplaceShader( scene::Graph& graph, const char* find, const char* replace ){
if( DoingSearch( replace ) ){
if( !replace ){
Scene_forEachVisiblePatchInstance( PatchSelectByShader( find ) );
}
else{
@@ -506,7 +501,7 @@ void Scene_PatchFindReplaceShader( scene::Graph& graph, const char* find, const
}
void Scene_PatchFindReplaceShader_Selected( scene::Graph& graph, const char* find, const char* replace ){
if( DoingSearch( replace ) ){
if( !replace ){
//do nothing, because alternative is replacing to notex
//perhaps deselect ones with not matching shaders here?
}