Merge branch 'agmNoRadio' of git@github.com:KoffeinFlummi/ACE3.git into agmPortNoRadio

This commit is contained in:
Nicolás Badano 2015-01-16 10:48:16 -03:00
commit 96d78d07b9
9 changed files with 71 additions and 46 deletions

View File

@ -1,18 +0,0 @@
// by commy2
0 spawn {
waitUntil {!isNull AGM_player};
[AGM_player] call AGM_Core_fnc_muteUnit;
AGM_player setVariable ["AGM_NoRadio_isMuted", true, true];
};
[missionNamespace, "playerChanged", {
[_this select 0] call AGM_Core_fnc_muteUnit;
(_this select 0) setVariable ["AGM_NoRadio_isMuted", true, true];
if (!((_this select 1) getVariable ["AGM_isUnconscious", false]) && {alive (_this select 1)}) then {
[_this select 1] call AGM_Core_fnc_unmuteUnit;
};
(_this select 1) setVariable ["AGM_NoRadio_isMuted", false, true];
}] call AGM_Core_fnc_addCustomEventHandler;

View File

@ -1,20 +0,0 @@
class CfgPatches {
class AGM_NoRadio {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2"};
authorUrl = "https://github.com/commy2/";
};
};
class Extended_PostInit_EventHandlers {
class AGM_NoRadio {
clientInit = "call compile preprocessFileLineNumbers '\AGM_NoRadio\clientInit.sqf'";
serverInit = "call compile preprocessFileLineNumbers '\AGM_NoRadio\serverInit.sqf'";
};
};

View File

@ -1,8 +0,0 @@
// by commy2
addMissionEventHandler ["HandleDisconnect", {
if !((_this select 0) getVariable ["AGM_isUnconscious", false]) then {
_this call AGM_Core_fnc_unmuteUnit;
};
(_this select 0) setVariable ["AGM_NoRadio_isMuted", false, true];
}];

View File

@ -0,0 +1 @@
z\ace\addons\noradio

View File

@ -0,0 +1,6 @@
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_post_initClient));
serverInit = QUOTE(call COMPILE_FILE(XEH_post_initServer));
};
};

View File

@ -0,0 +1,25 @@
// by commy2
#include "script_component.hpp"
_setupPlayer = {
if (!isNull ACE_player) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
[ACE_player] call EFUNC(common,muteUnit);
ACE_player setVariable [QGVAR(isMuted), true, true];
};
};
[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler;
[missionNamespace, "playerChanged", {
//On player change, mute old unit and unmute new player
[_this select 0] call EFUNC(common,muteUnit);
(_this select 0) setVariable [QGVAR(isMuted), true, true];
if (!((_this select 1) getVariable ["ACE_isUnconscious", false]) && {alive (_this select 1)}) then { //@todo: ACE_isUnconscious???
[_this select 1] call EFUNC(common,unMuteUnit);
};
(_this select 1) setVariable [QGVAR(isMuted), false, true];
}] call EFUNC(common,addCustomEventHandler);

View File

@ -0,0 +1,10 @@
// by commy2
#include "script_component.hpp"
addMissionEventHandler ["HandleDisconnect", {
if !((_this select 0) getVariable ["ACE_isUnconscious", false]) then { //@ToDo: ai waking up will be silent?
_this call EFUNC(common,unMuteUnit);
};
(_this select 0) setVariable [QGVAR(isMuted), false, true];
}];

15
addons/noradio/config.cpp Normal file
View File

@ -0,0 +1,15 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"commy2"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
};
#include "CfgEventhandlers.hpp"

View File

@ -0,0 +1,14 @@
#define COMPONENT noradio
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#ifdef DEBUG_ENABLED_NORADIO
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_NORADIO
#define DEBUG_SETTINGS DEBUG_SETTINGS_NORADIO
#endif
#include "\z\ace\addons\main\script_macros.hpp"