]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
final fix for ufoai
authornamespace <namespace@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sat, 6 Jan 2007 13:47:21 +0000 (13:47 +0000)
committernamespace <namespace@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Sat, 6 Jan 2007 13:47:21 +0000 (13:47 +0000)
git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@135 8a3a26a2-13c4-0310-b231-cf6edde360e5

SConscript
contrib/ufoaiplug/ufoai.cpp
contrib/ufoaiplug/ufoai_gtk.cpp
contrib/ufoaiplug/ufoai_gtk.h

index f63531f7c11710fd7b0b91e35e3afb8e0b0fa305..a0509a90827db126aa597148177a26e4d504c1ea 100644 (file)
@@ -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()
index 81e749f476e217ca6351e3f17ef264eb45331bb5..e2372dd0e0d44fece0d8942cee0a25e387414b56 100644 (file)
@@ -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()
        {
index 3fff09bb90e8c84d5b6875f7e29a8f93cd1d5695..34685ee01e7416ba1c2a2524dd85bd36f09048b9 100644 (file)
@@ -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;
+}
index 6199bdbdbdbcb938e9a483ccf0e0828f9d1d5fb5..ef2ae3c3d6012be4492a8263b1db1af026f4b2d1 100644 (file)
@@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <gtk/gtk.h>
 
 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