From 965521ecd289e24d0087182c70c27337ba73aa11 Mon Sep 17 00:00:00 2001 From: mattn Date: Sun, 16 Mar 2008 17:24:26 +0000 Subject: [PATCH] * show supported models in picomodel about message git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/branches/ZeroRadiant@216 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- plugins/model/plugin.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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); + } } -- 2.39.2