#include "dialogs/dialogs-gtk.h"
#include "../../libs/cmdlib.h"
+#define PLUGIN_NAME "bobToolz"
+
void BobToolz_construct(){
}
}
}
-// plugin name
-const char* PLUGIN_NAME = "bobToolz";
-
// commands in the menu
static const char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Split patches cols,Split patches rows,Turn edge";
// globals
-ui::Widget g_pRadiantWnd{ui::null};
-
-static const char *PLUGIN_ABOUT = "bobToolz for SDRadiant\n"
- "by digibob (digibob@splashdamage.com)\n"
- "http://www.splashdamage.com\n\n"
- "Additional Contributors:\n"
- "MarsMattel, RR2DO2\n";
+static ui::Window main_window{ui::null};
extern "C" const char* QERPlug_Init( void* hApp, void* pMainWidget ) {
- g_pRadiantWnd = ui::Widget::from(pMainWidget);
+ main_window = ui::Window::from(pMainWidget);
- return "bobToolz for GTKradiant";
+ return PLUGIN_NAME " for " RADIANT_NAME;
}
extern "C" const char* QERPlug_GetName() {
DoFlipTerrain();
}
else if ( string_equal_nocase( p, "reset textures..." ) ) {
- DoResetTextures();
+ DoResetTextures( main_window );
}
else if ( string_equal_nocase( p, "pitomatic" ) ) {
DoPitBuilder();
DoMakeChain();
}
else if ( string_equal_nocase( p, "path plotter..." ) ) {
- DoPathPlotter();
+ DoPathPlotter( main_window );
}
else if ( string_equal_nocase( p, "about..." ) ) {
- DoMessageBox( PLUGIN_ABOUT, "About", eMB_OK );
+ static const char *label_text =
+ PLUGIN_NAME " for "
+ RADIANT_NAME " " RADIANT_VERSION "\n\n"
+ "by digibob <digibob@splashdamage.com>\n"
+ "https://www.splashdamage.com\n\n"
+ "Additional Contributors:\n"
+ "Arnout van Meer <rr2do2@splashdamage.com>\n"
+ "Mars Mattel\n\n"
+ "Built against "
+ RADIANT_NAME " " RADIANT_VERSION_STRING "\n"
+ __DATE__;
+
+ GlobalRadiant().m_pfnMessageBox( main_window, label_text,
+ "About " PLUGIN_NAME,
+ eMB_OK,
+ eMB_ICONDEFAULT );
}
}
}
-#define NUM_TOOLBARBUTTONS 14
+const int NUM_TOOLBARBUTTONS = 14;
std::size_t ToolbarButtonCount( void ) {
return NUM_TOOLBARBUTTONS;