Advertisement
Guest User

Untitled

a guest
Nov 8th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.11 KB | None | 0 0
  1. //--------------------------------------------------------------------------------------------------
  2. // CONFIG
  3. //--------------------------------------------------------------------------------------------------
  4. BIS_AdvHints_NextKeySentence = localize "STR_EP1_adv_hints.sqf0";
  5. BIS_AdvHints_DurationSentence = localize "STR_EP1_adv_hints.sqf1";
  6.  
  7. BIS_AdvHints_NextKeyTime = 0;
  8.  
  9. BIS_AdvHints_ClosingInSentence = localize "STR_EP1_adv_hints.sqf2"; //countdown text
  10.  
  11. //--------------------------------------------------------------------------------------------------
  12. // INIT
  13. //--------------------------------------------------------------------------------------------------
  14. //feature: "Press %1 to continue"
  15. BIS_AdvHints_NextKeyPressed = false;
  16. BIS_AdvHints_NextKeyTracked = false;
  17.  
  18. /*
  19. if (count(actionKeys "Help") > 0) then {
  20. BIS_AdvHints_NextKeyCode = (actionKeys "Help") select 0;
  21. } else {
  22. BIS_AdvHints_NextKeyCode = 35;
  23. };
  24. */
  25.  
  26. BIS_AdvHints_NextKeyCode = 57; //forced to [Space] key
  27. BIS_AdvHints_NextKeyName = call compile keyName(BIS_AdvHints_NextKeyCode);
  28. BIS_AdvHints_NextKeySentence = format[BIS_AdvHints_NextKeySentence,BIS_AdvHints_NextKeyName];
  29. BIS_AdvHints_DurationSentence = format[BIS_AdvHints_DurationSentence,BIS_AdvHints_NextKeyName];
  30.  
  31. //feature: pausing
  32. BIS_AdvHints_PausedObjects = [];
  33. BIS_AdvHints_GamePaused = false;
  34. BIS_AdvHints_ppColor = ppEffectCreate ["colorCorrections", 2000];
  35. BIS_AdvHints_ppBlur = ppEffectCreate ["dynamicBlur", 1000];
  36.  
  37. //feature: input actions
  38. BIS_AdvHints_IATracked = ""; //input action to look for
  39. BIS_AdvHints_IADetected = false; //result
  40. BIS_AdvHints_IAMinTime = 0; //min. time that the input action has to be performed
  41.  
  42. //gfx & icons
  43. BIS_AdvHints_ImgBullet = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_bullet_ca.paa' align='left' size='1.3'/>";
  44. BIS_AdvHints_ImgBullet1 = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_bullet_ca.paa' align='left' size='1.3'/>";
  45. BIS_AdvHints_ImgBullet2 = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_bullet_ca.paa' align='left' size='1.3'/>";
  46. BIS_AdvHints_ImgBullet3 = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_bullet_ca.paa' align='left' size='1.3'/>";
  47. BIS_AdvHints_ImgBullet4 = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_bullet_ca.paa' align='left' size='1.3'/>";
  48. BIS_AdvHints_ImgBullet5 = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_bullet_ca.paa' align='left' size='1.3'/>";
  49. BIS_AdvHints_ImgArrow = "";
  50.  
  51. BIS_AdvHints_ImgInfo = "<img color='#e6b448' shadow='1' shadowColor='#312100' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_info_ca.paa'/>";
  52. BIS_AdvHints_ImgImp = "<img color='#e6b448' shadow='1' shadowColor='#312100' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_important_ca.paa'/>";
  53. BIS_AdvHints_ImgAction = "<img color='#e6b448' shadow='1' shadowColor='#312100' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_action_ca.paa'/>";
  54. BIS_AdvHints_ImgLine = "<img col or='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_line_ca.paa' align='left' size='0.78'/>";
  55. BIS_AdvHints_ImgLineThin = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\img_line_thin_ca.paa' align='left' size='0.78'/>";
  56.  
  57. BIS_AdvHints_ImgMisc_Watch = "<img color='#ffffff' image='\CA\Missions_e\bootcamp\BootCamp_Shared\modules\img\gfx_watch_ca.paa' align='left' size='5'/>";
  58.  
  59. waitUntil {!(isNil "BIS_fnc_init")};
  60.  
  61. //--------------------------------------------------------------------------------------------------
  62. // NEXT KEY MONITOR
  63. //--------------------------------------------------------------------------------------------------
  64. #define DISPLAY_MAIN (findDisplay 46)
  65. #define DISPLAY_GEAR (findDisplay 106)
  66.  
  67. [] spawn {
  68. while {true} do {
  69. waitUntil {!isNil{DISPLAY_GEAR} && !isNull(DISPLAY_GEAR)};
  70. DISPLAY_GEAR displayAddEventHandler ["KeyDown", "_this call BIS_AdvHints_keyPressFunc"];
  71. waitUntil {isNil{DISPLAY_GEAR} || isNull(DISPLAY_GEAR)};
  72. };
  73. };
  74.  
  75. [] spawn {
  76. waitUntil {!isNil{DISPLAY_MAIN} && !isNull(DISPLAY_MAIN)};
  77. DISPLAY_MAIN displayAddEventHandler ["KeyDown", "_this call BIS_AdvHints_keyPressFunc"];
  78. };
  79.  
  80. BIS_AdvHints_keyPressFunc = {
  81. private["_keyCode","_block"];
  82.  
  83. _block = false;
  84.  
  85. _keyCode = _this select 1;
  86.  
  87. //['Key pressed',str(_keyCode) + ': ' + keyName(_keyCode)] call BIS_debugLog;
  88.  
  89. if (_keyCode == BIS_AdvHints_NextKeyCode && BIS_AdvHints_NextKeyTracked) then {
  90. BIS_AdvHints_NextKeyPressed = true;
  91. _block = true;
  92. };
  93.  
  94. _block
  95. };
  96.  
  97. //--------------------------------------------------------------------------------------------------
  98. // INPUT ACTION MONITOR
  99. //--------------------------------------------------------------------------------------------------
  100. [] spawn {
  101. private ["_action","_i","_counter"];
  102.  
  103. _counter = 0;
  104.  
  105. waitUntil {
  106. _action = BIS_AdvHints_IATracked;
  107.  
  108. if (_action == "") then {
  109. _counter = 0;
  110. sleep 0.1;
  111. } else {
  112. _i = inputAction(_action);
  113.  
  114. if (_i > 0) then {
  115. _counter = _counter + 0.05;
  116. if (_counter >= BIS_AdvHints_IAMinTime) then {
  117. BIS_AdvHints_IADetected = true;
  118. _counter = 0;
  119. };
  120. sleep 0.05;
  121. } else {
  122. _counter = 0;
  123. sleep 0.0001;
  124. };
  125. };
  126. _action == "ABORT";
  127. };
  128. };
  129.  
  130. //--------------------------------------------------------------------------------------------------
  131. // ADVANCED HINTS
  132. //--------------------------------------------------------------------------------------------------
  133. BIS_AdvHints_setDefaults =
  134. {
  135. call BIS_AdvHints_terminateHint;
  136.  
  137. BIS_AdvHints_Header = "";
  138. BIS_AdvHints_Text = "";
  139. BIS_AdvHints_Footer = "";
  140. BIS_AdvHints_Duration = -1;
  141. BIS_AdvHints_DurationMin = 0;
  142. BIS_AdvHints_ShowCond = "true";
  143. BIS_AdvHints_ShowCode = "";
  144. BIS_AdvHints_HideCond = "";
  145. BIS_AdvHints_HideCode = "";
  146. BIS_AdvHints_Silent = false;
  147. BIS_AdvHints_Seamless = false;
  148. BIS_AdvHints_KeyPress = "";
  149. BIS_AdvHints_CanSkip = true;
  150. BIS_AdvHints_NoFooter = false;
  151. BIS_AdvHints_Pause = false;
  152. BIS_AdvHints_Dynamic = [];
  153. };
  154.  
  155. BIS_AdvHints_terminateHint =
  156. {
  157. //kill the hint
  158. if !(isNil "BIS_AdvHints_Spawn") then {
  159. if !(scriptDone BIS_AdvHints_Spawn) then {
  160. //["Terminating 'BIS_AdvHints_Spawn'"] call BIS_debugLog;
  161.  
  162. terminate BIS_AdvHints_Spawn;
  163. hintSilent "";
  164. } else {
  165. //["NOT terminating 'BIS_AdvHints_Spawn'"] call BIS_debugLog;
  166. };
  167. //["NOT terminating 'BIS_AdvHints_Spawn'","IT IS NILL!"] call BIS_debugLog;
  168. };
  169. };
  170.  
  171. BIS_AdvHints_showHint =
  172. {
  173. BIS_AdvHints_Spawn = [] spawn BIS_AdvHints_showHintSpawn;
  174.  
  175. waitUntil{(scriptDone BIS_AdvHints_Spawn)};
  176.  
  177. call BIS_AdvHints_setDefaults;
  178. };
  179.  
  180. BIS_AdvHints_showHintSpawn =
  181. {
  182. private ["_countdownType","_elapsed","_html","_t","_show","_period"];
  183. private ["_header","_text","_footer","_duration","_showCond","_showCode","_hideCond","_hideCode","_silent","_seamless","_keyPress","_keyDownTime","_pause","_durationMin","_canSkip"];
  184.  
  185. _countdownType = 0;
  186. _elapsed = 0;
  187.  
  188. //shortcuts
  189. _header = BIS_AdvHints_Header;
  190. _text = BIS_AdvHints_Text;
  191. _footer = BIS_AdvHints_Footer;
  192. _duration = BIS_AdvHints_Duration;
  193. _durationMin = BIS_AdvHints_DurationMin;
  194. _showCond = BIS_AdvHints_ShowCond;
  195. _showCode = BIS_AdvHints_ShowCode;
  196. _hideCond = BIS_AdvHints_HideCond;
  197. _hideCode = BIS_AdvHints_HideCode;
  198. _silent = BIS_AdvHints_Silent;
  199. _seamless = BIS_AdvHints_Seamless;
  200. _keyPress = BIS_AdvHints_KeyPress;
  201. _pause = BIS_AdvHints_Pause;
  202. _canSkip = BIS_AdvHints_CanSkip;
  203.  
  204. //pause or un-pause the game
  205. if (_pause) then {
  206. //game not paused, pause it!
  207. if !BIS_AdvHints_GamePaused then {
  208. call BIS_AdvHints_PauseGame;
  209. };
  210. } else {
  211. //game paused, un-pause it!
  212. if BIS_AdvHints_GamePaused then {
  213. call BIS_AdvHints_UnPauseGame;
  214. };
  215. };
  216.  
  217. //minimal duration for condition driven hints
  218. if (_durationMin > 0) then {
  219. _hideTime = time + _durationMin;
  220.  
  221. //add durationMin to hideCond
  222. if (_hideCond != "") then {
  223. _hideCond = _hideCond + format["&& time > %1",_hideTime];
  224.  
  225. //set keyPress as the only posCond
  226. } else {
  227. _hideCond = format["time > %1",_hideTime];
  228. };
  229. };
  230.  
  231. //countdown style
  232. if (_duration > 0) then {
  233. _countdownType = floor(_duration/1000);
  234. _duration = _duration - (_countdownType * 1000);
  235.  
  236. _period = switch (_countdownType) do {
  237. //progress bar
  238. case 0: {0.5};
  239. //hidden
  240. case 1: {1};
  241. //count-down text
  242. case 2: {1};
  243. };
  244. };
  245.  
  246. //add countdown to "Press %1 to continue." type of hint
  247. if (BIS_AdvHints_NextKeyTime > 0 && _duration == -1) then {
  248. if (BIS_AdvHints_KeyPress == "" && BIS_AdvHints_HideCond == "") then {
  249. _duration = BIS_AdvHints_NextKeyTime;
  250. _period = 0.5;
  251. };
  252. };
  253.  
  254. //used when you need to track that player is performing the action over some time, not only once
  255. if (typeName(_keyPress) == "ARRAY") then {
  256. _keyDownTime = _keyPress select 1;
  257. _keyPress = _keyPress select 0;
  258. } else {
  259. _keyDownTime = 0;
  260. };
  261.  
  262. //setup vars for input action pseudo-handler
  263. if (_keyPress != "") then {
  264. //setup 4 input action monitoring
  265. BIS_AdvHints_IATracked = _keyPress; //input action to look for
  266. BIS_AdvHints_IADetected = false; //result
  267. BIS_AdvHints_IAMinTime = _keyDownTime; //min. time that the input action has to be performed
  268.  
  269. //set post condition
  270. //add keyPress to hideCond
  271. if (_hideCond != "") then {
  272. _hideCond = _hideCond + " && BIS_AdvHints_IADetected";
  273. //set keyPress as the only posCond
  274. } else {
  275. _hideCond = "BIS_AdvHints_IADetected";
  276. };
  277. if (typeName(_text) == "STRING") then {
  278. _text = format[_text,_keyPress call BIS_getKeyBind];
  279. };
  280. } else {
  281. BIS_AdvHints_IATracked = ""; //input action to look for
  282. BIS_AdvHints_IADetected = false; //result
  283. };
  284.  
  285. //autofill preCond with negated postCond
  286. if (call compile(_showCond) && _hideCond != "") then {
  287. _showCond = "!(" + _hideCond + ")";
  288. };
  289.  
  290. //pre-condition
  291. if (call compile(_showCond)) then {
  292. //pre-code
  293. if (_showCode != "") then {
  294. call compile(_showCode);
  295. };
  296.  
  297. //seamless transition between hints
  298. if !_seamless then {
  299. hintSilent "";
  300. sleep 0.5;
  301. };
  302.  
  303. //display hint
  304. _show = true;
  305. while {_show} do {
  306. //handle _text formatting (if hint text supplied as array)
  307. if ((typeName(BIS_AdvHints_Text) == "ARRAY") || (count(BIS_AdvHints_Dynamic) > 0)) then {
  308. private ["_params","_i","_param","_temp"];
  309.  
  310. _params = [];
  311.  
  312. if (count(BIS_AdvHints_Dynamic) > 0) then {
  313. {
  314. if (typeName(_x) == "CODE") then {
  315. _param = call _x;
  316. } else {
  317. _param = _x;
  318. };
  319.  
  320. _params = _params + [_param];
  321.  
  322. } forEach BIS_AdvHints_Dynamic;
  323. };
  324.  
  325. if (typeName(BIS_AdvHints_Text) == "ARRAY") then {
  326. for "_i" from 1 to (count(BIS_AdvHints_Text)-1) do {
  327. _temp = BIS_AdvHints_Text select _i;
  328.  
  329. if (typeName(_temp) == "CODE") then {
  330. _param = call _temp;
  331. } else {
  332. _param = _temp;
  333. };
  334.  
  335. _params = _params + [_param];
  336. };
  337. };
  338.  
  339. if (typeName(BIS_AdvHints_Text) == "ARRAY") then {
  340. _text = format([BIS_AdvHints_Text select 0] + _params);
  341. } else {
  342. _text = format([BIS_AdvHints_Text] + _params);
  343. };
  344. };
  345.  
  346. //compile _footer
  347. if (typeName(BIS_AdvHints_Footer) == "CODE") then {
  348. _footer = call BIS_AdvHints_Footer;
  349. };
  350.  
  351. //auto-fill _footer
  352. if (BIS_AdvHints_NoFooter) then {
  353. _footer = "";
  354. } else {
  355. if(_duration == -1) then {
  356. if (_hideCond == "" && _footer == "") then {
  357. _footer = BIS_AdvHints_NextKeySentence;
  358. };
  359. } else {
  360. //progressbar
  361. if (_countdownType == 0) then {
  362. _footer = [_elapsed,_duration] call BIS_AdvHints_createCountdownLine;
  363. };
  364. //hidden
  365. if (_countdownType == 1) then {
  366. _footer = "";
  367. };
  368. //'remaining x secs' text
  369. if (_countdownType == 2) then {
  370. _footer = format[BIS_AdvHints_ClosingInSentence,_duration-_elapsed];
  371. };
  372. };
  373. };
  374.  
  375. _html = "";
  376.  
  377. //add _header
  378. if (_header != "") then {
  379. _html = "<t color='#818960' size='0.85' shadow='0' align='left'>" + _header + "</t><br/><br/>";
  380. };
  381.  
  382. //add _text
  383. _html = _html + "<t color='#a9b08e' size='1' shadow='0' shadowColor='#312100' align='left'>" + _text + "</t>";
  384.  
  385. //add _footer
  386. if (_footer != "") then {
  387. _html = _html + "<br/><br/><t color='#818960' size='0.85' shadow='0' align='right'>" + _footer + "</t>";
  388. };
  389.  
  390. //last-line cutted fix
  391. _html = _html + "<br/>";
  392.  
  393. //display the hint
  394. if (_text != "") then {
  395. if (_silent) then {
  396. hintSilent parseText(_html);
  397. } else {
  398. hint parseText(_html);
  399. };
  400. };
  401.  
  402.  
  403. //handle hint refresh or destruction
  404. if (_duration == -1) then {
  405.  
  406. //"Press 'F' to continue."
  407. if (_hideCond == "") then {
  408. _t = time;
  409.  
  410. //tracking 'next key' pressed
  411. BIS_AdvHints_NextKeyPressed = false;
  412. BIS_AdvHints_NextKeyTracked = true;
  413.  
  414. waitUntil {(BIS_AdvHints_NextKeyPressed) || (time > _t + 1)};
  415.  
  416. BIS_AdvHints_NextKeyTracked = false;
  417.  
  418. //the 'next key' pressed
  419. if (BIS_AdvHints_NextKeyPressed) then {
  420. _show = false;
  421. };
  422.  
  423. //controlled by condition
  424. } else {
  425. if (call compile(_hideCond)) then {
  426. _show = false;
  427. if (_keyPress != "") then {
  428. BIS_AdvHints_IATracked = ""; //input action to look for
  429. BIS_AdvHints_IADetected = false; //result
  430. };
  431. } else {
  432. sleep 0.1;
  433. };
  434. };
  435. } else {
  436. if (_elapsed < _duration) then {
  437.  
  438. _t = time;
  439.  
  440. if (_canSkip) then {
  441. //tracking 'next key' pressed
  442. BIS_AdvHints_NextKeyPressed = false;
  443. BIS_AdvHints_NextKeyTracked = true;
  444.  
  445. waitUntil {(BIS_AdvHints_NextKeyPressed) || (time > _t + _period)};
  446.  
  447. BIS_AdvHints_NextKeyTracked = false;
  448.  
  449. //save elapsed time
  450. _elapsed = _elapsed + _period;
  451.  
  452. //the 'next key' pressed
  453. if (BIS_AdvHints_NextKeyPressed) then {
  454. _show = false;
  455. } else {
  456. _show = true;
  457. };
  458. } else {
  459. waitUntil {(time > _t + _period)};
  460.  
  461. //save elapsed time
  462. _elapsed = _elapsed + _period;
  463. };
  464. } else {
  465. _show = false;
  466. };
  467. };
  468.  
  469. _silent = true;
  470. };
  471.  
  472. //post-code
  473. if (_hideCode != "") then {
  474. call compile(_hideCode);
  475. };
  476. };
  477. };
  478.  
  479. BIS_AdvHints_createCountdownLine =
  480. {
  481. private ["_elapsed","_max","_line","_char","_i","_segments","_segmentsElapsed","_segmentsRemaining"];
  482.  
  483. _elapsed = _this select 0;
  484.  
  485. if (count(_this) > 1) then {
  486. _max = _this select 1;
  487. };
  488. if isNil("_max") then {
  489. _max = 10;
  490. };
  491.  
  492. //number of countdown segments
  493. _segments = 20;
  494.  
  495. _segmentsElapsed = round(_elapsed/_max * _segments);
  496. _segmentsRemaining = _segments - _segmentsElapsed;
  497.  
  498. if (_segmentsElapsed > _segments) then {
  499. _segmentsElapsed = _segments;
  500. _segmentsRemaining = 0;
  501. };
  502.  
  503. _char = "|";
  504.  
  505. _line = "<t color='#818960'>";
  506.  
  507. for "_i" from 1 to _segmentsElapsed do
  508. {
  509. _line = _line + _char;
  510. };
  511. _line = _line + "</t>";
  512.  
  513. if (_segmentsRemaining > 0) then {
  514. _line = _line + "<t color='#000000'>";
  515. for "_i" from 1 to _segmentsRemaining do
  516. {
  517. _line = _line + _char;
  518. };
  519. _line = _line + "</t>";
  520. };
  521.  
  522. //_line = _line + "<br/>" + BIS_AdvHints_ImgLineThin + "<br/>" + BIS_AdvHints_DurationSentence;
  523. //_line = _line + " ";
  524.  
  525. _line
  526. };
  527.  
  528.  
  529. BIS_AdvHints_createProgressBar =
  530. {
  531. private["_completed","_max","_line","_char"];
  532.  
  533. _completed = floor (_this select 0);
  534. _max = _this select 1;
  535.  
  536. if (_completed > _max) then {
  537. _completed = _max;
  538. };
  539.  
  540.  
  541. _char = "|";
  542.  
  543. _line = "<t color='#818960'>";
  544. for "_i" from 1 to _completed do
  545. {
  546. _line = _line + _char;
  547. };
  548. _line = _line + "</t>";
  549.  
  550. if (_max > _completed) then {
  551. _line = _line + "<t color='#000000'>";
  552. for "_i" from (_completed+1) to _max do
  553. {
  554. _line = _line + _char;
  555. };
  556. _line = _line + "</t>";
  557. };
  558.  
  559. _line
  560. };
  561.  
  562. //'SwitchCommand' call BIS_getKeyBind
  563. BIS_getKeyBind =
  564. {
  565. private ["_key","_action2press","_r","_binds"];
  566.  
  567. if (typeName(_this) == "STRING") then {
  568. _binds = actionKeysNamesArray _this;
  569. } else {
  570. _binds = [];
  571.  
  572. if (typeName(_this) == "ARRAY") then {
  573. {
  574. _binds = _binds + [call compile (keyName _x)];
  575.  
  576. } forEach _this;
  577. };
  578. };
  579.  
  580. //the key we are waiting for
  581. _action2press = BIS_AdvHints_IATracked;
  582.  
  583. //return string
  584. _r = "";
  585.  
  586. if (count _binds == 0) then {
  587. _r = "'Not assigned!'";
  588. } else {
  589.  
  590. //loop through all assigned bindings
  591. {
  592. if (_r != "") then {
  593. _r = _r + " " + localize "STR_EP1_adv_hints.sqf43" + " ";
  594. };
  595.  
  596. _key = "'" + _x + "'";
  597.  
  598. //add yellow hilite
  599. _r = _r + "<t color='#fed886' shadow='1' shadowColor='#312100'>"+_key+"</t>";
  600.  
  601. } forEach _binds;
  602. };
  603.  
  604. _r
  605. };
  606.  
  607. BIS_AdvHints_formatText = {
  608.  
  609. private["_header","_text","_count","_format","_i","_r","_params","_addLine"];
  610.  
  611. //init
  612. if (isNil "BIS_AdvHints_TImp") then {
  613. BIS_AdvHints_TImp = "";
  614. };
  615.  
  616. _r = "";
  617. _addLine = false;
  618.  
  619. //header + line
  620. _r = format["<t color='#e6b448'>%1</t><br/>%2<br/>",BIS_AdvHints_THeader,BIS_AdvHints_ImgLine];
  621.  
  622. //info
  623. if (BIS_AdvHints_TInfo != "") then {
  624. _r = _r + BIS_AdvHints_ImgInfo + " " + BIS_AdvHints_TInfo;
  625.  
  626. _addLine = true;
  627. };
  628.  
  629. //info: important
  630. if (BIS_AdvHints_TImp != "") then {
  631. //add an empty line
  632. if (_addLine) then {
  633. _r = _r + "<br/><br/>";
  634. };
  635.  
  636. _r = _r + BIS_AdvHints_ImgImp + " " + BIS_AdvHints_TImp;
  637. _addLine = true;
  638. };
  639.  
  640. //action
  641. if (BIS_AdvHints_TAction != "") then {
  642. //add an empty line
  643. if (_addLine) then {
  644. _r = _r + "<br/><br/>";
  645. };
  646.  
  647. _r = _r + BIS_AdvHints_ImgAction + " <t color='#e6b448' shadow='1' shadowColor='#312100'>" + BIS_AdvHints_TAction + "</t>";
  648. _addLine = true;
  649. };
  650.  
  651. //binds
  652. if (typeName(BIS_AdvHints_TBinds) == "STRING") then {
  653. if (BIS_AdvHints_TBinds != "") then {
  654. //add an empty line
  655. if (_addLine) then {
  656. _r = _r + "<br/><br/>";
  657. };
  658.  
  659. _r = _r + localize "STR_EP1_adv_hints.sqf55" + BIS_AdvHints_ImgLineThin + "<br/>" + BIS_AdvHints_TBinds;
  660. };
  661. } else {
  662. //add an empty line
  663. if (_addLine) then {
  664. _r = _r + "<br/><br/>";
  665. };
  666.  
  667. _r = _r + localize "STR_EP1_adv_hints.sqf58" + BIS_AdvHints_ImgLineThin + "<br/>";
  668.  
  669. _count = count(BIS_AdvHints_TBinds) - 1;
  670. _params = [];
  671.  
  672. _format = [_r + (BIS_AdvHints_TBinds select 0)];
  673.  
  674. for "_i" from 1 to _count do {
  675. _params = _params + [BIS_AdvHints_TBinds select _i];
  676. _format = _format + ["%" + str(_i) + BIS_AdvHints_ImgArrow];
  677. };
  678.  
  679. _r = [format _format] + _params;
  680. };
  681.  
  682. //reset optional parameters
  683. BIS_AdvHints_TImp = "";
  684.  
  685. _r
  686. };
  687.  
  688. BIS_AdvHints_createWelcome = {
  689. private["_mission","_objectives","_title","_content","_gfxWelcome"];
  690.  
  691. //play background music
  692. 0 fadeMusic 0.3;
  693. [["EP1_Track02","EP1_Track04","EP1_Track06","EP1_Track07","EP1_Track08"]] spawn bis_fnc_music;
  694.  
  695. //disable teamswitch
  696. enableTeamSwitch false;
  697.  
  698. _gfxWelcome = "<img color='#ffffff' image='img\gfx_welcome_ca.paa' align='center' size='6.28'/>";
  699.  
  700. _mission = _this select 0;
  701. _objectives = _this select 1;
  702.  
  703. _title = "<t color='#e6b448' shadow='1' shadowColor='#312100' size='1.6' align='center'>"+_mission+"</t><br/>";
  704. _content = "<t color='#e6b448'>TUTORIAL OBJECTIVES</t>" + "<br/>" + BIS_AdvHints_ImgLine;
  705.  
  706. {
  707.  
  708. _content = _content + "<br/>" + BIS_AdvHints_ImgBullet + " " + _x;
  709.  
  710. } forEach _objectives;
  711.  
  712.  
  713. BIS_AdvHints_Header = localize "STR_EP1_adv_hints.sqf64";
  714. BIS_AdvHints_Text = _title + "<br/>" + _gfxWelcome + "<br/><br/>" + _content;
  715. BIS_AdvHints_Pause = true;
  716. BIS_AdvHints_Duration = 10;
  717. call BIS_AdvHints_showHint;
  718. };
  719.  
  720.  
  721. BIS_AdvHints_PauseGame = {
  722. private["_length"];
  723.  
  724. _length = 1;
  725.  
  726. ["Paused!"] call BIS_debugLog;
  727.  
  728. //color: desaturate
  729. BIS_AdvHints_ppColor ppEffectAdjust [1, 1.02, -0.005, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 0], [0.199, 0.587, 0.114, 0.0]];
  730. BIS_AdvHints_ppColor ppEffectCommit _length;
  731. BIS_AdvHints_ppColor ppEffectEnable true;
  732.  
  733. //dynamic blur
  734. BIS_AdvHints_ppBlur ppEffectAdjust [0.75];
  735. BIS_AdvHints_ppBlur ppEffectCommit _length;
  736. BIS_AdvHints_ppBlur ppEffectEnable true;
  737.  
  738. //radial blur: apply
  739. //"radialBlur" ppEffectAdjust [0.0075, 0.0075, 0.005, 0.005];
  740. //"radialBlur" ppEffectCommit _length;
  741. //"radialBlur" ppEffectEnable true;
  742.  
  743. //film grain: turn off
  744. //"filmGrain" ppEffectAdjust [0.8,10,1,1,1,true];
  745. //"filmGrain" ppEffectCommit 2;
  746. //"filmGrain" ppEffectEnable true;
  747.  
  748. [] spawn {
  749. private["_objects"];
  750.  
  751. if (vehicle player != player) then {
  752. _objects = crew vehicle player;
  753. _objects = _objects + [vehicle player];
  754. } else {
  755. _objects = [player];
  756. };
  757.  
  758. {
  759. //["Paused object",_x] call BIS_debugLog;
  760.  
  761. _x enableSimulation false;
  762.  
  763. } forEach _objects;
  764.  
  765. BIS_AdvHints_PausedObjects = _objects;
  766. BIS_AdvHints_GamePaused = true;
  767. };
  768. };
  769.  
  770. BIS_AdvHints_UnPauseGame = {
  771. private["_length"];
  772.  
  773. _length = 1;
  774.  
  775. ["UnPaused!"] call BIS_debugLog;
  776.  
  777. //color: revert back from B/W
  778. BIS_AdvHints_ppColor ppEffectAdjust [1, 1.02, -0.005, [0.0, 0.0, 0.0, 0.0], [1, 1, 0.7, 0.65], [0.199, 0.587, 0.114, 0.0]];
  779. BIS_AdvHints_ppColor ppEffectCommit _length;
  780. BIS_AdvHints_ppColor ppEffectEnable true;
  781.  
  782. //dynamic blur
  783. BIS_AdvHints_ppBlur ppEffectAdjust [0.0];
  784. BIS_AdvHints_ppBlur ppEffectCommit _length;
  785. BIS_AdvHints_ppBlur ppEffectEnable true;
  786.  
  787. //radial blur: remove
  788. //"radialBlur" ppEffectAdjust [0.0, 0.0, 0, 0];
  789. //"radialBlur" ppEffectCommit _length;
  790. //"radialBlur" ppEffectEnable true;
  791.  
  792. //film grain: turn off
  793. //"filmGrain" ppEffectAdjust [0,10,1,1,1,true];
  794. //"filmGrain" ppEffectCommit 2;
  795. //"filmGrain" ppEffectEnable true;
  796.  
  797. {
  798. //["Un-paused object",_x] call BIS_debugLog;
  799.  
  800. _x enableSimulation true;
  801.  
  802. } forEach BIS_AdvHints_PausedObjects;
  803.  
  804. BIS_AdvHints_PausedObjects = [];
  805. BIS_AdvHints_GamePaused = false;
  806. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement