-/*\r
-BobToolz plugin for GtkRadiant\r
-Copyright (C) 2001 Gordon Biggans\r
-\r
-This library is free software; you can redistribute it and/or\r
-modify it under the terms of the GNU Lesser General Public\r
-License as published by the Free Software Foundation; either\r
-version 2.1 of the License, or (at your option) any later version.\r
-\r
-This library is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-Lesser General Public License for more details.\r
-\r
-You should have received a copy of the GNU Lesser General Public\r
-License along with this library; if not, write to the Free Software\r
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-*/\r
-\r
-#include "StdAfx.h"\r
-\r
-#include "funchandlers.h"\r
-#include "misc.h"\r
-\r
-#include "dialogs/dialogs-gtk.h"\r
-\r
-// Radiant function table\r
-_QERFuncTable_1 g_FuncTable;\r
-_QERAppBSPFrontendTable g_BSPTable; // for map name\r
-\r
-BOOL g_bBSPInitDone = FALSE;\r
-\r
-// plugin name\r
-static const char *PLUGIN_NAME = "ctfToolz";\r
-\r
-// commands in the menu\r
-static const char *PLUGIN_COMMANDS = "About...,Colour Changer...,Swap Light Colours,Change Angles 180,Swap Spawn Points";\r
-\r
-// globals\r
-GtkWidget *g_pRadiantWnd=NULL;\r
-\r
-static const char *PLUGIN_ABOUT = "ctfToolz for GtkRadiant\n"\r
- "by djbob\n"\r
- "http://www.planetquake.com/toolz\n\n";\r
-\r
-extern "C" LPVOID WINAPI QERPlug_GetFuncTable()\r
-{\r
- return &g_FuncTable;\r
-}\r
-\r
-extern "C" LPCSTR WINAPI QERPlug_Init(HMODULE hApp, GtkWidget* pMainWidget)\r
-{\r
- g_pRadiantWnd = pMainWidget;\r
- memset(&g_FuncTable, 0, sizeof(_QERFuncTable_1));\r
- g_FuncTable.m_fVersion = QER_PLUG_VERSION;\r
- g_FuncTable.m_nSize = sizeof(_QERFuncTable_1);\r
-\r
- return "ctfToolz for GTKradiant";\r
-}\r
-\r
-extern "C" LPCSTR WINAPI QERPlug_GetName()\r
-{\r
- return (char*)PLUGIN_NAME;\r
-}\r
-\r
-extern "C" LPCSTR WINAPI QERPlug_GetCommandList()\r
-{\r
- return (char*)PLUGIN_COMMANDS;\r
-}\r
-\r
-extern "C" void WINAPI QERPlug_Dispatch (LPCSTR p, vec3_t vMin, vec3_t vMax, bool bSingleBrush)\r
-{\r
- LoadLists();\r
-\r
- if (!g_bBSPInitDone)\r
- {\r
- g_BSPTable.m_nSize = sizeof(_QERAppBSPFrontendTable);\r
- if ( g_FuncTable.m_pfnRequestInterface( QERAppBSPFrontendTable_GUID, static_cast<LPVOID>(&g_BSPTable) ) )\r
- g_bBSPInitDone = TRUE;\r
- else\r
- {\r
- Sys_ERROR("_QERAppBSPFrontendTable interface request failed\n");\r
- return;\r
- }\r
- }\r
- \r
- if(!strcmp(p, "About..."))\r
- DoMessageBox(PLUGIN_ABOUT, "About", IDOK);\r
- else if(!strcmp(p, "Colour Changer..."))\r
- DoCTFColourChanger();\r
- else if(!strcmp(p, "Swap Light Colours"))\r
- DoSwapLights();\r
- else if(!strcmp(p, "Change Angles 180"))\r
- DoChangeAngles();\r
- else if(!strcmp(p, "Swap Spawn Points"))\r
- DoSwapSpawns();\r
-}\r
+/*
+ BobToolz plugin for GtkRadiant
+ Copyright (C) 2001 Gordon Biggans
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "StdAfx.h"
+
+#include "funchandlers.h"
+#include "misc.h"
+
+#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;
+
+// commands in the menu
+static const char *PLUGIN_COMMANDS = ABOUT_CMD ",Colour Changer...,Swap Light Colours,Change Angles 180,Swap Spawn Points";
+
+// globals
+GtkWidget *main_window = NULL;
+
+extern "C" LPVOID WINAPI QERPlug_GetFuncTable(){
+ return &g_FuncTable;
+}
+
+extern "C" LPCSTR WINAPI QERPlug_Init( HMODULE hApp, GtkWidget* 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 );
+
+ return "ctfToolz for GTKradiant";
+}
+
+extern "C" LPCSTR WINAPI QERPlug_GetName(){
+ return (char*)PLUGIN_NAME;
+}
+
+extern "C" LPCSTR WINAPI QERPlug_GetCommandList(){
+ return (char*)PLUGIN_COMMANDS;
+}
+
+extern "C" void WINAPI QERPlug_Dispatch( LPCSTR p, vec3_t vMin, vec3_t vMax, bool bSingleBrush ){
+ LoadLists();
+
+ if ( !g_bBSPInitDone ) {
+ g_BSPTable.m_nSize = sizeof( _QERAppBSPFrontendTable );
+ if ( g_FuncTable.m_pfnRequestInterface( QERAppBSPFrontendTable_GUID, static_cast<LPVOID>( &g_BSPTable ) ) ) {
+ g_bBSPInitDone = TRUE;
+ }
+ else
+ {
+ Sys_ERROR( "_QERAppBSPFrontendTable interface request failed\n" );
+ return;
+ }
+ }
+
+ 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();
+ }
+ else if ( !strcmp( p, "Swap Light Colours" ) ) {
+ DoSwapLights();
+ }
+ else if ( !strcmp( p, "Change Angles 180" ) ) {
+ DoChangeAngles();
+ }
+ else if ( !strcmp( p, "Swap Spawn Points" ) ) {
+ DoSwapSpawns();
+ }
+}