diff --git a/framework/TODO.md b/framework/TODO.md
index 1f532c6..4398efd 100644
--- a/framework/TODO.md
+++ b/framework/TODO.md
@@ -136,7 +136,7 @@
## cleanup
- [X] Move images from rsc\data to folders inside components
- - [ ] Add Readme to each module
+ - [X] Add Readme to each module
- [ ] Cleanup ui files
- [ ] Follow ACE Code rules and remove sleeps, spawns etc. Get everything unscheduled:
https://ace3.acemod.org/wiki/development/arma-3-scheduler-and-our-practices.html
diff --git a/framework/changelog.md b/framework/changelog.md
index bb08ba3..88a310c 100644
--- a/framework/changelog.md
+++ b/framework/changelog.md
@@ -1,3 +1,23 @@
+# Changelog v2.1.1.61 => v2.1.1.62
+*Reverted back to v2.1.1.58*
+
+## Added
+- Added function to set a random loadout for a unit using a specified loadoutfile in 3den and zeus
+- Added function to set a crate loadout for a crate using a specified logistics file in 3den and zeus
+- Added a script log viewer to the CMF menu
+- Added `PATHTO` family of macros
+- Added shots fired statistic to AAR
+- Added `cmf_common_fnc_displayAddInitEvent` function
+
+# Changed
+- Changed how ui elements are included. it now uses a master include file in the ui directory
+- Changed how zeus/curator modules are registered
+- Renamed all curator functions to reflect the change
+- Changed so logistics crates will always be carryable / draggable regardless of weight
+
+# Fixed
+- Fixed bug where vehicle rallypoints were placeable for everyone
+
# Changelog v2.1.1.60 => v2.1.1.61
## Fixed
- Fixed bug with ace action on crates being broken
diff --git a/framework/components/aar/functions/fn_endMission.sqf b/framework/components/aar/functions/fn_endMission.sqf
index 7cd6acb..7935da3 100644
--- a/framework/components/aar/functions/fn_endMission.sqf
+++ b/framework/components/aar/functions/fn_endMission.sqf
@@ -94,6 +94,8 @@ EFUNC(inline_aar,endMission) = {
_statsText = _statsText + format["Your Enemy Kills: %1
", (player getVariable [QGVAR(stats_E_kills), 0])];
_statsText = _statsText + format["Your Friendly Kills: %1
", (player getVariable [QGVAR(stats_F_kills), 0])];
_statsText = _statsText + format["Your Civilian Kills: %1
", (player getVariable [QGVAR(stats_C_kills), 0])];
+ _statsText = _statsText + format["Shots Fired: %1
", (player getVariable [QGVAR(stats_shots_fired), 0])];
+ // @TODO: Make sure to save stats incase of a rejip
while { player getVariable QGVAR(spectatorStatus) } do {
hintSilent parseText _statsText;
@@ -177,7 +179,7 @@ EFUNC(inline_aar,endMission) = {
private _EHIndex = addMissionEventHandler ["EntityCreated", {
params ["_entity"];
- if ((typeof _entity) isEqualTo "ModuleEndMission_F") then {
+ if ((typeof _entity) isEqualTo "ModuleEndMission_F" && local _entity) then {
deleteVehicle _entity;
[] spawn EFUNC(inline_aar,endMission);
};
diff --git a/framework/components/aar/functions/fn_record.sqf b/framework/components/aar/functions/fn_record.sqf
index 32584c4..d4dee37 100644
--- a/framework/components/aar/functions/fn_record.sqf
+++ b/framework/components/aar/functions/fn_record.sqf
@@ -10,7 +10,7 @@
* None
*
* Example:
- * call cmf_aar_fnc_record
+ * [] call cmf_aar_fnc_record
*
* Public: No
*/
@@ -22,7 +22,7 @@ if (!isServer) exitWith { };
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
- if ((_entity in allUnits || _entity in allMapMarkers || _entity in vehicles) && { !isNull _entity }) then {
+ if ((_entity in allUnits || _entity in allMapMarkers || _entity in vehicles) && !isNull _entity) then {
_entity addEventHandler ["Fired", {
params ["_unit", "_weapon", "", "", "", "", "_projectile"];
@@ -45,10 +45,10 @@ addMissionEventHandler ["EntityCreated", {
_this spawn {
/* Get title of mission */
- private _missionTitle = if (!isNil QGVAR(safestart_title)) then {
- GVAR(safestart_title)
+ private _missionTitle = if (!isNil { missionNameSpace getVariable QGVAR(safestart_title) }) then {
+ missionNameSpace getVariable QGVAR(safestart_title)
} else {
- [getMissionConfigValue ['IntelBriefingName', briefingName]] call EFUNC(common,hexToASCII);
+ [getMissionConfigValue ['IntelBriefingName', briefingName]] call cmf_utility_fnc_hexToASCII;
};
/* Set base AAR data (and overwrite any old data) */
diff --git a/framework/components/aar/functions/fn_stats.sqf b/framework/components/aar/functions/fn_stats.sqf
index 5b1dec8..63dedbb 100644
--- a/framework/components/aar/functions/fn_stats.sqf
+++ b/framework/components/aar/functions/fn_stats.sqf
@@ -16,33 +16,40 @@
*/
SCRIPT(stats);
-if (!isServer) exitWith { };
-
-addMissionEventHandler ["EntityKilled", {
- /* Track deaths */
- if (isPlayer (_this select 0)) then {
- private _deaths = (_this select 0) getVariable [QGVAR(stats_deaths), -1];
- (_this select 0) setVariable [QGVAR(stats_deaths), _deaths, true];
- };
+if (isServer) then {
+ addMissionEventHandler ["EntityKilled", {
+ /* Track deaths */
+ if (isPlayer (_this select 0)) then {
+ private _deaths = (_this select 0) getVariable [QGVAR(stats_deaths), -1];
+ (_this select 0) setVariable [QGVAR(stats_deaths), _deaths + 1, true];
+ };
- /* Don't count suicides as kills */
- if ((_this select 1) isEqualTo (_this select 0)) exitWith { };
+ /* Don't count suicides as kills */
+ if ((_this select 1) isEqualTo (_this select 0)) exitWith { };
- /* Track kills */
- if (isPlayer (_this select 1) && { (_this select 0) isKindOf "Man" }) then {
- if (([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsEnemy) && { (side group (_this select 0) != civilian) }) exitWith {
- private _kills = (_this select 1) getVariable [QGVAR(stats_E_kills), 0];
- (_this select 1) setVariable [QGVAR(stats_E_kills), _kills + 1, true];
- };
+ /* Track kills */
+ if (isPlayer (_this select 1) && (_this select 0) isKindOf "Man") then {
+ switch (true) do {
+ case (([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsEnemy) && (side group (_this select 0) != civilian)): {
+ private _kills = (_this select 1) getVariable [QGVAR(stats_E_kills), 0];
+ (_this select 1) setVariable [QGVAR(stats_E_kills), _kills + 1, true];
+ };
- if (([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsFriendly) && { (side group (_this select 0) != civilian) }) exitWith {
- private _kills = (_this select 1) getVariable [QGVAR(stats_F_kills), 0];
- (_this select 1) setVariable [QGVAR(stats_F_kills), _kills + 1, true];
- };
+ case (([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsFriendly) && (side group (_this select 0) != civilian)): {
+ private _kills = (_this select 1) getVariable [QGVAR(stats_F_kills), 0];
+ (_this select 1) setVariable [QGVAR(stats_F_kills), _kills + 1, true];
+ };
- if (side group (_this select 0) isEqualTo civilian) exitWith {
- private _kills = (_this select 1) getVariable [QGVAR(stats_C_kills), 0];
- (_this select 1) setVariable [QGVAR(stats_C_kills), _kills + 1, true];
+ case (side group (_this select 0) == civilian): {
+ private _kills = (_this select 1) getVariable [QGVAR(stats_C_kills), 0];
+ (_this select 1) setVariable [QGVAR(stats_C_kills), _kills + 1, true];
+ };
+ };
};
- };
-}];
+ }];
+} else {
+ player addEventHandler ["Fired", {
+ private _shots = player getVariable [QGVAR(stats_shots_fired), 0];
+ player setVariable [QGVAR(stats_shots_fired), _shots + 1, true];
+ }];
+};
\ No newline at end of file
diff --git a/framework/components/ai/functions/fn_hostage.sqf b/framework/components/ai/functions/fn_hostage.sqf
index 87e17d1..05addaf 100644
--- a/framework/components/ai/functions/fn_hostage.sqf
+++ b/framework/components/ai/functions/fn_hostage.sqf
@@ -70,7 +70,7 @@ GVAR(hostage_followPlayerFNC) = {
private _getSeat = [vehicle _target] call ace_captives_fnc_findEmptyNonFFVCargoSeat;
_getSeat params ["_cargoIndex"];
- if (_cargoIndex isEqualTo -1) exitWith {};
+ if (_cargoIndex == -1) exitWith {};
_hostage assignAsCargoIndex [vehicle _target, _cargoIndex];
[_hostage] orderGetIn true;
@@ -89,7 +89,7 @@ private _followAction = [QGVAR(hostageFollow), "Follow Me!", "",
GVAR(hostage_followPlayerFNC),
{
isNull ((_this select 0) getVariable [QGVAR(hostage_owner), objNull]) &&
- { !((_this select 0) getVariable ["ace_captives_isHandcuffed", false]) }
+ !((_this select 0) getVariable ["ace_captives_isHandcuffed", false])
}
] call ace_interact_menu_fnc_createAction;
diff --git a/framework/components/ai/functions/fn_reinforce.sqf b/framework/components/ai/functions/fn_reinforce.sqf
index f376b55..d3845b1 100644
--- a/framework/components/ai/functions/fn_reinforce.sqf
+++ b/framework/components/ai/functions/fn_reinforce.sqf
@@ -38,10 +38,10 @@ if (!isServer) exitWith {};
_thisArgs params ["_reinforceGroup"];
params ["", "_shareGroup", "_target"];
- if (_reinforceGroup getVariable [QGVAR(reinforce_disableGroup), false]) exitWith { };
- if ((group _target) getVariable [QGVAR(reinforce_disableTarget), false]) exitWith { };
+ if (_reinforceGroup getVariable [QGVAR(reinforce_disableGroup), false]) exitWith {};
+ if ((group _target) getVariable [QGVAR(reinforce_disableTarget), false]) exitWith {};
- if ( (leader _reinforceGroup distance leader _shareGroup) < SETTING(reinforceRange) && { _reinforceGroup != _shareGroup && { !(_reinforceGroup getVariable [QGVAR(reinforce_targetGroup), grpNull] isEqualTo _shareGroup) && { side _reinforceGroup isEqualTo side _shareGroup } } }) then {
+ if ( (leader _reinforceGroup distance leader _shareGroup) < SETTING(reinforceRange) && _reinforceGroup != _shareGroup && !(_reinforceGroup getVariable [QGVAR(reinforce_targetGroup), grpNull] isEqualTo _shareGroup) && side _reinforceGroup isEqualTo side _shareGroup ) then {
LOG_2("%1 reinforcing %2(TaskRush)", groupId _reinforceGroup, groupId _shareGroup);
[_reinforceGroup, 200, 15, [], getPos _target, false] spawn lambs_wp_fnc_taskRush;
diff --git a/framework/components/common/XEH_PREP.sqf b/framework/components/common/XEH_PREP.sqf
index 2a22216..9eadd36 100644
--- a/framework/components/common/XEH_PREP.sqf
+++ b/framework/components/common/XEH_PREP.sqf
@@ -17,4 +17,5 @@ PREP(stripUnit);
PREP(versionCompare);
PREP(zeusHint);
PREP(acreRestore);
-PREP(chatHandler);
\ No newline at end of file
+PREP(chatHandler);
+PREP(displayAddInitEvent);
\ No newline at end of file
diff --git a/framework/components/common/XEH_postInit.sqf b/framework/components/common/XEH_postInit.sqf
index d11da37..61ca95f 100644
--- a/framework/components/common/XEH_postInit.sqf
+++ b/framework/components/common/XEH_postInit.sqf
@@ -22,15 +22,6 @@ cmf_player removeDiarySubject "Statistics";
/* Remove team diary */
cmf_player removeDiarySubject "Units";
-/* Create notification colors */
-GVAR(notificationColors) = createHashMapFromArray [
- ["DEFAULT", [0.69, 0.69, 0.69, 0.50]],
- ["INFO", [0.00, 0.75, 0.75, 0.50]],
- ["DEBUG", [0.99, 0.42, 0.98, 0.50]],
- ["WARNING", [0.78, 0.78, 0.00, 0.50]],
- ["ERROR", [0.81, 0.20, 0.17, 0.50]]
-];
-
/* Create sub category for radios */
[(call acre_api_fnc_getAllRadios) select 0, "Radios", "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa", 1] call ace_arsenal_fnc_addRightPanelButton;
diff --git a/framework/components/common/XEH_preInit.sqf b/framework/components/common/XEH_preInit.sqf
index 210ebd5..db8d39d 100644
--- a/framework/components/common/XEH_preInit.sqf
+++ b/framework/components/common/XEH_preInit.sqf
@@ -7,5 +7,14 @@ ACE_maxWeightDrag = 1500;
/* Disable CTAB on ground vehicles */
cTab_vehicleClass_has_FBCB2 = [];
+/* Create notification colors */
+GVAR(notificationColors) = createHashMapFromArray [
+ ["DEFAULT", [0.69, 0.69, 0.69, 0.50]],
+ ["INFO", [0.00, 0.75, 0.75, 0.50]],
+ ["DEBUG", [0.99, 0.42, 0.98, 0.50]],
+ ["WARNING", [0.78, 0.78, 0.00, 0.50]],
+ ["ERROR", [0.81, 0.20, 0.17, 0.50]]
+];
+
/* Handle connection and disconnection messages */
call FUNC(chatHandler);
\ No newline at end of file
diff --git a/framework/components/common/functions/fn_acreRestore.sqf b/framework/components/common/functions/fn_acreRestore.sqf
index 9e9b3c9..3322588 100644
--- a/framework/components/common/functions/fn_acreRestore.sqf
+++ b/framework/components/common/functions/fn_acreRestore.sqf
@@ -16,6 +16,8 @@
*/
params ["_newUnit", "_oldUnit"];
+if (isNull _oldUnit) exitWith { };
+
private _oldPTT = cmf_player getVariable [QGVAR(ACREPTT), call acre_api_fnc_getMultiPushToTalkAssignment];
private _oldRadios = ([_oldUnit] call acre_sys_core_fnc_getGear) select { ([_x] call acre_api_fnc_getBaseRadio) != "" };
private _newRadios = ([_newUnit] call acre_sys_core_fnc_getGear) select { ([_x] call acre_api_fnc_getBaseRadio) != "" };
diff --git a/framework/components/common/functions/fn_displayAddInitEvent.sqf b/framework/components/common/functions/fn_displayAddInitEvent.sqf
new file mode 100644
index 0000000..4fe7053
--- /dev/null
+++ b/framework/components/common/functions/fn_displayAddInitEvent.sqf
@@ -0,0 +1,45 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Attaches a display / dialog init event
+ *
+ * Arguments:
+ * 0: IDD
+ * 1: Callback
+ * 2: Arguments
+ *
+ * Return Value:
+ * CBA PerFramehandler Handle
+ *
+ * Example:
+ * [313, { hint str _this }, ["foo", "bar"]] call cmf_common_fnc_displayAddInitEvent
+ *
+ * Public: Yes
+ */
+params ["_idd", "_callback", ["_args", []]];
+
+private _displayInitEvent = {
+ params ["_self", "_idd", "_callback", "_args"];
+
+ [findDisplay _idd, _args] call _callback;
+
+ [
+ { isNull findDisplay (_this select 1) },
+ {
+ params ["_self"];
+
+ [
+ { !isNull findDisplay (_this select 1) },
+ _self,
+ _this
+ ] call CBA_fnc_waitUntilAndExecute;
+ },
+ _this
+ ] call CBA_fnc_waitUntilAndExecute;
+};
+
+[
+ { !isNull findDisplay (_this select 1) },
+ _displayInitEvent,
+ [_displayInitEvent, _idd, _callback, _args]
+] call CBA_fnc_waitUntilAndExecute;
\ No newline at end of file
diff --git a/framework/components/curator/XEH_PREP.sqf b/framework/components/curator/XEH_PREP.sqf
index 4c9d947..db28a90 100644
--- a/framework/components/curator/XEH_PREP.sqf
+++ b/framework/components/curator/XEH_PREP.sqf
@@ -1,15 +1,18 @@
#include "script_component.hpp"
-PREP(setLivesModule);
-PREP(forceArsenalModule);
-PREP(ammoboxModule);
-PREP(resetKosherRoleModule);
-PREP(kosherForceCloseModule);
-PREP(disableFreezeTime);
-PREP(toggleSpectatorModule);
-PREP(addRallypointModule);
-PREP(removeRallypointModule);
+PREP(setLives);
+PREP(forceArsenal);
+PREP(setAmmobox);
+PREP(setUnitParameters);
+PREP(forceCloseArsenal);
+PREP(toggleFreezeTime);
+PREP(toggleSpectator);
+PREP(enableRallypoints);
+PREP(disableRallypoints);
+PREP(setPhase);
+PREP(addCutoffPhase);
+PREP(removeCutoffPhase);
+PREP(randomLoadout);
+PREP(setCrateLoadout);
PREP(playerInfo);
-PREP(safestartPhases);
-PREP(safestartCutoffPhases);
PREP(initDisplayCurator);
diff --git a/framework/components/curator/XEH_postInit.sqf b/framework/components/curator/XEH_postInit.sqf
index 5f15fb6..5d618e8 100644
--- a/framework/components/curator/XEH_postInit.sqf
+++ b/framework/components/curator/XEH_postInit.sqf
@@ -1,46 +1,109 @@
#include "script_component.hpp"
-call FUNC(setLivesModule);
-call FUNC(forceArsenalModule);
-call FUNC(ammoboxModule);
-call FUNC(resetKosherRoleModule);
-call FUNC(kosherForceCloseModule);
-call FUNC(disableFreezeTime);
-call FUNC(toggleSpectatorModule);
-call FUNC(addRallypointModule);
-call FUNC(removeRallypointModule);
+[ /* Set Lives */
+ QUOTE(FRAMEWORK: Respawn),
+ LSTRING(setLives),
+ FUNC(setLives),
+ QPATHTOF(data\icon_module_setLives_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[ /* Force Kosher Arsenal */
+ QUOTE(FRAMEWORK: Kosher Arsenal),
+ LSTRING(forceArsenal),
+ FUNC(forceArsenal),
+ QPATHTOF(data\icon_module_kosherArsenal_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[ /* Set ammobox */
+ QUOTE(FRAMEWORK: Kosher Arsenal),
+ LSTRING(setAmmobox),
+ FUNC(setAmmobox),
+ QPATHTOF(data\icon_module_ammobox_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[ /* Set Unit Parameters */
+ QUOTE(FRAMEWORK: Respawn),
+ LSTRING(setUnitParameters),
+ FUNC(setUnitParameters),
+ ""
+] call zen_custom_modules_fnc_register;
+
+[ /* Force Close Kosher Arsenal */
+ QUOTE(FRAMEWORK: Kosher Arsenal),
+ LSTRING(forceCloseArsenal),
+ FUNC(forceCloseArsenal),
+ QPATHTOF(data\icon_module_closeKosherArsenal_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[ /* Toggle Freezetime */
+ QUOTE(FRAMEWORK: Common),
+ LSTRING(toggleFreezeTime),
+ FUNC(toggleFreezeTime),
+ QPATHTOF(data\icon_module_disableSetDate_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[ /* Toggle spectator */
+ QUOTE(FRAMEWORK: Common),
+ LSTRING(toggleSpectator),
+ FUNC(toggleSpectator),
+ QPATHTOF(data\icon_module_spectate_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[ /* Enable rallypoints */
+ QUOTE(FRAMEWORK: Respawn),
+ LSTRING(enableRallypoints),
+ FUNC(enableRallypoints),
+ QPATHTOEF(respawn,data\icon_ace_rallypoint_place_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[ /* Disable rallypoints */
+ QUOTE(FRAMEWORK: Respawn),
+ LSTRING(disableRallypoints),
+ FUNC(disableRallypoints),
+ QPATHTOEF(respawn,data\icon_ace_rallypoint_disabled_ca.paa)
+] call zen_custom_modules_fnc_register;
+
+[
+ QUOTE(FRAMEWORK: Safestart),
+ "Set Phase",
+ FUNC(setPhase),
+ ""
+] call zen_custom_modules_fnc_register;
+
+[
+ QUOTE(FRAMEWORK: Safestart),
+ "Add Cutoff Phase",
+ FUNC(addCutoffPhase),
+ ""
+] call zen_custom_modules_fnc_register;
+
+[
+ QUOTE(FRAMEWORK: Safestart),
+ "Remove Cutoff Phase",
+ FUNC(removeCutoffPhase),
+ ""
+] call zen_custom_modules_fnc_register;
+
+[ /* Set Random Loadout */
+ QUOTE(FRAMEWORK: Kosher Arsenal),
+ "Set Random Loadout",
+ FUNC(randomLoadout),
+ "a3\ui_f\data\gui\rsc\rscdisplayarsenal\uniform_ca.paa"
+] call zen_custom_modules_fnc_register;
+
+[ /* Set Crate Loadout */
+ QUOTE(FRAMEWORK: Logistics),
+ "Set Crate Loadout",
+ FUNC(setCrateLoadout),
+ "a3\ui_f\data\map\vehicleicons\iconcrateord_ca.paa"
+] call zen_custom_modules_fnc_register;
+
call FUNC(playerInfo);
-call FUNC(safestartPhases);
-call FUNC(safestartCutoffPhases);
GVAR(zeusInfoShow) = true;
/* curator displayInit */
-private _displayInitEvent = {
- params ["_self"];
-
- [findDisplay 312] call FUNC(initDisplayCurator);
-
- [
- { isNull findDisplay 312 },
- {
- params ["_displayInitEvent"];
-
- [
- { !isNull findDisplay 312 },
- _displayInitEvent,
- [_displayInitEvent]
- ] call CBA_fnc_waitUntilAndExecute;
- },
- [_self]
- ] call CBA_fnc_waitUntilAndExecute;
-};
-
-[
- { !isNull findDisplay 312 },
- _displayInitEvent,
- [_displayInitEvent]
-] call CBA_fnc_waitUntilAndExecute;
+[IDD_ZEUS, FUNC(initDisplayCurator)] call EFUNC(common,displayAddInitEvent);
[QGVAR(toggleZeusInfo), {
GVAR(zeusInfoShow) = !GVAR(zeusInfoShow);
diff --git a/framework/components/curator/functions/fn_addCutoffPhase.sqf b/framework/components/curator/functions/fn_addCutoffPhase.sqf
new file mode 100644
index 0000000..051bfeb
--- /dev/null
+++ b/framework/components/curator/functions/fn_addCutoffPhase.sqf
@@ -0,0 +1,32 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * module to add/remove safestart cutoff phases
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_safestartCutoffPhases
+ *
+ * Public: No
+ */
+SCRIPT(safestartCutoffPhases);
+
+private _onConfirm = {
+ (_this select 0) params ["_name", "_cutoff", "_code"];
+ private _cutoffPhases = missionNameSpace getVariable [QEGVAR(gameplay,safestart_phaseCutOffs), []];
+
+ _cutoffPhases pushBack [_name, time + (_cutOff * 60), _code];
+ EGVAR(gameplay,safestart_phaseCutOffs) = _cutoffPhases;
+ publicVariable QEGVAR(gameplay,safestart_phaseCutOffs);
+};
+
+["Add: Cutoff Phase", [
+ ["EDIT", ["Phase name", "Name of the cutoff phase"], [""]],
+ ["SLIDER", ["Cutoff Time", "(In minutes)"], [0, 60, 20, 0]],
+ ["EDIT:CODE", ["On Complete", "Code that get's executed when the phase completes"], [""]]
+], _onConfirm, {}] call zen_dialog_fnc_create;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_addRallypointModule.sqf b/framework/components/curator/functions/fn_addRallypointModule.sqf
deleted file mode 100644
index e0488e9..0000000
--- a/framework/components/curator/functions/fn_addRallypointModule.sqf
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Creates a zeus module to add rallypoints for unit
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_addRallypointModule
- *
- * Public: No
- */
-SCRIPT(setLivesModule);
-
-private _moduleFunction = {
- if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
- if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
- if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
-
- if !((_this select 1) getVariable [QEGVAR(respawn,rallypoint), false]) then {
- [[(_this select 1)]] call EFUNC(respawn,rallypoint);
- } else {
- (_this select 1) setVariable [QEGVAR(respawn,showRallypoint), true, true];
- };
- [format[LSTRING(rallypoint_success_message), name (_this select 1)]] call zen_common_fnc_showMessage;
-};
-
-[LSTRING(respawn_module_category_displayname), LSTRING(rallypoint_module_displayname), _moduleFunction, "components\respawn\data\icon_ace_rallypoint_place_ca.paa"] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_ammoboxModule.sqf b/framework/components/curator/functions/fn_ammoboxModule.sqf
deleted file mode 100644
index 2c86f56..0000000
--- a/framework/components/curator/functions/fn_ammoboxModule.sqf
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Creates a zeus module to set object as an ammo box
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_ammoboxModule
- *
- * Public: No
- */
-SCRIPT(ammoboxModule);
-
-/* Add kosher ammobox to object */
-private _dialogFunction = {
- if (isNull (_this select 1)) exitWith {[LSTRING(object_requirement_message)] call zen_common_fnc_showMessage};
-
- private _result = [(_this select 1)] call EFUNC(kosherArsenal,ammobox);
- if (_result) then {
- [LSTRING(ammobox_success_message)] call zen_common_fnc_showMessage;
-
- /* Raise event */
- [QGVAR(ammobox_added), [_this select 1]] call CBA_fnc_globalEvent;
- } else {
- [LSTRING(ammobox_fail_message)] call zen_common_fnc_showMessage;
- };
-};
-
-[LSTRING(kosherArsenal_module_category_displayname), LSTRING(ammobox_module_displayname), _dialogFunction, "components\curator\data\icon_module_ammobox_ca.paa"] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_disableFreezeTime.sqf b/framework/components/curator/functions/fn_disableFreezeTime.sqf
deleted file mode 100644
index 0c66753..0000000
--- a/framework/components/curator/functions/fn_disableFreezeTime.sqf
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Creates a zeus module to disable freezeTime
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_disableFreezeTime
- *
- * Public: No
- */
-SCRIPT(disableFreezeTime);
-
-[LSTRING(common_module_category_displayname), LSTRING(dis_freezeTime_module_displayname), {
- ESETTING(environment,freezeTime) = !ESETTING(environment,freezeTime);
- publicVariable ESETTING(environment,freezeTime);
-
- if (ESETTING(environment,freezeTime)) then {
- [LSTRING(en_freezeTime_success_message)] call zen_common_fnc_showMessage;
- } else {
- [LSTRING(dis_freezeTime_success_message)] call zen_common_fnc_showMessage;
- };
-
-}, "components\curator\data\icon_module_disableSetDate_ca.paa"] call zen_custom_modules_fnc_register;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_disableRallypoints.sqf b/framework/components/curator/functions/fn_disableRallypoints.sqf
new file mode 100644
index 0000000..5d685de
--- /dev/null
+++ b/framework/components/curator/functions/fn_disableRallypoints.sqf
@@ -0,0 +1,24 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Creates a zeus module to remove rallypoints for unit
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call cmf_zeus_fnc_disableRallypoints
+ *
+ * Public: No
+ */
+SCRIPT(disableRallypoints);
+
+if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
+if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
+
+(_this select 1) setVariable [QEGVAR(respawn,showRallypoint), false, true];
+[format[LSTRING(rallypoint_remove_success_message), name (_this select 1)]] call zen_common_fnc_showMessage;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_enableRallypoints.sqf b/framework/components/curator/functions/fn_enableRallypoints.sqf
new file mode 100644
index 0000000..7174337
--- /dev/null
+++ b/framework/components/curator/functions/fn_enableRallypoints.sqf
@@ -0,0 +1,28 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Creates a zeus module to add rallypoints for unit
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call cmf_zeus_fnc_enableRallypoints
+ *
+ * Public: No
+ */
+SCRIPT(enableRallypoints);
+
+if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
+if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
+
+if !((_this select 1) getVariable [QEGVAR(respawn,rallypoint), false]) then {
+ [[(_this select 1)]] call EFUNC(respawn,rallypoint);
+} else {
+ (_this select 1) setVariable [QEGVAR(respawn,showRallypoint), true, true];
+};
+[format[LSTRING(rallypoint_success_message), name (_this select 1)]] call zen_common_fnc_showMessage;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_forceArsenal.sqf b/framework/components/curator/functions/fn_forceArsenal.sqf
new file mode 100644
index 0000000..b0bbb44
--- /dev/null
+++ b/framework/components/curator/functions/fn_forceArsenal.sqf
@@ -0,0 +1,24 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Creates a zeus module to force kosher arsenal on a player
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_forceArsenal
+ *
+ * Public: No
+ */
+SCRIPT(forceArsenal);
+
+if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
+if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
+
+[(_this select 1)] call EFUNC(kosherArsenal,forceArsenal);
+[LSTRING(forceopen_kosherArsenal_success_message)] call zen_common_fnc_showMessage;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_forceArsenalModule.sqf b/framework/components/curator/functions/fn_forceArsenalModule.sqf
deleted file mode 100644
index 8d79993..0000000
--- a/framework/components/curator/functions/fn_forceArsenalModule.sqf
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Creates a zeus module to force kosher arsenal on a player
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_forceArsenalModule
- *
- * Public: No
- */
-SCRIPT(forceArsenalModule);
-
-private _dialogFunction = {
- if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
- if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
- if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
-
- [(_this select 1)] call EFUNC(kosherArsenal,forceArsenal);
- [LSTRING(forceopen_kosherArsenal_success_message)] call zen_common_fnc_showMessage;
-};
-
-[LSTRING(kosherArsenal_module_category_displayname), LSTRING(forceopen_kosherArsenal_module_displayname), _dialogFunction, "components\curator\data\icon_module_kosherArsenal_ca.paa"] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_forceCloseArsenal.sqf b/framework/components/curator/functions/fn_forceCloseArsenal.sqf
new file mode 100644
index 0000000..9e11e29
--- /dev/null
+++ b/framework/components/curator/functions/fn_forceCloseArsenal.sqf
@@ -0,0 +1,24 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Creates module that force closes kosher arsenal for supplied unit
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_forceCloseArsenal
+ *
+ * Public: No
+ */
+SCRIPT(forceCloseArsenal);
+
+if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
+if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
+
+[(_this select 1)] call EFUNC(kosherArsenal,forceClose);
+[LSTRING(forceclose_kosherArsenal_message)] call zen_common_fnc_showMessage;
diff --git a/framework/components/curator/functions/fn_kosherForceCloseModule.sqf b/framework/components/curator/functions/fn_kosherForceCloseModule.sqf
deleted file mode 100644
index 6905f94..0000000
--- a/framework/components/curator/functions/fn_kosherForceCloseModule.sqf
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Creates module that force closes kosher arsenal for supplied unit
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_kosherForceCloseModule
- *
- * Public: No
- */
-SCRIPT(kosherForceCloseModule);
-
-private _dialogFunction = {
- if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
- if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
- if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
-
- [(_this select 1)] call EFUNC(kosherArsenal,forceClose);
- [LSTRING(forceclose_kosherArsenal_message)] call zen_common_fnc_showMessage;
-};
-
-[LSTRING(kosherArsenal_module_category_displayname), LSTRING(forceclose_kosherArsenal_module_displayname), _dialogFunction, "components\curator\data\icon_module_closeKosherArsenal_ca.paa"] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_randomLoadout.sqf b/framework/components/curator/functions/fn_randomLoadout.sqf
new file mode 100644
index 0000000..571feaf
--- /dev/null
+++ b/framework/components/curator/functions/fn_randomLoadout.sqf
@@ -0,0 +1,41 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Sets a random loadout for a selected unit based on a role and loadoutfile
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call cmf_curator_fnc_randomLoadout
+ *
+ * Public: No
+ */
+
+private _unit = _this param [1, objNull];
+
+if (isNull _unit) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+if !(_unit isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
+
+private _randomizeLoadout = {
+ params ["_values", "_unit"];
+
+ private _loadout = format["rsc\loadouts\%1.sqf", _values select 1];
+ if !(FILE_EXISTS(_loadout)) exitWith { ERROR_MSG_1("Unable to find loadoutfile: %1", _loadout) };
+ private _whitelist = [_values select 0, player, true] call compile(preprocessFileLineNumbers _loadout);
+
+ [_unit, _values select 0, _whitelist select 1] call EFUNC(kosherAI,setLoadout);
+
+ ["Randomized Loadout"] call zen_common_fnc_showMessage;
+};
+
+private _defaultRole = [_unit] call EFUNC(kosherAI,getRole);
+private _defaultLoadout = (missionNamespace getVariable [QEGVAR(kosherAI,loadouts), [""]]) select 0;
+
+["Set Random Loadout", [
+ ["EDIT", ["Role", "Role to set unit as"], [_defaultRole]],
+ ["EDIT", ["Loadout File", "Loadout file to use"], [_defaultLoadout]]
+], _randomizeLoadout, {}, _unit] call zen_dialog_fnc_create;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_removeCutoffPhase.sqf b/framework/components/curator/functions/fn_removeCutoffPhase.sqf
new file mode 100644
index 0000000..7530770
--- /dev/null
+++ b/framework/components/curator/functions/fn_removeCutoffPhase.sqf
@@ -0,0 +1,39 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * module to add/remove safestart cutoff phases
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_safestartCutoffPhases
+ *
+ * Public: No
+ */
+SCRIPT(safestartCutoffPhases);
+
+private _onConfirm = {
+ (_this select 0) params ["_name", "_cutoff", "_code"];
+ private _cutoffPhases = missionNameSpace getVariable [QEGVAR(gameplay,safestart_phaseCutOffs), []];
+
+ _cutoffPhases pushBack [_name, _cutOff, _code];
+ EGVAR(gameplay,safestart_phaseCutOffs) = _cutoffPhases;
+ publicVariable QEGVAR(gameplay,safestart_phaseCutOffs);
+};
+
+/* Get current cutoff phases */
+private _cutoffPhases = missionNameSpace getVariable [QEGVAR(gameplay,safestart_phaseCutOffs), []];
+
+/* get indexes */
+private _values = [];
+for "_i" from 0 to count _cutoffPhases do {
+ _values pushBack _i;
+};
+
+["Remove: Cutoff Phase", [
+ ["LIST", ["Phase name", "Name of the cutoff phase"], [_values, _cutoffPhases, 0, 5]]
+], _onConfirm, {}] call zen_dialog_fnc_create;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_removeRallypointModule.sqf b/framework/components/curator/functions/fn_removeRallypointModule.sqf
deleted file mode 100644
index dde9935..0000000
--- a/framework/components/curator/functions/fn_removeRallypointModule.sqf
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Creates a zeus module to remove rallypoints for unit
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_removeRallypointModule
- *
- * Public: No
- */
-SCRIPT(setLivesModule);
-
-private _moduleFunction = {
- if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
- if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
- if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
-
- (_this select 1) setVariable [QEGVAR(respawn,showRallypoint), false, true];
- [format[LSTRING(rallypoint_remove_success_message), name (_this select 1)]] call zen_common_fnc_showMessage;
-};
-
-[LSTRING(respawn_module_category_displayname), LSTRING(rallypoint_remove_module_displayname), _moduleFunction, "components\respawn\data\icon_ace_rallypoint_disabled_ca.paa"] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_resetkosherRoleModule.sqf b/framework/components/curator/functions/fn_resetkosherRoleModule.sqf
deleted file mode 100644
index f8b16c4..0000000
--- a/framework/components/curator/functions/fn_resetkosherRoleModule.sqf
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * module to reset a players role and/or team for kosher arsenal
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_resetKosherRoleModule
- *
- * Public: No
- */
-SCRIPT(resetKosherRoleModule);
-
-private _dialogFunction = {
- if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
- if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
- if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
-
- private _defaultRole = ((_this select 1) getVariable [QEGVAR(common,role), "RFL"]);
- private _defaultTeam = ((_this select 1) getVariable [QEGVAR(common,team), 0]);
- private _defaultLoadout = ((_this select 1) getVariable [QEGVAR(kosherArsenal,loadout), ""]);
- _defaultLoadout = _defaultLoadout splitString "\" select (count (_defaultLoadout splitString "\") - 1);
- _defaultLoadout = (_defaultLoadout splitString ".") select 0;
-
- private _onConfirm = {
- params["_dialogValues", "_unit", "_defaultRole", "_defaultTeam", "_defaultLoadout"];
-
- _dialogValues params[["_role", _defaultRole], ["_team", _defaultTeam], ["_loadout", _defaultLoadout]];
-
- /* Set the unit's role and team */
- [_unit, _role, _team] call EFUNC(organization,setRole);
-
- /* Set the unit's loadoutfile */
- private _loadout = format["rsc\loadouts\%1.sqf", _loadout];
- if !(FILE_EXISTS(_loadout)) exitWith { [LSTRING(no_loadoutFile_message)] call zen_common_fnc_showMessage };
- _unit setVariable [QEGVAR(kosherArsenal,loadout), _loadout, true];
-
- /* Open kosher arsenal */
- [_unit] call EFUNC(common,stripUnit);
- [_unit] call EFUNC(kosherArsenal,forceArsenal);
- [LSTRING(reset_kosherArsenal_success_message)] call zen_common_fnc_showMessage;
- };
-
- [LSTRING(change_kosherArsenal_module_displayname), [
- ["EDIT", [LSTRING(role), LSTRING(role_tooltip)], [_defaultRole]],
- ["SLIDER", [LSTRING(team), LSTRING(team_tooltip)], [0, 100, _defaultTeam, 0]],
- ["EDIT", [LSTRING(loadout), LSTRING(loadout_tooltip)], [_defaultLoadout]]
- ], _onConfirm, {}, (_this select 1), _defaultRole, _defaultTeam, _defaultLoadout] call zen_dialog_fnc_create;
-};
-
-[LSTRING(common_module_category_displayname), LSTRING(change_kosherArsenal_module_displayname), _dialogFunction, ""] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_safestartCutoffPhases.sqf b/framework/components/curator/functions/fn_safestartCutoffPhases.sqf
deleted file mode 100644
index 66d717f..0000000
--- a/framework/components/curator/functions/fn_safestartCutoffPhases.sqf
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * module to add/remove safestart cutoff phases
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_safestartCutoffPhases
- *
- * Public: No
- */
-SCRIPT(safestartCutoffPhases);
-
-private _addFunction = {
- private _onConfirm = {
- (_this select 0) params ["_name", "_cutoff", "_code"];
- private _cutoffPhases = missionNameSpace getVariable [QEGVAR(gameplay,safestart_phaseCutOffs), []];
-
- _cutoffPhases pushBack [_name, time + (_cutOff * 60), _code];
- EGVAR(gameplay,safestart_phaseCutOffs) = _cutoffPhases;
- publicVariable QEGVAR(gameplay,safestart_phaseCutOffs);
- };
-
- ["Add: Cutoff Phase", [
- ["EDIT", ["Phase name", "Name of the cutoff phase"], [""]],
- ["SLIDER", ["Cutoff Time", "(In minutes)"], [0, 60, 20, 0]],
- ["EDIT:CODE", ["On Complete", "Code that get's executed when the phase completes"], [""]]
- ], _onConfirm, {}] call zen_dialog_fnc_create;
-};
-
-["CMF: Safestart", "Add Cutoff Phase", _addFunction, ""] call zen_custom_modules_fnc_register;
-
-private _removeFunction = {
- private _onConfirm = {
- (_this select 0) params ["_name", "_cutoff", "_code"];
- private _cutoffPhases = missionNameSpace getVariable [QEGVAR(gameplay,safestart_phaseCutOffs), []];
-
- _cutoffPhases pushBack [_name, _cutOff, _code];
- EGVAR(gameplay,safestart_phaseCutOffs) = _cutoffPhases;
- publicVariable QEGVAR(gameplay,safestart_phaseCutOffs);
- };
-
- /* Get current cutoff phases */
- private _cutoffPhases = missionNameSpace getVariable [QEGVAR(gameplay,safestart_phaseCutOffs), []];
-
- /* get indexes */
- private _values = [];
- for "_i" from 0 to count _cutoffPhases do {
- _values pushBack _i;
- };
-
- ["Remove: Cutoff Phase", [
- ["LIST", ["Phase name", "Name of the cutoff phase"], [_values, _cutoffPhases, 0, 5]]
- ], _onConfirm, {}] call zen_dialog_fnc_create;
-};
-
-["CMF: Safestart", "Remove Cutoff Phase", _removeFunction, ""] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_safestartPhases.sqf b/framework/components/curator/functions/fn_safestartPhases.sqf
deleted file mode 100644
index c4c383f..0000000
--- a/framework/components/curator/functions/fn_safestartPhases.sqf
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * module to change safestart phase
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_safestartPhases
- *
- * Public: No
- */
-SCRIPT(safestartPhases);
-
-private _addFunction = {
- private _onConfirm = {
- (_this select 0) params ["_name"];
-
- EGVAR(gameplay,safestart_phase) = [_name, serverTime];
- publicVariable QEGVAR(gameplay,safestart_phase);
- };
-
- ["Change: Phase", [
- ["EDIT", ["Phase name", "Name of the phase"], [""]]
- ], _onConfirm, {}] call zen_dialog_fnc_create;
-};
-
-["CMF: Safestart", "Change Phase", _addFunction, ""] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_setAmmobox.sqf b/framework/components/curator/functions/fn_setAmmobox.sqf
new file mode 100644
index 0000000..2b647e4
--- /dev/null
+++ b/framework/components/curator/functions/fn_setAmmobox.sqf
@@ -0,0 +1,31 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Creates a zeus module to set object as an ammo box
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_setAmmobox
+ *
+ * Public: No
+ */
+SCRIPT(setAmmobox);
+
+if (isNull (_this select 1)) exitWith {[LSTRING(object_requirement_message)] call zen_common_fnc_showMessage};
+
+private _result = [(_this select 1)] call EFUNC(kosherArsenal,ammobox);
+if (_result) then {
+ [LSTRING(ammobox_success_message)] call zen_common_fnc_showMessage;
+
+ /* Raise event */
+ [QGVAR(ammobox_added), [_this select 1]] call CBA_fnc_globalEvent;
+} else {
+ [LSTRING(ammobox_fail_message)] call zen_common_fnc_showMessage;
+};
+
+
diff --git a/framework/components/curator/functions/fn_setCrateLoadout.sqf b/framework/components/curator/functions/fn_setCrateLoadout.sqf
new file mode 100644
index 0000000..797e2f8
--- /dev/null
+++ b/framework/components/curator/functions/fn_setCrateLoadout.sqf
@@ -0,0 +1,41 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Sets crate loadout for a selected crate based on a crate type and logistics file
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call cmf_curator_fnc_setCrateLoadout
+ *
+ * Public: No
+ */
+
+private _crate = _this param [1, objNull];
+
+if (isNull _crate) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+
+private _setLoadout = {
+ params ["_values", "_crate"];
+
+ private _path = format["rsc\loadouts\%1.sqf", (_values select 0)];
+ if !(FILE_EXISTS(_path)) exitWith { ERROR_MSG_1("Unable to find preset: %1", (_values select 0)); };
+
+ private _presets = [call compile preprocessFileLineNumbers _path] call CBA_fnc_hashCreate;
+ private _preset = [_presets, (_values select 1)] call CBA_fnc_hashGet;
+ private _presetData = [_preset] call FUNC(presetCompile);
+
+ [_crate, _presetData] call FUNC(fillCrate); // @BUG: Does not work in 3DEN Preview from zeus
+ ["Set Crate Loadout"] call zen_common_fnc_showMessage;
+};
+
+_defaultFile = missionNamespace getVariable [QEGVAR(logistics,crateConfigFile), ""];
+
+["Set Crate Loadout", [
+ ["EDIT", ["Logistics File", "Logistics file to use"], [_defaultFile]],
+ ["EDIT", ["Crate type", "Type of create to make e.g. Fireteam, Medical etc. (case sensitive)"], [""]]
+], _setLoadout, {}, _crate] call zen_dialog_fnc_create;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_setLives.sqf b/framework/components/curator/functions/fn_setLives.sqf
new file mode 100644
index 0000000..8228b06
--- /dev/null
+++ b/framework/components/curator/functions/fn_setLives.sqf
@@ -0,0 +1,32 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Creates a zeus module to set a player's lives
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_setLives
+ *
+ * Public: No
+ */
+SCRIPT(setLives);
+
+if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
+if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
+
+private _onConfirm = {
+ params["_dialogValues", "_unit"];
+ [[_unit, round(_dialogValues select 0), (_dialogValues select 1)], EFUNC(respawn,setLimit)] remoteExec ["call", _unit, true];
+ [format[LSTRING(setRespawns_success_message), round(_dialogValues select 0)]] call zen_common_fnc_showMessage
+};
+
+[LSTRING(setRespawns_module_displayname), [
+ ["SLIDER", [LSTRING(respawns_title), LSTRING(respawns_tooltip)], [0, 100, ((_this select 1) getVariable [QEGVAR(respawn,respawns)]), 0]],
+ ["CHECKBOX", [LSTRING(silent_title), LSTRING(silent_tooltip)], false]
+], _onConfirm, {}, (_this select 1)] call zen_dialog_fnc_create;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_setLivesModule.sqf b/framework/components/curator/functions/fn_setLivesModule.sqf
deleted file mode 100644
index 88a3e99..0000000
--- a/framework/components/curator/functions/fn_setLivesModule.sqf
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Creates a zeus module to set a player's lives
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_setLivesModule
- *
- * Public: No
- */
-SCRIPT(setLivesModule);
-
-private _dialogFunction = {
- if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
- if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
- if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
-
- private _onConfirm = {
- params["_dialogValues", "_unit"];
- [[_unit, round(_dialogValues select 0), (_dialogValues select 1)], EFUNC(respawn,setLimit)] remoteExec ["call", _unit, true];
- [format[LSTRING(setRespawns_success_message), round(_dialogValues select 0)]] call zen_common_fnc_showMessage
- };
-
- [LSTRING(setRespawns_module_displayname), [
- ["SLIDER", [LSTRING(respawns_title), LSTRING(respawns_tooltip)], [0, 100, ((_this select 1) getVariable [QEGVAR(respawn,respawns)]), 0]],
- ["CHECKBOX", [LSTRING(silent_title), LSTRING(silent_tooltip)], false]
- ], _onConfirm, {}, (_this select 1)] call zen_dialog_fnc_create;
-};
-
-[LSTRING(respawn_module_category_displayname), LSTRING(setRespawns_module_displayname), _dialogFunction, "components\curator\data\icon_module_setLives_ca.paa"] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/functions/fn_setPhase.sqf b/framework/components/curator/functions/fn_setPhase.sqf
new file mode 100644
index 0000000..358db7c
--- /dev/null
+++ b/framework/components/curator/functions/fn_setPhase.sqf
@@ -0,0 +1,28 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * module to change safestart phase
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_setPhase
+ *
+ * Public: No
+ */
+SCRIPT(setPhase);
+
+private _onConfirm = {
+ (_this select 0) params ["_name"];
+
+ EGVAR(gameplay,safestart_phase) = [_name, serverTime];
+ publicVariable QEGVAR(gameplay,safestart_phase);
+};
+
+["Change: Phase", [
+ ["EDIT", ["Phase name", "Name of the phase"], [""]]
+], _onConfirm, {}] call zen_dialog_fnc_create;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_setUnitParameters.sqf b/framework/components/curator/functions/fn_setUnitParameters.sqf
new file mode 100644
index 0000000..4327fec
--- /dev/null
+++ b/framework/components/curator/functions/fn_setUnitParameters.sqf
@@ -0,0 +1,52 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * module to reset a players role and/or team for kosher arsenal
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call cmf_zeus_fnc_setUnitParameters
+ *
+ * Public: No
+ */
+SCRIPT(setUnitParameters);
+
+if (isNull (_this select 1)) exitWith { [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage };
+if !((_this select 1) isKindOf "Man") exitWith { [LSTRING(unit_requirement_message)] call zen_common_fnc_showMessage };
+if !(isPlayer (_this select 1)) exitWith { [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage };
+
+private _defaultRole = ((_this select 1) getVariable [QEGVAR(common,role), "RFL"]);
+private _defaultTeam = ((_this select 1) getVariable [QEGVAR(common,team), 0]);
+private _defaultLoadout = ((_this select 1) getVariable [QEGVAR(kosherArsenal,loadout), ""]);
+_defaultLoadout = _defaultLoadout splitString "\" select (count (_defaultLoadout splitString "\") - 1);
+_defaultLoadout = (_defaultLoadout splitString ".") select 0;
+
+private _onConfirm = {
+ params["_dialogValues", "_unit", "_defaultRole", "_defaultTeam", "_defaultLoadout"];
+
+ _dialogValues params[["_role", _defaultRole], ["_team", _defaultTeam], ["_loadout", _defaultLoadout]];
+
+ /* Set the unit's role and team */
+ [_unit, _role, _team] call EFUNC(organization,setRole);
+
+ /* Set the unit's loadoutfile */
+ private _loadout = format["rsc\loadouts\%1.sqf", _loadout];
+ if !(FILE_EXISTS(_loadout)) exitWith { [LSTRING(no_loadoutFile_message)] call zen_common_fnc_showMessage };
+ _unit setVariable [QEGVAR(kosherArsenal,loadout), _loadout, true];
+
+ /* Open kosher arsenal */
+ [_unit] call EFUNC(utility,stripUnit);
+ [_unit] call EFUNC(kosherArsenal,forceArsenal);
+ [LSTRING(reset_kosherArsenal_success_message)] call zen_common_fnc_showMessage
+};
+
+[LSTRING(change_kosherArsenal_module_displayname), [
+ ["EDIT", [LSTRING(role), LSTRING(role_tooltip)], [_defaultRole]],
+ ["SLIDER", [LSTRING(team), LSTRING(team_tooltip)], [0, 100, _defaultTeam, 0]],
+ ["EDIT", [LSTRING(loadout), LSTRING(loadout_tooltip)], [_defaultLoadout]]
+], _onConfirm, {}, (_this select 1), _defaultRole, _defaultTeam, _defaultLoadout] call zen_dialog_fnc_create;
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_toggleFreezeTime.sqf b/framework/components/curator/functions/fn_toggleFreezeTime.sqf
new file mode 100644
index 0000000..c4bb207
--- /dev/null
+++ b/framework/components/curator/functions/fn_toggleFreezeTime.sqf
@@ -0,0 +1,26 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Creates a zeus module to disable freezeTime
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_toggleFreezeTime
+ *
+ * Public: No
+ */
+SCRIPT(toggleFreezeTime);
+
+ESETTING(environment,freezeTime) = !ESETTING(environment,freezeTime);
+publicVariable QESETTING(environment,freezeTime);
+
+if (ESETTING(environment,freezeTime)) then {
+ [LSTRING(en_freezeTime_success_message)] call zen_common_fnc_showMessage;
+} else {
+ [LSTRING(dis_freezeTime_success_message)] call zen_common_fnc_showMessage;
+};
\ No newline at end of file
diff --git a/framework/components/curator/functions/fn_toggleSpectator.sqf b/framework/components/curator/functions/fn_toggleSpectator.sqf
new file mode 100644
index 0000000..9feaa5e
--- /dev/null
+++ b/framework/components/curator/functions/fn_toggleSpectator.sqf
@@ -0,0 +1,33 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Toggles spectator for unit
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call cmf_zeus_fnc_toggleSpectator
+ *
+ * Public: No
+ */
+SCRIPT(toggleSpectator);
+
+private _entity = _this select 1;
+
+if (_entity != objNull) then {
+ if (isPlayer _entity) then {
+ [[], {
+ private _curSpectators = call ace_spectator_fnc_players;
+ [!(player in _curSpectators)] call ace_spectator_fnc_setSpectator;
+ }] remoteExec ["call", _entity];
+ [LSTRING(toggle_spectator_success_message)] call zen_common_fnc_showMessage;
+ } else {
+ [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage;
+ };
+} else {
+ [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage;
+};
diff --git a/framework/components/curator/functions/fn_toggleSpectatorModule.sqf b/framework/components/curator/functions/fn_toggleSpectatorModule.sqf
deleted file mode 100644
index 3badaad..0000000
--- a/framework/components/curator/functions/fn_toggleSpectatorModule.sqf
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "script_component.hpp"
-/*
- * Author: Eric
- * Toggles spectator for unit
- *
- * Arguments:
- * None
- *
- * Return Value:
- * None
- *
- * Example:
- * call cmf_zeus_fnc_toggleSpectatorModule
- *
- * Public: No
- */
-SCRIPT(toggleSpectatorModule);
-
-[LSTRING(common_module_category_displayname), LSTRING(toggle_spectator_module_displayname), {
- private _entity = _this select 1;
-
- if (_entity != objNull) then {
- if (isPlayer _entity) then {
- [[], {
- private _curSpectators = call ace_spectator_fnc_players;
- [!(player in _curSpectators)] call ace_spectator_fnc_setSpectator;
- }] remoteExec ["call", _entity];
- [LSTRING(toggle_spectator_success_message)] call zen_common_fnc_showMessage;
- } else {
- [LSTRING(player_requirement_message)] call zen_common_fnc_showMessage;
- };
- } else {
- [LSTRING(unitObject_requirement_message)] call zen_common_fnc_showMessage;
- };
-
-}, "components\curator\data\icon_module_spectate_ca.paa"] call zen_custom_modules_fnc_register;
diff --git a/framework/components/curator/script_component.hpp b/framework/components/curator/script_component.hpp
index d95cc2b..a6bb73c 100644
--- a/framework/components/curator/script_component.hpp
+++ b/framework/components/curator/script_component.hpp
@@ -14,4 +14,6 @@
#include "..\main\script_component.hpp"
-#include "\a3\ui_f\hpp\definedikcodes.inc"
\ No newline at end of file
+#include "\a3\ui_f\hpp\definedikcodes.inc"
+
+#define IDD_ZEUS 312
\ No newline at end of file
diff --git a/framework/components/curator/stringtable.sqf b/framework/components/curator/stringtable.sqf
index d1cdd61..0981568 100644
--- a/framework/components/curator/stringtable.sqf
+++ b/framework/components/curator/stringtable.sqf
@@ -20,13 +20,8 @@
["English", "Added rallypoints for %1"],
["Spanish", "Añadido rallypoints para %1"]
]],
- [DSTRING(respawn_module_category_displayname), [
- ["English", "CMF: Respawn"],
- ["Spanish", "CMF: Respawn"]
- ]],
- [DSTRING(rallypoint_module_displayname), [
- ["English", "Add rallypoint"],
- ["Spanish", "Añadir rallypoint"]
+ [DSTRING(enableRallypoints), [
+ ["English", "Enable rallypoints"]
]],
[DSTRING(object_requirement_message), [
@@ -41,20 +36,12 @@
["English", "Failed to add kosher ammobox"],
["Spanish", "Fallo al añadir KosherArsenal a la caja de munición"]
]],
- [DSTRING(kosherArsenal_module_category_displayname), [
- ["English", "CMF: Kosher Arsenal"],
- ["Spanish", "CMF: Kosher Arsenal"]
- ]],
- [DSTRING(ammobox_module_displayname), [
+ [DSTRING(setAmmobox), [
["English", "Set as ammobox"],
["Spanish", "Configurar como caja de munición"]
]],
- [DSTRING(common_module_category_displayname), [
- ["English", QUOTE(FRAMEWORK: Common)],
- ["Spanish", QUOTE(FRAMEWORK: Common)]
- ]],
- [DSTRING(dis_freezeTime_module_displayname), [
+ [DSTRING(toggleFreezeTime), [
["English", "Toggle frozen time"]
]],
[DSTRING(en_freezeTime_success_message), [
@@ -68,7 +55,7 @@
["English", "Forced open kosher arsenal on unit"],
["Spanish", "Se ha forzado la apertura del Kosher Arsenal en la unidad"]
]],
- [DSTRING(forceopen_kosherArsenal_module_displayname), [
+ [DSTRING(forceArsenal), [
["English", "Open Kosher Arsenal"],
["Spanish", "Abrir Kosher Arsenal"]
]],
@@ -77,7 +64,7 @@
["English", "Closed units arsenal"],
["Spanish", "Cerrar arsenal a todos"]
]],
- [DSTRING(forceclose_kosherArsenal_module_displayname), [
+ [DSTRING(forceCloseArsenal), [
["English", "Close Kosher Arsenal"],
["Spanish", "Cerrar Kosher Arsenal"]
]],
@@ -86,9 +73,8 @@
["English", "Removed rallypoints from %1"],
["Spanish", "Eliminar rallypoint para %1"]
]],
- [DSTRING(rallypoint_remove_module_displayname), [
- ["English", "Remove rallypoint"],
- ["Spanish", "Eliminar rallypoint"]
+ [DSTRING(disableRallypoints), [
+ ["English", "Disable rallypoints"]
]],
[DSTRING(no_loadoutFile_message), [
@@ -123,12 +109,11 @@
["English", "Sets player's loadout. Only write the filename without it's extension"],
["Spanish", "Asignar equipación al jugador. Solo escribe el nombre del archivo, sin la extensión"]
]],
- [DSTRING(change_kosherArsenal_module_displayname), [
- ["English", "Change kosher parameters"],
- ["Spanish", "Cambiar los parámetros del Kosher Arsenal"]
+ [DSTRING(setUnitParameters), [
+ ["English", "Set Unit Parameters"]
]],
- [DSTRING(setRespawns_module_displayname), [
+ [DSTRING(setLives), [
["English", "Set respawns"],
["Spanish", "Asignar respawns"]
]],
@@ -153,7 +138,7 @@
["Spanish", "Si es falso no mostrará una pista al jugador"]
]],
- [DSTRING(toggle_spectator_module_displayname), [
+ [DSTRING(toggleSpectator), [
["English", "Toggle Spectator"],
["Spanish", "Alternar Espectador"]
]],
diff --git a/framework/components/diagnostic/XEH_PREP.sqf b/framework/components/diagnostic/XEH_PREP.sqf
index 3bfb2b1..ce50caa 100644
--- a/framework/components/diagnostic/XEH_PREP.sqf
+++ b/framework/components/diagnostic/XEH_PREP.sqf
@@ -3,4 +3,5 @@
PREP(log);
PREP(error);
PREP(logFlush);
-PREP(errorFlush);
\ No newline at end of file
+PREP(errorFlush);
+PREP(initDisplayLog);
\ No newline at end of file
diff --git a/framework/components/diagnostic/XEH_preInit.sqf b/framework/components/diagnostic/XEH_preInit.sqf
index af1d6d7..6b34ec8 100644
--- a/framework/components/diagnostic/XEH_preInit.sqf
+++ b/framework/components/diagnostic/XEH_preInit.sqf
@@ -16,7 +16,7 @@ addMissionEventHandler ["ScriptError", {
text format ["at %1:%2", _sourceFile, _lineNumber]
];
- GVAR(errorOut) pushBack [QUOTE(PREFIX), QUOTE(MODULE), _errorText, _errorPos, _sourceFile, _lineNumber];
+ GVAR(errorOut) pushBack [serverTime, systemTime, [QUOTE(PREFIX), QUOTE(MODULE), _errorText, _errorPos, _sourceFile, _lineNumber]];
[QGVAR(errorNotification), _notif] call CBA_fnc_globalEvent;
}];
\ No newline at end of file
diff --git a/framework/components/diagnostic/functions/fn_error.sqf b/framework/components/diagnostic/functions/fn_error.sqf
index 2757208..60c8fb9 100644
--- a/framework/components/diagnostic/functions/fn_error.sqf
+++ b/framework/components/diagnostic/functions/fn_error.sqf
@@ -20,6 +20,6 @@
* Public: no
*/
-if (!is3DEN) then { _nil = GVAR(errorOut) pushBack _this };
+if (!is3DEN) then { _nil = GVAR(errorOut) pushBack [serverTime, systemTime, _this] };
_this call CBA_fnc_error;
diff --git a/framework/components/diagnostic/functions/fn_initDisplayLog.sqf b/framework/components/diagnostic/functions/fn_initDisplayLog.sqf
new file mode 100644
index 0000000..6fcc904
--- /dev/null
+++ b/framework/components/diagnostic/functions/fn_initDisplayLog.sqf
@@ -0,0 +1,80 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Initializes log display
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call cmf_diagnostic_fnc_initDisplayLog
+ *
+ * Public: No
+ */
+
+params ["_display"];
+
+private _formatTime = {
+ ((_this select [3, 3]) apply { [_x, 2] call CBA_fnc_formatNumber }) joinString ":";
+};
+
+/* Style errors */
+private _formattedError = GVAR(errorOut) apply {
+ private _errorColor = (EGVAR(common,notificationColors) get "ERROR") call BIS_fnc_colorRGBtoHTML;
+ private _infoColor = (EGVAR(common,notificationColors) get "INFO") call BIS_fnc_colorRGBtoHTML;
+ format ["%1 %2", (_x select 1) call _formatTime, (_x select 2), _infoColor, _errorColor];
+};
+
+/* Style log */
+private _logContent = GVAR(logOut) apply {
+ private _infoColor = (EGVAR(common,notificationColors) get "INFO") call BIS_fnc_colorRGBtoHTML;
+ format ["%1 %2", (_x select 1) call _formatTime, (_x select 2), _infoColor];
+};
+
+_logContent append _formattedError;
+_logContent sort true;
+
+disableSerialization;
+private _ctrlClear = _display displayCtrl IDC_LOG_CLEAR;
+private _ctrlText = _display displayCtrl IDC_LOG_TEXT;
+private _ctrlLines = _display displayCtrl IDC_LOG_LINES;
+private _ctrlGroup = ctrlParentControlsGroup _ctrlText;
+
+ctrlPosition _ctrlGroup params ["_xParent", "_yParent", "_wParent", "_hParent"];
+_maxW = selectMax (_logContent apply {
+ str parseText _x getTextWidth ["RobotoCondensedLight", LOG_FONTSIZE * 2]
+});
+
+_ctrlText ctrlSetPositionW (_maxW max _wParent);
+_ctrlText ctrlCommit 0;
+
+_ctrlText ctrlSetStructuredText parseText (_logContent joinString "
");
+_ctrlLines ctrlSetText str (count _logContent);
+_ctrlText ctrlSetPosition [
+ 0,
+ 0,
+ _wParent max _maxW,
+ _hParent max ctrlTextHeight _ctrlText
+];
+_ctrlText ctrlCommit 0;
+
+_ctrlGroup spawn {
+ _this ctrlSetScrollValues [1,0];
+};
+
+_ctrlClear ctrlAddEventHandler ["ButtonClick", {
+ _this spawn {
+ params ["_ctrl"];
+
+ private _result = ["This will clear the log. Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage;
+
+ if (_result) then {
+ call FUNC(errorFlush);
+ call FUNC(logFlush);
+ (ctrlParent _ctrl) closeDisplay 1;
+ };
+ };
+}];
\ No newline at end of file
diff --git a/framework/components/diagnostic/functions/fn_log.sqf b/framework/components/diagnostic/functions/fn_log.sqf
index 401dd60..f74ffeb 100644
--- a/framework/components/diagnostic/functions/fn_log.sqf
+++ b/framework/components/diagnostic/functions/fn_log.sqf
@@ -15,6 +15,6 @@
* Public: no
*/
-if (!is3DEN) then { _nil = GVAR(logOut) pushBack _this };
+if (!is3DEN) then { _nil = GVAR(logOut) pushBack [serverTime, systemTime, _this] };
_this call CBA_fnc_log;
\ No newline at end of file
diff --git a/framework/components/diagnostic/script_component.hpp b/framework/components/diagnostic/script_component.hpp
index a7b5f35..1b45510 100644
--- a/framework/components/diagnostic/script_component.hpp
+++ b/framework/components/diagnostic/script_component.hpp
@@ -16,24 +16,19 @@
#include "\a3\ui_f\hpp\definecommongrids.inc"
-#define DIALOG_CENTER ((20 * GUI_GRID_CENTER_W) / 2) - GUI_GRID_W
+#define IDC_LOG_TEXT 200
+#define IDC_LOG_CLEAR 300
-#define SLIDER_HEIGHT 1.3 * GUI_GRID_CENTER_H
-#define SLIDER_WIDTH 20 * GUI_GRID_CENTER_W
-#define SLIDER_X DIALOG_CENTER + (0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X)
-#define SLIDER_GAP 0.01
-#define SLIDER_Y(var1) (SLIDER_HEIGHT + SLIDER_GAP) * var1
+#define RSCDEBUG_W 45
+#define RSCDEBUG_H 30
-#define LABEL_X SLIDER_X + SLIDER_WIDTH + SLIDER_GAP
+#define UI_GRID_W (5 * 0.5 * pixelW * pixelGrid)
+#define UI_GRID_H (5 * 0.5 * pixelH * pixelGrid)
+#define CUI_GRID_X (0.5)
+#define CUI_GRID_Y (0.5)
+#define CUI_GRID_W UI_GRID_W
+#define CUI_GRID_H UI_GRID_H
-#define BUTTON_GAP 0.025
-#define BUTTON_W ((SLIDER_WIDTH / 3) - BUTTON_GAP)
-#define BUTTON_X(var1) SLIDER_X + (BUTTON_W * var1) + (BUTTON_GAP * var1)
+#define LOG_FONTSIZE 0.7 * CUI_GRID_H
-#define CONTROL_WIDTH(var1) (GUI_GRID_W * var1)
-#define CONTROL_HEIGHT(var1) (GUI_GRID_H * var1)
-
-#define DIALOG_MARGIN 0.1
-
-#define DIALOG_X(var1) ((GUI_GRID_X + CONTROL_WIDTH(DIALOG_MARGIN) + var1) min (GUI_GRID_W - CONTROL_WIDTH(DIALOG_MARGIN)))
-#define DIALOG_Y(var1) ((GUI_GRID_Y + CONTROL_HEIGHT(DIALOG_MARGIN) + var1) min (GUI_GRID_H - CONTROL_HEIGHT(DIALOG_MARGIN)))
\ No newline at end of file
+#define LINES_TOOLTIP QUOTE(Define the number of lines to be shown. 30 means the last 30 lines are shown. Use a small number to speed up the process. Use a very large number to display all lines.)
\ No newline at end of file
diff --git a/framework/components/kosherArsenal/XEH_3denInit.sqf b/framework/components/kosherArsenal/XEH_3denInit.sqf
index 0ac6690..453b9b8 100644
--- a/framework/components/kosherArsenal/XEH_3denInit.sqf
+++ b/framework/components/kosherArsenal/XEH_3denInit.sqf
@@ -34,4 +34,47 @@ private _ammoBoxAction = [
[
_ammoBoxAction
]
+] call EFUNC(3den,addMenuItem);
+
+private _randomLoadoutAction = [
+ "Set Random Loadout",
+ "a3\ui_f\data\gui\rsc\rscdisplayarsenal\uniform_ca.paa",
+ {
+ if (count get3DENSelected "object" isEqualTo 0) exitWith {
+ ["No units selected", 0, 1] call BIS_fnc_3DENNotification;
+ };
+
+ private _randomizeLoadout = {
+ params ["_values", "_units"];
+
+ private _loadout = format["rsc\loadouts\%1.sqf", _values select 1];
+ if !(FILE_EXISTS(_loadout)) exitWith { ERROR_MSG_1("Unable to find loadoutfile: %1", _loadout) };
+ private _whitelist = [_values select 0, player, true] call compile(preprocessFileLineNumbers _loadout);
+
+ {
+ [_x, _values select 0, _whitelist select 1] call EFUNC(kosherAI,setLoadout);
+ save3DENInventory [_x];
+ } forEach _units;
+
+ [format ["Set random loadout for %1 units.", count _units], 0, 1] call BIS_fnc_3DENNotification;
+ };
+
+ ["Set Random Loadout", [
+ ["EDIT", ["Role", "Role to set unit as"], ["RFL"]],
+ ["EDIT", ["Loadoutfile", "Loadoutfile to use"], [""]]
+ ], _randomizeLoadout, {}, (get3DENSelected "object") select { _x isKindOf "Man" }] call zen_dialog_fnc_create;
+
+ }
+];
+
+[
+ _path,
+ QUOTE(MODULE_BEAUTIFIED),
+ "a3\3den\data\displays\display3den\toolbar\open_ca.paa",
+ {},
+ [],
+ [
+ _ammoBoxAction,
+ _randomLoadoutAction
+ ]
] call EFUNC(3den,addMenuItem);
\ No newline at end of file
diff --git a/framework/components/kosherArsenal/XEH_preInit.sqf b/framework/components/kosherArsenal/XEH_preInit.sqf
new file mode 100644
index 0000000..f992a91
--- /dev/null
+++ b/framework/components/kosherArsenal/XEH_preInit.sqf
@@ -0,0 +1,3 @@
+#include "script_component.hpp"
+
+GVAR(loadouts) = [];
\ No newline at end of file
diff --git a/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf b/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf
index e734e95..36b87b6 100644
--- a/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf
+++ b/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf
@@ -79,7 +79,7 @@ params ["_unit", ["_forcePrimary", true]];
/* Remove the closed eventHandler */
["ace_arsenal_displayClosed", _thisId] call CBA_fnc_removeEventHandler;
- cmf_player setVariable [QGVAR(close), false, true];
+ player setVariable [QGVAR(close), false, true];
/* Raise event */
[QGVAR(onClose), [(player getVariable [QGVAR(close), false])]] call CBA_fnc_localEvent;
diff --git a/framework/components/kosherArsenal/functions/fn_forceClose.sqf b/framework/components/kosherArsenal/functions/fn_forceClose.sqf
index b985898..1e179e6 100644
--- a/framework/components/kosherArsenal/functions/fn_forceClose.sqf
+++ b/framework/components/kosherArsenal/functions/fn_forceClose.sqf
@@ -19,4 +19,4 @@ SCRIPT(forceClose);
params ["_unit"];
/* Forcefully close the units kosherArsenal */
-cmf_player setVariable [QGVAR(close), true, true];
\ No newline at end of file
+_unit setVariable [QGVAR(close), true, true];
\ No newline at end of file
diff --git a/framework/components/kosherArsenal/functions/fn_init.sqf b/framework/components/kosherArsenal/functions/fn_init.sqf
index 526db05..6a1e5ae 100644
--- a/framework/components/kosherArsenal/functions/fn_init.sqf
+++ b/framework/components/kosherArsenal/functions/fn_init.sqf
@@ -28,8 +28,11 @@ if (!hasInterface) exitWith {};
if (isNil "_loadouts") exitWith { ERROR_MSG("No loadoutfiles defined"); };
+ /* Keep a list of used loadouts */
+ { GVAR(loadouts) pushBackUnique _x } forEach _loadouts;
+
/* Check if light should be attached */
- _light = ((getLightingAt cmf_player) select 1 < 0.75); // @TODO: Fine tune this value
+ _light = ((getLightingAt cmf_player) select 1 < 30); // @TODO: Fine tune this value
/* Randomize player spawn position if enabled */
if (_randomPos) then {
@@ -49,7 +52,7 @@ if (!hasInterface) exitWith {};
/* Verify that the loadoutfile exists and save it on the unit */
private _loadout = format["rsc\loadouts\%1.sqf", (_loadouts select _team)];
if !(FILE_EXISTS(_loadout)) exitWith { ERROR_MSG_1("Unable to find loadoutfile: %1", _loadout); };
- cmf_player setVariable [QGVAR(loadout), _loadout, true];
+ player setVariable [QGVAR(loadout), _loadout, true];
/* If player is Re-Jip in same role exit */
private _reJip = false;
@@ -152,7 +155,7 @@ if (!hasInterface) exitWith {};
deleteVehicle _lightobject;
};
- cmf_player setVariable [QGVAR(close), false, true];
+ player setVariable [QGVAR(close), false, true];
/* Raise event */
[QGVAR(onClose), [(player getVariable [QGVAR(close), false])]] call CBA_fnc_localEvent;
diff --git a/framework/components/logistics/XEH_3denInit.sqf b/framework/components/logistics/XEH_3denInit.sqf
new file mode 100644
index 0000000..c37d3bf
--- /dev/null
+++ b/framework/components/logistics/XEH_3denInit.sqf
@@ -0,0 +1,48 @@
+#include "script_component.hpp"
+
+waitUntil { !isNil QEGVAR(3den,menu_entity) };
+
+private _path = EGVAR(3den,menu_entity);
+
+private _crateLoadoutAction = [
+ "Set Crate Loadout",
+ "a3\ui_f\data\map\vehicleicons\iconcrateord_ca.paa",
+ {
+ if (count get3DENSelected "object" isEqualTo 0) exitWith {
+ ["No units selected", 0, 1] call BIS_fnc_3DENNotification;
+ };
+
+ private _setLoadout = {
+ params ["_values", "_crates"];
+
+ private _path = format["rsc\loadouts\%1.sqf", (_values select 0)];
+ if !(FILE_EXISTS(_path)) exitWith { ERROR_MSG_1("Unable to find preset: %1", (_values select 0)); };
+
+ private _presets = [call compile preprocessFileLineNumbers _path] call CBA_fnc_hashCreate;
+ private _preset = [_presets, (_values select 1)] call CBA_fnc_hashGet;
+ private _presetData = [_preset] call FUNC(presetCompile);
+
+ {
+ [_x, _presetData] call FUNC(fillCrate);
+ } forEach _crates;
+
+ [format ["Set crate loadout for %1 objects.", count _crates], 0, 2] call BIS_fnc_3DENNotification;
+ };
+
+ ["Set Crate Loadout", [
+ ["EDIT", ["Logistics File", "Logistics file to use"], [""]],
+ ["EDIT", ["Crate type", "Type of create to make e.g. Fireteam, Medical etc. (case sensitive)"], [""]]
+ ], _setLoadout, {}, (get3DENSelected "object") select { !(_x isKindOf "Man") }] call zen_dialog_fnc_create;
+ }
+];
+
+[
+ _path,
+ QUOTE(MODULE_BEAUTIFIED),
+ "a3\3den\data\displays\display3den\toolbar\open_ca.paa",
+ {},
+ [],
+ [
+ _crateLoadoutAction
+ ]
+] call EFUNC(3den,addMenuItem);
\ No newline at end of file
diff --git a/framework/components/logistics/XEH_PREP.sqf b/framework/components/logistics/XEH_PREP.sqf
index ce35064..5b38142 100644
--- a/framework/components/logistics/XEH_PREP.sqf
+++ b/framework/components/logistics/XEH_PREP.sqf
@@ -4,4 +4,5 @@ PREP(cratePFH);
PREP(crateActions);
PREP(cratePreset);
PREP(presetCompile);
+PREP(fillCrate);
PREP(crateSpawner);
diff --git a/framework/components/logistics/functions/fn_cratePreset.sqf b/framework/components/logistics/functions/fn_cratePreset.sqf
index 117fe8e..76e5682 100644
--- a/framework/components/logistics/functions/fn_cratePreset.sqf
+++ b/framework/components/logistics/functions/fn_cratePreset.sqf
@@ -14,12 +14,12 @@
*
* Public: Yes
*/
-if (!isServer) exitWith { };
params ["_name"];
if (isNil "_name") exitWith { ERROR_MSG("No preset defined") };
private _path = format["rsc\loadouts\%1.sqf", _name];
if !(FILE_EXISTS(_path)) exitWith { ERROR_MSG_1("Unable to find preset: %1", _name); };
+GVAR(crateConfigFile) = _name;
private _presets = [call compile preprocessFileLineNumbers _path] call CBA_fnc_hashCreate;
GVAR(crateConfig) = _presets;
@@ -40,33 +40,24 @@ publicVariable QGVAR(crateConfig);
/* Using this method won't allow for using the same crate for different crates */
[(_presetData select 1), "init", compile ("
params ['_crate'];
+
if (_crate getVariable ['ace_cargo_customName', ''] isEqualTo '') then {
_crate setVariable ['ace_cargo_customName', '" + _key + " Crate | ', true];
};
- [_crate, true] call ace_dragging_fnc_setCarryable;
- [_crate, true] call ace_dragging_fnc_setDraggable;
-
- clearItemCargoGlobal _crate;
- clearMagazineCargoGlobal _crate;
- clearWeaponCargoGlobal _crate;
- clearBackpackCargoGlobal _crate;
- {_crate addWeaponCargoGlobal _x} forEach "+str(_presetData select 2)+";
- {_crate addMagazineCargoGlobal _x} forEach "+str(_presetData select 3)+";
- {_crate addItemCargoGlobal _x} forEach "+str(_presetData select 4)+";
+ private _weight = [] call ace_dragging_fnc_getWeight;
+ _weight = (_weight > misionNamespace getVariable [""ACE_maxWeightDrag"", 1E11]);
- if (count "+str(_presetData select 5)+" > 0) then {
- private _cargoSpace = 0;
- {
- _cargoSpace = _cargoSpace + _x;
- } forEach ("+str(_presetData select 5)+" apply { ([_x select 0] call ace_cargo_fnc_getSizeItem) * (_x select 1) });
- [_crate, _cargoSpace] call ace_cargo_fnc_setSpace;
- {
- private _cargo = _x;
- for '_i' from 0 to (_cargo select 1) do {
- [(_cargo select 0), _crate] call ace_cargo_fnc_loadItem;
- };
- } forEach "+str(_presetData select 5)+";
- };
+ private _position = _object getVariable [""ace_dragging_carryPosition"", [0, 1.5, 0]];
+ private _direction = _object getVariable [""ace_dragging_carryDirection"", 0];
+
+ [_crate, true, _position, _direction, _weight] call ace_dragging_fnc_setCarryable;
+
+ _position = _object getVariable [""ace_dragging_dragPosition"", [0, 1.5, 0]];
+ _direction = _object getVariable [""ace_dragging_dragDirection"", 0];
+ [_crate, true, _position, _direction, _weight] call ace_dragging_fnc_setDraggable;
+
+
+ [_crate, " + str _presetData + "] call cmf_logistics_fnc_fillCrate
"), true, [], true] call CBA_fnc_addClassEventHandler;
} forEach ([_presets] call CBA_fnc_hashKeys);
\ No newline at end of file
diff --git a/framework/components/logistics/functions/fn_fillCrate.sqf b/framework/components/logistics/functions/fn_fillCrate.sqf
new file mode 100644
index 0000000..231fc35
--- /dev/null
+++ b/framework/components/logistics/functions/fn_fillCrate.sqf
@@ -0,0 +1,63 @@
+#include "script_component.hpp"
+/*
+ * Author: Eric
+ * Fills crate with passed cargo
+ *
+ * Arguments:
+ * 0: Crate