Advertisement
Jamchiv01

ExileClient_gui_xm8_slide_apps_onOpen

Jul 1st, 2016
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.91 KB | None | 0 0
  1. /**
  2.  * ExileClient_gui_xm8_slide_apps_onOpen
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. // XM8 apps Imporeved by vitaly'mind'chizhikov
  13. // Based on idea XM8 apps by Shix. see http://www.exilemod.com/topic/9040-xm8-apps/?page=1
  14. // Original function from Exile 0.9.6
  15. // Updated for Exile 0.9.8 ~Jamie C
  16.  
  17. private["_display","_killDeathRatio","_killDeathRatioControl","_popTabsValue","_popTabs","_respectValue","_respect"];
  18. disableSerialization;
  19. _display = uiNameSpace getVariable ["RscExileXM8", displayNull];
  20. if (ExileClientPlayerDeaths < 1) then
  21. {
  22.     _killDeathRatio = ExileClientPlayerKills;
  23. }
  24. else
  25. {
  26.     _killDeathRatio = [ExileClientPlayerKills / ExileClientPlayerDeaths, 2] call ExileClient_util_math_round;
  27. };
  28. _killDeathRatioControl = _display displayCtrl 4057;
  29. _killDeathRatioControl ctrlSetTooltip format ["%1 Kills / %2 Deaths", ExileClientPlayerKills, ExileClientPlayerDeaths];
  30. _killDeathRatioControl ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>K/D</t>", _killDeathRatio]);
  31. _popTabsValue = (player getVariable ["ExileLocker", 0]);
  32. if (_popTabsValue > 999) then
  33. {
  34.     _popTabsValue = format ["%1k", floor (_popTabsValue / 1000)];
  35. };
  36. _popTabs = _display displayCtrl 4058;
  37. _popTabs ctrlSetTooltip format["You have %1 Pop Tabs in your locker", (player getVariable ["ExileLocker", 0])];
  38. _popTabs ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>POP TABS</t>", _popTabsValue]);
  39. _respectValue = ExileClientPlayerScore;
  40. if (_respectValue > 999) then
  41. {
  42.     _respectValue = format ["%1k", floor (_respectValue / 1000)];
  43. };
  44. _respect = _display displayCtrl 4059;
  45. _respect ctrlSetTooltip format["%1", ExileClientPlayerScore];
  46. _respect ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>RESPECT</t>", _respectValue]);
  47. //Lets hide old territory button, as we already made new one early on in ExileClient_gui_xm8_show.
  48. //Why we make new? Because if button is re-possition it will render picture (textureNoShortcut) incorrectly.
  49. private ["_sliders","_appSlide","_oldTerritoryBut"];
  50. _sliders = _display displayCtrl 4007;
  51. _appSlide = _sliders controlsGroupCtrl 4040;
  52. _oldTerritoryBut = _appSlide controlsGroupCtrl 1113;
  53. _oldTerritoryBut ctrlShow false;
  54. _oldTerritoryBut ctrlSetFade 0;
  55. _oldTerritoryBut ctrlCommit 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement