Implemented contextual modules

This commit is contained in:
SilentSpike 2015-05-18 20:43:02 +01:00
parent eefe995a0c
commit e27ac53713
4 changed files with 50 additions and 5 deletions

View File

@ -6,9 +6,14 @@ PREP(bi_moduleCurator);
PREP(bi_moduleMine);
PREP(bi_moduleProjectile);
PREP(bi_moduleRemoteControl);
PREP(contextualModules);
PREP(moduleCapture);
PREP(moduleKnockout);
PREP(moduleSurrender);
PREP(moduleZeusSettings);
if (isServer) then {
["zeusUnitAssigned", {_this call FUNC(contextualModules)}] call EFUNC(common,addEventHandler);
};
ADDON = true;

View File

@ -2,11 +2,7 @@
class CfgPatches {
class ADDON {
units[] = {
QGVAR(moduleCapture),
QGVAR(moduleKnockout),
QGVAR(moduleSurrender)
};
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
@ -14,6 +10,18 @@ class CfgPatches {
authorUrl = "https://github.com/SilentSpike";
VERSION_CONFIG;
};
// Use additional cfgPatches to contextually remove modules from zeus
class GVAR(captives): ADDON {
units[] = {
QGVAR(moduleCapture),
QGVAR(moduleSurrender)
};
};
class GVAR(medical): ADDON {
units[] = {
QGVAR(moduleKnockout)
};
};
};
#include "CfgEventHandlers.hpp"

View File

@ -2,6 +2,7 @@
* Author: Bohemia Interactive
* Module function for initalizing zeus
* Edited to remove eagle and global ascension message
* Added "zeusUnitAssigned" event call
*
* Arguments:
* 0: The module logic <LOGIC>
@ -171,6 +172,9 @@ if (_activated) then {
[_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler;
// Added by ACE_zeus
["zeusUnitAssigned", [_logic,_player]] call EFUNC(common,globalEvent);
//--- Forced interface
//if (_forced) then {
// [[true,true],"bis_fnc_forceCuratorInterface",_player] call bis_fnc_mp;

View File

@ -0,0 +1,28 @@
/*
* Author: SilentSpike
* Removes ace_zeus modules from zeus based on the prescence of other ACE addons
*
* Arguments:
* 0: The zeus logic <LOGIC>
* 1: The zeus player <UNIT>
*
* Return Value:
* nil
*
* Public: No
*/
private ["_logic","_addons","_removeAddons","_classname"];
_logic = _this select 0;
_addons = ["captives","medical"];
_removeAddons = [];
{
_classname = format ["ace_%1",_x];
if !(isClass (configFile >> "CfgPatches" >> _classname)) then {
_removeAddons pushBack (format ["ace_zeus_%1",_x]);
};
} forEach _addons;
_logic removeCuratorAddons _removeAddons;