X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fbobtoolz%2FctfToolz-GTK.cpp;h=c4b6c6d511b869a461ae0010866a59fbb431dbde;hb=e47e3afa806ffd805f91734dcd3cfcd68ad8d7b4;hp=4e5231d13fa80acc4e55f543d0105a23da4c9a3b;hpb=2057690056f78aeb91f5d70ce9f917bf6845aa6e;p=xonotic%2Fnetradiant.git diff --git a/contrib/bobtoolz/ctfToolz-GTK.cpp b/contrib/bobtoolz/ctfToolz-GTK.cpp index 4e5231d1..c4b6c6d5 100644 --- a/contrib/bobtoolz/ctfToolz-GTK.cpp +++ b/contrib/bobtoolz/ctfToolz-GTK.cpp @@ -24,31 +24,27 @@ #include "dialogs/dialogs-gtk.h" +#define PLUGIN_NAME "ctfTools" +#define CMD_ABOUT = "About..." + // Radiant function table _QERFuncTable_1 g_FuncTable; _QERAppBSPFrontendTable g_BSPTable; // for map name BOOL g_bBSPInitDone = FALSE; -// plugin name -static const char *PLUGIN_NAME = "ctfToolz"; - // commands in the menu -static const char *PLUGIN_COMMANDS = "About...,Colour Changer...,Swap Light Colours,Change Angles 180,Swap Spawn Points"; +static const char *PLUGIN_COMMANDS = ABOUT_CMD ",Colour Changer...,Swap Light Colours,Change Angles 180,Swap Spawn Points"; // globals -GtkWidget *g_pRadiantWnd = NULL; - -static const char *PLUGIN_ABOUT = "ctfToolz for NetRadiant\n" - "by djbob\n" - "http://www.planetquake.com/toolz\n\n"; +GtkWidget *main_window = NULL; extern "C" LPVOID WINAPI QERPlug_GetFuncTable(){ return &g_FuncTable; } extern "C" LPCSTR WINAPI QERPlug_Init( HMODULE hApp, GtkWidget* pMainWidget ){ - g_pRadiantWnd = pMainWidget; + main_window = pMainWidget; memset( &g_FuncTable, 0, sizeof( _QERFuncTable_1 ) ); g_FuncTable.m_fVersion = QER_PLUG_VERSION; g_FuncTable.m_nSize = sizeof( _QERFuncTable_1 ); @@ -79,8 +75,20 @@ extern "C" void WINAPI QERPlug_Dispatch( LPCSTR p, vec3_t vMin, vec3_t vMax, boo } } - if ( !strcmp( p, "About..." ) ) { - DoMessageBox( PLUGIN_ABOUT, "About", IDOK ); + if ( !strcmp( p, CMD_ABOUT ) ) { + const char *label_text = + PLUGIN_NAME for " RADIANT_NAME "\n\n" + "Written by djbob\n\n" +// 20190605 dead link +// "http://www.planetquake.com/toolz\n\n" + "Built against " + RADIANT_NAME " " RADIANT_VERSION "\n" + __DATE__; + + GlobalRadiant().m_pfnMessageBox( main_window, label_text, + "About " PLUGIN_NAME, + eMB_OK, + eMB_ICONDEFAULT ); } else if ( !strcmp( p, "Colour Changer..." ) ) { DoCTFColourChanger();