GtkRadiant
GtkRadiant copied to clipboard
switching mod needs restart
When I select a mod in File > Project settings, I have to close and restart GtkRadiant to get the change applied.
It's easy to reproduce, even if you click Textures > Flush & Reload Shaders the shaders from the mod are not displayed in texture browser until GtkRadiant is restarted, and there is nothing related to the mod in the console until GtkRadiant is restarted.
Something like calling QE_Init() https://github.com/TTimo/GtkRadiant/blob/master/radiant/qe3.cpp#L892 in DoProjectSettings() https://github.com/TTimo/GtkRadiant/blob/master/radiant/gtkdlgs.cpp#L913 should do it, but it is not safe to call QE_Init, is it?
I've tested and yes it's not safe: for example imagine your base game is named base
and the mod is named mod
(very original isn't it? :grin: ) while you start gtkradiant it loads shaders from base
then while you set the mod to mod
and call QE_Init()
then Flush & Reload shaders you see the shaders from mod
added to the texture list, then you unset the mod and Flush & Reload shaders and the shaders from mod
are still there. So it looks like we need a kind of QE_DeInit()
first.
A very ugly but very safe way would be to get radiant quitting and reloading itself entirely. But for that we need to add command line parameters to open map and select game. Note that this dirty trick would also allow us to do some convenient stuff like swaping the game.