Handle Distance when mounted

This commit is contained in:
PabstMirror 2015-10-13 13:40:16 -05:00
parent 8ffe1b4e01
commit 680f52cd27
4 changed files with 13 additions and 12 deletions

View File

@ -25,7 +25,9 @@ class ACE_Settings {
category = ECSTRING(medical,Category_Medical);
};
class GVAR(maxRange) {
value = 4;
//for ref: 3d interaction (MEDICAL_ACTION_DISTANCE) is 1.75
value = 3;
typeName = "SCALAR";
category = ECSTRING(medical,Category_Medical);
};
};

View File

@ -20,7 +20,6 @@ params ["_caller", "_target"];
(alive _caller)
&& {!isNull _target}
&& {(_caller distance _target) < GVAR(maxRange)}
&& {(GVAR(allow) == 1) || {(GVAR(allow) == 2) && {vehicle _caller != _caller || vehicle _target != _target}}}
&& {(GVAR(useMenu) == 1) || {(GVAR(useMenu) == 2) && {vehicle _caller != _caller || vehicle _target != _target}}}
&& {((_caller distance _target) < GVAR(maxRange)) || {(vehicle _caller) == (vehicle _target)}} //for now, ignore range when in same vehicle
&& {(GVAR(allow) == 1) || {(GVAR(allow) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}}
&& {(GVAR(useMenu) == 1) || {(GVAR(useMenu) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}}

View File

@ -20,7 +20,7 @@ params ["_target", "_display"];
private["_allInjuryTexts", "_bandagedwounds", "_damaged", "_genericMessages", "_logs", "_openWounds", "_part", "_partText", "_pointDamage", "_selectionBloodLoss", "_selectionN", "_severity", "_totalIvVolume", "_triageStatus"];
if (isNull _display) exitWith {ERROR("bad display");};
if (isNil "_display" || {isNull _display}) exitWith {ERROR("No display");};
_selectionN = GVAR(selectedBodyPart);
if (_selectionN < 0 || {_selectionN > 5}) exitwith {};

View File

@ -325,7 +325,7 @@ class GVAR(medicalMenu) {
animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)";
animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)";
animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)";
action = QUOTE(GVAR(selectedBodyPart) = 0; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo););
action = QUOTE(GVAR(selectedBodyPart) = 0;);
};
class selectTorso : selectHead {
idc = 302;
@ -333,7 +333,7 @@ class GVAR(medicalMenu) {
y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "4.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
action = QUOTE(GVAR(selectedBodyPart) = 1; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo););
action = QUOTE(GVAR(selectedBodyPart) = 1;);
};
class selectLeftArm: selectHead{
idc = 303;
@ -341,12 +341,12 @@ class GVAR(medicalMenu) {
y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
action = QUOTE(GVAR(selectedBodyPart) = 3; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo););
action = QUOTE(GVAR(selectedBodyPart) = 3;);
};
class selectRightArm: selectLeftArm{
idc = 304;
x = "20.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(GVAR(selectedBodyPart) = 2; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo););
action = QUOTE(GVAR(selectedBodyPart) = 2;);
};
class selectLeftLeg :selectHead {
idc = 305;
@ -354,12 +354,12 @@ class GVAR(medicalMenu) {
y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
action = QUOTE(GVAR(selectedBodyPart) = 5; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo););
action = QUOTE(GVAR(selectedBodyPart) = 5;);
};
class selectRightLeg :selectLeftLeg {
idc = 306;
x = "19.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(GVAR(selectedBodyPart) = 4; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo););
action = QUOTE(GVAR(selectedBodyPart) = 4;);
};