diff --git a/contrib/hydratoolz/plugin.cpp b/contrib/hydratoolz/plugin.cpp index 79bba252..b04e4022 100644 --- a/contrib/hydratoolz/plugin.cpp +++ b/contrib/hydratoolz/plugin.cpp @@ -339,11 +339,14 @@ const char *PLUGIN_COMMANDS = "About...;Create/Update WAD keypair"; const char *PLUGIN_ABOUT = "HydraToolz v1.0 for GTKRadiant\n\n" "By Hydra!"; +void *g_pMainWidget = NULL; + extern "C" void* WINAPI QERPlug_GetFuncTable(){ return &g_FuncTable; } const char* QERPlug_Init( void* hApp, void *pWidget ){ + g_pMainWidget = pWidget; return "HydraToolz for GTKRadiant"; // do we need this ? hmmm } @@ -360,7 +363,7 @@ extern "C" void QERPlug_Dispatch( const char* p, vec3_t vMin, vec3_t vMax, bool UpdateWadKeyPair(); } else if ( !strcmp( p, "About..." ) ) { - g_FuncTable.m_pfnMessageBox( NULL, PLUGIN_ABOUT, "About", MB_OK, NULL ); + g_FuncTable.m_pfnMessageBox( g_pMainWidget, PLUGIN_ABOUT, "About", MB_OK, NULL ); } } diff --git a/plugins/model/plugin.cpp b/plugins/model/plugin.cpp index dd3e305e..47bc4345 100644 --- a/plugins/model/plugin.cpp +++ b/plugins/model/plugin.cpp @@ -155,7 +155,10 @@ static const char *PLUGIN_NAME = "Model loading module"; static const char *PLUGIN_COMMANDS = "About;-;Flush & Reload Models;Flush & Reload Selected"; static const char *PLUGIN_ABOUT = "Model Module v1.0 for GtkRadiant\nby Arnout van Meer (rr2do2@splashdamage.com)\n\nBased on the MD3Model Module by SPoG\nPicoModel Library Copyright (c) 2002, Randy Reddig & seaw0lf\n\nSupported models:\n"; +void *g_pMainWidget = NULL; + extern "C" const char* QERPlug_Init( void *hApp, void* pMainWidget ){ + g_pMainWidget = pMainWidget; init_filetypes(); return (char *) PLUGIN_NAME; } @@ -188,7 +191,7 @@ extern "C" void QERPlug_Dispatch( const char *p, vec3_t vMin, vec3_t vMax, bool strncat( about_buf, module->copyright, sizeof( about_buf ) - 1 ); strncat( about_buf, "\n", sizeof( about_buf ) - 1 ); } - g_FuncTable.m_pfnMessageBox( NULL, about_buf, "About", MB_OK, NULL ); + g_FuncTable.m_pfnMessageBox( g_pMainWidget, about_buf, "About", MB_OK, NULL ); } } diff --git a/plugins/spritemodel/plugin.cpp b/plugins/spritemodel/plugin.cpp index e73fd988..9c06a8ab 100644 --- a/plugins/spritemodel/plugin.cpp +++ b/plugins/spritemodel/plugin.cpp @@ -155,6 +155,8 @@ static const char *PLUGIN_ABOUT = "Sprite Model loading module v0.2 for GTKRadia const char *supportedmodelformats[] = {"spr","bmp","tga","jpg","hlw",NULL}; // NULL is list delimiter +void *g_pMainWidget = NULL; + static void add_model_apis( CSynapseClient& client ){ const char **ext; for ( ext = supportedmodelformats; *ext != NULL; ext++ ) @@ -183,6 +185,7 @@ void init_filetypes(){ } extern "C" const char* QERPlug_Init( void *hApp, void* pMainWidget ){ + g_pMainWidget = pMainWidget; init_filetypes(); // see todo list above. return (char *) PLUGIN_NAME; } @@ -198,7 +201,7 @@ extern "C" const char* QERPlug_GetCommandList(){ extern "C" void QERPlug_Dispatch( const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush ){ // NOTE: this never happens in a module if ( !strcmp( p, "About..." ) ) { - g_FuncTable.m_pfnMessageBox( NULL, PLUGIN_ABOUT, "About", MB_OK, NULL ); + g_FuncTable.m_pfnMessageBox( g_pMainWidget, PLUGIN_ABOUT, "About", MB_OK, NULL ); } }