Advertisement
MGT

ExileClient_gui_xm8_slide_territory_event_etc

MGT
Nov 30th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.12 KB | None | 0 0
  1. /**
  2.  * Exile Mod
  3.  * www.exilemod.com
  4.  * © 2015 Exile Mod Team
  5.  *
  6.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  7.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  8.  */
  9.  
  10. private["_listBox","_index","_display","_playerListBox","_flag","_buildRights","_playerUID","_playerObject","_text","_playerTerritoryAccess","_myAccessLevel","_leaveButton","_promoteButton","_demoteButton","_nextProtectionMoneyDueDate","_dateTimeString","_territoryPayDayInfo"];
  11. disableSerialization;
  12. _listBox = _this select 0;
  13. _index = _this select 1;
  14. _display = uiNameSpace getVariable ["RscExileXM8", displayNull];
  15. _playerListBox = _display displayCtrl 4131;
  16. lbClear _playerListBox;
  17. _flag = objectFromNetId (_listBox lbData _index);
  18. _buildRights = _flag getVariable ["ExileTerritoryBuildRights", []];
  19. {
  20.     _playerUID = _x;
  21.     _playerObject = _playerUID call ExileClient_util_player_objectFromPlayerUid;
  22.     if (isNull _playerObject) then
  23.     {
  24.         _text = format ["~OFFLINE~ (%1)", _playerUID];
  25.     }
  26.     else
  27.     {
  28.         _text = format ["%1 (%2)", name _playerObject, _playerUID];
  29.     };
  30.     _playerTerritoryAccess = [_flag, _playerUID] call ExileClient_util_territory_getAccessLevel;
  31.     _playerListBox lbAdd _text;
  32.     _playerListBox lbSetTooltip [_forEachIndex, (_playerTerritoryAccess select 1)];
  33.     _playerListBox lbSetData [_forEachIndex, _playerUID];
  34.     switch (_playerTerritoryAccess select 0) do
  35.     {
  36.         case 3:    
  37.         {
  38.             _playerListBox lbSetPicture [_forEachIndex, "\a3\ui_f\data\gui\cfg\Ranks\sergeant_gs.paa"];
  39.             _playerListBox lbSetPictureColor [_forEachIndex, [0.91, 0, 0, 0.6]];
  40.         };
  41.         case 2:
  42.         {
  43.             _playerListBox lbSetPicture [_forEachIndex, "\a3\ui_f\data\gui\cfg\Ranks\corporal_gs.paa"];
  44.             _playerListBox lbSetPictureColor [_forEachIndex, [0, 0.78, 0.93, 0.6]];
  45.         };
  46.         default
  47.         {
  48.             _playerListBox lbSetPicture [_forEachIndex, "\a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"];
  49.             _playerListBox lbSetPictureColor [_forEachIndex, [0.7, 0.93, 0, 0.6]];
  50.         };
  51.     };
  52. }
  53. forEach _buildRights;
  54. _myAccessLevel = [_flag, getPlayerUID player] call ExileClient_util_territory_getAccessLevel;
  55. _leaveButton = _display displayCtrl 4135;
  56. _promoteButton = _display displayCtrl 4136;
  57. _demoteButton = _display displayCtrl 4137;
  58. _promoteButton ctrlEnable false;
  59. _demoteButton ctrlEnable false;
  60. if ((_myAccessLevel select 0) isEqualTo 3) then
  61. {
  62.     _leaveButton ctrlEnable false;
  63. }
  64. else
  65. {
  66.     _leaveButton ctrlEnable true;
  67. };
  68. _timePayed = _flag getVariable ["ExileTerritoryLastPayed", _currentTimestamp];// calling last time territory was paid
  69. /*_nextProtectionMoneyDueDate = _flag getVariable ["ExileTerritoryMaintenanceDue", [0, 0, 0, 0, 0]];
  70. _dateTimeString = format
  71. [
  72.     "%1-%2-%3 %4:%5",
  73.     _nextProtectionMoneyDueDate select 0,
  74.     _nextProtectionMoneyDueDate select 1,
  75.     _nextProtectionMoneyDueDate select 2,
  76.     _nextProtectionMoneyDueDate select 3,
  77.     _nextProtectionMoneyDueDate select 4
  78. ];*/
  79. _territoryPayDayInfo = _display displayCtrl 4133;
  80. _territoryPayDayInfo ctrlSetText (format ["Protection Money Last Paid: %1", _timePayed]);// displaying last time territory was paid
  81. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement