add virtual plugin type 'not game'

the only maybe useful distinction between plugin types
is game / others, so add a 'virtual' plugin type which
represents everything but games
This commit is contained in:
Stefan Seyfried
2014-02-16 18:29:23 +01:00
parent 945452e35a
commit 44cd36c412
2 changed files with 4 additions and 10 deletions

View File

@@ -4,13 +4,7 @@
Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/ Homepage: http://dbox.cyberphoria.org/
Kommentar: Copyright (C) 2011-2014 Stefan Seyfried
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
License: GPL License: GPL
@@ -139,7 +133,6 @@ void CPlugins::scanDir(const char *dir)
// already exists in the list. // already exists in the list.
// This behavior is used to make sure plugins can be disabled // This behavior is used to make sure plugins can be disabled
// by creating a .cfg in PLUGINDIR_VAR (PLUGINDIR often is read only). // by creating a .cfg in PLUGINDIR_VAR (PLUGINDIR often is read only).
if (!plugin_exists(new_plugin.filename)) if (!plugin_exists(new_plugin.filename))
{ {
plugin_list.push_back(new_plugin); plugin_list.push_back(new_plugin);
@@ -625,7 +618,7 @@ bool CPlugins::hasPlugin(CPlugins::p_type_t type)
for (std::vector<plugin>::iterator it=plugin_list.begin(); for (std::vector<plugin>::iterator it=plugin_list.begin();
it!=plugin_list.end(); ++it) it!=plugin_list.end(); ++it)
{ {
if (it->type == type && !it->hide) if ((it->type & type) && !it->hide)
return true; return true;
} }
return false; return false;

View File

@@ -52,7 +52,8 @@ class CPlugins
P_TYPE_GAME = 0x2, P_TYPE_GAME = 0x2,
P_TYPE_TOOL = 0x4, P_TYPE_TOOL = 0x4,
P_TYPE_SCRIPT = 0x8, P_TYPE_SCRIPT = 0x8,
P_TYPE_LUA = 0x10 P_TYPE_LUA = 0x10,
P_TYPE_NO_GAME = P_TYPE_TOOL|P_TYPE_SCRIPT|P_TYPE_LUA
} }
p_type_t; p_type_t;