From: mattn Date: Sun, 16 Mar 2008 17:24:26 +0000 (+0000) Subject: * show supported models in picomodel about message X-Git-Tag: xonotic-v0.7.0~16^2~12^2~112^2~39 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=a4e4f11c0e9a7a9006fc184c4970204970f9e6ad * show supported models in picomodel about message git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@216 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- diff --git a/plugins/model/plugin.cpp b/plugins/model/plugin.cpp index ea5ac937..a69ce21f 100644 --- a/plugins/model/plugin.cpp +++ b/plugins/model/plugin.cpp @@ -164,7 +164,7 @@ void init_filetypes() 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"; +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"; extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget) { @@ -188,8 +188,21 @@ extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool DoFlushReloadSelected(); else if( !strcmp( p, "Flush & Reload Models" ) ) DoFlushReloadAll(); - else if( !strcmp( p, "About" ) ) - g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL); + else if( !strcmp( p, "About" ) ) { + const picoModule_t** modules = PicoModuleList( NULL ); + char about_buf[1024]; + strncpy(about_buf, PLUGIN_ABOUT, sizeof(about_buf) - 1); + while(*modules != NULL) { + const picoModule_t* module = *modules++; + strncat(about_buf, module->displayName, sizeof(about_buf) - 1); + strncat(about_buf, " (", sizeof(about_buf) - 1); + strncat(about_buf, module->defaultExts[0], sizeof(about_buf) - 1); + strncat(about_buf, ")\n\t", sizeof(about_buf) - 1); + 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); + } }