From 9451716a4433fb99299dfaf7dba0243173bfa10a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 24 Sep 2016 15:15:02 -0500 Subject: [PATCH] Show damage on repair items interaction point (#4448) * Show damage on repair items interaction point * Fix dot size * Change scaling --- addons/repair/CfgVehicles.hpp | 5 ++++ addons/repair/XEH_PREP.hpp | 1 + .../functions/fnc_modifyInteraction.sqf | 28 ++++++++++++++++++ addons/repair/ui/damage_0_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_1_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_2_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_3_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_4_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_5_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_6_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_7_ca.paa | Bin 0 -> 5625 bytes addons/repair/ui/damage_8_ca.paa | Bin 0 -> 5625 bytes 12 files changed, 34 insertions(+) create mode 100644 addons/repair/functions/fnc_modifyInteraction.sqf create mode 100644 addons/repair/ui/damage_0_ca.paa create mode 100644 addons/repair/ui/damage_1_ca.paa create mode 100644 addons/repair/ui/damage_2_ca.paa create mode 100644 addons/repair/ui/damage_3_ca.paa create mode 100644 addons/repair/ui/damage_4_ca.paa create mode 100644 addons/repair/ui/damage_5_ca.paa create mode 100644 addons/repair/ui/damage_6_ca.paa create mode 100644 addons/repair/ui/damage_7_ca.paa create mode 100644 addons/repair/ui/damage_8_ca.paa diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index e073c3d2ff..847258f6da 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -313,6 +313,11 @@ class CfgVehicles { class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {}; }; + class ACE_Actions { + class ACE_MainActions { + modifierFunction = QUOTE(_this call FUNC(modifyInteraction)); + }; + }; accuracy = 0.2; vehicleClass = "ACE_Logistics_Items"; diff --git a/addons/repair/XEH_PREP.hpp b/addons/repair/XEH_PREP.hpp index e3604c95a7..692bee6112 100644 --- a/addons/repair/XEH_PREP.hpp +++ b/addons/repair/XEH_PREP.hpp @@ -23,6 +23,7 @@ PREP(isEngineer); PREP(isInRepairFacility); PREP(isNearRepairVehicle); PREP(isRepairVehicle); +PREP(modifyInteraction); PREP(moduleAddSpareParts); PREP(moduleAssignEngineer); PREP(moduleAssignRepairVehicle); diff --git a/addons/repair/functions/fnc_modifyInteraction.sqf b/addons/repair/functions/fnc_modifyInteraction.sqf new file mode 100644 index 0000000000..cff0fbe6e8 --- /dev/null +++ b/addons/repair/functions/fnc_modifyInteraction.sqf @@ -0,0 +1,28 @@ +/* + * Author: PabstMirror + * Modifies the base interaction point for repair items to show it's current damage + * + * Arguments: + * 0: Target + * 1: Player + * 2: Args + * 3: Action Data + * + * Return Value: + * Nothing + * + * Example: + * [cursorObject, player, [], []] call ace_repair_fnc_modifyInteraction; + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_player", "_args", "_actionData"]; +TRACE_4("params",_target,_player,_args,_actionData); + +// Interaction dots numbered 0..8, white to red. +// Convert damage to number (rounding up), so that even slight damage can bee seen + +private _fileName = format [QPATHTOF(ui\damage_%1_ca.paa), ceil (linearConversion [0, 1, damage _target, 0, 8, true])]; +_actionData set [2, _fileName]; diff --git a/addons/repair/ui/damage_0_ca.paa b/addons/repair/ui/damage_0_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..f7c2348f295c6d520b850ae48fae5112b281bd7a GIT binary patch literal 5625 zcmeHLUr19?82@&s=}?)-2ENEHSPwqCd3X(5VkQaJlDq&Ub&`pYxqR z_tdlAUjOCOy+MB+0IaXCpEU5G{~Te4g>bJwAQQIWL->*`pO>(%;q$N+V8Q_~=>%B8 zr?Mh}1b_^?g%t8Sy=%A@k6J$bjzDcb{C_^YY9DKThDDxBg)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>r1!MJA}tvQ}brZA;s#e z2ShBlsbA-x#9ayi+8g56@=?{kZT`npQ{;JsUwz>xWv zbI-ZwJLleea_y|EEBNcrU6EiD0BkRgbr?7r{Dm+>A>0+*5h5($LwHvx6qfN_!{@XM z;M_8R zxQD1~J^8eK=@oZ)M>jYSki;rI~y zi4kAZVbV{MzBg+70~Q$eV(~1XKWFaN>c><0uqu9k@qS|bw?!W)UrAq^lgBgLc)yho ze{p5y?r>!(`HRG&y;kQxP?HkoR?}+k>n;;1 zQ~sY#4phjVDB2t|`)6YrHqlJ_nwE{v)ql7YI?{n{2Jvb4;ol+&E!tei$UcBLWMJ?I zOst&@vZuT{z_#Kd*OYX+5{0=bx)<4 zl{*PXWsR#(Tb8YQd6+#ox{>rj6xv#KHa4ib?iyH=qujvvnr{oVfD91SvE%Y5UNH9Z z4M6vZflpO+6Wg1E`tc(_pbFs;T-!l?U^NXP+-#@)w2An<4cnHug^NEj=9qwGcvEZ0 EM}+x`NB{r; literal 0 HcmV?d00001 diff --git a/addons/repair/ui/damage_3_ca.paa b/addons/repair/ui/damage_3_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..88bc0b87ab65b4d3b8c4999702edeacfa421d9d6 GIT binary patch literal 5625 zcmeHLOK1~O6umQPY=cCDpBfQ0sb-^<+C?G+q!S7$f|8<63>YK^L=dY5K|~ibq9VAk zDrO=0S%@D31yRUCghWLVRN75tBqo;n-)N+z5}M?B?@XSGP-|0RK=NS79CF{i@0@$z zXP%XHbp^I|c7+2C0I=%$Xq%2BflY)NHo{$jjX}Z!K7_XfgCPmuReVl508TFeNGt?+ zh0pYw1QGyxs5T17-|4rG>w47d;im%i`S9oY@X&e8k;LXsrh2leU9An9Ex3j#%iXz@ zwSVtrW@T5M^3WR5pVwZLP|RzUH!gWLfIput+~9Z^z@59DvxSNsy8X68s_yUhrTd1z z@)*wukH@iD`B{d1m!x*D=6qSpr*6Rl@Tl_8<+YIp#t1#gI4sLD$JZ;zE2P(CnCuf| z-x9Ihgju@3XeRm{;eLqk;SD41Eu*C zFC2~Znw@`t{$si{k=EpVeZA3 zcuXMs?x-x!H2(kI-$7S_bjfJ6TFdnJ{>|E~W2KT_w(TB4gl5fMYGg$!%l3$*a`Q>c zvRNw*uqXT1l0Armr&(j8R}{ws9jj7=JNQ@QZGt9{00J7GxP0*sjII0(&^@T*qh-y& v*2aK#aNi0vAv}n4JD~L~r7naUt+bvtke>Ho!#tO8ZY5*8#$f^8)ava!7|xbb literal 0 HcmV?d00001 diff --git a/addons/repair/ui/damage_4_ca.paa b/addons/repair/ui/damage_4_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..24584de084ad68182bc521982637110b08ae0072 GIT binary patch literal 5625 zcmeHLO=uHQ5T4x_ZIEd2r$$6gT6?lmdq{+Ubc2#2D2eFSfI(uc2*qka5YfY~SP(o| z6?+i;IVh-sf+*x5LZTHBRO&@piHW8DAHwjT;+HWz?-|7bA*d6hW@rgs$uWug}bIb zeUxW}`{UTE{4B$Gm!$Trj!&L&N!G`Y!9VKxM)MH_ z$B+D18sB961@aiY@?{bElcc!i`S%YEetsL;-$?c7Z1DB+`BVMl^1aUSbonUT>+lb? z3_or;usM7@{;Bf8<3)QAS5Np1 zdzpA_S@QJS?2S&t->A;5Ti>tp^T?Zgkl2n#Am_uID-OJS+OeJTC9ZlVWBoGrq^FbW z7htxDmD^4e56a#g8##NylO=ui&^FndT-=x~+xs;?wSvW#&eUHrD~N4VGdc2MhCN<#?S?X;iHAU^NFhIt<0%nHWVe}V;gQ)|d~(D|Wp literal 0 HcmV?d00001 diff --git a/addons/repair/ui/damage_5_ca.paa b/addons/repair/ui/damage_5_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..41a7e5b42d1588c1d3917025773ea7fe7c2b42fe GIT binary patch literal 5625 zcmeHLU1$?o6h1R!v_YalYmJDSwDxH$wGW99STaFK5tKx9YQP{dvIt_eAc*M0jPyb9 zVY`2QSnvnTgAyo+LLNj&G$4XXeNjeYVyU`6AehpigigG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nm;bR&A+B>ort7*$V8pfZ@(Wt(z)PoeOUd3(ZK$~3>MLyYP z+g7+zYEfmCUb2s+HLXV9a9g@k<^Nb^#2|m7DB0)cXQdSTxQy&IEgf4Zf2bHd(v8~; z($nTu6y`#YlJhU}4hj%wCf&Y87pI3N<9%-m8 Xq~{&jxymh^|BbOs30C7ttvUV&%!a`o literal 0 HcmV?d00001 diff --git a/addons/repair/ui/damage_7_ca.paa b/addons/repair/ui/damage_7_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..087359e3244761b1df1eefa90d84dedc8d87c7f2 GIT binary patch literal 5625 zcmeHLO=uHQ5T4yM+91*3PmPGWsrF>0^^gbw=>{Q1P!iFt0fWSV2x4nN5YfY~R1iE^ z6?+i;Ie1V41yRUBgpC$NP^lMXB_@{Q|HWvFC2i8@%x<1apw_06qU6D{`(c`8Lyj_c6`%cl*kH%U^Mn zSA_F%JXiHuje1um53J{US>wmBU;{vXlGkCw99R*`<1ju+L6)$DnDR9hCVQRC8zZ)x zFwgWCjimtjoasBOUY6&BOnENoTrKPyei$F!yKs`~)#q(;@+fAi_fPZT8(vX(Fj!bZ zd>zq9H`iP(z2$uV><7Itp;JFgPKO|H{nP2G^u9l0w97kd(?yj79e z=A-0K_YJpwdD3$EKJj%&q8-()cR3%fNAVNMeQ8>c)~Kks5n5r{xrJ08usOV3|4j42 z^`bwBX=l8qzf>%`I&pq;`c|jOH(KQ0tGC{j>*tuik35No@jdto<5}iQWSF6GfY2dVV&dv$6SPuW6~+Z23dEU{?!nGbo>Suc9z~ zd4kP#g!}`D{U!#V-@@AQP;SxXm$*$J`*2iIX3PJ-KkuSXf%K8l8kM$b`ST6Nyq-dV z+IFC|Nf4pI@D%2=JhtUPYed$#`IK$hVB`ncqrPtA z&z8Ek<#mZ~UXN<|@1A@dnK`oNJH>0r)nr?;e@oQIJ-MmyaJ;ad_&P(u-mm0LI z^{=oeGnFXJCMcf;o0a3{da>Mi|3ME=M*h;pzRASb8y3at`;X2)9i;dR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