Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. private ['_display','_list','_volume','_playButton','_stopButton','_addButton','_removeButton'];
  2. disableSerialization;
  3. if (isNil 'MRADIO_VOLUME') then {
  4. MRADIO_VOLUME = 50; /* Set the volume if it doesn't exist */
  5. };
  6. createDialog 'NRD_Main'; /* Create the dialog */
  7.  
  8. _display = findDisplay 23974;
  9. _list = _display displayCtrl 13410;
  10. _volume = _display displayCtrl 13412;
  11. _volume sliderSetRange [0, 100];
  12. _volume sliderSetPosition MRADIO_VOLUME;
  13.  
  14. call NRD_fnc_fillStations;
  15.  
  16. _volume ctrlAddEventHandler['SliderPosChanged', {
  17. [round (_this select 1)] call NRD_fnc_volume;
  18. }];
  19.  
  20. /* Buton UI Event Handlers */
  21. _playButton = _display displayCtrl 13406;
  22. _playButton ctrlAddEventHandler['ButtonClick', {
  23. _selectedStationIndex = lbCurSel 13410;
  24. if (_selectedStationIndex != -1) then {
  25. _url = lbData[13410,_selectedStationIndex];
  26. [_url] call NRD_fnc_play;
  27. systemChat format ["NRD - Playing %1",_url];
  28. } else {
  29. systemChat "Error - Please select a station first";
  30. };
  31. }];
  32.  
  33. _stopButton = _display displayCtrl 13407;
  34.  
  35. _stopButton ctrlAddEventHandler['ButtonClick', NRD_fnc_stop];
  36.  
  37. _addButton = _display displayCtrl 13408;
  38. _addButton ctrlAddEventHandler['ButtonClick', NRD_fnc_startAdd];
  39.  
  40. _removeButton = _display displayCtrl 13409;
  41. _removeButton ctrlAddEventHandler['ButtonClick', {
  42. private ['_selectedStationIndex','_name','_result'];
  43. _selectedStationIndex = lbCurSel 13410;
  44. if (_selectedStationIndex != -1) then {
  45. _name = lbText[13410,_selectedStationIndex];
  46. _result = [_name] call NRD_fnc_removeFromProfile;
  47. if (_result) then {
  48. systemChat "Favourite Removed";
  49. lbDelete [13410,_selectedStationIndex];
  50. } else {
  51. systemChat "Error - Server Stations cannot be removed";
  52. };
  53. };
  54. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement