GREUH_dialog.sqf 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. _squadcontrols = [511,512,513,514,515,521,522,523,524,525,526,527];
  2. _platooncontrols = [611,612,613,614];
  3. _viewcontrols = [712,713,714,722,723,724,732,733,734];
  4. _worldcontrols = [812,813,814,815];
  5. _markerscontrols = [911,912,913,914];
  6. _allbuttons = [6677,511,512,513,514,613,614,812,813,814,815,913,914,712,722,732];
  7. _rename_controls = [521,522,523,524,525,526,527];
  8. _leader_controls = [561,562,563,564,565,566,567];
  9. renaming = false;
  10. choosingleader = false;
  11. _dialog = createDialog "GREUH_Menu";
  12. waitUntil { dialog };
  13. if ( GREUH_allow_customsquads ) then {
  14. ctrlShow [501, false];
  15. } else {
  16. ctrlShow [501, true];
  17. { ctrlShow [_x, false] } foreach _squadcontrols;
  18. };
  19. if ( GREUH_allow_platoonview ) then {
  20. ctrlShow [601, false];
  21. } else {
  22. ctrlShow [601, true];
  23. { ctrlShow [_x, false] } foreach _platooncontrols;
  24. };
  25. if ( GREUH_allow_viewdistance ) then {
  26. ctrlShow [701, false];
  27. sliderSetRange [712, 1000, 10000];
  28. sliderSetPosition [712, desiredviewdistance_inf];
  29. sliderSetSpeed [712, 500, 500];
  30. sliderSetRange [722, 1000, 10000];
  31. sliderSetPosition [722, desiredviewdistance_veh];
  32. sliderSetSpeed [722, 500, 500];
  33. sliderSetRange [732, 30, 100];
  34. sliderSetPosition [732, desiredviewdistance_obj];
  35. sliderSetSpeed [732, 5, 5];
  36. ctrlSetText [ 960, format ["%1",desired_fps] ];
  37. } else {
  38. ctrlShow [701, true];
  39. { ctrlShow [_x, false] } foreach _viewcontrols;
  40. };
  41. if ( GREUH_allow_worldquality ) then {
  42. ctrlShow [801, false];
  43. } else {
  44. ctrlShow [801, true];
  45. { ctrlShow [_x, false] } foreach _worldcontrols;
  46. };
  47. if ( GREUH_allow_mapmarkers ) then {
  48. ctrlShow [901, false];
  49. } else {
  50. ctrlShow [901, true];
  51. { ctrlShow [_x, false] } foreach _markerscontrols;
  52. };
  53. if ( true ) then {
  54. sliderSetSpeed [ 1102, 5, 5];
  55. sliderSetRange [ 1102, 0, 100];
  56. sliderSetPosition [ 1102, desired_vehvolume ];
  57. };
  58. while { dialog && alive player } do {
  59. if ( renaming ) then {
  60. { ctrlEnable [_x, false] } foreach (_allbuttons);
  61. { ctrlShow [_x, true] } foreach _rename_controls;
  62. { ctrlShow [_x, false] } foreach _leader_controls;
  63. } else {
  64. if ( choosingleader ) then {
  65. { ctrlEnable [_x, false] } foreach _allbuttons;
  66. { ctrlShow [_x, false] } foreach _rename_controls;
  67. { ctrlShow [_x, true] } foreach _leader_controls;
  68. } else {
  69. { ctrlEnable [_x, true] } foreach _allbuttons;
  70. { ctrlShow [_x, false] } foreach (_rename_controls + _leader_controls);
  71. ctrlEnable [513,(leader (group player) == player)];
  72. ctrlEnable [514,(leader (group player) == player)];
  73. };
  74. };
  75. if ( GREUH_allow_platoonview ) then { ctrlShow [612, show_platoon]; };
  76. if ( GREUH_allow_mapmarkers ) then { ctrlShow [912, show_teammates]; };
  77. ctrlShow [ 962, show_nametags ];
  78. if ( GREUH_allow_customsquads ) then {
  79. lbClear 515;
  80. {
  81. _brakets = "";
  82. if ( _x == group player ) then { _brakets = ">> "; };
  83. lbAdd [515, format [ "%4%1 - %2 (%3)",groupId _x, name leader _x, count units _x,_brakets ]];
  84. } foreach groups_list;
  85. };
  86. if ( GREUH_allow_viewdistance ) then {
  87. ctrlSetText [713, format [ '%1m' ,round desiredviewdistance_inf]];
  88. ctrlSetText [723, format [ '%1m' ,round desiredviewdistance_veh]];
  89. ctrlSetText [733, format [ '%1m' ,round ((desiredviewdistance_obj / 100.0) * desiredviewdistance_inf) ]];
  90. };
  91. ctrlSetText [ 1103, format [ "%1%2", round (desired_vehvolume), "%" ] ];
  92. desired_fps = parseNumber (ctrlText 960);
  93. uiSleep 0.2;
  94. };
  95. if (!alive player) then { closeDialog 0 };
  96. greuh_options_profile = [ desiredviewdistance_inf, desiredviewdistance_veh, desiredviewdistance_obj, show_teammates, show_platoon, desired_vehvolume, show_nametags, desired_fps ];
  97. profileNamespace setVariable [ "GREUH_OPTIONS_PROFILE",greuh_options_profile ];
  98. saveProfileNamespace;