From 5e882b271373293f57552853a963165fec9bba8f Mon Sep 17 00:00:00 2001 From: namespace Date: Sat, 6 Jan 2007 13:47:21 +0000 Subject: [PATCH] final fix for ufoai git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@135 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- SConscript | 6 +++--- contrib/ufoaiplug/ufoai.cpp | 11 +++++++++-- contrib/ufoaiplug/ufoai_gtk.cpp | 16 ++++++++++++++++ contrib/ufoaiplug/ufoai_gtk.h | 2 ++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/SConscript b/SConscript index f63531f7..a0509a90 100644 --- a/SConscript +++ b/SConscript @@ -465,7 +465,7 @@ bob_env.useGlib2() bob_env.useGtk2() bob_env.Install(INSTALL + '/plugins', bob_lib) -#camera_lst = build_list('contrib/camera', +#camera_lst = build_list('contrib/camera', #'camera.cpp dialogs.cpp dialogs_common.cpp funchandlers.cpp listener.cpp misc.cpp renderer.cpp') #camera_lst.append('libs/libsplines.a') #bob_env.SharedLibrarySafe(target='camera', source=camera_lst) @@ -494,10 +494,10 @@ sunplug_lib = sunplug_env.SharedLibrarySafe(target='sunplug', source=sunplug_lst sunplug_env.Install(INSTALL + '/plugins', sunplug_lib) ufoai_env = module_env.Copy() -ufoai_lst = build_list('contrib/ufoai', 'ufoai.cpp ufoai_filters.cpp ufoai_gtk.cpp ufoai_level.cpp') +ufoai_lst = build_list('contrib/ufoaiplug', 'ufoai.cpp ufoai_filters.cpp ufoai_gtk.cpp ufoai_level.cpp') ufoai_env.useGlib2() ufoai_env.useGtk2() -ufoai_lib = ufoai_env.SharedLibrarySafe(target='ufoai', source=ufoai_lst, LIBPATH='libs') +ufoai_lib = ufoai_env.SharedLibrarySafe(target='ufoaiplug', source=ufoai_lst, LIBPATH='libs') ufoai_env.Install(INSTALL + '/plugins', ufoai_lib) shaderplug_env = module_env.Copy() diff --git a/contrib/ufoaiplug/ufoai.cpp b/contrib/ufoaiplug/ufoai.cpp index 81e749f4..e2372dd0 100644 --- a/contrib/ufoaiplug/ufoai.cpp +++ b/contrib/ufoaiplug/ufoai.cpp @@ -204,8 +204,15 @@ public: UFOAIToolbarModule() { - m_table.m_pfnToolbarButtonCount = ToolbarButtonCount; - m_table.m_pfnGetToolbarButton = GetToolbarButton; + if (!strcmp(GlobalRadiant().getGameDescriptionKeyValue("name"), "UFO:Alien Invasion")) { + m_table.m_pfnToolbarButtonCount = ToolbarButtonCount; + m_table.m_pfnGetToolbarButton = GetToolbarButton; + } + else + { + m_table.m_pfnToolbarButtonCount = ToolbarNoButtons; + m_table.m_pfnGetToolbarButton = GetToolbarNoButton; + } } _QERPlugToolbarTable* getTable() { diff --git a/contrib/ufoaiplug/ufoai_gtk.cpp b/contrib/ufoaiplug/ufoai_gtk.cpp index 3fff09bb..34685ee0 100644 --- a/contrib/ufoaiplug/ufoai_gtk.cpp +++ b/contrib/ufoaiplug/ufoai_gtk.cpp @@ -77,6 +77,14 @@ std::size_t ToolbarButtonCount(void) return NUM_TOOLBARBUTTONS; } +/** + * @brief Used if the ufo plugin should not be visible (at least the toolbar stuff) + */ +std::size_t ToolbarNoButtons (void) +{ + return 0; +} + /** * @brief */ @@ -179,3 +187,11 @@ const IToolbarButton* GetToolbarButton(std::size_t index) g_ufoaiToolbarButtons[index].mIndex = index; return &g_ufoaiToolbarButtons[index]; } + +/** + * @brief + */ +const IToolbarButton* GetToolbarNoButton(std::size_t index) +{ + return NULL; +} diff --git a/contrib/ufoaiplug/ufoai_gtk.h b/contrib/ufoaiplug/ufoai_gtk.h index 6199bdbd..ef2ae3c3 100644 --- a/contrib/ufoaiplug/ufoai_gtk.h +++ b/contrib/ufoaiplug/ufoai_gtk.h @@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include const IToolbarButton* GetToolbarButton(std::size_t index); +const IToolbarButton* GetToolbarNoButton(std::size_t index); std::size_t ToolbarButtonCount(void); +std::size_t ToolbarNoButtons(void); #endif