#include "ifilesystem.h"
#include "namespace.h"
#include "moduleobserver.h"
+#include "moduleobservers.h"
#include <set>
void AddRegionBrushes( void );
void RemoveRegionBrushes( void );
+/* Map open/close observers */
+
+ModuleObservers g_mapPathObservers;
+
+class UnvanquishedMapFileObserver : public ModuleObserver
+{
+void realise() {
+ if ( strncmp( GlobalRadiant().getGameFile(), "unvanquished", 12 ) == 0 ) {
+ // Restart VFS to apply new pak filtering based on mapname
+ VFS_Restart();
+ }
+}
+void unrealise() { }
+};
+
+UnvanquishedMapFileObserver g_unvanquishedMapFileObserver;
+
+void BindMapFileObservers(){
+ g_mapPathObservers.attach( g_unvanquishedMapFileObserver );
+}
+
+void UnBindMapFileObservers(){
+ g_mapPathObservers.detach( g_unvanquishedMapFileObserver );
+}
+
/*
================
g_currentMap = 0;
Brush_unlatchPreferences();
+ g_mapPathObservers.unrealise();
}
class EntityFindByClassname : public scene::Graph::Walker
}
Brush_toggleFormat( i );
g_map.m_name = filename;
+ g_mapPathObservers.realise();
Map_UpdateTitle( g_map );
g_map.m_resource = GlobalReferenceCache().capture( g_map.m_name.c_str() );
if ( format ) {
g_map.m_resource->detach( g_map );
GlobalReferenceCache().release( g_map.m_name.c_str() );
+ g_mapPathObservers.unrealise();
g_map.m_resource = resource;
g_map.m_name = absolute;
+ g_mapPathObservers.realise();
Map_UpdateTitle( g_map );
g_map.m_resource->attach( g_map );
//globalOutputStream() << "Map_New\n";
g_map.m_name = "unnamed.map";
+ g_mapPathObservers.realise();
Map_UpdateTitle( g_map );
{