Compare commits
11 Commits
3.1.0
...
1f1552bd53
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f1552bd53 | |||
| c912e730ac | |||
|
0301758e28
|
|||
|
|
85e9af6a73 | ||
|
|
32d8589733 | ||
|
|
bc9b20a89d | ||
| 61d3e2faf1 | |||
| 544039efbf | |||
|
15f7225a5f
|
|||
| a3da783d06 | |||
|
18435194a7
|
11
CHANGELOG.md
11
CHANGELOG.md
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project badly attempts [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [3.1.2] - 2024-01-04
|
||||
|
||||
### Added
|
||||
- Add forgotten code file file for medical overlay
|
||||
|
||||
## [3.1.1] - 2024-01-04
|
||||
|
||||
### Changed
|
||||
- Spelling Fixes
|
||||
- Update class binding for vehicle flag interaction
|
||||
|
||||
## [3.1.0] - 2023-12-17
|
||||
|
||||
### Added
|
||||
|
||||
@@ -32,6 +32,7 @@ class milsim
|
||||
class bindEventHandlers { postInit = 1; };
|
||||
class bindVehicleActions { postInit = 1; };
|
||||
class addClientStatsPFH {};
|
||||
class addMedicalOverlayPFH { postInit = 1; }; // nees refactor
|
||||
class calculateClientStats {};
|
||||
class initVehicleFlags { postInit = 1; };
|
||||
class bindEmptyGroupGarbageCleanup { postInit = 1; };
|
||||
|
||||
79
functions/client/fn_addMedicalOverlayPFH.sqf
Normal file
79
functions/client/fn_addMedicalOverlayPFH.sqf
Normal file
@@ -0,0 +1,79 @@
|
||||
// Enable/Disable the script
|
||||
if (isNil "milsim_client_medState3D_enabled") then {
|
||||
milsim_client_medState3D_enabled = true;
|
||||
};
|
||||
|
||||
// List of units to draw icons for
|
||||
milsim_client_medState3D_drawTargets = [];
|
||||
|
||||
// Range to draw icons for
|
||||
milsim_client_medState3D_drawRange = 10;
|
||||
|
||||
// ACE Triage colors, for consistency across UIs and functions
|
||||
// #define TRIAGE_COLOR_NONE 0.5, 0.5, 0.5, 0.1
|
||||
// #define TRIAGE_COLOR_MINIMAL 0, 0.5, 0, 0.9
|
||||
// #define TRIAGE_COLOR_DELAYED 1, 0.84, 0, 0.9
|
||||
// #define TRIAGE_COLOR_IMMEDIATE 1, 0, 0, 0.9
|
||||
// #define TRIAGE_COLOR_DECEASED 0, 0, 0, 0.9
|
||||
|
||||
// ACE Triage colors, for consistency across UIs and functions
|
||||
milsim_client_medState3D_colors = [
|
||||
[0, 0.5, 0, 0.9], // TRIAGE_COLOR_MINIMAL
|
||||
[1, 0.84, 0, 0.9], // TRIAGE_COLOR_DELAYED
|
||||
[1, 0, 0, 0.9], // TRIAGE_COLOR_IMMEDIATE
|
||||
[0, 0, 0, 0.9], // TRIAGE_COLOR_DECEASED
|
||||
[0.5, 0.5, 0.5, 0] // TRIAGE_COLOR_NONE
|
||||
];
|
||||
|
||||
// Per-frame handler to draw icons
|
||||
milsim_client_medState3D_pfh = [
|
||||
{
|
||||
// if disabled, skip processing
|
||||
if (!milsim_client_medState3D_enabled) exitWith {};
|
||||
|
||||
// if no targets, skip processing
|
||||
if (count milsim_client_medState3D_drawTargets == 0) exitWith {};
|
||||
|
||||
if !([player] call ace_medical_treatment_fnc_isMedic) exitWith {};
|
||||
|
||||
{
|
||||
// distance within 10 meters
|
||||
if (player distance _x > milsim_client_medState3D_drawRange) then {continue};
|
||||
// check unit not null, not conscious, and not in a vehicle
|
||||
if (
|
||||
isNull _x ||
|
||||
!(_x getVariable ["ACE_isUnconscious", false]) ||
|
||||
!isNull (objectParent _x)
|
||||
) then {continue};
|
||||
|
||||
// color based on triage level
|
||||
private _color = milsim_client_medState3D_colors select ((_x getVariable ["ace_medical_triageLevel", -1]) -1);
|
||||
// draw position, slightly above the prone unit
|
||||
private _drawPos = (visiblePosition _x) vectorAdd [0, 0, 0.5];
|
||||
// draw icon
|
||||
drawIcon3D [
|
||||
"\A3\ui_f\data\map\markers\military\dot_CA.paa", // icon texture
|
||||
_color, // color
|
||||
_drawPos, // position AGL
|
||||
1, // width
|
||||
1, // height
|
||||
0 // angle
|
||||
// further params optional, omitted
|
||||
];
|
||||
} forEach milsim_client_medState3D_drawTargets;
|
||||
},
|
||||
0,
|
||||
[]
|
||||
] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[
|
||||
"Man",
|
||||
"InitPost",
|
||||
{
|
||||
params ["_unit"];
|
||||
milsim_client_medState3D_drawTargets pushBack _unit;
|
||||
},
|
||||
true,
|
||||
[],
|
||||
true
|
||||
] call CBA_fnc_addClassEventHandler;
|
||||
@@ -80,15 +80,46 @@ milsim_vehicleflag_options = [
|
||||
];
|
||||
|
||||
|
||||
private _appliedParentClasses = [
|
||||
"LandVehicle",
|
||||
"Helicopter"
|
||||
];
|
||||
|
||||
["AllVehicles", "InitPost", {
|
||||
private _modelsWithoutFlagProxies = [
|
||||
"TF373_SOAR_MH47G_Base", // MH-47G Chinook
|
||||
"RHS_MELB_base", // MELB AH-6M/MH-6M/H-6M Little Bird
|
||||
"USAF_C17", // C17 Globemaster III
|
||||
"USAF_C130J", // C130J Super Hercules
|
||||
"USAF_AC130U", // AC130 Spooky II
|
||||
"ej_UH60M_base", // UH-60M Black Hawk + DAP variants
|
||||
"rhsusf_fmtv_base" // M1083A1P2 variants + SOV SOCOM variants
|
||||
];
|
||||
|
||||
{
|
||||
private _parentClass = _x;
|
||||
[_parentClass, "InitPost", {
|
||||
private _flagActionID = "SetVehicleFlag";
|
||||
private _flagMasterAction = [
|
||||
_flagActionID, // id
|
||||
"Set Vehicle Flag", // displayed title
|
||||
"\A3\ui_f\data\map\markers\flags\nato_ca.paa", // flag icon
|
||||
{true}, // statement
|
||||
{true}, // condition
|
||||
{
|
||||
params ["_target", "_player", "_params"];
|
||||
private _modelsWithoutFlagProxies = _params select 1;
|
||||
|
||||
// check if hierarchy includes any of the models without flag proxies
|
||||
private _excluded = false;
|
||||
{
|
||||
if (_excluded) exitWith {false};
|
||||
_excluded = _target isKindOf _x;
|
||||
} forEach _modelsWithoutFlagProxies;
|
||||
if (_excluded) exitWith {false};
|
||||
|
||||
|
||||
// check if vehicle is alive
|
||||
alive _target;
|
||||
}, // condition
|
||||
{
|
||||
params ["_target", "_player", "_params"];
|
||||
private _flagActionID = _params#0;
|
||||
@@ -149,7 +180,7 @@ milsim_vehicleflag_options = [
|
||||
|
||||
_actions;
|
||||
}, // child code
|
||||
[_flagActionID], // params
|
||||
[_flagActionID, _modelsWithoutFlagProxies], // params
|
||||
nil, // position
|
||||
4, // distance
|
||||
[false, false, false, false, false], // other params
|
||||
@@ -174,7 +205,10 @@ milsim_vehicleflag_options = [
|
||||
params ["_target", "_player", "_params"];
|
||||
_target forceFlagTexture "";
|
||||
}, // statement
|
||||
{true}, // condition
|
||||
{
|
||||
params ["_target", "_player", "_params"];
|
||||
alive _target && getForcedFlagTexture _target != "";
|
||||
}, // condition
|
||||
nil // child code
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
|
||||
@@ -185,6 +219,7 @@ milsim_vehicleflag_options = [
|
||||
_removeFlagAction // action
|
||||
] call ace_interact_menu_fnc_addActionToObject;
|
||||
|
||||
}, true, [], true] call CBA_fnc_addClassEventHandler;
|
||||
}, true, [], true] call CBA_fnc_addClassEventHandler;
|
||||
} forEach _appliedParentClasses;
|
||||
|
||||
nil;
|
||||
@@ -6,7 +6,7 @@
|
||||
"milsim_sideChat",
|
||||
"CHECKBOX",
|
||||
"Side Chat Text Enabled",
|
||||
["17th Battallion", "Side Chat"],
|
||||
["17th Battalion", "Side Chat"],
|
||||
false,
|
||||
true,
|
||||
{
|
||||
@@ -25,7 +25,7 @@
|
||||
"milsim_server_cps_enable",
|
||||
"CHECKBOX",
|
||||
"CPS Metrics Enabled",
|
||||
["17th Battallion", "Server Metrics"],
|
||||
["17th Battalion", "Server Metrics"],
|
||||
true,
|
||||
true,
|
||||
{
|
||||
@@ -40,7 +40,7 @@
|
||||
"milsim_server_cps_interval",
|
||||
"TIME",
|
||||
"Metrics Interval",
|
||||
["17th Battallion", "Server Metrics"],
|
||||
["17th Battalion", "Server Metrics"],
|
||||
[60,300,120],
|
||||
true,
|
||||
{
|
||||
@@ -71,7 +71,7 @@
|
||||
"milsim_client_cps_enable",
|
||||
"CHECKBOX",
|
||||
"CPS Metrics Enabled",
|
||||
["17th Battallion", "Client Metrics"],
|
||||
["17th Battalion", "Client Metrics"],
|
||||
true,
|
||||
true,
|
||||
{
|
||||
@@ -86,7 +86,7 @@
|
||||
"milsim_client_cps_interval",
|
||||
"TIME",
|
||||
"CPS Metrics Interval",
|
||||
["17th Battallion", "Client Metrics"],
|
||||
["17th Battalion", "Client Metrics"],
|
||||
[60,300,120],
|
||||
true,
|
||||
{
|
||||
@@ -104,6 +104,17 @@
|
||||
}
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
//---------------------
|
||||
// Medical Overlay
|
||||
//---------------------
|
||||
|
||||
[
|
||||
"milsim_client_medState3D_enabled",
|
||||
"CHECKBOX",
|
||||
["Enable 3D Triage Card State", "Draws a colored dot over units within 10m indicating current ACE Triage State"],
|
||||
"Medical",
|
||||
true
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
diag_log text "[MILSIM] (settings) Custom CBA settings initialized";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user