Skip to content

Commit

Permalink
Merge pull request #771 from ColdEvul/copyNameToClipy
Browse files Browse the repository at this point in the history
Added moduel and event to log and save attending and attended players
  • Loading branch information
AndreasBrostrom authored Aug 6, 2021
2 parents 020ad26 + 8968d02 commit e6b26da
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cScripts/CavFnc/cScripts_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ if (EGVAR(Settings,showDiaryRecords)) then {
call FUNC(initDocuments);
};

onPlayerConnected {
[QEGVAR(log,player), [name player]] call CBA_fnc_serverEvent;
};

#ifdef DEBUG_MODE
["Initialization completed", "postInit"] call FUNC(info);
#endif
9 changes: 8 additions & 1 deletion cScripts/CavFnc/functions/init/fn_initEvents.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@ if !(isServer) exitWith {};

[QEGVAR(event,logServer), {
diag_log text _this;
}] call CBA_fnc_addEventHandler;
}] call CBA_fnc_addEventHandler;

[QEGVAR(log,player), {
_this params ["_playerName"];
private _playerLog = missionNamespace getVariable [QEGVAR(log,players), []];
_playerLog pushBack _playerName;
missionNamespace setVariable [QEGVAR(log,players), _playerLog];
}] call CBA_fnc_addEventHandler;
9 changes: 9 additions & 0 deletions cScripts/CavFnc/functions/init/fn_initModulesZen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ if (EGVAR(Settings,enableACRE)) then {
"\a3\modules_f\data\portraitmodule_ca.paa"
] call zen_custom_modules_fnc_register;

["7Cav Mission", "Copy attendees to clipboard",
{
private _playerLog = missionNamespace getVariable [QEGVAR(log,players), []];
copyToClipboard str _playerLog;
["All attended players have been saved to your clipboard"] call zen_common_fnc_showMessage;
},
"\a3\modules_f\data\portraitmodule_ca.paa"
] call zen_custom_modules_fnc_register;

#ifdef DEBUG_MODE
["7Cav Custom Zen Modules initialization complete", "initModulesZen"] call FUNC(info);
#endif
4 changes: 3 additions & 1 deletion cScripts/CavFnc/functions/modules/fn_zenModuleCallEndex.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ params ["_modulePos", "_objectPos"];
[format["Mission var %1 is set %2", QEGVAR(Mission,Endex), missionNamespace getVariable QEGVAR(Mission,Endex)]] call FUNC(info);
#endif
};
["Endex called"] call zen_common_fnc_showMessage;
private _playerLog = missionNamespace getVariable [QEGVAR(log,players), []];
copyToClipboard str _playerLog;
["Endex called (All attended players have been saved to your clipboard)"] call zen_common_fnc_showMessage;
},
{},
[_modulePos]
Expand Down

0 comments on commit e6b26da

Please sign in to comment.