2 BobToolz plugin for GtkRadiant
3 Copyright (C) 2001 Gordon Biggans
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "funchandlers.h"
25 #include "dialogs/dialogs-gtk.h"
27 #define PLUGIN_NAME "ctfTools"
28 #define CMD_ABOUT = "About..."
30 // Radiant function table
31 _QERFuncTable_1 g_FuncTable;
32 _QERAppBSPFrontendTable g_BSPTable; // for map name
34 BOOL g_bBSPInitDone = FALSE;
36 // commands in the menu
37 static const char *PLUGIN_COMMANDS = ABOUT_CMD ",Colour Changer...,Swap Light Colours,Change Angles 180,Swap Spawn Points";
40 GtkWidget *main_window = NULL;
42 extern "C" LPVOID WINAPI QERPlug_GetFuncTable(){
46 extern "C" LPCSTR WINAPI QERPlug_Init( HMODULE hApp, GtkWidget* pMainWidget ){
47 main_window = pMainWidget;
48 memset( &g_FuncTable, 0, sizeof( _QERFuncTable_1 ) );
49 g_FuncTable.m_fVersion = QER_PLUG_VERSION;
50 g_FuncTable.m_nSize = sizeof( _QERFuncTable_1 );
52 return "ctfToolz for GTKradiant";
55 extern "C" LPCSTR WINAPI QERPlug_GetName(){
56 return (char*)PLUGIN_NAME;
59 extern "C" LPCSTR WINAPI QERPlug_GetCommandList(){
60 return (char*)PLUGIN_COMMANDS;
63 extern "C" void WINAPI QERPlug_Dispatch( LPCSTR p, vec3_t vMin, vec3_t vMax, bool bSingleBrush ){
66 if ( !g_bBSPInitDone ) {
67 g_BSPTable.m_nSize = sizeof( _QERAppBSPFrontendTable );
68 if ( g_FuncTable.m_pfnRequestInterface( QERAppBSPFrontendTable_GUID, static_cast<LPVOID>( &g_BSPTable ) ) ) {
69 g_bBSPInitDone = TRUE;
73 Sys_ERROR( "_QERAppBSPFrontendTable interface request failed\n" );
78 if ( !strcmp( p, CMD_ABOUT ) ) {
79 const char *label_text =
80 PLUGIN_NAME for " RADIANT_NAME "\n\n"
81 "Written by djbob\n\n"
83 // "http://www.planetquake.com/toolz\n\n"
85 RADIANT_NAME " " RADIANT_VERSION "\n"
88 GlobalRadiant().m_pfnMessageBox( main_window, label_text,
93 else if ( !strcmp( p, "Colour Changer..." ) ) {
96 else if ( !strcmp( p, "Swap Light Colours" ) ) {
99 else if ( !strcmp( p, "Change Angles 180" ) ) {
102 else if ( !strcmp( p, "Swap Spawn Points" ) ) {