* added new var in ScriptConfig.conf: OnGUIClose=0
-> set to 1 to close PseuWoW when the GUI is closed
This commit is contained in:
parent
fb1e696551
commit
1bd487445a
@ -15,6 +15,9 @@ cmdchar=.
|
||||
// MaNGOS does also accept ! as cmd identifier. put here all identifiers that can trigger a server command!
|
||||
other_cmd_chars=.!
|
||||
|
||||
// Set to 1 if PseuWoW should exit after the GUI is closed (if there is a GUI)
|
||||
ExitOnGUIClose=0
|
||||
|
||||
|
||||
|
||||
[#normal]
|
||||
|
||||
@ -103,6 +103,16 @@ LOG * Assigning permissions for internal functions...
|
||||
setscriptpermission,emote 0
|
||||
// ... set more permissions here ...
|
||||
|
||||
//-------------------------------------------------
|
||||
#script=register_onguiclose_exit
|
||||
//-------------------------------------------------
|
||||
if ?{not ?{ScriptHasLine,_onguiclose #tag:hook:${@myname}}}
|
||||
appenddef,_onguiclose #tag:hook:${@myname}
|
||||
appenddef,_onguiclose if ?\{GetVar #EXITONGUICLOSE\}
|
||||
appenddef,_onguiclose exit
|
||||
appenddef,_onguiclose endif
|
||||
endif
|
||||
|
||||
|
||||
// this dummy script does nothing actually but since its loaded last in this file it causes the config
|
||||
// script to be run before all .def files are loaded
|
||||
@ -114,5 +124,6 @@ setscriptpermission,emote 0
|
||||
if ?{not ${#config::DONE}}
|
||||
config
|
||||
endif
|
||||
register_onguiclose_exit
|
||||
#/onload
|
||||
|
||||
|
||||
@ -371,7 +371,10 @@ void PseuInstance::Sleep(uint32 msecs)
|
||||
void PseuInstance::DeleteGUI(void)
|
||||
{
|
||||
_gui = NULL;
|
||||
delete _guithread; // since it was allocated with new
|
||||
_guithread = NULL;
|
||||
if(GetScripts()->ScriptExists("_onguiclose"))
|
||||
AddCliCommand("_onguiclose"); // since this func is called from another thread, use threadsafe variant via CLI
|
||||
}
|
||||
|
||||
PseuInstanceConf::PseuInstanceConf()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user