From 29af88b71b4c3aeaced16ee1a9963f57abe1774b Mon Sep 17 00:00:00 2001 From: Thomas Kooi Date: Mon, 12 Jan 2015 23:35:40 +0100 Subject: [PATCH] Added cse_main source --- TO_MERGE/cse/main/CfgFactionClasses.h | 22 +++ TO_MERGE/cse/main/CfgFunctions.h | 154 +++++++++++++++ TO_MERGE/cse/main/CfgHints.h | 27 +++ TO_MERGE/cse/main/CfgVehicles.h | 115 +++++++++++ TO_MERGE/cse/main/Combat_Space_Enhancement.h | 60 ++++++ .../main/anim/functions/fn_broadcastAnim.sqf | 21 ++ .../main/anim/functions/fn_getDeathAnim.sqf | 33 ++++ .../cse/main/anim/functions/fn_localAnim.sqf | 24 +++ .../main/anim/functions/fn_playMoveNow.sqf | 14 ++ .../cse/main/anim/functions/fn_switchAnim.sqf | 15 ++ .../cse/main/arrays/functions/fn_findAll.sqf | 22 +++ .../cse/main/arrays/functions/fn_findIf.sqf | 22 +++ .../cse/main/arrays/functions/fn_findIn.sqf | 22 +++ .../main/arrays/functions/fn_foreachDo.sqf | 21 ++ .../arrays/functions/fn_insertionSort.sqf | 32 +++ .../functions/fn_sortAlphabeticallyBy.sqf | 42 ++++ .../functions/fn_uniqueElementsOnly.sqf | 22 +++ TO_MERGE/cse/main/config.cpp | 33 ++++ .../main/config/functions/fn_inheritsFrom.sqf | 24 +++ TO_MERGE/cse/main/data/cse_aim_module.paa | Bin 0 -> 5625 bytes .../cse/main/data/cse_backblast_module.paa | Bin 0 -> 5625 bytes .../cse/main/data/cse_ballistics_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_basic_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_cc_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_debug_icon.paa | Bin 0 -> 5625 bytes .../cse/main/data/cse_earmuffs_module.paa | Bin 0 -> 5625 bytes .../cse/main/data/cse_explosive_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_groups_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_logging_icon.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_medical_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_nvg_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_rifle_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/data/cse_tags_module.paa | Bin 0 -> 5625 bytes TO_MERGE/cse/main/debug/Debug.h | 9 + .../cse/main/debug/functions/fn_debug.sqf | 66 +++++++ .../main/debug/functions/fn_debugModule.sqf | 15 ++ .../main/debug/functions/fn_traceModule.sqf | 23 +++ .../main/equipment/functions/fn_findItem.sqf | 25 +++ .../equipment/functions/fn_findMagazine.sqf | 21 ++ .../functions/fn_getNumberMagazinesIn.sqf | 26 +++ .../main/equipment/functions/fn_hasItem.sqf | 11 ++ .../equipment/functions/fn_hasMagazine.sqf | 21 ++ .../main/equipment/functions/fn_useItem.sqf | 36 ++++ .../equipment/functions/fn_useMagazine.sqf | 28 +++ TO_MERGE/cse/main/hc/functions/fn_isHC.sqf | 22 +++ TO_MERGE/cse/main/init.sqf | 81 ++++++++ .../alive/alive_flexiMenu_integration.sqf | 182 ++++++++++++++++++ .../alive/alive_gui_integration.sqf | 72 +++++++ .../fn_broadcastMonitoredVariable.sqf | 23 +++ .../interaction/functions/fn_canInteract.sqf | 13 ++ .../functions/fn_getAllMonitoredVariables.sqf | 14 ++ .../functions/fn_getCanInteract.sqf | 13 ++ .../functions/fn_getInteractionTarget.sqf | 14 ++ .../functions/fn_getMonitoredVariableName.sqf | 20 ++ .../fn_getMonitoredVariableValue.sqf | 39 ++++ .../functions/fn_getOnUpdateVariableEH.sqf | 23 +++ ...fn_getRegisteredMonitorVariablesOwners.sqf | 25 +++ .../fn_isRegisteredInteractingWith.sqf | 22 +++ .../functions/fn_registerInteractingWith.sqf | 30 +++ .../functions/fn_registerVariableMonitor.sqf | 34 ++++ .../functions/fn_setCanInteract.sqf | 26 +++ .../fn_setMonitoredVariableValue.sqf | 35 ++++ .../functions/fn_setOnUpdateVariableEH.sqf | 17 ++ .../fn_unregisterInteractingWith.sqf | 38 ++++ .../functions/fn_sendDisplayInformationTo.sqf | 46 +++++ .../functions/fn_sendDisplayMessageTo.sqf | 46 +++++ .../main/messages/functions/fn_sendHintTo.sqf | 23 +++ .../messages/functions/fn_sendMessageTo.sqf | 22 +++ .../misc/functions/fn_broadcastSound3D_f.sqf | 16 ++ .../misc/functions/fn_closeAllDialogs_f.sqf | 14 ++ .../main/misc/functions/fn_disableAI_f.sqf | 23 +++ .../misc/functions/fn_disableKeyInput_f.sqf | 77 ++++++++ .../misc/functions/fn_disableUserInput_f.sqf | 28 +++ .../main/misc/functions/fn_dropWeapon_f.sqf | 39 ++++ .../functions/fn_endRadioTransmission_f.sqf | 29 +++ .../fn_getFirstObjectIntersection.sqf | 44 +++++ .../fn_getFirstTerrainIntersection.sqf | 44 +++++ .../cse/main/misc/functions/fn_getName.sqf | 26 +++ .../misc/functions/fn_getWeaponItems_f.sqf | 14 ++ .../cse/main/misc/functions/fn_hasItem_f.sqf | 16 ++ .../cse/main/misc/functions/fn_inWater_f.sqf | 20 ++ .../cse/main/misc/functions/fn_isAwake.sqf | 13 ++ .../main/misc/functions/fn_isInBuilding.sqf | 23 +++ .../functions/fn_lockVehicleOfUnitUntil.sqf | 38 ++++ .../functions/fn_moduleEnableBasicRevive.sqf | 36 ++++ .../misc/functions/fn_resetAllDefaults_f.sqf | 51 +++++ .../main/misc/functions/fn_revealObject_f.sqf | 4 + .../cse/main/misc/functions/fn_setDead.sqf | 101 ++++++++++ .../functions/fn_setHearingCapability.sqf | 53 +++++ .../cse/main/misc/functions/fn_setProne.sqf | 26 +++ .../main/misc/functions/fn_setVolume_f.sqf | 45 +++++ .../misc/functions/fn_switchToGroupSide_f.sqf | 65 +++++++ .../main/mods/functions/fn_ALiVE_BUS_Mod.sqf | 16 ++ .../mods/functions/fn_isLoaded_ALiVE_Mod.sqf | 12 ++ .../main/mods/functions/fn_isModLoaded_f.sqf | 14 ++ .../main/mutex/functions/fn_createMutex.sqf | 24 +++ .../cse/main/mutex/functions/fn_lockMutex.sqf | 24 +++ .../main/mutex/functions/fn_releaseMutex.sqf | 24 +++ .../functions/fn_waitForMultipleMutex.sqf | 18 ++ .../mutex/functions/fn_waitForSingleMutex.sqf | 28 +++ .../main/ragdoll/functions/fn_ragdoll_f.sqf | 11 ++ .../requests/functions/fn_onAnswerRequest.sqf | 37 ++++ .../requests/functions/fn_receiveRequest.sqf | 67 +++++++ .../requests/functions/fn_requestCallback.sqf | 21 ++ .../requests/functions/fn_sendRequest_f.sqf | 26 +++ .../strings/functions/fn_stringCompare.sqf | 33 ++++ .../functions/fn_string_removeWhiteSpace.sqf | 19 ++ TO_MERGE/cse/main/stringtable.xml | 27 +++ .../tasks/functions/fn_addTaskToPool_f.sqf | 22 +++ .../tasks/functions/fn_loopThroughPool_f.sqf | 17 ++ .../functions/fn_removeTaskFromPool_f.sqf | 25 +++ .../variables/functions/fn_defineVariable.sqf | 39 ++++ .../functions/fn_getAllSetVariables.sqf | 27 +++ .../variables/functions/fn_getVariable.sqf | 31 +++ .../functions/fn_getvariableDefault.sqf | 18 ++ .../functions/fn_getvariableInfo.sqf | 11 ++ .../variables/functions/fn_setVariable.sqf | 29 +++ .../main/version/functions/fn_getVersion.sqf | 11 ++ 118 files changed, 3362 insertions(+) create mode 100644 TO_MERGE/cse/main/CfgFactionClasses.h create mode 100644 TO_MERGE/cse/main/CfgFunctions.h create mode 100644 TO_MERGE/cse/main/CfgHints.h create mode 100644 TO_MERGE/cse/main/CfgVehicles.h create mode 100644 TO_MERGE/cse/main/Combat_Space_Enhancement.h create mode 100644 TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf create mode 100644 TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf create mode 100644 TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf create mode 100644 TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf create mode 100644 TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf create mode 100644 TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf create mode 100644 TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf create mode 100644 TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf create mode 100644 TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf create mode 100644 TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf create mode 100644 TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf create mode 100644 TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf create mode 100644 TO_MERGE/cse/main/config.cpp create mode 100644 TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf create mode 100644 TO_MERGE/cse/main/data/cse_aim_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_backblast_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_ballistics_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_basic_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_cc_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_debug_icon.paa create mode 100644 TO_MERGE/cse/main/data/cse_earmuffs_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_explosive_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_groups_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_logging_icon.paa create mode 100644 TO_MERGE/cse/main/data/cse_medical_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_nvg_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_rifle_module.paa create mode 100644 TO_MERGE/cse/main/data/cse_tags_module.paa create mode 100644 TO_MERGE/cse/main/debug/Debug.h create mode 100644 TO_MERGE/cse/main/debug/functions/fn_debug.sqf create mode 100644 TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf create mode 100644 TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf create mode 100644 TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf create mode 100644 TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf create mode 100644 TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf create mode 100644 TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf create mode 100644 TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf create mode 100644 TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf create mode 100644 TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf create mode 100644 TO_MERGE/cse/main/hc/functions/fn_isHC.sqf create mode 100644 TO_MERGE/cse/main/init.sqf create mode 100644 TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf create mode 100644 TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf create mode 100644 TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf create mode 100644 TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf create mode 100644 TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf create mode 100644 TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf create mode 100644 TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_getName.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_setDead.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_setProne.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf create mode 100644 TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf create mode 100644 TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf create mode 100644 TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf create mode 100644 TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf create mode 100644 TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf create mode 100644 TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf create mode 100644 TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf create mode 100644 TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf create mode 100644 TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf create mode 100644 TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf create mode 100644 TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf create mode 100644 TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf create mode 100644 TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf create mode 100644 TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf create mode 100644 TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf create mode 100644 TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf create mode 100644 TO_MERGE/cse/main/stringtable.xml create mode 100644 TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf create mode 100644 TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf create mode 100644 TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf create mode 100644 TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf create mode 100644 TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf create mode 100644 TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf create mode 100644 TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf create mode 100644 TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf create mode 100644 TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf create mode 100644 TO_MERGE/cse/main/version/functions/fn_getVersion.sqf diff --git a/TO_MERGE/cse/main/CfgFactionClasses.h b/TO_MERGE/cse/main/CfgFactionClasses.h new file mode 100644 index 0000000000..6dce67e747 --- /dev/null +++ b/TO_MERGE/cse/main/CfgFactionClasses.h @@ -0,0 +1,22 @@ +class CfgFactionClasses +{ + class NO_CATEGORY; + class cseModules: NO_CATEGORY { + displayName = "CSE Modules"; + }; + class cseDebug: NO_CATEGORY { + displayName = "CSE Debug"; + }; + class cseMisc: NO_CATEGORY { + displayName = "CSE Misc"; + }; + class cse_equipment: NO_CATEGORY { + displayName = "CSE Equipment"; + }; + class cse_medical: NO_CATEGORY { + displayName = "CSE Medical"; + }; + class cseCCModule: NO_CATEGORY { + displayName = "CSE Command & Control"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/CfgFunctions.h b/TO_MERGE/cse/main/CfgFunctions.h new file mode 100644 index 0000000000..29cb3d875e --- /dev/null +++ b/TO_MERGE/cse/main/CfgFunctions.h @@ -0,0 +1,154 @@ +class CfgFunctions { + class CSE { + class Strings { + file = "cse\cse_main\strings\functions"; + class stringCompare { recompile = 1; }; + class string_removeWhiteSpace { recompile = 1; }; + }; + class HC { + file = "cse\cse_main\hc\functions"; + class isHC { recompile = 1; }; + }; + class Requests { + file = "cse\cse_main\requests\functions"; + class sendRequest_f { recompile = 1; }; + class requestCallback { recompile = 1; }; + class receiveRequest { recompile = 1; }; + class onAnswerRequest { recompile = 1; }; + }; + + class Debug { + file = "cse\cse_main\debug\functions"; + class debug { recompile = 1; }; + class debugModule { recompile = 1; }; + class traceModule { recompile = 1; }; + }; + + class TaskPool { + file = "cse\cse_main\tasks\functions"; + class addTaskToPool_f { recompile = 1; }; + class removeTaskFromPool_f { recompile = 1; }; + class loopThroughPool_f { recompile = 1; }; + }; + + class Mutex { + file = "cse\cse_main\mutex\functions"; + class createMutex { recompile = 1; }; + class releaseMutex { recompile = 1; }; + class waitForSingleMutex { recompile = 1; }; + class waitForMultipleMutex { recompile = 1; }; + class lockMutex { recompile = 1; }; + }; + + class Variables { + file = "cse\cse_main\variables\functions"; + class defineVariable { recompile = 1; }; + class setVariable { recompile = 1; }; + class getVariable { recompile = 1; }; + class getAllSetVariables { recompile = 1; }; + class getVariableInfo { recompile = 1; }; + class getVariableDefault { recompile = 1; }; + }; + + class Messages { + file = "cse\cse_main\messages\functions"; + class sendHintTo { recompile = 1; }; + class sendMessageTo { recompile = 1; }; + class sendDisplayInformationTo { recompile = 1; }; + class sendDisplayMessageTo { recompile = 1; }; + }; + + class Anim { + file = "cse\cse_main\anim\functions"; + class broadcastAnim { recompile = 1; }; + class getDeathAnim { recompile = 1; }; + class switchAnim { recompile = 1; }; + class playMoveNow { recompile = 1; }; + class localAnim { recompile = 1; }; + }; + + class Arrays { + file = "cse\cse_main\arrays\functions"; + class insertionSort { recompile = 1; }; + class findIf { recompile = 1; }; + class findIn { recompile = 1; }; + class findAll { recompile = 1; }; + class uniqueElementsOnly { recompile = 1; }; + class foreachDo { recompile = 1; }; + class sortAlphabeticallyBy { recompile = 1; }; + }; + + class EquipmentLib { + file = "cse\cse_main\equipment\functions"; + class hasMagazine { recompile = 1; }; + class useMagazine { recompile = 1; }; + class findMagazine { recompile = 1; }; + class hasItem { recompile = 1; }; + class useItem { recompile = 1; }; + class findItem { recompile = 1; }; + class getNumberMagazinesIn { recompile = 1; }; + }; + + class Interaction { + file = "cse\cse_main\interaction\functions"; + class registerInteractingWith { recompile = 1; }; + class getInteractionTarget { recompile = 1; }; + class isRegisteredInteractingWith { recompile = 1; }; + class unregisterInteractingWith { recompile = 1; }; + class getAllMonitoredVariables { recompile = 1; }; + class registerVariableMonitor { recompile = 1; }; + class setOnUpdateVariableEH { recompile = 1; }; + class getOnUpdateVariableEH { recompile = 1; }; + class getRegisteredMonitorVariablesOwners { recompile = 1; }; + class getMonitoredVariableName { recompile = 1; }; + class getMonitoredVariableValue { recompile = 1; }; + class setMonitoredVariableValue { recompile = 1; }; + class broadcastMonitoredVariable { recompile = 1; }; + class setCanInteract { recompile = 1; }; + class getCanInteract { recompile = 1; }; + class canInteract { recompile = 1; }; + }; + class Misc { + file = "cse\cse_main\misc\functions"; + class resetAllDefaults_f { recompile = 1; }; + class broadcastSound3D_f { recompile = 1; }; + class getName { recompile = 1; }; + class setDead { recompile = 1; }; + class isAwake { recompile = 1; }; + class setProne { recompile = 1; }; + class isInBuilding { recompile = 1; }; + class disableKeyInput_f { recompile = 1; }; + class disableUserInput_f { recompile = 1; }; + class dropWeapon_f { recompile = 1; }; + class inWater_f { recompile = 1; }; + class setVolume_f { recompile = 1; }; + class lockVehicleOfUnitUntil { recompile = 1; }; + class closeAllDialogs_f { recompile = 1; }; + class disableAI_f { recompile = 1; }; + class moduleEnableBasicRevive { recompile = 1; }; + class switchToGroupSide_f { recompile = 1; }; + class hasItem_f { recompile = 1; }; + class getFirstObjectIntersection { recompile = 1; }; + class getFirstTerrainIntersection { recompile = 1; }; + class setHearingCapability { recompile = 1; }; + class revealObject_f { recompile = 1; }; + class getWeaponItems_f { recompile = 1; }; + }; + class Mods { + file = "cse\cse_main\mods\functions"; + class ALiVE_Bus_Mod { recompile = 1; }; + class isLoaded_ALiVE_Mod { recompile = 1; }; + class isModLoaded_f { recompile = 1; }; + }; + + + class Config { + file = "cse\cse_main\config\functions"; + class inheritsFrom; + }; + class Version { + file = "cse\cse_main\version\functions"; + class getVersion; + }; + }; +}; diff --git a/TO_MERGE/cse/main/CfgHints.h b/TO_MERGE/cse/main/CfgHints.h new file mode 100644 index 0000000000..23611db6cc --- /dev/null +++ b/TO_MERGE/cse/main/CfgHints.h @@ -0,0 +1,27 @@ +class CfgHints +{ + class Combat_Space_Enhancement + { + displayName = "Combat Space Enhancement"; + class Main + { + displayName = "Combat Space Enhancement"; + displayNameShort = "Combat Space Enhancement"; + description = "Combat Space Enhancement is a standalone modification for the game Arma III and is developed by the team behind Combat Medical System. All features from CSE are build on top of our in house developed framework, allowing for compatibility between various modules/features with ease by both our in house created modules and any third party made content."; + tip = ""; + arguments[] = {}; + image = ""; + noImage = true; + }; + class Credits + { + displayName = "Credits"; + displayNameShort = "Credits"; + description = "Glowbal, Project Lead & lead developer (Scripting, Graphics, Design) %2Kieran, Webmaster %2Rye, PR & Testing %1%1Contributions by:%2Aposky, Artist (Graphics & Models)%2Janus, Artist (Graphics & Models)%2DocScarle (Medical Knowledge)%2-FM- (Medical Knowledge)%2Carrot (Medical Knowledge)%2Ogirdor (Graphics)%2Beardmoresam (Medical Knowledge)%2Raptor 6 Actual (Medical Knowledge)%2Bovine3dom (Some script contributions & assistance with calculations)%2Donny (Models)%2Deadman (Graphics & Models)%1%1Additional:%2This project contains some free icons by http://icons8.com/%2ALIVE Team (ALiVE & CSE integration)%2LondonLad (Allowing use of dedicated server for testing)%2bodybag.p3d file and textures by Bohemia Interactive."; + tip = ""; + arguments[] = {}; + image = ""; + noImage = true; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/CfgVehicles.h b/TO_MERGE/cse/main/CfgVehicles.h new file mode 100644 index 0000000000..e717a10d4f --- /dev/null +++ b/TO_MERGE/cse/main/CfgVehicles.h @@ -0,0 +1,115 @@ +#include "CfgFactionClasses.h" + +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_enableLogging: Module_F { + scope = 2; + displayName = "Logging [CSE]"; + icon = "\cse\cse_main\data\cse_logging_icon.paa"; + category = "cseDebug"; + function = "cse_fnc_debugModule"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class logLevel { + displayName = "Enable Logging at"; + description = "The maximum level of logging"; + typeName = "STRING"; + class values { + class NONE {name="None"; value=4; default=1; }; + class INFO {name="Information"; value=3; }; + class DEBUG {name="Debug"; value=2; }; + class WARN {name="Warnings"; value=1; }; + class ERROR {name="Errors"; value=0; }; + }; + }; + class logDisplayLevel { + displayName = "Show in chat"; + description = "The maximum level of log messages to be shown in chat"; + typeName = "STRING"; + class values { + class NONE {name="None"; value=4; default=1; }; + class INFO {name="Information"; value=3; }; + class DEBUG {name="Debug"; value=2; }; + class WARN {name="Warnings"; value=1; }; + class ERROR {name="Errors"; value=0; }; + }; + }; + }; + class ModuleDescription { + description = "Lets you modify the logging settings within CSE."; // Short description, will be formatted as structured text + sync[] = {}; + }; + }; + class cse_traceValuesObject: Module_F { + + scope = 2; + displayName = "Trace variables [CSE]"; + icon = "\cse\cse_main\data\cse_debug_icon.paa"; + category = "cseDebug"; + function = "cse_fnc_traceModule"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 1; + class Arguments { + class enableFor { + displayName = "Trace player variables"; + description = "Whatever or not a debug message will be printed when a value for a player changes"; + typeName = "STRING"; + class values { + class DISABLED {name="Disable"; value=0; default=1; }; + class ENABLE {name="Enable"; value=1; }; + }; + }; + }; + class ModuleDescription { + description = "Trace variables of given object"; // Short description, will be formatted as structured text + sync[] = {}; + }; + }; + + + class cse_basicRevive: Module_F { + scope = 2; + displayName = "Basic Revive [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class enableFor { + displayName = "Enable for"; + description = "Should the basic revive be enabled for players, AI or both?"; + typeName = "NUMBER"; + class values { + class disable {name="Disable"; value=0; default=1; }; + class playersOnly {name="Players only"; value=1; }; + class playersAndAI { name="Players and AI"; value = 2; }; + }; + }; + class timer { + displayName = "Timer"; + description = "How long can a unit spend in unconscious mode (In seconds)"; + typeName = "NUMBER"; + defaultValue = 600; + }; + class amountOf { + displayName = "Hits while unconscious"; + description = "number of times a unit can be hit/killed before being force killed. -1 is disabled."; + typeName = "NUMBER"; + defaultValue = -1; + }; + }; + class ModuleDescription { + description = "Enables the basic revive script for all damage done through CSE.
Any unit that is killed, will be put in an unconscious state until their timer runs out."; + sync[] = {}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/Combat_Space_Enhancement.h b/TO_MERGE/cse/main/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..9046550f26 --- /dev/null +++ b/TO_MERGE/cse/main/Combat_Space_Enhancement.h @@ -0,0 +1,60 @@ +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement +{ + class EventHandlers { + class PostInit_EventHandlers { + class cse_main { + init = " call compile preprocessFile 'cse\cse_main\init.sqf';"; + }; + }; + }; + class cfgModules { + class cse_main { + init = ""; + name = "Main"; + class EventHandlers { + class CAManBase { + respawn = "_this call cse_fnc_resetAllDefaults_F;"; + }; + }; + + class Configurations { + class ActionAcceptRequest_f { + type = ACTION_KEYBINDING; + title = $STR_CSE_ACTION_ACCEPT_REQUEST_KEY_TITLE; + description = $STR_CSE_ACTION_ACCEPT_REQUEST_KEY_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "if (!isnil 'CSE_RECIEVE_REQUEST_ID_KEY_BINDING') then {[player,CSE_RECIEVE_REQUEST_ID_KEY_BINDING, true] call cse_fnc_onAnswerRequest;};"; + }; + class ActionDeclineRequest_f { + type = ACTION_KEYBINDING; + title = $STR_CSE_ACTION_DECLINE_REQUEST_KEY_TITLE; + description = $STR_CSE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "if (!isnil 'CSE_RECIEVE_REQUEST_ID_KEY_BINDING') then {[player,CSE_RECIEVE_REQUEST_ID_KEY_BINDING, false] call cse_fnc_onAnswerRequest;};"; + }; + }; + }; + + class cse_basicRevive { + init = "_this call cse_fnc_moduleEnableBasicRevive;"; + name = "Basic Revive"; + }; + + class cse_basic_revive : cse_basicRevive { + init = "_this call cse_fnc_moduleEnableBasicRevive; ['Incorrect basic revive classname. Please change cse_basic_revive to cse_basicRevive in your enabledModules_sample.hpp file.'] call BIS_fnc_error; "; + }; + }; + class CustomEventHandlers { + class variableDefined {}; // [_name,_value,_defaultGlobal,_catagory,_code, _persistent] + class AddedTotaskPool {}; // [_args, _code] + class killed {}; // [unit, bool] + class setVolume {}; // [bool] + class disableKeyInput {}; // [bool] + class switchToGroupSide {}; // [unit, bool, id (String), side] + class resetToDefaults {}; // [unit] + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf new file mode 100644 index 0000000000..82a9535799 --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf @@ -0,0 +1,21 @@ +/** + * fn_broadcastAnim.sqf + * @Descr: Broadcast an animation across the network using switchMove + * @Author: Glowbal + * + * @Arguments: [unit OBJECt, animation STRING] + * @Return: void + * @PublicAPI: true + */ + + +private ["_unit","_anim","_persistent"]; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_anim = [_this, 1, "",[""]] call BIS_fnc_Param; + + if (count _this >2) then { + _persistent = [_this, 2, false, [false]] call BIS_fnc_Param; + [[_unit,_anim], "cse_fnc_switchAnim", true, _persistent] spawn BIS_fnc_MP; + } else { + [[_unit,_anim], "cse_fnc_switchAnim", true, false] spawn BIS_fnc_MP; + }; diff --git a/TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf new file mode 100644 index 0000000000..2722e16ffb --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf @@ -0,0 +1,33 @@ +/** + * fn_getDeathAnim.sqf + * @Descr: Get the death animation for the unit at current time + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: STRING animation + * @PublicAPI: true + */ + + +private ["_unit", "_curAnim", "_animation", "_cfg","_unitAnimation", "_animationState"]; +_unit = _this select 0; +_animation = ""; +_animationState = (animationState _unit); +_unitAnimation = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); +if (isText (_unitAnimation >> "actions")) then { + if ((vehicle _unit) != _unit) then { + _cfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); + if (isArray (_cfg >> "interpolateTo")) then { + _animation = getArray (_cfg >> "interpolateTo") select 0; + }; + } else { + _cfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimation >> "actions")) >> "die"); + if (isText _cfg) then { + _animation = getText _cfg; + }; + }; +}; +if (isnil "_animation") then { + _animation = ""; +}; +_animation \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf new file mode 100644 index 0000000000..919a7176c6 --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf @@ -0,0 +1,24 @@ +/** + * fn_localAnim.sqf + * @Descr: Play an animation on a local machine using playMoveNow + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, animation STRING] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit","_anim","_persistent"]; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_anim = [_this, 1, "",[""]] call BIS_fnc_Param; + +if (!local _unit) then { + if (count _this >2) then { + _persistent = [_this, 2, false, [false]] call BIS_fnc_Param; + [[_unit,_anim], "cse_fnc_playMoveNow", _unit, _persistent] spawn BIS_fnc_MP; + } else { + [[_unit,_anim], "cse_fnc_playMoveNow", _unit, false] spawn BIS_fnc_MP; + }; +} else { + [_unit,_anim] call cse_fnc_playMoveNow; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf b/TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf new file mode 100644 index 0000000000..03ffda17fb --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf @@ -0,0 +1,14 @@ +/** + * fn_playMoveNow.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_anim"]; +_unit = [_this,0,objNull,[objNull]] call BIS_fnc_Param; +_anim = [_this,1,"",[""]] call BIS_fnc_Param; +_unit playMoveNow _anim; \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf new file mode 100644 index 0000000000..73a0260ef6 --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf @@ -0,0 +1,15 @@ +/** + * fn_switchAnim.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_anim"]; +_unit = [_this,0,objNull,[objNull]] call BIS_fnc_Param; +_anim = [_this,1,"",[""]] call BIS_fnc_Param; +_unit switchMove _anim; +_unit playMove _anim; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf b/TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf new file mode 100644 index 0000000000..9a2255f45b --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf @@ -0,0 +1,22 @@ +/** + * fn_findAll.sqf + * @Descr: Find all elements for which the code returns true + * @Author: Glowbal + * + * @Arguments: [array ARRAY, if CODE (Code called for each element. Should return a bool)] + * @Return: ARRAY Array with elements for which the if code returned true. + * @PublicAPI: true + */ + +private ["_array", "_if", "_return"]; +_array = _this select 0; +_if = _this select 1; + +_return = []; +{ + if (_x call _if) then { + _return pushback _x; + }; +}foreach _array; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf b/TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf new file mode 100644 index 0000000000..9fe7c57869 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf @@ -0,0 +1,22 @@ +/** + * fn_findIf.sqf + * @Descr: Get the first element that returns true. + * @Author: Glowbal + * + * @Arguments: [array ARRAY, if CODE (Code called for each element. Should return a bool)] + * @Return: ANY. Any element. Default return is an empty array ([]) + * @PublicAPI: true + */ + +private ["_array", "_if"]; +_array = _this select 0; +_if = _this select 1; + +_return = []; +{ + if (_x call _if) exitwith { + _return = _array select _foreachIndex; + }; +}foreach _array; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf b/TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf new file mode 100644 index 0000000000..d8001d03c2 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf @@ -0,0 +1,22 @@ +/** + * fn_findIn.sqf + * @Descr: Get the index of the first element that is equal to compare value + * @Author: Glowbal + * + * @Arguments: [array ARRAY, value ANY (The compared value)] + * @Return: NUMBER (-1 is not found. Else index of element in array) + * @PublicAPI: true + */ + +private ["_array", "_value", "_return"]; +_array = _this select 0; +_value = _this select 1; + +_return = -1; +{ + if (_x isEqualTo _value) exitwith { + _return = _foreachIndex; + }; +}foreach _array; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf b/TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf new file mode 100644 index 0000000000..1c18a746eb --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf @@ -0,0 +1,21 @@ +/** + * fn_foreachDo.sqf + * @Descr: Execute code for each element in an array and collect the return values. + * @Author: Glowbal + * + * @Arguments: [array ARRAY, do CODE (Code executed for each element)] + * @Return: ARRAY Array with return values. + * @PublicAPI: true + */ + +private ["_array", "_do", "_return"]; +_array = _this select 0; +_do = _this select 1; + +_return = []; +{ + _return pushback(_x call _do); + false; +}count _array; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf b/TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf new file mode 100644 index 0000000000..5653256621 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf @@ -0,0 +1,32 @@ +/** + * fn_insertionSort.sqf + * @Descr: Sorts an array of numbers + * @Author: Ruthberg + * + * @Arguments: [array ARRAY, (optional) ascending BOOL] + * @Return: sortedArray ARRAY + * @PublicAPI: true + */ + +private ["_list", "_ascending", "_tmp", "_i", "_j"]; +_list = +(_this select 0); +_ascending = true; +if (count _this > 1) then { + _ascending = _this select 1; +}; + +for "_i" from 1 to (count _list) - 1 do { + _tmp = _list select _i; + _j = _i; + while {_j >= 1 && {_tmp < _list select (_j - 1)}} do { + _list set [_j, _list select (_j - 1)]; + _j = _j - 1; + }; + _list set[_j, _tmp]; +}; + +if (!_ascending) then { + reverse _list; +}; + +_list \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf b/TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf new file mode 100644 index 0000000000..91f4c837e5 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf @@ -0,0 +1,42 @@ +/** + * fn_sortAlphabeticallyBy.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_array", "_elements", "_elementN", "_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; +_array = _this select 0; +_elementN = _this select 1; + +_indexes = []; +_elements = []; + +{ + _theElement = toArray (_x select _elementN); + _indexes pushback _foreachIndex; + _elements pushback _theElement; +}foreach _array; + +for "_i" from 1 to (count _elements) - 1 do { + _tmp = _elements select _i; + _tempIndex = _indexes select _i; + _j = _i; + while {_j >= 1 && {_tmp < _elements select (_j - 1)}} do { + _elements set [_j, _elements select (_j - 1)]; + _indexes set [_j, _indexes select (_j - 1)]; + _j = _j - 1; + }; + _elements set[_j, _tmp]; + _indexes set [_j, _tempIndex]; +}; + +_returnArray = []; +{ + _returnArray pushback (_array select _x); +}foreach _indexes; + +_returnArray; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf b/TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf new file mode 100644 index 0000000000..3bf40595e6 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf @@ -0,0 +1,22 @@ +/** + * fn_uniqueElementsOnly.sqf + * @Descr: Make a copy of an array with only the unique elements. + * @Author: Glowbal + * + * @Arguments: [array ARRAY] + * @Return: ARRAY Copy of original array + * @PublicAPI: true + */ + +private ["_array", "_result", "_value"]; +_array = _this select 0; + +_result = []; +{ + _value = _x; + if ({_x isEqualTo _value} count _result == 0) then { + _result pushback _x; + }; +}foreach _array; + +_result; \ No newline at end of file diff --git a/TO_MERGE/cse/main/config.cpp b/TO_MERGE/cse/main/config.cpp new file mode 100644 index 0000000000..3620b37e7a --- /dev/null +++ b/TO_MERGE/cse/main/config.cpp @@ -0,0 +1,33 @@ +class CfgPatches +{ + class cse_main + { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"A3_Modules_F", "cse_f_eh"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; +class CfgAddons { + class PreloadAddons { + class cse_main { + list[] = {"cse_main"}; + }; + }; +}; +class CfgUnitInsignia { + class CSE { + displayName = "Combat Space Enhancement"; // Name displayed in Arsenal + author = "Combat Space Enhancement"; // Author displayed in Arsenal + texture = "\cse\cse_main\data\cse_insignia.paa"; // Image path + textureVehicle = ""; // Does nothing currently, reserved for future use + }; +}; + +#include "Combat_Space_Enhancement.h" +#include "CfgVehicles.h" +#include "CfgFunctions.h" +#include "CfgHints.h" \ No newline at end of file diff --git a/TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf b/TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf new file mode 100644 index 0000000000..e0c942c40d --- /dev/null +++ b/TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf @@ -0,0 +1,24 @@ +/** + * fn_inheritsFrom.sqf + * @Descr: Checks whether a given configuration name appears in the inheritance tree of a specific configuration entry. + * @Author: Ruthberg + * + * @Arguments: [configEntry CONFIG, configname STRING] + * @Return: BOOL + * @PublicAPI: true + */ + + private ["_configEntry","_configMatch", "_match"]; +_configEntry = _this select 0; +_configMatch = _this select 1; + +if (configName _configEntry == _configMatch) exitWith { true }; +if (configName _configEntry == ",") exitWith { false }; + +_match = false; +while {configName _configEntry != ""} do { + if (configName _configEntry == _configMatch) exitWith { _match = true }; + _configEntry = inheritsFrom(_configEntry); +}; + +_match \ No newline at end of file diff --git a/TO_MERGE/cse/main/data/cse_aim_module.paa b/TO_MERGE/cse/main/data/cse_aim_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..0bd682d3d2065c48d489eb2ec7e284ac1d70f948 GIT binary patch literal 5625 zcmeHLeQXow8GjFa1=gf7kSil@NCK8<86Rya)+$(i?nXWoNH438L8onm6iQWMSDh4T z)6&3TM2HDPv{EsMGL0cB@dr+u9olG>6xu8cRoT+fC4_~KhJ*#OIJiq}Ve{_yymyy? znP3qWf9;ih_V3>JeZJr4dG2IhP~h`_yI_^i!5AAJ9$q2vYTru29D{IyZ$&;~317l5 z=I6hl;{RrRYn+Vj%4F;>g@K<5x%d!PF&?lu_swp~ zHlw1;DC;5lbzPB4`i+XMr^tQ4@R}#Gy{@Y%*+sZi)3kf(?}>Oed542y|8iNDL2qS8 z^{`0~))D-|$!3$E|AE_!v!dEDiFsL8bk{o|7Y}}E(UVFpR!0OgT!?}D zqOr0oBQc4PuBmkED;=O;Hm5Rhljtk5Bz5=4iG2=Th|#=89{ud?bRjQOHNTq`*1C&o z-8Adhb^U&YakHY`Ha!LO795KQZyEuY;4aBZcR!DE9wKpsJnoC(?2b_KGr?aQ|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pk_@v(^b literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_ballistics_module.paa b/TO_MERGE/cse/main/data/cse_ballistics_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..4be1f5869fee8f463ae393112c248795ff44399b GIT binary patch literal 5625 zcmd^DeQZUp?qbE$z4GC4W<5W_X4m53<}#AT&Fa3L1p zi+GdEwLygce)tAVgtQhB@{*a558?auhDbz0Ktgh$LjM2Tyiy{V@Ppa}7;u?ogAZa6 z#fw+Y4dQzTHHPRGi%HRhT*hl2baK4g*NOFsK>xKr($Yj)GP6PS1#SPvm z-b`2Gz5OJnrf9iSu)n z9Onk)dW&553C@?yW@E+WcnE1Y81Goq^_#73W*_+L(a-;;c=10V-mX@K>$~;cd9b+P zVp4y}6R=r27eTx=dnmbe@9gq@PcS4H%@vpFgcFG{&=&A#e)ve^AR@`*Nrjlx_4Za@ zo%BZfd~Cg8xdlst#zIX|7Ej<6GuO8W;-jDcb@5^<*B*53yp!8QPivcm$;puIH(RG5=D1L{0M>al-kjpe$w&OH$_7K)LP5(^t z^z`*zeLmXYy@s;|!Dw`}QPoNlP7ufZ(evwZPc+_7S&D1?xfS4ippnHF%6GU-qC!F<3gyn_VQmsJ-IRa=Tw06vX|wr z(O@w2B-kHDvg2Vs*{m)+TyN2&i$#{iXi!l?OdIaJA6|8;y}`z0{elBJIe>w! zuO8Zx#26L2qh&Z7&R0I2oriGzNc=`p`Zqow((?570tL_C zF>=#qXa2y}8~PJcjrP)*6@PJVZXmEI%=<5oC&NCyyll+%+6P8`pUZVDzEDri&~Hpo z8ba|*{_?KQ#v!NbM1=8JlG=~h4@+6~(g-)WTsB*eVMZ3+BT059Z@+=bhX#9Pms~qO z8e-bf--}~$_)neqgLCZzPIdT*){nt?mD11U@+;?`4)go^>ym*J5RdJ!Ux6aP{`deT z1tI>Lesjn76ej|pi@>t(D)b-uc)Vf%LC8H7(7!aR8kXD|c0kG?9s0%fQRu(6LHmK& z3_WLuD+B-rr~`SL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hhpt&TADeBQ0ft4mid-y_s; kOR{(C%hS_FKO@}0T&m_mMTNNEcygwyN4C!xyrGQ!7vD&{vj6}9 literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_debug_icon.paa b/TO_MERGE/cse/main/data/cse_debug_icon.paa new file mode 100644 index 0000000000000000000000000000000000000000..e5cbceeebbc2bc2fc65867cf3b8463f9b8cb7aa1 GIT binary patch literal 5625 zcmcgweNa@_6~9mR2?hv@?9xny3_8ZiPMu`jM^Zr~;6wKjs<91Vw3*1RGwt|K zrHj$ZI1^p9v8kiZwoM%CG&3&E`m{5hf}exh28v(c`o%}UfX1Z=?vDGsJ?FmnfUc=b zCZl)u>$mrw&wI|f=RTem6y!PIC@9M_5kiKBhL$m0o>z>R!a!V*_hvp~4&I2D<>xOE z;dd>(>&%2~w-B;hAmkdnzugdtNCZcHAroGRMHtUmo$oAe(q^SP zs8n>L{<17^C4EZurt`RcfO$gfp)LD^4Qdc^sU%6`*>4Zo*E)vXjD8`{^T4mT%`>d= zlL%q*{A!~n&-u*#MM>eV&3{|RG5G>VN;;a*ST@j^)&ux+@C44o5Q{<$YMZ~B*)K^> zId0ygdyU{Soagdnz_j|5jzz#lp<#EgQo-hVUXZPS26hqmeVrdy(%}g)Veo+hvOARG zU`jL|k^B_g0sJebuXjB{{sPZ)H~Jzd-i9A2e^!7FUidhf=}Sb(nN1e$$}ZfMjk8W! zmT}G4Ve18B?W@0J`pO)~@b{wy8Xmh+`<+b+cNqKx;Fo(e;(nyKtV}w`3pe`cAf;YZ zhv}2u;m>IEsuvJBB}sgovxrM-cd;?y!$B*ZGq^&;3N3#PS#IP5Dfz zjw|a_*?OMia#nzS{tV_1S(c=X)4*?7pBFeT@p@D9Sbp?6nSdJMfB2pFwZFLStLPd{ ze<%(RZ`p;vGco?MAfUX)#Q_h)c|b>|?uaYgxr$MPKZ?5PfCHJqKz?9PafQkP^>sUXaYiZ0+ zMSh+T)C{J%7%OikJ(O{EE(7&?XtDP6l$J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aak1hTz3PWMnd@W z{Uzm9j2^Cv@|1{j@RhH$uz`nj^0Mg0|2a((NCHdWW3>roeXq|&wwS#+S2iVok^1in z#MpDs=!}b7{DX=rO%0BJ@${h?!mZbs8$c1s1ThBw+>)O4M(s!6d)crSEhgl@7Lx*% literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_earmuffs_module.paa b/TO_MERGE/cse/main/data/cse_earmuffs_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..d0d571112c24c2f58b447914b90048661b8fbd0e GIT binary patch literal 5625 zcmeHLeQZgORNi;eufDbK4NIkl=tHr3G4&Y*Zb@u2wA- zsyruvnpG;8u(gx{^4LUKHB}2s`WRZPqy-`vXkoC@B!M86b8~oj^#^{=HP?$ zs-;U;i157@KJ{ioc4iaura;Ig`21@_BqAZe;QPo>QnS8)!_+A^aNs80TS#C6N}j zqp_Ol?{vDPl==4tTES#E&p9NZY4r)67J)8_40*zG1)Jx2L9+Z7*u_1!b$(n~k1xW6 z!2<>4_sFHeOeGB|>3?7j;9rqf15OzEqGj?I zhSka97xhhKxWL2WAQ*EO8nQ_#(`nuuM!m-|-3On|`v}Pn7`32RN`n=&vgcHhquz z2l#&y{#m`YN{em}aCfQrHVx3&fXeg%7Ej!4_QH9#BMs?8908SmP4o{-Jl;-EY4~9Q zSAHX)cGwk$AGRm$PvmFYdv6r}!e+Y?^sAjHUjzV&>$B#|6>H@e7UR4CV`V5Fpz$n- ze@z3+Pnt4<+jg`e1?C@9{;bP2?&y%4`5(ve{Iq_bn&yiX8T=CEC(_HB+dQ;P#!b<- z0R`!7o^UkOH4fM=H}FrXJu>P%9ywbIElE6A7nQ5_<;Q6EmuOEo^By`lEIqma+uh4u@eIQWH-iG7*3j_t9$%_y_koJUXZKUaJp8)+=} zTjDqURK@i(!W(u?n@dkHM01V((=XI*S!jKW@i)WN%7pyNR*!h3F0;A&AcT>>u79+J z#;pdw5lip;bCIGJ&yGK;;;COt#YxvX)Tin{!iacg?0w}8;!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Vb%+-KwA^DI7^5e?63oku`H1>S6 v{e@d=H*R1s0T%zQ;M6JR&z3MV04}EqGAh`!+S2)$JLRnc%5HOLdK~`*d7Z~% literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_explosive_module.paa b/TO_MERGE/cse/main/data/cse_explosive_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..583793277626ad99a900004c066af47c031cb42c GIT binary patch literal 5625 zcmd^Ddr(x@89!I|idv8rc8$6r3lTNN`iPosjM2R$6{JMHG<$s{6XR+v@xg9uXKdOD zT~SklHreRJiHtg1+i^_W7}vVJrZp`ni6v?!qfuTCiYOquvbcb|vX|5EJ9ii8G85w1 z@t>Z7h2Ng@JLm#3MT>6RBW7pH3oA?@w$ix^&-z5p?Wg*Y?)r3}Oz{33oiBV&;O z|8IidLMO8c#VO!C*Q;x~!IkK?69F1iQooP6L|N2kjJ}e>ISE5w8^O*gj zXpsib=x!|qm*GB_E&--_pNFvkINR50Z<4KSpXc?G;Ui!dw6}-(aSQ7mJ|+x4P(W(E zyr4Ed6oW_-1^nuNx`4lR+(uhB^4IemSJx6m@kabWL1`Z9zwluk)0YUMC6&zInVPjT z6?ZL?Bt-`8nJ@A`+ENJhRZ3ZTt~bB(}96soIragBa37h(13MrsT2r2WRd0G13$8 zNA`8vW)3Tiv|vwM?UDQ{W{<@p4#Y3V+i7b$WoP#d*UcG%)bDcmm_LD5h`!&%Q)e!_ zy3qfy2?vJnh5I}b&d;3w`T2Oooz_sG$cQSUF5@p9R!U1k6^#B{)W1b6esUx6LyX7e z{a@3zN~FggUU1f8*Q!ZG{^BvI?PH*wefa@{;@B?9|Z~&3CK^2D6DFF^Rr52Z@5AdGQl_J zAO8vzycIb=`2)<4ym9Qjr00kD@=(osKc9zsbZu-GaP6B{zl_rv(y);pe)7J^Rd}rd|^K05AoSAKQ&%?<#9Qe zy7sh-aF~stHukso4e;YW?njFYFN6aJ8@IoXI~9l9nmNKPUH4DWv}HW)A4SpGu$;7fzF%|*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4D&~FQ#2l3>^2Gg1bx$Yohu$Iut=aRno zq_ZbhjK0LBo-7|rX7ugcD{J2^i~D#klLupPVwaq|N6t<`3{x`M-VCn=4yuo3AYK%x z3C8HvOdojc*DtDHLPyifMn(^X)JNWU?xR_|!fle1OriDf-4Jc;JcyHi*Wn1nnAeA~ zAWgcf**5-95e#nzt~sYP)j3O4ejIt>GWho|YFUA)zNbwj12gp5liqT>BCj;C^U(H| zU3Dwfj;~<{{2>rBvK;Q$t$ctOyIcZd`9!0N_2iYSvbFVe?_DA7jF#+F0MDvTrT6`7A zk)m}?%`!X>FB}kq8^p1JjK+(1 zZnH4txb*b#=j3Id#txTpUk4IMOBZ+?ln0Spl}kdt8T*0CvNKT8}nJ)$ib0P8;y(e@Dl literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_groups_module.paa b/TO_MERGE/cse/main/data/cse_groups_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..067eb7ef0c0d933415a9bde5dbb97edfbebdffe4 GIT binary patch literal 5625 zcmd5=e^38`Jz@7rC0 z)5#J}o(nwdOJQx{I+h_}tx4n8Fx1+~dKSltX`91)nsd`YafBAjdK46(KPvVsW@u(RmT%)S$WcGU!p69)z0YP6T%QE;? z#hOMfekx-^UfArgl7xJh#HxFbk+EWsGu?;i>&TyI9z&^2M9o;Z zUf8dyK5hE)8^axN8O=+j8ZfW_vyBzt%EV}3K(7_^vh32_zXiKg;EK&ps_tz{2w`}T zfZ|@gDxPiJM@ah&+yVZzMGgKN#NQ>$QqN$D#23(mr6RI}T6VjUYEdLLSL4i+GKA(CiZOQNQj;Op|{}o#oepre!UY_%8$n>bv#J zLswez<8RsZz~|HEROxkYJO5n>@cqBR!sM{w(B}^lB}aZ+zs!lWZ;adZ#0UCxebz)e z1H8dMOsgf-Pfr^+3wX*)SV>=e8{Cmdp5!9MEqPg$FutWx_#5Wm67S2oUjOU$FNu8D zu;GP&_gsT8494i-R^yBJ_t}`_Ki;RKcwZIslnp=c)$5B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V1N7|(O zkmk6C2Gvdxz$;3H@Ib8au*Y!2ZWKPW z?zPk-n-d(@$)yI~vYXf>7ltob$cdt;YQkWS6g9VcuGAh{fv1y^(5;7-8QhKeG J$l(QR{{rXMxHbR) literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_medical_module.paa b/TO_MERGE/cse/main/data/cse_medical_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..9cb6c4782deae77909fe9d0f1dc4fdd11dfec8ed GIT binary patch literal 5625 zcmeHLe{5Sv9lzK5u@+L|rhA$?t4i8hsuWhHw#-ri;mcT?L|NMx_TIJ*2}n0Uh{Z-i zsz4~SvsLq|O*o4fQ_wmKrmB;sK?>nbz#n!gR8fYMDFc+$RcN{_sZydkcndM{%kA^M zdrmSZOB%t-{@BUCK7M!KpLd`8-sz&gzRvn`{rz=5#@OuaY>UJX)*T`&&Hm&3#I#OS^n^F3#n;tL08aq$??t7ZluWRh^NG~}n8wE3Pntta0NYBxDQ!ece zcDG9ZP1Ca1@0+`xLCEO2R%Zi?)<1ce12^TSqvKACe6H(;9e5ey3ek5wdD`KTSWYU# z2Pp`SIES*8#ajs3Ca1strw#I3b{>z+k$gkfwBd;YsjsFFQdHX`@^3!BN!rV}X$4tB zXRxs|NKY->wkck0V~3pYHu4F)j>buQ>3bO*k8}lW|8aqnz49MI4S|K{;L;_N~ zrW?Z(A}>Ue%#rp4N4mESCfzrsesk^XsUqRD2AqfAlJ*&f-ZVOslEOXtY$Eo~r>ae9 zKlw|(tkeWK@A(h+b!DX@I2yMEGdS=05BJTLWXtjFwvP3U&psmMARbMlVk+zzOwZxZ zrtI0aLFtcWttzj1ayl}8Au98YbZdcv$fsgC8Bd7g<@qHYE42^X|MK|}C=~idud*L@ zY0Z-T5p+xm`aJ+ z8}~miQlhxPClyVvwGCnlQ8X+B;3MyULnv|$OPK8S{LiOFq54MizrPFXX9m*;jb_P# z9yp(N&l57SfTaH(ziS%tJDP{70$3J%{6`iksf*^j9IyzJJdgi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n&H=UmZ{uo-BBkm#h8zqJ}@dq-Tp$&xfAzp NsDiuFe)55__W*bWJKg{Q literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_nvg_module.paa b/TO_MERGE/cse/main/data/cse_nvg_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..3d0a8bc050a459af87999b69d90b17d4fabe0e2e GIT binary patch literal 5625 zcmc&&4Nz3q6~0e+_!ERxc>e8BAd(twt&=#}sZA#PFp-~9$fMb3FqxQuZA>QF-OlJZ z?PSPeqTM=avTEB&8H3wtb!?}d$(roEq?61nsVPITQO7g}T%te_2nJkSL|(Fw+jH)H zPY4KGCyu?t?()5R?)kgtoO|vQX>oC(>w)5pg{g!PUDvA^t|}}?Okp4{F8omuVgWvg zA1*3-NQVFG;N!Ou@@h6Azmo`QhtG`-naG3yhg&=-5p4KJDHsIvC7Jz>nBzI;h?lM3Ac`XJ zD{u9UaDLz&CNE?(a(S*>?k`G8_wV}q&jco46i7v9GaAbVI@5j_|Be3x=V8cYv53(c zax?oC#igdK9lO*BF2i}DPz6lgADCDMToxPg_G;B^UKAzO{%2sPdxuSaLPe)9#)QEa z3MlB*%A=Wy*@#p{#z!}G0RQUcJ3M2^UlIl3T)&RubMXrWtqRllN3YFi`Vv`j6_Aqs z1*Q87aMq=&>Ni!UfRygF_({NT_1n64O!L^8bU~EP_0u?|0aS1ANNzn0}UglG1)k)l^=BFMO1Z$B+5KyY3A-i64b z)Ym=Te6sZbcO3evBfmb~fgww^b}X^j~LB z`{((&BePImw#}wIfz?+ZpHHUmT21uxOn1(L@3 z2$EXW0sIZ`wDEH1hftsB&?lxGxg-q6k9b+V6`_Ewt7r4)feW(-b)0Eb4)k~v*YZaY z?SJ$oa_LuWwG0cP-h8bdeg8v84b%hX4>+z>+aQf3(!7sxX@W#gp)~CG_!AmMO!6$8 zH5$xm4X`kVpiXG|bOO z2AsyRK&@H7z`sdGy5Hfs*XlncNv%N7Pl$KYE5?LKtQh6F{)c`et$(v8#nM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2FZ1e#IJ(g4g5mo{oC z-wQm*+zf}2vb6DN!-5}s4lp-BByK`_c;R5WK^Z0MmaVGHszQu!_liz9p6>1A2H|aR zY5SWEZ9ce=z&yHf+30OwoY?ICCt_JHEPQx4qifz~H|wr&efH;=HRJ4M*el+^42pM$QISUbMNj~PHm6<0WoINm*kG^2UiB)<7x?F#@=7d fdvM<4tjPpJlvJpw;Lk($XCC-lYQ1CPh7$5$f|{=e literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/data/cse_rifle_module.paa b/TO_MERGE/cse/main/data/cse_rifle_module.paa new file mode 100644 index 0000000000000000000000000000000000000000..f3867137367eeb8ff88a187941586b8b6370f7de GIT binary patch literal 5625 zcmds5e^3O zu}9TXpXwMw`4vUr3dhva>dW~0fQGkb^&fBWdBZ-WizG=}N`I^0ddN2IV*9gso(H^w zu8L_553IxZHHBL>e)2uH7bSTokN)W}$N2LcDI91=W!XSunj7(U@&eAo5cB=sa92|) z(_fNgC345i%~miO&U1DJXj=N7PK!Y2`=?zas)Nn*yr7uh1h}AUO2^|02P*uG8C;No zWk4uWCWV*1GPk^&cvPdi82T*mZsI_atKGkXG@_#v@1tjT+wyv84%)8C5At$F}74 zN%sB{dcZ#h>P{nt-mvAF&-+L8ZmaVKgfPzQ`cHakFxA*^$hp}6UG)$@0dOA}xF)*= zl=p^NzLWloe7ca&sy}wc&+K(pYv_dEa?QQ5=csNUlca1M?!Wd)j`I^X5BcY1l6S%K z$Pt!r5@bnExOLezv)A<-V_vy6;0I;jHRMfdv8E2acP5PU*f{R0hx|n+J~rkT%CnFz z8XtCrX5)wB&A+P%rPABX8X_!)d;|4OlLz8)+3~QD-$HuLmFN|NrW8=2)MR&QLzm_goaWz)wLq`7r z3<`$;XkL7h5#G;v{ke!P{}1|&h4xsI9wVziy>bTfE9*~45z0#^Q}K#><7#R)`HcQc zmY3a+SUQJY{{WLC8st;#Hzp{g2m^m>OH+BbEo?LFk$#u`L-V(jQHT%zCSg53=$@#HoTy|mQ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0Q#v|TzUchN6u#gQ?}eyiTXZ+QBjPQ&-Vm?3ehCN>eKmO=$+dii0nUVIakS!19 z-gJ9!v_Ee){{mLP7(HRIMghKPKWs=ufjxhR&yCuD5Cv71H9zh4pIQBc-DYHDG(X+i zIMBKixyYEN<>rd{ohI&vG=C-wQ~aF#o%pu6QG3VcJ@?RhO7n+5F?m^smDWfsA8TH? zlGYGCgTkP>Fk7{8F2bH$n=a=8H^--7f8{1z` z^Y5Oscr5UebuAS@w%o3NMks~+Bmp7Y~;TA$wKrTpo=f*vzXpH+{;^ec5JE-)T9 z5wwk7!yg$6b`!>}gx$+qYCUd4NiRJXkWlItTvX;y@!W8 z&B3O>fr9u^8Ox(*7M-Ec)9~t0Ff&yq)wDAC@A&7^qd6#bXeoO1UxK8>W z>BZ9^>vn}*&>wsPx0$BQQ$$CgYs=%C&wqIFaE~=#RW~Km!UAqm;;$U2dcazboYcRV zFkV`7Zi^LWz?+gSSDhw{*dj`wcUk|ki;q+;CAKI&?CT%x&U$}U-WI}|n!&zya{j#K oU#YDVYUD~XdpY=Jz1VAKfvRPoqQajqxVE2oZOwD;^bKX~pNvj5Y5)KL literal 0 HcmV?d00001 diff --git a/TO_MERGE/cse/main/debug/Debug.h b/TO_MERGE/cse/main/debug/Debug.h new file mode 100644 index 0000000000..16095b6db1 --- /dev/null +++ b/TO_MERGE/cse/main/debug/Debug.h @@ -0,0 +1,9 @@ +// debug constants + +#define ERROR 0 +#define WARN 1 +#define DEBUG 2 +#define INFO 3 +#define NONE 4 + +#define DEFAULTLOGLEVEL INFO diff --git a/TO_MERGE/cse/main/debug/functions/fn_debug.sqf b/TO_MERGE/cse/main/debug/functions/fn_debug.sqf new file mode 100644 index 0000000000..3c87285e10 --- /dev/null +++ b/TO_MERGE/cse/main/debug/functions/fn_debug.sqf @@ -0,0 +1,66 @@ +/** + * fn_debug.sqf + * @Descr: Print logging messages through the CSE framework. + * @Author: Glowbal + * + * @Arguments: [message ANY, level NUMBER (Optional)] + * @Return: BOOL True if message has been printed + * @PublicAPI: true + */ + +#define ERROR 0 +#define WARN 1 +#define DEBUG 2 +#define INFO 3 +#define NONE 4 + +#define DEFAULTLOGLEVEL NONE +#define DEFAULTTEXTDISPLAY WARN + +private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"]; +_msg = _this select 0; +_level = _this select 1; + +if (isNil "CSE_LOGLEVEL") then { + _defaultLoglevel = DEFAULTLOGLEVEL; +} else { + _defaultLoglevel = CSE_LOGLEVEL; +}; + +if (isnil "CSE_LOGDISPLAY_LEVEL") then { + _defaultLogDisplayLevel = DEFAULTTEXTDISPLAY; +} else { + _defaultLogDisplayLevel = CSE_LOGDISPLAY_LEVEL; +}; + +if (isNil "_level") then { + _level = DEBUG; +}; +if (_defaultLoglevel == 4) exitwith {false}; +if (_level <= _defaultLoglevel) then { + switch (_level) do { + case ERROR: { _prefix = "CSE Error" }; + case WARN: { _prefix = "CSE Warn" }; + case DEBUG: { _prefix = "CSE Debug" }; + case INFO: { _prefix = "CSE Info" }; + default { _prefix = "CSE Unknown" }; + }; + _message = format["[%1] %2",_prefix,_msg]; + + if (isnil "CSE_LOGIC_OBJECT") then { + _group = createGroup sideLogic; + CSE_LOGIC_OBJECT = _group createUnit ["logic", [1,1,1], [], 0, "FORM"]; + }; + if (isNull CSE_LOGIC_OBJECT) then { + _group = createGroup sideLogic; + CSE_LOGIC_OBJECT = _group createUnit ["logic", [1,1,1], [], 0, "FORM"]; + }; + + + if (_level <= _defaultLogDisplayLevel) then { + showChat true; + CSE_LOGIC_OBJECT globalChat _message; + }; + diag_log _message; +}; +true \ No newline at end of file diff --git a/TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf b/TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf new file mode 100644 index 0000000000..f0a9902ef8 --- /dev/null +++ b/TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf @@ -0,0 +1,15 @@ +/** + * fn_debugModule.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_entity"]; +_entity = _this select 0; + +CSE_LOGDISPLAY_LEVEL = call compile (_entity getvariable ["logDisplayLevel","4"]); +CSE_LOGLEVEL = call compile (_entity getvariable ["logLevel","4"]); diff --git a/TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf b/TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf new file mode 100644 index 0000000000..ef64fa09f8 --- /dev/null +++ b/TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf @@ -0,0 +1,23 @@ +/** + * fn_traceModule.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_entity"]; +_entity = _this select 0; + +_enableForPlayer = call compile (_entity getvariable ["logDisplayLevel","0"]); +if (isnil "CSE_OBJECTS_TRACING") then { + CSE_OBJECTS_TRACING = []; +}; + +if (!isDedicated) then { + if (_enableForPlayer==1) then { + CSE_OBJECTS_TRACING set [count CSE_OBJECTS_TRACING, PLAYER]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf b/TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf new file mode 100644 index 0000000000..b53adb3315 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf @@ -0,0 +1,25 @@ +/** + * fn_findItem.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit","_magazine","_return"]; +_unit = _this select 0; +_item = _this select 1; + +if (_item in (uniformItems _unit)) exitwith {1}; +if (_item in (vestItems _unit)) exitwith {2}; +if (_item in (backpackItems _unit)) exitwith {3}; +if (_item in (assignedItems _unit)) exitwith {4}; +if (_item in (primaryWeaponItems _unit)) exitwith {5}; +if (_item in (secondaryWeaponItems _unit)) exitwith {6}; +if (_item in (handgunItems _unit)) exitwith {7}; +if (_item in (items _unit)) exitwith {8}; // in case it is in items but cannot be found in any other container (should never reach this) + +// If we cannot find the item, return 0. +0; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf b/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf new file mode 100644 index 0000000000..14d6a455ec --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf @@ -0,0 +1,21 @@ +/** + * fn_findMagazine.sqf + * @Descr: Find where the current magazines are. Order: uniform, vest, backpack, any. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, magazine STRING (Classname of magazine)] + * @Return: NUMBER 0 = none, 1 = in uniform, 2 = in vest, 3 = in backpack, 4 = found outside container + * @PublicAPI: true + */ + +private ["_unit","_magazine"]; +_unit = _this select 0; +_magazine = _this select 1; + +if (_magazine in (getMagazineCargo uniformContainer _unit)) exitwith {1}; +if (_magazine in (getMagazineCargo vestContainer _unit)) exitwith {2}; +if (_magazine in (getMagazineCargo backpackContainer _unit)) exitwith {3}; +if (_magazine in (magazines _unit)) exitwith {4}; // in case it cannot be found in any other container. Most likely loaded in a weapon. + +// If we cannot find the item, return 0. +0; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf b/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf new file mode 100644 index 0000000000..0b470c1a20 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf @@ -0,0 +1,26 @@ +/** + * fn_getNumberMagazinesIn.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit","_magazine"]; +_unit = _this select 0; +_magazine = _this select 1; + +_return = 0; +if (_unit isKindOf "CAManBase") then { + _return = {_x == _magazine} count magazines _unit; +} else { + { + _return = _return + {_x == _magazine} count magazines _x; + }foreach (crew _unit); + + _return = _return + ({_x == _magazine} count getMagazineCargo _unit); +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf b/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf new file mode 100644 index 0000000000..a0b07f1852 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf @@ -0,0 +1,11 @@ +/** + * fn_hasItem.sqf + * @Descr: Check if unit has item + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, item STRING (Classname of item)] + * @Return: BOOL + * @PublicAPI: true + */ +// item classname in items unit +((_this select 1) in items (_this select 0)); \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf b/TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf new file mode 100644 index 0000000000..468c955290 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf @@ -0,0 +1,21 @@ +/** + * fn_hasMagazine.sqf + * @Descr: Check if given unit has a magazine of given classname + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, magazine STRING] + * @Return: BOOL True if unith as given magazine + * @PublicAPI: true + */ + +private ["_unit","_magazine","_return"]; +_unit = _this select 0; +_magazine = _this select 1; + +if (_magazine != "") then { + _return = (_magazine in magazines _unit); +} else { + _return = false; +}; +//[format["fnc_hasMagazine: %1 | %2",_this,_return]] call cse_fnc_debug; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf b/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf new file mode 100644 index 0000000000..fd07398aad --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf @@ -0,0 +1,36 @@ +/** + * fn_useItem.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit","_item","_return"]; +_unit = _this select 0; +_item = _this select 1; +_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; + +if (!_vehicleUsage) then { + if (_item != "") then { + if (_item in (items _unit)) then { + _unit removeItem _item; + _return = true; + } else { + if (_item in (assignedItems _unit)) then { + _unit unassignItem _item; + _unit removeItem _item; + _return = true; + }; + }; + } else { + _return = false; + }; + [format["fnc_useItem: %1 | %2",_this,_return]] call cse_fnc_debug; +_return +} else +{ + // TODO implement shared item functionality +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf b/TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf new file mode 100644 index 0000000000..0a356aabc5 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf @@ -0,0 +1,28 @@ +/** + * fn_useMagazine.sqf + * @Descr: Use magazine + * @Author: Glowbal + * + * @Arguments: [unit OBJECt, magazine STRING] + * @Return: BOOL True if magazine has been used. + * @PublicAPI: true + */ + +private ["_unit","_magazine","_return"]; +_unit = _this select 0; +_magazine = _this select 1; +_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; + +if (!_vehicleUsage) then { + if (_magazine != "") then { + _unit removeMagazine _magazine; + _return = true; + } else { + _return = false; + }; + [format["fnc_useMagazine: %1 | %2",_this,_return]] call cse_fnc_debug; +_return +} else +{ + // TODO implement shared magazine functionality +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf b/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf new file mode 100644 index 0000000000..443e6d48f2 --- /dev/null +++ b/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf @@ -0,0 +1,22 @@ +/** + * fn_isHC.sqf + * @Descr: Check if current locality is a headless client + * @Author: Glowbal + * + * @Arguments: [] + * @Return: BOOL True if locality is headless client OR is not in multiplayer + * @PublicAPI: true + */ + +private ["_return"]; + +if (!isMultiplayer) then { + _return = true; +} else { + if (isServer && !isDedicated) then { + _return = true; + } else { + _return = !(hasInterface || isDedicated); + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/init.sqf b/TO_MERGE/cse/main/init.sqf new file mode 100644 index 0000000000..3ab0f5f3c4 --- /dev/null +++ b/TO_MERGE/cse/main/init.sqf @@ -0,0 +1,81 @@ +CSE_AI_COLLECTION_LOOP = [[]]; +if (isnil "CSE_OBJECTS_TRACING") then { + CSE_OBJECTS_TRACING = []; +}; + +["cse_interactionRegister",[],true,"cse_framework"] call cse_fnc_defineVariable; +["cse_interactionTarget",objNull,true,"cse_framework"] call cse_fnc_defineVariable; +["cse_variableMonitor",[],false,"cse_framework"] call cse_fnc_defineVariable; +["CSE_ENABLE_REVIVE_COUNTER",0,false,"cse_framework"] call cse_fnc_defineVariable; +["cse_inReviveState", false, true, "cse_framework"] call cse_fnc_defineVariable; + +cse_main = true; + +if (isnil "CSE_F_MODULE_OBJ_EH") then { + CSE_F_MODULE_OBJ_EH = []; +}; +CSE_F_MODULE_OBJ_EH pushback "cse_main"; +if (isnil "CSE_TASK_POOL_COLLECTION_F") then { + CSE_TASK_POOL_COLLECTION_F = []; +}; +if (isNil "CSE_ENABLE_REVIVE_F") then { + CSE_ENABLE_REVIVE_F = 0; +}; +if (hasInterface) then{ + [] spawn { + + sleep 1; + waitUntil {!isNull player && !(isNull (findDisplay 46))}; + player setvariable ["cse_name", name player, true]; + player addEventHandler ["respawn", {_this call cse_fnc_resetAllDefaults_F;}]; + 11401 cutRsc ["cse_gui_iconsDisplay","PLAIN"]; + + if (["cse_sys_vehicles"] call cse_fnc_isModLoaded_F) then { + call compile preprocessFile "cse\cse_sys_vehicles\init.sqf"; + }; + }; +}; + +["Task Loop is starting"] call cse_fnc_debug; +["cse_main_taskPool_f", "oneachframe", cse_fnc_loopThroughPool_f] call BIS_fnc_addStackedEventHandler; + +if (["cse_sys_ieds"] call cse_fnc_isModLoaded_F) then { + ["cse_sys_ieds", []] call cse_fnc_enableModule_f; +}; + +if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { + // integrate ALiVE menu with CSE Radial Action menu + // call compile preprocessFile "cse\cse_main\integration\alive\alive_gui_integration.sqf"; + // call compile preprocessFile "cse\cse_main\integration\alive\alive_flexiMenu_integration.sqf"; +}; + +// version checks +if !(isServer) exitwith {}; +if (isnil "cse_fnc_getVersion") exitwith {}; + +_versionCheckCode = compile format[' + if (isServer) exitwith {}; + sleep 5; + _serverVersion = "%1"; + CSE_SERVER_VERSION = _serverVersion; + if (!isnil "cse_fnc_getVersion") then { + _clientVersion = [] call cse_fnc_getVersion; + if (_serverVersion != _clientVersion) then { + // incorrect version + _warningMessage = format["WARNING: CSE Version mismatch. Server version: %1 Client version: %2", _serverVersion, _clientVersion]; + diag_log _warningMessage; + systemChat _warningMessage; + + [[{sysemChat format["%1" has an incorrect version of CSE", _this];}, player], "BIS_fnc_spawn", true, true] call BIS_fnc_MP; + } else { + ["Passed version check - same as server"] call cse_fnc_debug; + }; + } else { + // incorrect version + _warningMessage = format["WARNING: CSE Version mismatch: Server version: %1 Client version: unknown"]; + diag_log _warningMessage; + systemChat _warningMessage; + }; +', call cse_fnc_getVersion]; + +[_versionCheckCode, "BIS_fnc_spawn", true, true] call BIS_fnc_MP; diff --git a/TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf b/TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf new file mode 100644 index 0000000000..51804eec13 --- /dev/null +++ b/TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf @@ -0,0 +1,182 @@ + +#include "\x\alive\addons\ui\script_component.hpp" +#define ALiVE_ICON "cse\cse_gui\radialmenu\data\icons\icon_alive_mod.paa" + +/* + [ + "player", + [SELF_INTERACTION_KEY], + -9500, + [ + "call ALIVE_fnc_adminActionsMenuDef", + "main" + ] + ] +*/ + + + [ + ["player",[[221,[false,false,false]]],-9500,["call ALIVE_fnc_newsFeedMenuDef","main"],true], + ["player",[[221,[false,false,false]]],-9500,["call ALIVE_fnc_adminActionsMenuDef","main"],true] + ]; + +/* + 4 [ + 5 "caption", + 6 "action", + 7 "icon", + 8 "tooltip", + 9 {"submenu"|["menuName", "", {0|1} (optional - use embedded list menu)]}, +10 -1 (shortcut DIK code), +11 {0|1/"0"|"1"/false|true} (enabled), +12 {-1|0|1/"-1"|"0"|"1"/false|true} (visible) +13 ] +*/ + +[format["ALIVE FlexiMenu integration started"]] call cse_fnc_debug; +_menusources = GVAR(typeMenuSources); +{ + + // This is a string. defines classnames ? + _type = _x select 0; + + // not relevant for us + _keybindings = _x select 1; + + // not relevant for us + _priority = _x select 2; + + // array format: [code STRING, name STRING] + _details = _x select 3; + _code = _details select 0; + _menuName = _details select 1; + + // condition. BOOL or CODE ? + _condition = _x select 4; + + // TODO figure out parsing + [format["ALiVE FlexiMenu entry: %1", _x]] call cse_fnc_debug; + + if (_type == "player") then { + + if (typeName _condition == typeName true) then { + + } else { + // calling condition + }; + + _target = player; + _params = [_menuName, "popup"]; + + if (typeName _code == typeName "") then { + + // this has to be called upon menu open. + _res = [_target, _params] call compile _code; + [format["ALIVE FlexiMenu call res: %1", _res]] call cse_fnc_debug; + // [["main","ALiVE","popup"],[["Player Combat Support",{["radio"] call ALIVE_fnc_radioAction},"","ALiVE Combat Support System (CAS/Artillery/Transport)","",-1,1,false]] + if (_res isEqualTo []) exitwith {}; + _entryDetails = _res select 1 select 0; + + + // [["main","ALiVE","popup"],[["Admin Actions >","","","Server admin functions",["call ALiVE_fnc_adminActionsMenuDef","adminActions",1],-1,1,true]]] + //_menuName = _entryDetails select 4 select 1; + _compiledCode = compile format['[_this, "%1"] call cse_fnc_aliveFlexiMenuDisplayOptions', _menuName]; + [format["compiled code: %1", _compiledCode]] call cse_fnc_debug; + _entries = [ + [_entryDetails select 0, {true /* Condition should check for activation of ALiVE menu entries */}, ALiVE_ICON, _compiledCode, _entryDetails select 3] + ]; + ["ActionMenu","alive_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + /*{ + if (_foreachIndex > 0) then { + [format["BUTTON FORMAT: %1",_x]] call cse_fnc_debug; + _info = _x select 0; + _title = _info select 0; + _code = _info select 1; + _toolTip = _info select 2; + _allow = _info select 7; + [format["Showing button: %1", _info]] call cse_fnc_debug + }; + }foreach _res;*/ + }; + + }; +}foreach _menusources; + + + +cse_fnc_aliveFlexiMenuDisplayOptions = { + _args = _this select 0; + _checkMenuName = _this select 1; + [format["cse_fnc_aliveFlexiMenuDisplayOptions %1",_this]] call cse_fnc_debug; + _menusources = GVAR(typeMenuSources); + { + // This is a string. defines classnames ? + _type = _x select 0; + + // not relevant for us + _keybindings = _x select 1; + + // not relevant for us + _priority = _x select 2; + + // array format: [code STRING, name STRING] + _details = _x select 3; + _code = _details select 0; + _menuName = _details select 1; + + // condition. BOOL or CODE ? + _condition = _x select 4; + + if (_menuName == _checkMenuName) exitwith { + [format["ALiVE FlexiMenu entry: %1", _x]] call cse_fnc_debug; + if (_type == "player") then { + _continue = false; + if (typeName _condition == typeName true) then { + _continue = _condition; + }; + if (!_continue) exitwith {}; + + _target = player; + _params = [_menuName, "popup"]; + + if (typeName _code == typeName "") then { + // this has to be called upon menu open. + _res = [_target, _params] call compile _code; + // [["main","ALiVE","popup"],[["Player Combat Support",{["radio"] call ALIVE_fnc_radioAction},"","ALiVE Combat Support System (CAS/Artillery/Transport)","",-1,1,false]] + + if (_res isEqualTo []) exitwith {}; + _entryDetails = _res select 1; + + _cse_menu_entries = []; + { + _info = _x select 0; + if (_foreachIndex > 0) then { + _title = _info select 0; + _code = _info select 1; + _toolTip = _info select 2; + _allow = _info select 7; + + if (_allow) then { + _cse_menu_entries pushback [_title, ALiVE_ICON, _code, true, _toolTip]; + }; + }; + }foreach _res; + [format["Showing entries: %1 - %2", _cse_menu_entries, _res]] call cse_fnc_debug; + + if !(_cse_menu_entries isEqualTo []) then { + hintSilent "displaying alive entries"; + [ _args select 3, + _cse_menu_entries, + _args select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true + ] call cse_fnc_openRadialSecondRing_GUI; + }; + + }; + + }; + + }; + }foreach _menusources; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf b/TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf new file mode 100644 index 0000000000..1ecbbe1767 --- /dev/null +++ b/TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf @@ -0,0 +1,72 @@ +/** + * alive_gui_integration.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include <\x\alive\addons\sys_adminactions\script_component.hpp> +#include <\x\cba\addons\ui_helper\script_dikCodes.hpp> + +#define ALiVE_ICON "cse\cse_gui\radialmenu\data\icons\icon_alive_mod.paa" + +private ["_entries", "_openAdminActions"]; + +waitUntil{!isnil "cse_gui"}; + +// ALiVE Admin Actions + +_alive_openAdminActions = { + private ["_entries"]; + _entries = []; + if ((MOD(adminActions) getVariable ["ghost", 0]) == "1") then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_GHOST_ENABLE", ALiVE_ICON, {player setCaptive true; _this call cse_alive_openAdminActions; }, (!captive player), localize "STR_ALIVE_ADMINACTIONS_GHOST_COMMENT"]]; + + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_GHOST_DISABLE", ALiVE_ICON, {player setCaptive false; _this call cse_alive_openAdminActions; }, (captive player), localize "STR_ALIVE_ADMINACTIONS_GHOST_COMMENT"]]; + }; + if ((MOD(adminActions) getVariable ["teleport", 0]) == "1") then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_TELEPORT_ENABLE", ALiVE_ICON, { MOD(adminActions) setVariable ["teleport_enabled", true]; onMapSingleClick {vehicle player setPos _pos;}; _this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["teleport_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_TELEPORT_COMMENT"]]; + + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_TELEPORT_DISABLE",ALiVE_ICON, { MOD(adminActions) setVariable ["teleport_enabled", false]; onMapSingleClick DEFAULT_MAPCLICK; _this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["teleport_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_TELEPORT_COMMENT"]]; + + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_TELEPORTUNITS", ALiVE_ICON, { ["CAManBase"] spawn ALiVE_fnc_AdminActionsTeleportUnits; _this call cse_alive_openAdminActions; }, true, localize "STR_ALIVE_ADMINACTIONS_TELEPORTUNITS_COMMENT"]]; + }; + if ((MOD(adminActions) getVariable ["mark_units", 0]) == "1") then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_MARK_UNITS_ENABLE", ALiVE_ICON, { [] call ALIVE_fnc_markUnits; _this call cse_alive_openAdminActions; }, true, localize "STR_ALIVE_ADMINACTIONS_MARK_UNITS_COMMENT"]]; + }; + if (["ALiVE_mil_CQB"] call ALiVE_fnc_isModuleAvailable) then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CQB_ENABLE", ALiVE_ICON, { {MOD(adminActions) setVariable ["CQB_enabled", true]; [_x,"debug",true] call ALiVE_fnc_CQB} foreach (MOD(CQB) getVariable ["instances",[]]); _this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["CQB_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_CQB_ENABLE_COMMENT"]]; + + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CQB_DISABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["CQB_enabled", false]; {[_x,"debug",false] call ALiVE_fnc_CQB} foreach (MOD(CQB) getVariable ["instances",[]]); _this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["CQB_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_CQB_DISABLE_COMMENT"]]; + }; + if (["ALiVE_sys_profile"] call ALiVE_fnc_isModuleAvailable) then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_ENABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["PROFILES_enabled", true]; [] call ALIVE_fnc_profileSystemDebug;_this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["PROFILES_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_COMMENT"]]; + + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_DISABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["PROFILES_enabled", false]; [] call ALIVE_fnc_profileSystemDebug; _this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["PROFILES_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_COMMENT"]]; + }; + if ((MOD(adminActions) getVariable ["profiles_create", 0]) == "1") then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CREATE_PROFILES_ENABLE", ALiVE_ICON,{ [] call ALIVE_fnc_adminCreateProfiles; _this call cse_alive_openAdminActions; }, true, localize "STR_ALIVE_ADMINACTIONS_CREATE_PROFILES_COMMENT"]]; + }; + if (["ALiVE_amb_civ_population"] call ALiVE_fnc_isModuleAvailable) then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_AGENTS_DEBUG_ENABLE", ALiVE_ICON,{MOD(adminActions) setVariable ["AGENTS_enabled", true]; [] call ALIVE_fnc_agentSystemDebug; _this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["AGENTS_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_AGENTS_DEBUG_COMMENT"]]; + + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_AGENTS_DEBUG_DISABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["AGENTS_enabled", false]; [] call ALIVE_fnc_agentSystemDebug;_this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["AGENTS_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_COMMENT"]]; + }; + if ((MOD(adminActions) getVariable ["console", 0]) == "1") then { + _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CONSOLE_ENABLE", ALiVE_ICON,{ closeDialog 0; createDialog "RscDisplayDebugPublic"; }, true, localize "STR_ALIVE_ADMINACTIONS_CONSOLE_COMMENT"]]; + }; + + [ _this select 3, + _entries, + _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true + ] call cse_fnc_openRadialSecondRing_GUI; +}; + +_entries = [ + [localize "STR_ALIVE_ADMINACTIONS", {true /* Condition should check for activation of ALiVE Admin */}, ALiVE_ICON, _alive_openAdminActions, localize "STR_ALIVE_ADMINACTIONS"] +]; +["ActionMenu","alive_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + diff --git a/TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf b/TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf new file mode 100644 index 0000000000..4ddb76b131 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf @@ -0,0 +1,23 @@ +/** + * fn_broadcastMonitoredVariable.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_variable","_owners"]; +_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_variable = [_this,1,"",[""]] call BIS_fnc_Param; + +if (_variable == "cse_variableMonitor" || _variable == "cse_interactionRegister") exitwith{}; + +if (!local _target) exitwith { + [_this, "cse_fnc_broadcastMonitoredVariable",owner _target, false] spawn BIS_fnc_MP; +}; +_owners = ([_target,_variable] call cse_fnc_getRegisteredMonitorVariablesOwners); +{ + [_this, "cse_fnc_setMonitoredVariableValue",owner _x, false] spawn BIS_fnc_MP; +}foreach _owners; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf b/TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf new file mode 100644 index 0000000000..496c0a43e5 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf @@ -0,0 +1,13 @@ +/** + * fn_canInteract.sqf + * @Descr: Check if unit can interact with enviroment. Unit has to be awake and not be in arrested state. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if unit can interact with enviroment. + * @PublicAPI: true + */ + +private ["_unit","_return"]; +_unit = _this select 0; +(((_unit getvariable ["cse_canInteract",0]) < 1) && ([_unit] call cse_fnc_isAwake) && !([_unit] call cse_fnc_isArrested)) \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf new file mode 100644 index 0000000000..62d3e2a989 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf @@ -0,0 +1,14 @@ +/** + * fn_getAllMonitoredVariables.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +if (isnil "CSE_REGISTERED_MONITORED_VARIABLES") then { + CSE_REGISTERED_MONITORED_VARIABLES = []; +}; +CSE_REGISTERED_MONITORED_VARIABLES \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf new file mode 100644 index 0000000000..f90af6758c --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf @@ -0,0 +1,13 @@ +/** + * fn_getCanInteract.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_return"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +(_unit getvariable ["cse_canInteract",0]) \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf new file mode 100644 index 0000000000..d81bfdc24a --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf @@ -0,0 +1,14 @@ +/** + * fn_getInteractionTarget.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_prevTarget"]; +_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_prevTarget = [_unit,"cse_interactionTarget"] call cse_fnc_getVariable; +_prevTarget \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf new file mode 100644 index 0000000000..7a721e4c54 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf @@ -0,0 +1,20 @@ +/** + * fn_getMonitoredVariableName.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_stagingName","_name","_variableName"]; +_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_variableName = [_this,1,"",[""]] call BIS_fnc_Param; +//_name = ""; +//{ +// _name = _name + _x; +//}foreach ([format["%",_target], " "] call BIS_fnc_splitString); + +_stagingName = format["CSE_MONITORED_VARIABLE_%1", _variableName]; +_stagingName \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf new file mode 100644 index 0000000000..7f2658afec --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf @@ -0,0 +1,39 @@ +/** + * fn_getMonitoredVariableValue.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_returnValue","_stagingName","_variable"]; +_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_variable = [_this,1,"",[""]] call BIS_fnc_Param; + +_returnValue = ""; +_stagingName = [_target,_variable] call cse_fnc_getMonitoredVariableName; +_unknown = false; +if (isnil _stagingName) then { + // default value for variable, else "" + _returnValue = [_variable] call cse_fnc_getVariableDefault; + [_target,_variable,_returnValue] call cse_fnc_setMonitoredVariableValue; + _unknown = true; +} else { + _returnValue = call compile _stagingName; + if (isnil "_returnValue") then { + _returnValue = [_variable] call cse_fnc_getVariableDefault; + _unknown = true; + } else { + if (typeName _returnValue == typeName "") then { + if (_returnValue == "") then { + call compile format["%1 = '';",_stagingName]; + player sidechat format["Return didnt function propery"]; + }; + _returnValue = [_variable] call cse_fnc_getVariableDefault; + _unknown = true; + }; + }; +}; +_returnValue \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf new file mode 100644 index 0000000000..8ecae2ba6a --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf @@ -0,0 +1,23 @@ +/** + * fn_getOnUpdateVariableEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target","_variable","_name","_return","_variableName"]; +_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_variableName = [_this,1,"",[""]] call BIS_fnc_Param; +_name = [_target,_variableName] call cse_fnc_getMonitoredVariableName; +_name = _name + "_UPDATE_EH"; +_return = ""; +if (isnil _name) then { + +} else { + _return = call compile _name; + //[format["cse_fnc_getOnUpdateVariableEH %1 | %2",_return, _name]] call cse_fnc_debug; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf new file mode 100644 index 0000000000..90eeed1aa1 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf @@ -0,0 +1,25 @@ +/** + * fn_getRegisteredMonitorVariablesOwners.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_returnOwners","_register","_variableName","_registerMonitorCol"]; +_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_variableName = [_this,1,"",[""]] call BIS_fnc_Param; +_returnOwners = []; + +_registerMonitorCol = + ([_target,"cse_variableMonitor",[]] call cse_fnc_getVariable); + +//if (count _registerMonitor > 0) then { + { + if ((_x select 1) == _variableName) then { + _returnOwners pushback (_x select 0); + }; + }foreach _registerMonitorCol; +//}; +_returnOwners \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf b/TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf new file mode 100644 index 0000000000..436979399f --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf @@ -0,0 +1,22 @@ +/** + * fn_isRegisteredInteractingWith.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_register"]; +_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; +_register = [_target,"cse_interactionRegister",[]] call cse_fnc_getVariable; +_return = false; +{ + if (_x == _unit) exitwith { + _return = true; + }; +}foreach _register; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf b/TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf new file mode 100644 index 0000000000..bb48949687 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf @@ -0,0 +1,30 @@ +/** + * fn_registerInteractingWith.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_prevTarget","_register"]; +_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; + +if (local _unit) then { + _prevTarget = [_unit,"cse_interactionTarget"] call cse_fnc_getVariable; + if (!isNull _prevTarget) then { + [_unit,_prevTarget] call cse_fnc_unregisterInteractingWith; + //waituntil {sleep 0.1; !([_unit,_prevTarget] call cse_fnc_isRegisteredInteractingWith)}; + }; + [_unit,"cse_interactionTarget",_target] call cse_fnc_setVariable; +}; +if (!local _target) exitwith { + [_this, "cse_fnc_registerInteractingWith",owner _target, false] spawn BIS_fnc_MP; +}; + +// local on target ! +_register = [_target,"cse_interactionRegister",[]] call cse_fnc_getVariable; +_register pushback _unit; +[_target,"cse_interactionRegister",_register] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf b/TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf new file mode 100644 index 0000000000..51f273faa6 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf @@ -0,0 +1,34 @@ +/** + * fn_registerVariableMonitor.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_varName","_register","_onUpdate","_registerMonitor"]; +_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; +_varName = _this select 2; +_onUpdate = ""; +if (count _this >3) then { + _onUpdate = _this select 3; + [_target,_varName,_onUpdate] call cse_fnc_setOnUpdateVariableEH; +}; +if (local _unit) then { + if (isnil "CSE_REGISTERED_MONITORED_VARIABLES") then { + CSE_REGISTERED_MONITORED_VARIABLES = []; + }; + CSE_REGISTERED_MONITORED_VARIABLES pushback _varName; + [_target,_varName] call cse_fnc_getMonitoredVariableValue; +}; + +if (!local _target) exitwith { + [_this, "cse_fnc_registerVariableMonitor",owner _target, false] spawn BIS_fnc_MP; +}; +_registerMonitor = [_target,"cse_variableMonitor",[]] call cse_fnc_getVariable; +_registerMonitor pushback [_unit,_varName]; +[_target,"cse_variableMonitor",_registerMonitor] call cse_fnc_setVariable; +// [[_target,_varName,([_target,_varName] call cse_fnc_getVariable)], "cse_fnc_setMonitoredVariableValue", _unit, false] spawn BIS_fnc_MP; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf b/TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf new file mode 100644 index 0000000000..2d7ca320b5 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf @@ -0,0 +1,26 @@ +/** + * fn_setCanInteract.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_to","_return"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_to = _this select 1; +_return = false; +if (((typeName _to) == "SCALAR")) then { + if (_to <-1) then { + _to = -1; + } else { + if (_to > 1) then { + _to = 1; + }; + }; + _unit setvariable ["cse_canInteract", ([_unit] call cse_fnc_getCanInteract) + _to,false]; + _return = true; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf b/TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf new file mode 100644 index 0000000000..c0da8c58f6 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf @@ -0,0 +1,35 @@ +/** + * fn_setMonitoredVariableValue.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +_this spawn { + private ["_unit","_target","_variable","_eh"]; + _target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; + _variable = [_this,1,"",[""]] call BIS_fnc_Param; 1; + + _stagingName = [_target,_variable] call cse_fnc_getMonitoredVariableName; + if (count _this >2) then { + call compile format["%1 = %2;",_stagingName,_this select 2]; + } else { + call compile format["%1 = nil;",_stagingName]; + }; + + + _eh = [_target,_variable] call cse_fnc_getOnUpdateVariableEH; + if (!isnil _eh) then { + if (typeName _eh == typeName "") then { + [_target,_variable,_this select 2] spawn compile _eh; + } else { + if (typeName _eh == typeName {}) then { + [_target,_variable,_this select 2] spawn _eh; + }; + }; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf b/TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf new file mode 100644 index 0000000000..63021c0287 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf @@ -0,0 +1,17 @@ +/** + * fn_setOnUpdateVariableEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target","_name","_eh","_variableName"]; +_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_variableName = [_this,1,"",[""]] call BIS_fnc_Param; +_eh = _this select 2; // what data type? +_name = [_target,_variableName] call cse_fnc_getMonitoredVariableName; +_name = _name + "_UPDATE_EH"; +[_eh] call compile format["%1 = (_this select 0);",_name,_eh]; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf b/TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf new file mode 100644 index 0000000000..d3621d1462 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf @@ -0,0 +1,38 @@ +/** + * fn_unregisterInteractingWith.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_target","_register","_toRemove","_newRegister","_registerMonitor"]; +_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; + +if (local _unit) then { + [_unit,"cse_interactionTarget"] call cse_fnc_setVariable; + { + _name = [_target, _x] call cse_fnc_getMonitoredVariableName; + call compile format["%1 = nil;",_name]; + }foreach (call cse_fnc_getAllMonitoredVariables); +}; +if (!local _target) exitwith { + [_this, "cse_fnc_unregisterInteractingWith",owner _target, false] spawn BIS_fnc_MP; +}; +_register = [_target,"cse_interactionRegister",[]] call cse_fnc_getVariable; +_register = _register - [_unit]; +[_target,"cse_interactionRegister",_register] call cse_fnc_setVariable; + +_registerMonitor = [_target,"cse_variableMonitor",[]] call cse_fnc_getVariable; +_newRegister = []; +{ + if ((_x select 0) == _unit) then { + + } else { + _newRegister pushback _x; + }; +}foreach _registerMonitor; +[_target,"cse_variableMonitor",_newRegister] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf new file mode 100644 index 0000000000..b8a47455ce --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf @@ -0,0 +1,46 @@ +/** + * fn_sendDisplayInformationTo.sqf + * @Descr: Sends a display information hint to a receiver + * @Author: Glowbal + * + * @Arguments: [receiver OBJECT, title STRING, content ARRAY (An array with strings), type NUMBER (Optional)] + * @Return: void + * @PublicAPI: true + */ + +private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; +_reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_title = [_this, 1, "",[""]] call BIS_fnc_Param; +_content = [_this, 2, [""],[[""]]] call BIS_fnc_Param; +_type = [_this, 3, 0,[0]] call BIS_fnc_Param; +_parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; + +if (isPlayer _reciever) then { + if (!local _reciever) then { + [_this, "cse_fnc_sendDisplayInformationTo", _reciever, false] spawn BIS_fnc_MP; + } else { + + if (isLocalized _title) then { + _title = localize _title; + }; + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; + + { + if (isLocalized _x) then { + _localizationArray = [localize _x]; + { + _localizationArray pushback _x; + }foreach _parameters; + + _content set [_foreachIndex, format _localizationArray]; + }; + + }foreach _content; + + [_title,_content,_type] call cse_fnc_gui_displayInformation; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf new file mode 100644 index 0000000000..da02f48dbc --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf @@ -0,0 +1,46 @@ +/** + * fn_sendDisplayMessageTo.sqf + * @Descr: Displays a message on locality of receiver + * @Author: Glowbal + * + * @Arguments: [receiver OBJECT, title STRING, content STRING, type NUMBER (Optional)] + * @Return: void + * @PublicAPI: true + */ + +private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; +_reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_title = [_this, 1, "",[""]] call BIS_fnc_Param; +_content = [_this, 2, "",[""]] call BIS_fnc_Param; +_type = [_this, 3, 0,[0]] call BIS_fnc_Param; +_parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; + +[_this] call cse_fnc_debug; + +if (isPlayer _reciever) then { + if (!local _reciever) then { + [_this, "cse_fnc_sendDisplayMessageTo", _reciever, false] spawn BIS_fnc_MP; + } else { + + if (isLocalized _title) then { + _title = localize _title; + }; + if (isLocalized _content) then { + _content = localize _content; + }; + + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; + + _localizationArray = [_content]; + { + _localizationArray pushback _x; + }foreach _parameters; + _content = format _localizationArray; + + [_title,_content,_type] call cse_fnc_gui_displayMessage; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf new file mode 100644 index 0000000000..a86bc0bc2d --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf @@ -0,0 +1,23 @@ +/** + * fn_sendHintTo.sqf + * @Descr: Sends a hint to player unit across network + * @Author: Glowbal + * + * @Arguments: [reciever OBJECT, message STRING] + * @Return: void + * @PublicAPI: true + */ + + +private ["_reciever","_message"]; +_reciever = _this select 0; +_message = _this select 1; +//[_reciever,_message] call cms_fnc_sendChatMessageTo; + +if (isPlayer _reciever) then { + if (!local _reciever) then { + [_this, "cse_fnc_sendHintTo", _reciever, false] spawn BIS_fnc_MP; + } else { + hintsilent format ["%1",_message]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf new file mode 100644 index 0000000000..f54d49d6d5 --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf @@ -0,0 +1,22 @@ +/** + * fn_sendMessageTo.sqf + * @Descr: Sends a chat message to player unit across the network + * @Author: Glowbal + * + * @Arguments: [reciever OBJECT, message STRING] + * @Return: void + * @PublicAPI: true + */ + +private ["_reciever","_message"]; +_reciever = _this select 0; +_message = _this select 1; + + +if (isPlayer _reciever) then { + if (!local _reciever) then { + [_this, "cse_fnc_sendMessageTo", _reciever, false] spawn BIS_fnc_MP; + } else { + CSE_LOGIC_OBJECT globalChat format ["%1",_message]; + }; +}; diff --git a/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf new file mode 100644 index 0000000000..b44904ae10 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf @@ -0,0 +1,16 @@ +/** + * fn_broadcastSound3D_f.sqf + * @Descr: Plays a sound in 3D + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, sound STRING] + * @Return: void + * @PublicAPI: true + */ + + + +if (isDedicated) exitwith{}; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_sound = [_this, 1, "",[""]] call BIS_fnc_Param; +_unit say3D _sound; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf new file mode 100644 index 0000000000..4d9cb33837 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf @@ -0,0 +1,14 @@ +/** + * fn_closeAllDialogs_f.sqf + * @Descr: Close all dialogs + * @Author: Glowbal + * + * @Arguments: [] + * @Return: void + * @PublicAPI: true + */ + + +while {dialog} do { + closeDialog 0; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf new file mode 100644 index 0000000000..d2ad392559 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf @@ -0,0 +1,23 @@ +/** + * fn_disableAI_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_disable"]; +_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_disable = [_this, 1,false,[false]] call BIS_fnc_Param; + +if (local _unit && !(IsPlayer _unit)) then { + if (_disable) then { + _unit disableAI "Move"; + _unit disableAI "TARGET"; + } else { + _unit enableAI "Move"; + _unit enableAI "TARGET"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf new file mode 100644 index 0000000000..679ca870a1 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf @@ -0,0 +1,77 @@ +/** + * fn_disableKeyInput_f.sqf + * @Descr: Disable the keyinput + * @Author: Glowbal + * + * @Arguments: [disable BOOL] + * @Return: void + * @PublicAPI: false + */ + + + +private["_disable"]; +_disable = [_this, 0, false, [false]] call BIS_fnc_Param; +if (!hasInterface) exitwith {}; +CSE_DISABLE_KEY_INPUT_F = _disable; + +[format["Disable Key input: %1",_disable]] call cse_fnc_debug; +if (_disable) then { + if (isNil "CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F") then { + [format["Keyinput has not yet been disabled, now disabling",_disable]] call cse_fnc_debug; + + CSE_DISABLE_USER_INPUT_SCREEN = true; + createDialog 'cse_empty_screen'; + disableSerialization; + _display = uiNamespace getvariable "cse_empty_screen"; + CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F = _display displayAddEventHandler ["KeyDown", { + _return = true; + if ((_this select 1) == 1) then { + if (isNull finddisplay 49) then { + [format["Assigning ctrlEventhandlers to buttons"]] call cse_fnc_debug; + if (isMultiplayer) then { + createDialog "RscDisplayMPInterrupt"; + _ctrl = (finddisplay 49) displayctrl 103; + _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; [false] call cse_fnc_disableKeyInput_f; failMission 'LOSER';"]; + + _ctrl = (finddisplay 49) displayctrl 104; + _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; [false] call cse_fnc_disableKeyInput_f; player setDamage 1;"]; + } else { + createDialog "RscDisplayInterrupt"; + _ctrl = (finddisplay 49) displayctrl 104; + _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; [false] call cse_fnc_disableKeyInput_f; failMission 'LOSER';"]; + }; + } else { + closeDialog 49; + }; + }; + + if ((_this select 1) in actionKeys "CuratorInterface" && {player in allCurators}) then { + openCuratorInterface + }; + if (serverCommandAvailable "#missions") then { + }; + [format["Returning %1 for disable key input keyDown handler", _return]] call cse_fnc_debug; + _return; + }]; + CSE_DISABLE_KEY_DOWN_INPUT_DISPLAY_EH_F = _display displayAddEventHandler ["KeyUp", {true;}]; + }; +} else { + if (!isNil "CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F") then { + [format["Keyinput has been disabled, now enabling",_disable]] call cse_fnc_debug; + CSE_DISABLE_USER_INPUT_SCREEN = false; + disableSerialization; + _display = uiNamespace getvariable "cse_empty_screen"; + if (isnil "_display") then { + _display = displayNull; + }; + closeDialog 679123; + _display closeDisplay 1; + _display displayRemoveEventHandler ["KeyDown", CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F]; + _display displayRemoveEventHandler ["KeyUp", CSE_DISABLE_KEY_DOWN_INPUT_DISPLAY_EH_F]; + CSE_DISABLE_KEY_DOWN_INPUT_DISPLAY_EH_F = nil; + CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F = nil; + }; +}; + +[[_disable], "disableKeyInput"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf new file mode 100644 index 0000000000..a2832cfebc --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf @@ -0,0 +1,28 @@ +/** + * fn_disableUserInput_f.sqf + * @Descr: Disables the user input. Works stacked. + * @Author: Glowbal + * + * @Arguments: [id STRING, disable BOOL] + * @Return: void + * @PublicAPI: true + */ + +private ["_id","_disable"]; +_id = _this select 0; +_disable = _this select 1; + + +if (isnil "CSE_DISABLE_USER_INPUT_COLLECTION_F") then { + CSE_DISABLE_USER_INPUT_COLLECTION_F = []; +}; + +if (_disable) then { + CSE_DISABLE_USER_INPUT_COLLECTION_F pushback _id; + [true] call cse_fnc_disableKeyInput_f; +} else { + CSE_DISABLE_USER_INPUT_COLLECTION_F = CSE_DISABLE_USER_INPUT_COLLECTION_F - [_id]; + if (CSE_DISABLE_USER_INPUT_COLLECTION_F isEqualTo []) then { + [false] call cse_fnc_disableKeyInput_f; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf new file mode 100644 index 0000000000..4a23b214b5 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf @@ -0,0 +1,39 @@ +/** + * fn_dropWeapon_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_currentWeapon","_currentAnimation", "_WeaponHolder"]; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; + +_currentWeapon = currentWeapon _unit; +_currentAnimation = animationState _unit; +_WeaponHolder = "GroundWeaponHolder" createVehicle position _unit; + +_unit removeWeapon _currentWeapon; +_weaponHolder addWeaponCargoGlobal [_currentWeapon, 1]; +//_unit action [ "DropWeapon", _WeaponHolder, _currentWeapon ]; +_WeaponHolder setPos (getPos _unit); +//_unit switchMove _currentAnimation; + +_primairyWeapon = primaryWeapon _unit; +_secondairyWeapon = secondaryWeapon _unit; +_handGunWeapon = handgunWeapon _unit; + +switch (_currentWeapon) do { + case _primairyWeapon: { + + }; + case _secondairyWeapon: { + + }; + case _handGunWeapon: { + + }; + default {}; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf new file mode 100644 index 0000000000..86457e708c --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf @@ -0,0 +1,29 @@ +/** + * fn_endRadioTransmission_f.sqf + * @Descr: force end all radio transmissions by TFAR or ACRE + * @Author: Glowbal + * + * @Arguments: [] + * @Return: nil + * @PublicAPI: true + */ + + +if (["acre_api"] call cse_fnc_isModLoaded_F) then { + [-1] call acre_sys_core_fnc_handleMultiPttKeyPressUp; + [0] call acre_sys_core_fnc_handleMultiPttKeyPressUp; + [1] call acre_sys_core_fnc_handleMultiPttKeyPressUp; + [2] call acre_sys_core_fnc_handleMultiPttKeyPressUp; +}; + +if (["task_force_radio"] call cse_fnc_isModLoaded_F) then { + call TFAR_fnc_onSwTangentReleased; + call TFAR_fnc_onAdditionalSwTangentReleased; + + call TFAR_fnc_onLRTangentReleased; + call TFAR_fnc_onAdditionalLRTangentReleased; + + call TFAR_fnc_onDDTangentReleased; +}; + +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf b/TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf new file mode 100644 index 0000000000..9d57ea57a1 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf @@ -0,0 +1,44 @@ +/** + * fn_getFirstIntersection.sqf + * @Descr: Returns the the first intersection with an object between two positions + * @Author: Ruthberg + * + * @Arguments: [position PositionASL, position PositionASL, accuracy FLOAT] + * @Return: [intersects BOOL, intersection PositionASL] + * @PublicAPI: true + */ + + +private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersections", "_result"]; +_source = _this select 0; +_destination = _this select 1; +_accuracy = _this select 2; + +_result = [false, [0, 0, 0]]; + +_distance = _source vectorDistance _destination; + +if (count (lineIntersectsWith [_source, _destination]) > 0) then { + _lower = 0; + _upper = 1; + _mid = 0.5; + + _dir = _source vectorFromTo _destination; + + while {(_upper - _lower) * _distance > _accuracy} do { + _mid = _lower + (_upper - _lower) / 2; + + _intersections = count (lineIntersectsWith [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]); + + if (_intersections > 0) then { + _upper = _mid; + } else { + _lower = _mid; + }; + }; + + _mid = _lower + (_upper - _lower) / 2; + _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; +}; + +_result diff --git a/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf b/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf new file mode 100644 index 0000000000..57ff80fa60 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf @@ -0,0 +1,44 @@ +/** + * fn_getFirstIntersection.sqf + * @Descr: Returns the the first intersection with an object between two positions + * @Author: Ruthberg + * + * @Arguments: [position PositionASL, position PositionASL, accuracy FLOAT] + * @Return: [intersects BOOL, intersection PositionASL] + * @PublicAPI: true + */ + + +private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersection", "_result"]; +_source = _this select 0; +_destination = _this select 1; +_accuracy = _this select 2; + +_result = [false, [0, 0, 0]]; + +_distance = _source vectorDistance _destination; + +if (terrainIntersectASL [_source, _destination]) then { + _lower = 0; + _upper = 1; + _mid = 0.5; + + _dir = _source vectorFromTo _destination; + + while {(_upper - _lower) * _distance > _accuracy} do { + _mid = _lower + (_upper - _lower) / 2; + + _intersection = terrainIntersectASL [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; + + if (_intersection) then { + _upper = _mid; + } else { + _lower = _mid; + }; + }; + + _mid = _lower + (_upper - _lower) / 2; + _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; +}; + +_result diff --git a/TO_MERGE/cse/main/misc/functions/fn_getName.sqf b/TO_MERGE/cse/main/misc/functions/fn_getName.sqf new file mode 100644 index 0000000000..b7b4c9bda8 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getName.sqf @@ -0,0 +1,26 @@ +/** + * fn_getName.sqf + * @Descr: Get the name of unit + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: STRING Name of object + * @PublicAPI: true + */ + +private["_unit","_return"]; +_unit = _this select 0; +_return = "Unknown"; + +if (alive _unit) then { + if (_unit iskindof "CAManBase") then { + if (_unit getvariable ["cse_isDead",false]) then { + _return = _unit getvariable ["cse_name","Unknown"]; + } else { + _return = name _unit; + }; + }; +} else { + _return = _unit getvariable ["cse_name","Unknown"]; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf new file mode 100644 index 0000000000..7128ceb09c --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf @@ -0,0 +1,14 @@ +/** + * fn_getWeaponItems_f.sqf + * @Descr: Get the weapon items from the unit. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: + * @PublicAPI: false + */ + +private "_unit"; +_unit = _this select 0; + +[primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf new file mode 100644 index 0000000000..6091895503 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf @@ -0,0 +1,16 @@ +/** + * fn_hasItem_f.sqf + * @Descr: Check if a unit has item + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, item STRING (Classname of item)] + * @Return: BOOL True if unit has the item in it's inventory + * @PublicAPI: true + */ + + +private ["_unit","_item"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_item = [_this, 1, "", [""]] call BIS_fnc_Param; + +(_item in items _unit); \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf new file mode 100644 index 0000000000..93027ffe7d --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf @@ -0,0 +1,20 @@ +/** + * fn_inWater_f.sqf + * @Descr: Check if unit is underwater + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if unit is in the water + * @PublicAPI: true + */ + +private ["_unit","_return","_aslPos"]; +_unit = _this select 0; +_return = false; +if ((surfaceIsWater getPos _unit)) then { + _aslPos = _unit modelToWorld (_unit selectionPosition "head"); + if ((_aslPos select 2) <= 0) then { + _return = true; + }; +}; +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf b/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf new file mode 100644 index 0000000000..a8afe16aa6 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf @@ -0,0 +1,13 @@ +/** + * fn_isAwake.sqf + * @Descr: Check if unit is awake. Will be false when death or unit is unconscious. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if unit is awake + * @PublicAPI: true + */ + +private ["_unit","_return"]; +_unit = _this select 0; +(!([_unit] call cse_fnc_isUnconscious)) && alive _unit && !(_unit getvariable ["cse_isDead",false]); diff --git a/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf b/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf new file mode 100644 index 0000000000..6b08e969f0 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf @@ -0,0 +1,23 @@ +/** + * fn_isInBuilding.sqf + * @Descr: Check is unit is within a building + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if unit is under a roof + * @PublicAPI: true + */ + +private ["_unit","_eyePos","_obj","_isInBuilding"]; +_unit = _this select 0; + +_eyePos = eyePos _unit; +_isInBuilding = false; +_obj = (lineIntersectsWith [_unit modelToWorld [0, 0, (_eyePos select 2)], _unit modelToWorld [0, 0, (_eyePos select 2) +10], _unit]); +{ + if (_x isKindOf "Building") exitwith { + _isInBuilding = true; + }; +}foreach _obj; + +_isInBuilding \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf b/TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf new file mode 100644 index 0000000000..adf55eed55 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf @@ -0,0 +1,38 @@ +/** + * fn_lockVehicleOfUnitUntil.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_vehicleOfUnit","_lockSwitch"]; +_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_vehicleOfUnit = vehicle _unit; +_lockSwitch = false; +waituntil{ + if (!_lockSwitch) then { + if (_vehicleOfUnit != _unit) then { + if (locked _vehicleOfUnit != 0) then { + _lockSwitch = true; + _vehicleOfUnit lock true; + [format["VEHICLE LOCKED %1", _vehicleOfUnit]] call cse_fnc_debug; + }; + }; + } else { + if (vehicle _unit == _unit) then { + _vehicleOfUnit lock false; + _lockSwitch = false; + [format["VEHICLE UNLOCKED %1", _vehicleOfUnit]] call cse_fnc_debug; + }; + }; + (!(_unit getvariable ["cse_state_unconscious", false]) || !alive _unit)}; + +if (_lockSwitch) then { + _vehicleOfUnit lock false; + [format["VEHICLE UNLOCKED %1", _vehicleOfUnit]] call cse_fnc_debug; +} else { + [format["NO VEHICLE TO UNLOCKED %1", _unit]] call cse_fnc_debug; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf b/TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf new file mode 100644 index 0000000000..f7541e4d58 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf @@ -0,0 +1,36 @@ +/** + * fn_moduleEnableBasicRevive.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_args", "_units", "_activated"]; +_args = _this; + +CSE_ENABLE_REVIVE_F = 0; +CSE_REVIVE_TIMER_F = 600; +CSE_REVIVE_NUMBER_MAX_F = -1; +{ + _value = _x select 1; + if (!isnil "_value") then { + if (_x select 0 == "enableFor") then { + CSE_ENABLE_REVIVE_F = _x select 1; + }; + if (_x select 0 == "timer") then { + CSE_REVIVE_TIMER_F = _x select 1; + }; + if (_x select 0 == "amountOf") then { + CSE_REVIVE_NUMBER_MAX_F = _x select 1; + }; + }; +}foreach _args; + +[ + {(((_this select 0) getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > 0)} +] call cse_fnc_registerUnconsciousCondition; + +[format["Enabled Basic Revive Module - ENABLED FOR: %1. TIMER: %2. NUMBER: %3", CSE_ENABLE_REVIVE_F, CSE_REVIVE_TIMER_F, CSE_REVIVE_NUMBER_MAX_F]] call cse_fnc_debug; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf new file mode 100644 index 0000000000..7937c359a2 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf @@ -0,0 +1,51 @@ +/** + * fn_resetAllDefaults_f.sqf + * @Descr: reset all variables that have been defined + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_oldUnit","_sets","_CSEFadingBlackUI","_ctrlFadingBlackUI"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_oldUnit = [_this, 1, objNull, [objNull]] call BIS_fnc_param; + +//_unit setvariable["cse_unconscious_non_captive_f",nil]; +if (missionNamespace getvariable ["cse_unconscious_non_captive_f",false]) then { + _unit setCaptive false; + missionNamespace setvariable["cse_unconscious_non_captive_f",nil]; + [format["Detected unit as a non captive but in captive state. RESETTING"]] call cse_fnc_debug; +} else { + [format["didn't trigger but unit is: %1 - %2", captive _unit, (missionNamespace getvariable ["cse_unconscious_non_captive_f",false])]] call cse_fnc_debug; +}; + +_unit setvariable ["cse_isDead",nil,true]; +_unit setvariable ["cse_state_unconscious", nil, true]; + +if (isPlayer _unit) then { + [true] call cse_fnc_setVolume_f; + [false] call cse_fnc_disableKeyInput_f; + [false] call cse_fnc_effectBlackOut; + [player, -1] call cse_fnc_limitSpeed; + if (isnil "CSE_DISABLE_USER_INPUT_COLLECTION_F") then { + CSE_DISABLE_USER_INPUT_COLLECTION_F = []; + }; + { + [_X, false] call cse_fnc_disableUserInput_f; + }foreach CSE_DISABLE_USER_INPUT_COLLECTION_F; +}; +_sets = [_unit] call cse_fnc_getAllSetVariables; +[format["defaults for %1 : %2",_unit,_sets]] call cse_fnc_debug; +if ((count _sets) > 0) then { + { + if (!(_x select 4)) then { + _unit setvariable [(_x select 0),nil,_x select 3]; + [format["RESETTING: %1",[(_x select 0),_unit, _x select 1, (_unit getvariable (_x select 0))]]] call cse_fnc_debug; + }; + }foreach _sets; +} else { + ["No defaults have been set"] call cse_fnc_debug; +}; +[[_unit],"resetToDefaults"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf new file mode 100644 index 0000000000..e711fe6c91 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf @@ -0,0 +1,4 @@ + +if (hasInterface) then { + player reveal (_this select 0); +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_setDead.sqf b/TO_MERGE/cse/main/misc/functions/fn_setDead.sqf new file mode 100644 index 0000000000..dd85ecea06 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setDead.sqf @@ -0,0 +1,101 @@ +/** + * fn_setDead.sqf + * @Descr: Kills a unit + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit"]; +_unit = _this select 0; +_force = false; +if (count _this >= 2) then { + _force = _this select 1; +}; + +if (!alive _unit) exitwith{}; +if (!local _unit) exitwith { + [[_unit, _force], "cse_fnc_setDead", _unit, false] spawn BIS_fnc_MP; + diag_log format["WARNING: cse_fnc_setDead triggered on non local unit %1", _unit]; +}; +if (isnil "CSE_ENABLE_REVIVE_F") then { + CSE_ENABLE_REVIVE_F = 0; +}; +_name = _unit getvariable "cse_name"; +if (isnil "_name") then { + _unit setvariable ["cse_name", name _unit, true]; +}; + +if (((CSE_ENABLE_REVIVE_F == 1 && isPlayer _unit) || (CSE_ENABLE_REVIVE_F == 2)) && !_force) then { + [format["CSE_ENABLE_REVIVE_F %1",_unit]] call cse_fnc_debug; + _unit spawn { + private ["_unit","_counter"]; + _unit = _this; + _playerDead = isPlayer _unit; + + if ((_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > 0) exitwith { + _unit setvariable["CSE_ENABLE_REVIVE_SETDEAD_F",(_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) + 1]; + }; + _unit setvariable["CSE_ENABLE_REVIVE_SETDEAD_F",1]; + [_unit] call cse_fnc_setUnconsciousState; + if (isnil "CSE_REVIVE_TIMER_F") then { + CSE_REVIVE_TIMER_F = 10; + }; + if (isnil "CSE_REVIVE_NUMBER_MAX_F") then { + CSE_REVIVE_NUMBER_MAX_F = -1; + }; + waituntil {([_unit] call cse_fnc_isUnconscious)}; + _counter = 0; + if (alive (vehicle _unit)) then { + _unit setvariable ["cse_inReviveState", true, true]; + while {([_unit] call cse_fnc_isUnconscious)} do { + _counter = _unit getvariable ["CSE_ENABLE_REVIVE_COUNTER",_counter]; + if (_counter > CSE_REVIVE_TIMER_F || (((_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > CSE_REVIVE_NUMBER_MAX_F) && (CSE_REVIVE_NUMBER_MAX_F > 0))) exitwith{ + if (_counter > CSE_REVIVE_TIMER_F) then { + [format["Timer ran out for %1",_unit]] call cse_fnc_debug; + }; + if (((_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > CSE_REVIVE_NUMBER_MAX_F) && (CSE_REVIVE_NUMBER_MAX_F > 0)) then { + [format["amount of calls for setDead ran out for %1",_unit]] call cse_fnc_debug; + }; + if (isPlayer _unit) then { + titleText ["You died..","PLAIN DOWN"]; + }; + [format["cse_isDead %1",_unit]] call cse_fnc_debug; + [_unit,"cse_isDead",true,true] call cse_fnc_setVariable; + if (_playerDead) then { + [_unit,"cse_isDeadPlayer",true,true] call cse_fnc_setVariable; + }; + _unit setdamage 1; + [[_unit, true],"killed"] call cse_fnc_customEventHandler_F; + }; + sleep 1; + _unit setvariable ["CSE_ENABLE_REVIVE_COUNTER",_counter + 1]; + _counter = _counter + 1; + }; + _unit setvariable ["cse_inReviveState", nil, true]; + [format["no longer unconscious %1",_unit]] call cse_fnc_debug; + } else { + if (isPlayer _unit) then { + titleText ["You died..","PLAIN DOWN"]; + }; + [_unit,"cse_isDead",true,true] call cse_fnc_setVariable; + _unit setdamage 1; + [[_unit, false],"killed"] call cse_fnc_customEventHandler_F; + }; + }; +} else { + [format["INSTANT KILL %1",_unit]] call cse_fnc_debug; + _unit setvariable ["cse_isUnconscious", true, true]; + if (isPlayer _unit) then { + titleText ["You died..","PLAIN DOWN"]; + }; + if (isPLayer _unit) then { + [_unit,"cse_isDeadPlayer",true,true] call cse_fnc_setVariable; + }; + _unit setdamage 1; + [_unit,"cse_isDead",true,true] call cse_fnc_setVariable; + + [[_unit, false],"killed"] call cse_fnc_customEventHandler_F; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf b/TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf new file mode 100644 index 0000000000..b1e29dc68f --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf @@ -0,0 +1,53 @@ +/** + * fn_setHearingCapability.sqf + * @Descr: Handle set volume calls. Will use the lowest available volume setting. + * @Author: Glowbal + * + * @Arguments: [id STRING, settings NUMBER, add BOOL (Optional. True will add, false will remove. Default value is true)] + * @Return: nil + * @PublicAPI: true + */ + +private ["_id", "_settings", "_add", "_exists", "_map", "_lowestVolume"]; +_id = _this select 0; +_settings = _this select 1; +_add = true; +if (count _this > 2) then { + _add = _this select 2; +}; + +_map = missionNamespace getVariable ["cse_setHearingCapabilityMap",[]]; + +_exists = false; +{ + if (_id == _x select 0) exitWith { + _exists = true; + if (_add) then { + _x set [1, _settings]; + } else { + _map set [_forEachIndex, 0]; + _map = _map - [0]; + }; + }; +} forEach _map; + +if (!_exists && _add) then { + _map pushBack [_id, _settings]; +}; + +missionNamespace setVariable ["cse_setHearingCapabilityMap", _map]; + +// find lowest volume +_lowestVolume = 1; +{ + _lowestVolume = (_x select 1) min _lowestVolume; +} forEach _map; + +// in game sounds +0 fadeSound _lowestVolume; +0 fadeRadio _lowestVolume; +0 fadeMusic _lowestVolume; + +// Set Radio mod variables. +player setVariable ["tf_globalVolume", _lowestVolume]; +player setVariable ["acre_sys_core_globalVolume", _lowestVolume]; diff --git a/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf b/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf new file mode 100644 index 0000000000..0ad2a231eb --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf @@ -0,0 +1,26 @@ +/** + * fn_setProne.sqf + * @Descr: Force a unit to go prone + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit"]; +_unit = [_this,0, ObjNull,[ObjNull]] call BIS_fnc_Param; +switch (currentWeapon _unit) do { + case (primaryWeapon _unit): { + [_unit,"amovppnemstpsraswrfldnon"] call cse_fnc_localAnim; + }; + case (secondaryWeapon _unit): { + [_unit,"amovppnemstpsraswlnrdnon"] call cse_fnc_localAnim; + }; + case (handgunWeapon _unit): { + [_unit,"AmovPpneMstpSrasWpstDnon"] call cse_fnc_localAnim; + }; + default { + [_unit,"amovppnemstpsnonwnondnon"] call cse_fnc_localAnim; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf new file mode 100644 index 0000000000..44d4179091 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf @@ -0,0 +1,45 @@ +/** + * fn_setVolume_f.sqf + * @Descr: Sets the volume of the game, including third party radio modifications such as TFAR and ACRE. + * @Author: Glowbal + * + * @Arguments: [setVolume BOOL] + * @Return: void + * @PublicAPI: true + */ +#define MUTED_LEVEL 0.2 +#define NORMAL_LEVEL 1 +#define NO_SOUND 0 + +private ["_setVolume"]; +_setVolume = [_this, 0, false, [false]] call BIS_fnc_Param; + +if (_setVolume) then { + // Vanilla Game + 2 fadeSound NORMAL_LEVEL; + + // TFAR + player setVariable ["tf_voiceVolume", NORMAL_LEVEL, true]; + player setVariable ["tf_globalVolume", NORMAL_LEVEL]; + player setVariable ["tf_unable_to_use_radio", false]; + + // ACRE2 + player setVariable ["acre_sys_core_globalVolume", NORMAL_LEVEL]; + player setVariable ["acre_sys_core_isDisabled", false, true]; + +} else { + // Vanilla Game + 2 fadeSound MUTED_LEVEL; + + // TFAR + player setVariable ["tf_voiceVolume", NO_SOUND, true]; + player setVariable ["tf_globalVolume", MUTED_LEVEL]; + player setVariable ["tf_unable_to_use_radio", true]; + + // ACRE2 + player setVariable ["acre_sys_core_globalVolume", MUTED_LEVEL]; + player setVariable ["acre_sys_core_isDisabled", true, true]; + +}; + +[[_setVolume],"setVolume"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf new file mode 100644 index 0000000000..6a28fa473a --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf @@ -0,0 +1,65 @@ +/** + * fn_switchToGroupSide_f.sqf + * @Descr: Stack group switches. Will always trace back to original group. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, switch BOOL, id STRING, side SIDE] + * @Return: void + * @PublicAPI: true + */ + + +private ["_unit","_side","_previousGroup","_newGroup", "_currentGroup", "_switch", "_originalSide", "_previousGroupsList", "_id"]; +_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_switch = [_this, 1, false,[false]] call BIS_fnc_Param; +_id = [_this, 2, "", [""]] call BIS_fnc_Param; +_side = [_this, 3, side _unit,[west]] call BIS_fnc_Param; + +_previousGroupsList = _unit getvariable ["cse_previous_group_switchTo_f",[]]; +if (_switch) then { + // go forward + _previousGroup = group _unit; + _originalSide = side group _unit; + + if (count units _previousGroup == 1 && _originalSide == _side) exitwith { + [format["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call cse_fnc_debug; + }; + + _newGroup = createGroup _side; + [_unit] joinSilent _newGroup; + + _previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; + _unit setvariable ["cse_previous_group_switchTo_f", _previousGroupsList, true]; +} else { + // go one back + { + if (_id == (_x select 2)) exitwith { + _x set [ 3, false]; + _previousGroupsList set [_foreachIndex, _x]; + [format["found group with ID: %1", _id]] call cse_fnc_debug; + }; + }foreach _previousGroupsList; + reverse _previousGroupsList; + + { + if (_x select 3) exitwith {}; // stop at first id set to true + if !(_x select 3) then { + _currentGroup = group _unit; + if (!isNull (_x select 0)) then { + [_unit] joinSilent (_x select 0); + } else { + _newGroup = createGroup (_x select 1); + [_unit] joinSilent _newGroup; + }; + if (count units _currentGroup == 0) then { + deleteGroup _currentGroup; + }; + _previousGroupsList set [_foreachIndex, ObjNull]; + }; + }foreach _previousGroupsList; + _previousGroupsList = _previousGroupsList - [objNull]; + reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. + _unit setvariable ["cse_previous_group_switchTo_f", _previousGroupsList, true]; +}; + +[[_unit, _switch, _id, _side],"switchToGroupSide"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf b/TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf new file mode 100644 index 0000000000..7ccf6c5d27 --- /dev/null +++ b/TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf @@ -0,0 +1,16 @@ +/** + * fn_ALiVE_BUS_Mod.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_busArguments","_return"]; +_busArguments = [_this, 0, [], [[]]] call BIS_fnc_Param; +if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { + _return = _busArguments call ALiVE_fnc_BUS; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf b/TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf new file mode 100644 index 0000000000..12a37391ae --- /dev/null +++ b/TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf @@ -0,0 +1,12 @@ +/** + * fn_isLoaded_ALiVE_Mod.sqf + * Descr: Check if the ALiVE Modification is loaded + * Author: Glowbal + * + * Arguments: [] + * Return: BOOL true if ALiVE is loaded + * PublicAPI: true + */ + + +(["ALIVE_main"] call cse_fnc_isModLoaded_f) \ No newline at end of file diff --git a/TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf b/TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf new file mode 100644 index 0000000000..3be56bff11 --- /dev/null +++ b/TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf @@ -0,0 +1,14 @@ +/** + * fn_isModLoaded_f.sqf + * Descr: Check in cfgPatches if modification is loaded + * Author: Glowbal + * + * Arguments: [modName STRING (Classname of the mod in cfgPatches)] + * Return: BOOL true if modification is loaded + * PublicAPI: true + */ + +private ["_modName"]; +_modName = [_this, 0, "",[""]] call BIS_fnc_Param; + +(isClass (configFile >> "cfgPatches" >> _modName)) \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf new file mode 100644 index 0000000000..895687082f --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf @@ -0,0 +1,24 @@ +/** + * fn_createMutex.sqf + * @Descr: Create a Mutex + * @Author: Glowbal + * + * @Arguments: [mutexName STRING, intialStatus BOOL (True if initial status is locked)] + * @Return: BOOL True if mutex has been created. + * @PublicAPI: true + */ + +private ["_mutexName","_initalStatus","_return"]; +_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; +_initalStatus = [_this, 1, false, [false]] call BIS_fnc_param; +_return = false; +if (_mutexName != "") then { + private["_mutexCombinedName"]; + _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; + if (isnil _mutexCombinedName) then { + missionNamespace setvariable [_mutexCombinedName, _initalStatus]; + _return = true; + }; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf new file mode 100644 index 0000000000..536176bcba --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf @@ -0,0 +1,24 @@ +/** + * fn_lockMutex.sqf + * @Descr: Lock a mutex. If mutex exists and is locked, will wait until mutex becomes free, before locking it again. + * @Author: Glowbal + * + * @Arguments: [mutexName STRING] + * @Return: BOOL True if succesfullly locked. + * @PublicAPI: true + */ + +private ["_mutexName","_initalStatus","_return"]; +_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; + +_return = false; +if (_mutexName != "")then { + private["_mutexCombinedName"]; + _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; + if !(isnil _mutexCombinedName) then { + [_mutexName] call cse_fnc_waitForSingleMutex; + missionNamespace setvariable [_mutexCombinedName, 1]; + _return = true; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf new file mode 100644 index 0000000000..8e29633dc5 --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf @@ -0,0 +1,24 @@ +/** + * fn_releaseMutex.sqf + * @Descr: Releases or unlocks a mutex. + * @Author: Glowbal + * + * @Arguments: [mutexName STRING] + * @Return: True if succesfully unlocked or mutex was never locked. + * @PublicAPI: true + */ + + +private ["_mutexName","_initalStatus","_return"]; +_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; + +_return = false; +if (_mutexName != "")then { + private["_mutexCombinedName"]; + _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; + if !(isnil _mutexCombinedName) then { + missionNamespace setvariable [_mutexCombinedName, 0]; + _return = true; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf new file mode 100644 index 0000000000..4e626cc6c1 --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf @@ -0,0 +1,18 @@ +/** + * fn_waitForMultipleMutex.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_mutexes"]; +_mutexes = _this; +{ + if (typeName _x == typeName "") then { + [_x, -1] call cse_fnc_waitForSingleMutex; + }; +}foreach _mutexes; \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf new file mode 100644 index 0000000000..5d04a60968 --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf @@ -0,0 +1,28 @@ +/** + * fn_waitForSingleMutex.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_mutexName","_timeout","_return"]; +_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; +if (count _this > 1) then { + _timeout = [_this, 1, -1, [-1]] call BIS_fnc_param; +}; + +_return = false; +if (_mutexName != "") then { + private["_mutexCombinedName"]; + _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; + if !(isnil _mutexCombinedName) then { + _startTime = time; + waituntil {((missionNamespace getvariable [_mutexCombinedName, 0]) == 0) || ((time - _startTime > (_timeout*accTime)) && _timeout > 0)}; + _return = (missionNamespace getvariable [_mutexCombinedName, 0]) == 0; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf b/TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf new file mode 100644 index 0000000000..2e2710509b --- /dev/null +++ b/TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf @@ -0,0 +1,11 @@ +/** + * fn_ragdoll_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +// Deleted. \ No newline at end of file diff --git a/TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf b/TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf new file mode 100644 index 0000000000..8f2420f7ba --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf @@ -0,0 +1,37 @@ +/** + * fn_onAnswerRequest.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_requestID", "_id", "_accepted", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; +_unit = _this select 0; +_id = _this select 1; +_accepted = _this select 2; + +_info = _unit getvariable _id; +if (!isnil "_info") then { + _caller = _info select 0; + _target = _info select 1; + _requestID = _info select 2; + _requestMessage = _info select 3; + _callBack = _info select 4; + _replyParams = [_info, _accepted]; + [_replyParams, "cse_fnc_requestCallback", _caller, false] spawn BIS_fnc_MP; + _unit setvariable [_id, nil]; +}; + +CSE_RECIEVE_REQUEST_ID_KEY_BINDING = nil; + +if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT") then { + _unit removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT; + CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = nil; +}; +if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE") then { + _unit removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE; + CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = nil; +}; diff --git a/TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf b/TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf new file mode 100644 index 0000000000..8e1502edc1 --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf @@ -0,0 +1,67 @@ +/** + * fn_recieveRequest.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; +_caller = _this select 0; +_target = _this select 1; +_requestID = _this select 2; +_requestMessage = _this select 3; +_callBack = _this select 4; + +_requestID = ("cse_fnc_recieveRequest_f"+_requestID); + +_target setvariable [_requestID, _this]; + +if (isLocalized _requestMessage) then { + _requestMessage = format[localize _requestMessage,[_caller] call cse_fnc_getName]; +} else { + _requestMessage = format[_requestMessage,[_caller] call cse_fnc_getName]; +}; + +hint format["%1",_requestMessage]; +if !(isnil "CSE_RECIEVE_REQUEST_TIME_OUT_SCRIPT") then { + terminate CSE_RECIEVE_REQUEST_TIME_OUT_SCRIPT; +}; + +if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT") then { + _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT; + CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = nil; +}; +if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE") then { + _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE; + CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = nil; +}; + +CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = _target addAction ["Accept", compile format["[player,'%1', true] call cse_fnc_onAnswerRequest;", _requestID]]; +CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = _target addAction ["Decline", compile format["[player,'%1', false] call cse_fnc_onAnswerRequest;", _requestID]]; + +CSE_RECIEVE_REQUEST_ID_KEY_BINDING = _requestID; + +CSE_RECIEVE_REQUEST_TIME_OUT_SCRIPT = [time, _target, _requestID] spawn { + _t = (_this select 0) + 40; + _target = _this select 1; + _requestID = _this select 2; + _id = _target getvariable _requestID; + waituntil { + _id = _target getvariable _requestID; + + (time > _t || isnil "_id")}; + _target setvariable [_requestID, nil]; + CSE_RECIEVE_REQUEST_ID_KEY_BINDING = nil; + if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT") then { + _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT; + CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = nil; + }; + if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE") then { + _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE; + CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = nil; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf b/TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf new file mode 100644 index 0000000000..1896f8b3dc --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf @@ -0,0 +1,21 @@ +/** + * fn_requestCallback.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_info", "_accepted", "_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; +_info = _this select 0; +_accepted = _this select 1; + +_caller = _info select 0; +_target = _info select 1; +_requestID = _info select 2; +_requestMessage = _info select 3; +_callBack = _info select 4; + +[_caller, _target, _accepted] call compile _callBack; \ No newline at end of file diff --git a/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf b/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf new file mode 100644 index 0000000000..2ba9cbc9f1 --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf @@ -0,0 +1,26 @@ +/** + * fn_sendRequest_f.sqf + * @Descr: Send a request to an unit and execute code based upon results. + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, target OBJECT, requestID STRING, requestMessage STRING (Will be localized for other target object), callback CODE (Code called upon accept or decline.)] + * @Return: void + * @PublicAPI: true + */ + +private ["_caller", "_target", "_requestMessage", "_requestID", "_callBack"]; +_caller = _this select 0; +_target = _this select 1; +_requestID = _this select 2; +_requestMessage = _this select 3; +_callBack = _this select 4; + +if (isPlayer _target) then { + // Pass request on to target locality for player accept/decline. + [[_caller, _target, _requestID, _requestMessage, _callBack], "cse_fnc_receiveRequest", _target, false] spawn BIS_fnc_MP; +} else { + // accept it, since it's an AI. + [_caller, _target, true] spawn compile _callBack; +}; + +// [player, player, "myRequestTest", "Hello %1, how are you?", "hint 'it worked!';"] call cse_fnc_sendRequest_f; \ No newline at end of file diff --git a/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf b/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf new file mode 100644 index 0000000000..75ae1ff3b7 --- /dev/null +++ b/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf @@ -0,0 +1,33 @@ +/** + * fn_stringCompare.sqf + * @Descr: Determines whether one string matches another and how many characters match. Case insensitive. + * @Author: bovine3dom + * + * @Arguments: [stringA STRING, stringB STRING] + * @Return: NUMBER Number of matching characters + * @PublicAPI: true + */ + +private ["_searchTerm", "_string", "_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"]; +_string = toLower (_this select 0); // removes case sensitivity +_searchTerm = toLower (_this select 1); + + +_arraySearchTerm = toArray _searchTerm; // splits string into array of unicode decimals +_arrayString = toArray _string; +_sizeSearchTerm = count _arraySearchTerm; // We only measure the array once +_sizeString = count _arrayString; + + +_matchingCharacters = 0; +_targetIterator = 0; +_searchIterator = 0; +while {(_searchIterator < _sizeSearchTerm) && (_targetIterator < _sizeString)} do { // Prevents us from going out of bounds + if ((_arraySearchTerm select _searchIterator) == (_arrayString select _targetIterator)) then { // If we have a match, start looking for the next character in the search term + _matchingCharacters = _matchingCharacters + 1; + _searchIterator = _searchIterator + 1 + }; + _targetIterator = _targetIterator + 1; // Look at the next character in the string +}; + +_matchingCharacters \ No newline at end of file diff --git a/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf b/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf new file mode 100644 index 0000000000..b17a582697 --- /dev/null +++ b/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf @@ -0,0 +1,19 @@ +/** + * fn_stringTrim.sqf + * @Descr: Removes white spaces from string + * @Author: Glowbal + * + * @Arguments: [string STRING] + * @Return: STRING copy of string + * @PublicAPI: true + */ + +#define WHITE_SPACE [20] + +private ["_string", "_charArray", "_returnString"]; +_string = [_this, 0, "",[""]] call bis_fnc_param; +_charArray = toArray _string; +_charArray = _charArray - [((toArray " ") select 0)]; +_returnString = toString _charArray; + +_returnString; \ No newline at end of file diff --git a/TO_MERGE/cse/main/stringtable.xml b/TO_MERGE/cse/main/stringtable.xml new file mode 100644 index 0000000000..a0493c1ae5 --- /dev/null +++ b/TO_MERGE/cse/main/stringtable.xml @@ -0,0 +1,27 @@ + + + + + + Accept Requests + Akceptuj prośby + Aceptar Peticiones + + + Decline Requests + Ignoruj prośby + Rechazar Peticiones + + + Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. + Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. + Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. + + + Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions. + Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. + Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. + + + + diff --git a/TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf b/TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf new file mode 100644 index 0000000000..d9d9776bed --- /dev/null +++ b/TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf @@ -0,0 +1,22 @@ +/** + * fn_addTaskToPool_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [id STRING, args ARRAY, code COE] + * @Return: nil; + * @PublicAPI: false + */ + +private ["_id", "_args","_code"]; +_id = _this select 0; +_args = _this select 1; +_code = [_this, 2, {}, [{}]] call BIS_fnc_Param; + +if (isnil "CSE_TASK_POOL_COLLECTION_F") then { + CSE_TASK_POOL_COLLECTION_F = []; +}; +CSE_TASK_POOL_COLLECTION_F pushback [_id, _args, _code ]; + +[format["Added task to task pool: %1", CSE_TASK_POOL_COLLECTION_F]] call cse_fnc_debug; +[[_id, _args, _code],"AddedTotaskPool"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf b/TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf new file mode 100644 index 0000000000..5a44c14bdb --- /dev/null +++ b/TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf @@ -0,0 +1,17 @@ +/** + * fn_loopThroughPool_f.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define TASK_PARAMETERS (_x select 1) +#define TASK_CODE (_x select 2) + +{ + TASK_PARAMETERS call TASK_CODE; + false; +}count CSE_TASK_POOL_COLLECTION_F; diff --git a/TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf b/TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf new file mode 100644 index 0000000000..0699208043 --- /dev/null +++ b/TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf @@ -0,0 +1,25 @@ +/** + * fn_removeTaskFromPool_f.sqf + * @Descr: Remove a task from the task pool. + * @Author: Glowbal + * + * @Arguments: [id STRING] + * @Return: nil + * @PublicAPI: true + */ + +private ["_id", "_index"]; +_id = _this select 0; +_index = -1; + +if (isnil "CSE_TASK_POOL_COLLECTION_F") exitwith {nil}; + +{ + if ((_x select 0) == _id) exitwith { + _index = _foreachIndex; + CSE_TASK_POOL_COLLECTION_F set [ _foreachIndex, objNull]; + }; +}foreach CSE_TASK_POOL_COLLECTION_F; +CSE_TASK_POOL_COLLECTION_F = CSE_TASK_POOL_COLLECTION_F - [objNull]; + +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf b/TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf new file mode 100644 index 0000000000..da83e326fc --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf @@ -0,0 +1,39 @@ +/** + * fn_defineVariable.sqf + * @Descr: Define a variable for the CSE variable framework + * @Author: Glowbal + * + * @Arguments: [name STRING, defaultValue ANY, publicFlag BOOL, category STRING, type NUMBER, persistentFlag BOOL] + * @Return: + * @PublicAPI: true + */ + +private ["_name","_value","_defaultGlobal","_catagory","_code","_persistent"]; +_name = _this select 0; +_value = _this select 1; +_defaultGlobal = _this select 2; +_catagory = _this select 3; +_code = 0; +_persistent = false; + +if (count _this < 3) exitwith {}; +if (count _this > 4) then { + _code = _this select 4; + if (count _this > 5) then { + _persistent = _this select 5; + }; +}; + +if (typeName _name != typeName "") then { + throw "IllegalArgument"; +}; + +if (isnil 'CSE_OBJECT_VARIABLES_STORAGE') then { + CSE_OBJECT_VARIABLES_STORAGE = []; +}; + +CSE_OBJECT_VARIABLES_STORAGE pushback [_name,_value,_defaultGlobal,_catagory,_code, _persistent]; + +missionNamespace setvariable ["cse_object_variables_storage_" + _name, [_name,_value,_defaultGlobal,_catagory,_code, _persistent]]; + +[[_name,_value,_defaultGlobal,_catagory,_code, _persistent],"variableDefined"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf b/TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf new file mode 100644 index 0000000000..52ffe02a36 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf @@ -0,0 +1,27 @@ +/** + * fn_getAllSetVariables.sqf + * @Descr: Returns an 2d array of all variables that have been set on the object + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, category STRING (Optional. Only get the variables from the specified category. Default is "" == all)] + * @Return: ARRAY REturns an array with the format [ [name STRING, typeName STRING, value ANY, publicFlag BOOL, peristentFlag BOOL] ] + * @PublicAPI: true + */ + +private ["_object", "_return", "_val", "_category"]; +_object = _this select 0; +_category = if (count _this > 1) then { _this select 1 } else { "" }; + +if (isnil 'CSE_OBJECT_VARIABLES_STORAGE') then { + CSE_OBJECT_VARIABLES_STORAGE = []; +}; +_return = []; +{ + _val = _object getvariable (_x select 0); + if (!isnil "_val") then { + if (_category == "" || _category == _x select 3) then { + _return pushback [_x select 0, typeName _val, _val, _x select 2, _x select 5]; + }; + }; +}foreach CSE_OBJECT_VARIABLES_STORAGE; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf b/TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf new file mode 100644 index 0000000000..84f37c9387 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf @@ -0,0 +1,31 @@ +/** + * fn_getVariable.sqf + * @Descr: Grabs a variable. If variable has not been set, attempts to use default defined value + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, variableName STRING] + * @Return: ANY + * @PublicAPI: true + */ + +#define UNIT (_this select 0) +#define VARIABLE (_this select 1) + +private "_value"; + +_value = UNIT getvariable VARIABLE; +if (isnil "_value") then { + if (count _this >2) then { + _value = _this select 2; + } else { + private "_definedVariable"; + _definedVariable = ([VARIABLE] call cse_fnc_getVariableInfo); + if (count _definedVariable > 1) then { + _value = _definedVariable select 1; + }; + }; + if (isnil "_value") then { + _value = 0; + }; +}; +_value \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf b/TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf new file mode 100644 index 0000000000..f187f3b05a --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf @@ -0,0 +1,18 @@ +/** + * fn_getvariableDefault.sqf + * @Descr: Get the variable default value + * @Author: Glowbal + * + * @Arguments: [variableName STRING] + * @Return: ANY + * @PublicAPI: true + */ + +private ["_name","_return"]; +_name = _this select 0; +_variableDefinition = ([_name] call cse_fnc_getVariableInfo); +if (count _variableDefinition > 0) then { + _return = _variableDefinition select 1; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf b/TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf new file mode 100644 index 0000000000..0909925f17 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf @@ -0,0 +1,11 @@ +/** + * fn_getvariableInfo.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + ++(missionNamespace getvariable ["cse_object_variables_storage_" + (_this select 0),[]]) \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf b/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf new file mode 100644 index 0000000000..e2119fcb37 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf @@ -0,0 +1,29 @@ +/** + * fn_setVariable.sqf + * @Descr: Setvariable value + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, variableName STRING, value ANY] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit","_variable","_value","_update","_global","_definedVariable","_defaultGlobal","_currentValue"]; +_unit = _this select 0; +_variable = _this select 1; +_value = _this select 2; +_global = false; + +if (count _this > 3) then { + _global = _this select 3; +} else { + _definedVariable = ([_variable] call cse_fnc_getVariableInfo); + if (count _definedVariable > 2) then { + _global = _definedVariable select 2; + }; +}; + +if (!isNil "_value") exitwith { + _unit setvariable [_variable, _value, _global]; +}; +_unit setvariable [_variable, nil, _global]; \ No newline at end of file diff --git a/TO_MERGE/cse/main/version/functions/fn_getVersion.sqf b/TO_MERGE/cse/main/version/functions/fn_getVersion.sqf new file mode 100644 index 0000000000..c3953426f0 --- /dev/null +++ b/TO_MERGE/cse/main/version/functions/fn_getVersion.sqf @@ -0,0 +1,11 @@ +/** + * fn_getVersion.sqf + * @Descr: Get the version number of the current CSE Build + * @Author: Glowbal + * + * @Arguments: [] + * @Return: STRING String containing the version + * @PublicAPI: true + */ + +getText (configFile >> "cfgPatches" >> "cse_main" >> "version"); \ No newline at end of file