mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'agmNoRadio' of git@github.com:KoffeinFlummi/ACE3.git into agmPortNoRadio
This commit is contained in:
commit
96d78d07b9
@ -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;
|
|
@ -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'";
|
|
||||||
};
|
|
||||||
};
|
|
@ -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];
|
|
||||||
}];
|
|
1
addons/noradio/$PBOPREFIX$
Normal file
1
addons/noradio/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
|||||||
|
z\ace\addons\noradio
|
6
addons/noradio/CfgEventhandlers.hpp
Normal file
6
addons/noradio/CfgEventhandlers.hpp
Normal 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));
|
||||||
|
};
|
||||||
|
};
|
25
addons/noradio/XEH_post_initClient.sqf
Normal file
25
addons/noradio/XEH_post_initClient.sqf
Normal 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);
|
10
addons/noradio/XEH_post_initServer.sqf
Normal file
10
addons/noradio/XEH_post_initServer.sqf
Normal 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
15
addons/noradio/config.cpp
Normal 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"
|
14
addons/noradio/script_component.hpp
Normal file
14
addons/noradio/script_component.hpp
Normal 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"
|
Loading…
Reference in New Issue
Block a user