From bbbfabec035c87d73280f2ec7130005546c1a677 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 22 Jun 2018 15:41:43 -0400 Subject: [PATCH] Add new explosive timer UI --- addons/explosives/ACE_Arsenal_Stats.hpp | 2 +- addons/explosives/ACE_Triggers.hpp | 28 +++-- addons/explosives/CfgEventHandlers.hpp | 1 - addons/explosives/ExplosivesUI.hpp | 80 +-------------- addons/explosives/TimerDialog.hpp | 97 ++++++++++++++++++ addons/explosives/UI/seven_segment_0.paa | Bin 0 -> 11666 bytes addons/explosives/UI/seven_segment_1.paa | Bin 0 -> 11421 bytes addons/explosives/UI/seven_segment_2.paa | Bin 0 -> 11591 bytes addons/explosives/UI/seven_segment_3.paa | Bin 0 -> 11590 bytes addons/explosives/UI/seven_segment_4.paa | Bin 0 -> 11550 bytes addons/explosives/UI/seven_segment_5.paa | Bin 0 -> 11594 bytes addons/explosives/UI/seven_segment_6.paa | Bin 0 -> 11634 bytes addons/explosives/UI/seven_segment_7.paa | Bin 0 -> 11481 bytes addons/explosives/UI/seven_segment_8.paa | Bin 0 -> 11681 bytes addons/explosives/UI/seven_segment_9.paa | Bin 0 -> 11650 bytes .../explosives/UI/seven_segment_separator.paa | Bin 0 -> 11498 bytes addons/explosives/XEH_PREP.hpp | 12 +-- addons/explosives/config.cpp | 16 ++- .../functions/fnc_openTimerSetUI.sqf | 44 -------- .../explosives/functions/fnc_openTimerUI.sqf | 77 ++++++++++++++ .../explosives/functions/fnc_startTimer.sqf | 14 +-- addons/explosives/script_component.hpp | 15 +++ addons/explosives/stringtable.xml | 3 + 23 files changed, 232 insertions(+), 157 deletions(-) create mode 100644 addons/explosives/TimerDialog.hpp create mode 100644 addons/explosives/UI/seven_segment_0.paa create mode 100644 addons/explosives/UI/seven_segment_1.paa create mode 100644 addons/explosives/UI/seven_segment_2.paa create mode 100644 addons/explosives/UI/seven_segment_3.paa create mode 100644 addons/explosives/UI/seven_segment_4.paa create mode 100644 addons/explosives/UI/seven_segment_5.paa create mode 100644 addons/explosives/UI/seven_segment_6.paa create mode 100644 addons/explosives/UI/seven_segment_7.paa create mode 100644 addons/explosives/UI/seven_segment_8.paa create mode 100644 addons/explosives/UI/seven_segment_9.paa create mode 100644 addons/explosives/UI/seven_segment_separator.paa delete mode 100644 addons/explosives/functions/fnc_openTimerSetUI.sqf create mode 100644 addons/explosives/functions/fnc_openTimerUI.sqf diff --git a/addons/explosives/ACE_Arsenal_Stats.hpp b/addons/explosives/ACE_Arsenal_Stats.hpp index 61534b0f9d..cde27f3bde 100644 --- a/addons/explosives/ACE_Arsenal_Stats.hpp +++ b/addons/explosives/ACE_Arsenal_Stats.hpp @@ -4,7 +4,7 @@ class EGVAR(arsenal,stats) { scope = 2; priority = 1; stats[] = {QGVAR(Range)}; - displayName= CSTRING(statExploRange); + displayName = CSTRING(statExploRange); showText = 1; textStatement = QUOTE(params [ARR_2('_stat', '_config')]; private _exploRangeStat = getNumber (_config >> _stat select 0); format [ARR_3('%1m (%2ft)', _exploRangeStat, (_exploRangeStat / 0.3048) toFixed 1)]); condition = QUOTE(params [ARR_2('', '_config')]; (getNumber (_config >> QQGVAR(Detonator))) > 0); diff --git a/addons/explosives/ACE_Triggers.hpp b/addons/explosives/ACE_Triggers.hpp index b62e593261..e9c717504e 100644 --- a/addons/explosives/ACE_Triggers.hpp +++ b/addons/explosives/ACE_Triggers.hpp @@ -1,13 +1,19 @@ class ACE_Triggers { - /* onPlace parameters: -0: OBJECT - unit placing -1: OBJECT - Placed explosive -2: STRING - Magazine classname -3: ARRAY - vars -Last Index: ACE_Triggers config of trigger type. -onSetup parameters: -0: STRING - Magazine Classname - */ + /* onPlace Parameters: + * 0: Unit placing + * 1: Explosive + * 2: Magazine classname + * 3: Additional arguments + * - Same as those passed to FUNC(placeExplosive) for specific trigger type + * - Last element is ACE_Triggers config of the trigger type + * + * onSetup Parameters: + * 0: Explosive + * 1: Magazine classname + * + * For both, expected return type is BOOL. + * True indicates manual handling of explosive setup/placement. + */ class Command { isAttachable = 1; displayName = CSTRING(clacker_displayName); @@ -50,8 +56,8 @@ onSetup parameters: isAttachable = 1; displayName = CSTRING(timerName); picture = QPATHTOF(data\UI\Timer.paa); - onPlace = QUOTE([ARR_2(_this select 1,(_this select 3) select 0)] call FUNC(startTimer);false); - onSetup = QUOTE(_this call FUNC(openTimerSetUI);true); + onPlace = QUOTE([ARR_2(_this select 1, _this select 3 select 0)] call FUNC(startTimer); false); + onSetup = QUOTE(_this call FUNC(openTimerUI)); }; class Tripwire { isAttachable = 0; diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index 37df24577d..e25f1e14ab 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index 7b0b2c6629..cd06abff5b 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -1,19 +1,4 @@ -#define GUI_GRID_X (0) -#define GUI_GRID_Y (0) -#define GUI_GRID_W (0.025) -#define GUI_GRID_H (0.04) - -#define ST_CENTER 0x02 -#define X_OFFSET 0.25 - -class RscText; -class RscButton; -class RscXSliderH; -class IGUIBack; -class RscPicture; -class RscEdit; - -class Rsc_ACE_CallScreen_Edit:RscEdit { +class Rsc_ACE_CallScreen_Edit: RscEdit { canModify = 1; colorBackground[] = {0,0,0,0}; colorText[] = {0,0,0,1}; @@ -32,7 +17,7 @@ class Rsc_ACE_CallScreen_Edit:RscEdit { w = 0.0825 * safezoneW; h = 0.044 * safezoneH; }; -class Rsc_ACE_HiddenButton:RscButton { +class Rsc_ACE_HiddenButton: RscButton { colorText[] = {0, 0, 0, 0}; colorDisabled[] = {0, 0, 0, 0}; colorBackground[] = {0, 0, 0, 0}; @@ -46,66 +31,7 @@ class Rsc_ACE_HiddenButton:RscButton { shadow = 0; }; -class Rsc_ACE_Timer_Slider:RscXSliderH { - x = 0.4; - y = 0.2; - w = 0.3; - h = "1*((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0,0,0,0.5}; -}; - -class RscACE_SelectTimeUI { - idd = 8854; - movingEnable = 0; - class controls { - class back:IGUIBack { - x = X_OFFSET; - y = 0; - w = 0.5; - h = 0.2; - colorBackground[] = {0, 0, 0, 0.5}; - }; - class header: RscText{ - idc = 8870; - x = X_OFFSET + 0.005; - y = 0.005; - w = 0.49; - h = 0.05; - style = ST_CENTER; - text = ""; - }; - class slider: Rsc_ACE_Timer_Slider { - idc = 8845; - x = X_OFFSET + 0.005; - y = 0.06; - w = 0.49; - h = 0.025; - onSliderPosChanged = "_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];"; - }; - class cancelBtn: RscButton { - idc = 8855; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.09; - style = ST_CENTER; - text = CSTRING(Cancel); - action = "closeDialog 0;"; - }; - class approveBtn: RscButton { - idc = 8860; - x = X_OFFSET + 0.345; - y = 0.09; - h = 0.1; - w = 0.15; - style = ST_CENTER; - text = CSTRING(SetTime); - action = "closeDialog 0;"; - }; - }; -}; - -class Rsc_ACE_NumKeyButton: Rsc_ACE_HiddenButton{}; +class Rsc_ACE_NumKeyButton: Rsc_ACE_HiddenButton {}; class Rsc_ACE_PhoneInterface { idd = 8855; movingEnable = 1; diff --git a/addons/explosives/TimerDialog.hpp b/addons/explosives/TimerDialog.hpp new file mode 100644 index 0000000000..a3ab96af06 --- /dev/null +++ b/addons/explosives/TimerDialog.hpp @@ -0,0 +1,97 @@ +class GVAR(timerUI) { + idd = -1; + movingEnable = 1; + enableSimulation = 1; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(timerDisplay), _this select 0)]); + class controlsBackground { + class Header: RscText { + idc = -1; + text = CSTRING(ExplosiveTimer); + x = 13.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 5 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 13 * GUI_GRID_W; + h = GUI_GRID_H; + colorBackground[] = GUI_BCG_COLOR; + moving = 1; + }; + class Background: RscText { + idd = -1; + x = 13.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 6.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 13 * GUI_GRID_W; + h = 6.5 * GUI_GRID_H; + colorBackground[] = {0, 0, 0, 0.8}; + }; + }; + class controls { + class DigitBackground_1: RscPicture { + idc = -1; + text = QPATHTOF(UI\seven_segment_8.paa); + x = 14 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 4 * GUI_GRID_W; + h = 4 * GUI_GRID_H; + colorText[] = {0.3, 0.3, 0.3, 0.5}; + }; + class DigitBackground_2: DigitBackground_1 { + x = 16.4 * GUI_GRID_W + GUI_GRID_CENTER_X; + }; + class DigitBackground_3: DigitBackground_1 { + x = 19.7 * GUI_GRID_W + GUI_GRID_CENTER_X; + }; + class DigitBackground_4: DigitBackground_1 { + x = 22.1 * GUI_GRID_W + GUI_GRID_CENTER_X; + }; + class DigitSeparator: DigitBackground_1 { + text = QPATHTOF(UI\seven_segment_separator.paa); + x = 18.025 * GUI_GRID_W + GUI_GRID_CENTER_X; + colorText[] = {1, 0.05, 0.05, 1}; + }; + class Digit_1: DigitBackground_1 { + idc = IDC_TIMER_DIGIT_1; + text = QPATHTOF(UI\seven_segment_0.paa); + colorText[] = {1, 0.05, 0.05, 1}; + }; + class Digit_2: Digit_1 { + idc = IDC_TIMER_DIGIT_2; + x = 16.4 * GUI_GRID_W + GUI_GRID_CENTER_X; + }; + class Digit_3: Digit_1 { + idc = IDC_TIMER_DIGIT_3; + x = 19.7 * GUI_GRID_W + GUI_GRID_CENTER_X; + }; + class Digit_4: Digit_1 { + idc = IDC_TIMER_DIGIT_4; + x = 22.1 * GUI_GRID_W + GUI_GRID_CENTER_X; + }; + class Slider: ctrlXSliderH { + idc = IDC_TIMER_SLIDER; + x = 14 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 11.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 12 * GUI_GRID_W; + h = GUI_GRID_H; + color[] = {0.3, 0.3, 0.3, 0.7}; + colorActive[] = {0.3, 0.3, 0.3, 0.7}; + sliderRange[] = {TIMER_VALUE_MIN, TIMER_VALUE_MAX}; + sliderPosition = TIMER_VALUE_DEFAULT; + }; + class CancelButton: RscButton { + idc = -1; + text = CSTRING(Cancel); + onButtonClick = QUOTE(closeDialog 0); + x = 13.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 12.7 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 5 * GUI_GRID_W; + h = GUI_GRID_H; + colorActive[] = {0, 0, 0, 1}; + colorBackground[] = {0, 0, 0, 0.8}; + colorFocused[] = {0, 0, 0, 0.8}; + }; + class ConfirmButton: CancelButton { + idc = IDC_TIMER_CONFIRM; + text = CSTRING(SetTime); + onButtonClick = ""; + x = 21.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + }; + }; +}; diff --git a/addons/explosives/UI/seven_segment_0.paa b/addons/explosives/UI/seven_segment_0.paa new file mode 100644 index 0000000000000000000000000000000000000000..39c56516b0905726477781a6248fd90c58238e39 GIT binary patch literal 11666 zcmeGiOK2Tc^tAJu8E9o<5kD}AH$jP}iP5Ii-|M?CSP~bC3rmThh#=@j-AF-5YZQd4 z2yWaZSVW`?yAec@Nx7Phpzs#D9J6Ru>Srx8?+EW?r-wXo3Pe11zvD1j9(-W= zrkK4Mc+*Jx&yzQ^y$iQa1>W~AdoFA3;A}bYCe~cv8GH{G_dom6gDCIU$Sn_h zqE2q&i2sdvN>F@u25@E9{qVzx1R}d%Y{-e)+c2ca$UI-0G`V zdEMg5FHVhsOz_t&eb({BA6B=He^xzO$B|wb2`WDEV$1xZ#H{Ldu$6LJ?MuT+AKaES z)&IEt$-OQ&a+=ovR>(=SGp(QWD(b&x|JyuW)IUZ2leTWU?Wc8S6&@|>Er$@`5E^mG#}D8^)M!Eh4%`DrpMO`if<$T@38%k+5S*H+*GGF z^fmVPic`Hy^GI^?evakEPwCeh4}IEg=SztE>Z!c!P2;2Hf&Q@R;O`Hn$tn8v9QQg8 zRj2}ZU2j*l&~(rCs!kf6k;e&Qc4^vf+vU*;1%NPg^)$X&`;A-`$@}71y@s`i5NR;x zzIy+e$2OhhTl-M_Rgc${zP^@EbXo088&}BR{`ogw6-X*B()?um$zPoQunAGW>Uc|+ z1{EW7%!Q|Wnc@#M;EFC5B8_j>e&SQazs@w*?)ul?lc4?kR9s<1YzBRwn>^kB>j;v= zwJ<#7)_T}@OoPHaf9gn=HO{k+BULsltFrR3;~0Jlh@Yog)Ix1B*PrpUO?S35uquRl z47aNLEgl4mFNaG|LU~vmoe=V#0&h**! z7x=zMwWcXV`kK`z4HA{vjI?>L(_>^12I;d<%T5V(bhRUe@7sP0={~MTH4KXlZu>1% wH_QMmhEnKNF(-XrG~D4~MT+rAc~ZBkHf zUSgp7xImmZ@9?rA8?QDtVHUe^{{iENH3`E4T6L%0BV0I0rBQ za7pXf(b6uP`pbr5hxc`l$XQ&|$*zZuXp-E9^K0#&ef%XQ0h>}s#gU<*I!G-`nb1fn zszKtLqGZd~f7jQ)q%y#oQ&CfOSG99q{-zi7DIk5R*~~Jfv;>UR{)&n8QT>$qLGA5` z>=S^x@gnup`_F>9_Dy>0u%3LMTPXu_myRO3gtN;K2 literal 0 HcmV?d00001 diff --git a/addons/explosives/UI/seven_segment_2.paa b/addons/explosives/UI/seven_segment_2.paa new file mode 100644 index 0000000000000000000000000000000000000000..dd1e6bd383ec9da86dc424aca8a3542cb0a24c8b GIT binary patch literal 11591 zcmeHNO^6gn6n-3Ug4%W!Bt+2MHY}5QUEAdsWpd+nLV%^|~`j7xcWYSFh@Q z@71g7s+ub3xw+cOcjr#kMgTx-z2D?d*WPz|Q$AOFZY3aiBE^=BPcv7z*eY%o&jMiT?^m_NWKJ*i{k7kDC8eo_L#VIs~Cj> z#sgnmX?Oyr0{{9nV_bZ_nMIL+(Py62e?AtU?e^6rP~q6qtxSNZmc^%mKS?zzXLe0s z?ehUVnSQI`9Y#R`Kh7UvsGHpag*lski%`0Q*PowxoQsWrdx&e>!UoOR%>tp`4QdJY z%-@K zQ~ANgo$nB6^n@0$1MS$jG&MHrlgT%4S9xhcl#c$2nGW!hh_mg7$lHGG?D68!#)Gjl z-BYTR)IbF>y<@@iD&lO4YFRkFi&B zMl@^8QE1#S(D6!k<2)#dW^F&_$OSrOm+BToY_!X?;5+=-H0gt42u1P2X{UOA9j<$ zmpL{SMi2k8nlf)28>E)IZI|j`f3Mo_(l(X&xczZ{pd7W`BUM@tn%%LV$RdV`Xv~Xg zgeiXiuhQK9y#Mp~&&Pj0|K;<4@*9_b|NbZ6f4ePtvHrnzD$NJl?E|R5osrmyGG+lIgN&roBu!8W7;w} zxz$g$QX<~VqPc#I(>3rv`Bh7M%+_vMAtPn_T&ZT?{ciNSV=l(4<{E+vsdN}B%Iw&R z^vAIqVv65i7R~h!g8%J(672qxiARixf2TULI3YdKD#Jr=i=$oaDg6Gllj*gbpg7}O z(r%B7@ouKQQ@Z*yVJ(*K7F*KYQOE9W1@|5voAqNpow~KFZ}G>s@M8SdV|YueEq5Uu+SbgDPM-Nxk-$Cs%ny1 zYvG&XGAZsPOn69XicP&(j>;JhSE8-lW%%KWf)zMEu1JN2AV~&O)ND41*6Vdi6jL+; OBeZlinY#VP0XzrMLxKMQ literal 0 HcmV?d00001 diff --git a/addons/explosives/UI/seven_segment_3.paa b/addons/explosives/UI/seven_segment_3.paa new file mode 100644 index 0000000000000000000000000000000000000000..71da8743c0c79682c90d032c3da85cdd73424f74 GIT binary patch literal 11590 zcmeHNO^6&t6n;CkrrH>-%@RlsJ)t7T!0v{S9}!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>P?1b;Qr!l5z9SL2w9`jQI5Yy54Pd4BR&fy2w- zDbJ8aZ#?Tf!FjYy(E{iU-E-k6)xk7cp{B5eLh2Z3;$Z5awsk;jCkzX0tK+v_daCt9 z*@N3VLCq83POtlE!R^wsQG3ZQysND7U&{!v>HcOR=_x0p94?7=EAS-K_;2!GuC`45 zoAsa8{#35MNH(>kx$VG{4zvH6{jXfD?VtV65o`UIK8>-dwMi$JcvvHp(Hdv#_3ZTe z*ZP&Stf1WNcUWX^%6k)?t0O&g0YUoF`gaQ?yW%vZZ=3WZzvpy4g{hsd(~e&h2m0N7 z_2Yj=s^MeSn!1V~v)16!_G7omi{cpNeYH)i`$;r=0iWc9@qc|yB*p4~#wXcs@^A8= zR2zE8ytP6thoI5FGx68Af4?dE z8;A;m@{t5ZAl1B-#g*ErHUFBA)M+~^s1HH*3!=vbAT|GXK~kG${cqH6qklKVUr-vb z_GQKWa-;dJmj3fkWkPD}uUfqurQ`G|Abl#D?lFLzFUs}HpYR2IZCXhm(ILAmr6WAO zbuGo0j$?jx8^nIJUB-|xr(#(U{|a-=t%dk=mGzg}qsJt-8v8YUDUA6GrTEQ`o1s~K zAdGTIMbv`$Wu6eF;%OdF1M1@^5lt&TO-J)9;fo0fr{^^!oDl!;Hl9d%Y(k+>py{w! TEUqTUVVHpo9bKd8h#TN95rn+6 literal 0 HcmV?d00001 diff --git a/addons/explosives/UI/seven_segment_5.paa b/addons/explosives/UI/seven_segment_5.paa new file mode 100644 index 0000000000000000000000000000000000000000..7622645c241a820a57bddaf771c57baa4996b9f7 GIT binary patch literal 11594 zcmeHNJ!~9B6n?&Oyc^+UjU@<(y)aNXkz)&qA1P9f8=pXS3J?Vdr66^hC`Ae+Bx6Da zQRIq(0)r()1qmI{SZE}d2(C$aj!+5;pjfzqX2bBlncXAa^XAT*HNKb~>GsW=dH?fv z_RZdonWd%H8!s)r*%~JzW6X@j&$V7na67-$dSwxKjenSbeR1)%1@2$r-(?Clzea?=^YhIB6b#dCL=Wg>tu+@TW$>qkGr}VG#(2CSr(l_B5IdRA1-av!55j+xmnr2?SLGlvY zxu)dA`j;Bt?c6Iq7$&#@W_85evSSAgul%ppzsmpW{;&4GYX8qZ+p6c^|K<6gt#@^V{eYV* z{J1ho(1K7SwJh(bLhGz(TQ?hl*b`ev`TUcv3j&ZFfBNd-l%_D$5sm;R-c0k!jBI`F z;(#lj3-<}N8r z_0P+VgEXG!OO^js{^#Y!evU)8N$NEe!WJ(Iwd3cy+Sb3loacJD*H2{cHx56ub!u5Q zq27gj9J9)jS+*Q&pF0khZll%@&ie!#2VA(hS)+HCl8fmes`+5*P)TMSLqI1=gZYa>3Nb5mz%bthY zfEyrWqow`-0zyZnzx?}8+I|Ur{P^kR74W>=()|3veD@wS zdAx(hAvbY;N4VS1gd{!%tU>Fx+XQM*&pVh6b38Dt;M>&NhT(2=hcyrU%&xO`4T~rI ziT!D$Qa{X4_V<_*2U0(xO(BN0BTEOn@YO_iJP!vww^X%-%-+tUPshQO97g(X7W|iz z(xq^UrtHVWjDyuS;i?^@`^hoSPeWUcp___HA?ADGQ%a@dDa1Sn!d_LNd*=9DkxFNR dYPZ{%w+CNKXcR!V+l|L*9Hpxr?Y1p9(LcKAgQ@@k literal 0 HcmV?d00001 diff --git a/addons/explosives/UI/seven_segment_6.paa b/addons/explosives/UI/seven_segment_6.paa new file mode 100644 index 0000000000000000000000000000000000000000..d805a028d5caa4304e608d5b5ef030e026e353e2 GIT binary patch literal 11634 zcmeGiO=uid_{+XcW)6uHQ!p(~;)kFuX=1??@n^FyizVBG;z5xL?YS4}sfa?2^`=O@ zcn~yI6c0rb_2g+SPjZ&Mc-)BeASxoGdk}Q=`F-!bO|!F^>~FehI}digdGCGy?|a{T zZ+1p>xmGF%EJOF5|7fk<5=~>q|^X1YrE8Ne~kLRCXS$S@m?l05t0~-9~L4a#> z0AJ1nJhlLEj(#1sH(}&Z4yK?4dKu6XT?ye+kU<50%i;N1P&9sO%M-ZzMJ|pI=0YFe zsd)$|L;v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UX z)x(?Ola;y}k6Hcpdm4Xo^O|_D{!gQ67cXUY`J`Q*-Okf?pg(LT_3SQ@xBLV_%q~sG?KE16?@KLRJ#9|Ac*|GYXfO=*Ygn7qF%=mu zNf-)GzyHkQm`)sGS&@AhU#CGWuV?tv9BQlA=(N9@Hs{|T`^UGHaM0XdH!3GYB(=|_ ztgpmQr+$y;lmBt!>3zq%l8t{8_%^iGiX%%x(}hyT>vRigotQR{zy8Eu|Lt$SCqe%Y z>bSy)SPy!huyHCk%$KolX^{8`!%X4rN9XmlxiMba`%fL|Vq8{`M6t@Zgq^+~;PfdV zeXZJjn=l#+tu85H`Z0_)G%L-oN+}5@#r+l^8zuQA`$UK2vK5}5IwkSRzNNSFH;aH@ zX|*N4mm+^yZJU3u^5gp+-I`2@>erI`Ci_HX-p#G`9=%IR&L4sy{f#o>4M+TErrJ@` z6Upf`2X~{sD+r;7HC;T9#*y6YLOX$QtH&)l9vbBe-o=WP8xcgURwI(AUZ;JeY*$gY P2t_Jg39YJCO%3oL#+>$F literal 0 HcmV?d00001 diff --git a/addons/explosives/UI/seven_segment_9.paa b/addons/explosives/UI/seven_segment_9.paa new file mode 100644 index 0000000000000000000000000000000000000000..9139d4ea1782393e3339af7feb36a246c7392d10 GIT binary patch literal 11650 zcmeGiONbmr^ksUo)v}xPW)FU#H$I~nnaKweiNDFzF3L_0iU&m^=s6e7QACza1O-L* z?7`JQ@F39$ilB#43-%(Y%q7Q8lobTQLnm`EVsF~_s=CM7%5>&qPu2}xF#YoJ zbp_zNeE@Q*K*O}`!C6aFaSiQS-x{^UjB;L>NMC`73E zF1{NGgok|hOx$TPSl05dnr)7M5)>TWO!o80=4#u_V$3D0t#CLr6 zFme9<;+;6Tc=tiyy&&*}4_E6)0`VX*;IHe#BRh7~XG!2va}SoU38fOd;J1jhnsKAs z->(T7*EO5 z0&&!Ls~3d~>Ue606Ve3!6^KK--FA%2fv6J>WpZIBxv=EJ-fukl{ayH4P(e80yZZuh z{Jm;z8lg%HPg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1RuCJkHn z=60h+0{$9doOL=+GO{&jI2evN>g3?Yftv?z9dPS_TL+GJ9pE`;Ol*?Vnr@^SLv#mbEXHxAr5aP#1Q*8ywj z72_xOr_ldV44y)n=T(NS5Py!H+@I3!FN~kupE#4lzq+P#h+GC`rxw4J0v%%pUyLw zD(;*D#|K5Zuk18|`c$Uu#|MLwtLvw~am?e7{dr3jORc|pM^%pdr8{7`J3a8@Gwwg; z7X|0O4Q|~#s_~PzBl#*I-SDKqsvI`TJkb?TCMHReq2uo`d0ECq`qzg699I6I{Nvu< zYN*-EzSKXnd=MM?cP^af^ literal 0 HcmV?d00001 diff --git a/addons/explosives/XEH_PREP.hpp b/addons/explosives/XEH_PREP.hpp index 17558ee54c..c04e0d3133 100644 --- a/addons/explosives/XEH_PREP.hpp +++ b/addons/explosives/XEH_PREP.hpp @@ -1,4 +1,3 @@ - PREP(addCellphoneIED); PREP(addClacker); PREP(addDetonateActions); @@ -16,28 +15,19 @@ PREP(detonateExplosive); PREP(detonateExplosiveAll); PREP(dialPhone); PREP(dialingPhone); - PREP(handleScrollWheel); - PREP(hasExplosives); PREP(hasPlacedExplosives); - PREP(interactEH); - PREP(getDetonators); PREP(getPlacedExplosives); PREP(getSpeedDialExplosive); - PREP(module); - PREP(onIncapacitated); PREP(onInventoryChanged); - -PREP(openTimerSetUI); - +PREP(openTimerUI); PREP(placeExplosive); PREP(removeFromSpeedDial); - PREP(scriptedExplosive); PREP(selectTrigger); PREP(setupExplosive); diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index a35137733e..3d2077ff1d 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -8,16 +8,14 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; author = ECSTRING(common,ACETeam); - authors[] = {"Garth 'L-H' de Wet"}; + authors[] = {"Garth 'L-H' de Wet", "mharis001"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; }; #include "ACE_Settings.hpp" - #include "CfgEventHandlers.hpp" - #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgWeapons.hpp" @@ -25,10 +23,18 @@ class CfgPatches { #include "CfgCloudlets.hpp" #include "ACE_Triggers.hpp" -#include "ExplosivesUI.hpp" -#include "GUI_VirtualAmmo.hpp" #include "ACE_Arsenal_Stats.hpp" +// UI stuff +class RscText; +class RscEdit; +class RscPicture; +class RscButton; +class ctrlXSliderH; +#include "ExplosivesUI.hpp" +#include "TimerDialog.hpp" +#include "GUI_VirtualAmmo.hpp" + class CfgActions { class None; class ActivateMine: None { diff --git a/addons/explosives/functions/fnc_openTimerSetUI.sqf b/addons/explosives/functions/fnc_openTimerSetUI.sqf deleted file mode 100644 index 7175f425d4..0000000000 --- a/addons/explosives/functions/fnc_openTimerSetUI.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Opens the UI for timer setting of an explosive - * - * Arguments: - * 0: Explosive - * 1: Magazine - * - * Return Value: - * None - * - * Example: - * [_explosive, "SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_openTimerSetUI; - * - * Public: No - */ -#include "script_component.hpp" - -params ["_explosive", "_mag"]; -TRACE_2("params",_explosive,_mag); - -createDialog "RscACE_SelectTimeUI"; -sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes -sliderSetPosition [8845, 30]; - -GVAR(explosive) = _explosive; - -DFUNC(SetTimer) = { - [ - ACE_player, - getPosATL GVAR(explosive), - GVAR(explosive) getVariable QGVAR(Direction), - GVAR(explosive) getVariable QGVAR(class), - "Timer", - [floor sliderPosition 8845], - GVAR(explosive) - ] call FUNC(placeExplosive); - closeDialog 0; -}; - -buttonSetAction [8860, QUOTE(call DFUNC(SetTimer);)]; -buttonSetAction [8855, QUOTE(closeDialog 0;)]; - -ctrlSetText [8870, format[localize LSTRING(TimerMenu),0, 30]]; diff --git a/addons/explosives/functions/fnc_openTimerUI.sqf b/addons/explosives/functions/fnc_openTimerUI.sqf new file mode 100644 index 0000000000..5b630df912 --- /dev/null +++ b/addons/explosives/functions/fnc_openTimerUI.sqf @@ -0,0 +1,77 @@ +/* + * Author: mharis001 + * Opens the Explosive Timer UI for given explosive. + * + * Arguments: + * 0: Explosive + * + * Return Value: + * True + * + * Example: + * [_explosive] call ace_explosives_fnc_openTimerUI + * + * Public: No + */ +#include "script_component.hpp" + +params ["_explosive"]; +TRACE_1("Opening timer UI",_explosive); + +createDialog QGVAR(timerUI); +private _display = uiNamespace getVariable [QGVAR(timerDisplay), displayNull]; + +// Update slider speed to 1s +(_display displayCtrl IDC_TIMER_SLIDER) sliderSetSpeed [1, 1]; + +// Add confirm button action +GVAR(explosive) = _explosive; +(_display displayCtrl IDC_TIMER_CONFIRM) ctrlAddEventHandler ["ButtonClick", { + params ["_button"]; + + private _slider = ctrlParent _button displayCtrl IDC_TIMER_SLIDER; + private _time = floor sliderPosition _slider; + private _explosive = GVAR(explosive); + [ + ACE_player, + getPosATL _explosive, + _explosive getVariable QGVAR(Direction), + _explosive getVariable QGVAR(class), + "Timer", + [_time], + _explosive + ] call FUNC(placeExplosive); + closeDialog 0; +}]; + +// Add EH to allow for changing values by scrolling +_display displayAddEventHandler ["MouseZChanged", { + params ["_display", "_scroll"]; + + private _change = round _scroll; + if (cba_events_control) then {_change = _change * 10}; + + private _slider = _display displayCtrl IDC_TIMER_SLIDER; + private _value = (sliderPosition _slider + _change) max TIMER_VALUE_MIN min TIMER_VALUE_MAX; + _slider sliderSetPosition _value; +}]; + +// Add PFH to update the digit display (delay of 0.1s) +// Done like this to avoid flicker that would happen when rapidly changing values through EH method +[{ + params ["_display", "_pfhID"]; + + if (isNull _display) exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; + }; + + private _value = sliderPosition (_display displayCtrl IDC_TIMER_SLIDER); + private _minutes = floor (_value / 60); + private _seconds = floor (_value % 60); + private _digitArray = [floor (_minutes / 10), _minutes mod 10, floor (_seconds / 10), _seconds mod 10]; + { + (_display displayCtrl _x) ctrlSetText format [QPATHTOF(UI\seven_segment_%1.paa), _digitArray select _forEachIndex]; + } forEach TIMER_DIGIT_IDCs; +}, 0.1, _display] call CBA_fnc_addPerFrameHandler; + +true diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index 737e6a6586..10faae3707 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: Explosive * 1: Time till detonate - * 2: Trigger Item Classname (default: "#timer") + * 2: Trigger classname (default: "#timer") * * Return Value: * None @@ -17,13 +17,13 @@ */ #include "script_component.hpp" -params ["_explosive", "_delay", ["_triggerClassname", "#timer", [""]]]; -TRACE_3("startTimer",_explosive,_delay,_triggerClassname); +params ["_explosive", "_delay", ["_trigger", "#timer", [""]]]; +TRACE_3("Starting timer",_explosive,_delay,_trigger); [{ - params ["_explosive", "_triggerClassname"]; - TRACE_1("Explosive Going Boom",_explosive); + params ["_explosive", "_trigger"]; + TRACE_1("Explosive detonating from timer",_explosive); if (!isNull _explosive) then { - [_explosive, -1, [_explosive, 0], _triggerClassname] call FUNC(detonateExplosive); + [_explosive, -1, [_explosive, 0], _trigger] call FUNC(detonateExplosive); }; -}, [_explosive, _triggerClassname], _delay] call CBA_fnc_waitAndExecute; +}, [_explosive, _trigger], _delay] call CBA_fnc_waitAndExecute; diff --git a/addons/explosives/script_component.hpp b/addons/explosives/script_component.hpp index b276fc8356..77ca89d32e 100644 --- a/addons/explosives/script_component.hpp +++ b/addons/explosives/script_component.hpp @@ -16,6 +16,21 @@ #include "\z\ace\addons\main\script_macros.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" +#include "\a3\ui_f\hpp\defineCommonColors.inc" + +#define IDC_TIMER_DIGIT_1 8501 +#define IDC_TIMER_DIGIT_2 8502 +#define IDC_TIMER_DIGIT_3 8503 +#define IDC_TIMER_DIGIT_4 8504 +#define IDC_TIMER_SLIDER 8505 +#define IDC_TIMER_CONFIRM 8506 +#define TIMER_DIGIT_IDCs [IDC_TIMER_DIGIT_1, IDC_TIMER_DIGIT_2, IDC_TIMER_DIGIT_3, IDC_TIMER_DIGIT_4] + +#define TIMER_VALUE_MIN 5 +#define TIMER_VALUE_MAX 900 +#define TIMER_VALUE_DEFAULT 30 + #define PLACE_WAITING -1 #define PLACE_CANCEL 0 #define PLACE_APPROVE 1 diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 320614a9db..70b6ffbe47 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1024,5 +1024,8 @@ Portée du détonateur 爆発範囲 + + Explosive Timer +