Guest User

Untitled

a guest
May 18th, 2022
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. TCMusic.oldISRadioWindow_activate = ISRadioWindow.activate
  2.  
  3. function ISRadioWindow.activate( _player, _item, bol)
  4.     if _player == getPlayer() then
  5.         if instanceof(_item, "Radio") then
  6.             if TCMusic.ItemMusicPlayer[_item:getFullType()] then
  7.                 if _player:getSecondaryHandItem() == _item then
  8.                     ISTCBoomboxWindow.activate( _player, _item );
  9.                 end
  10.             elseif TCMusic.WorldMusicPlayer[_item:getFullType()] then
  11.                
  12.             else
  13.                 TCMusic.oldISRadioWindow_activate( _player, _item, bol );
  14.             end
  15.         elseif instanceof(_item, "IsoWaveSignal") then
  16.             --my change start
  17.             local asdasd = _item:getDeviceData();
  18.             local dataqweqweqwe = _item:getDeviceData();
  19.             local deviceName = _item:getDeviceData():getDeviceName();
  20.             -- or "Vinyl player 'Elektronika S1-01'"
  21.             if (deviceName == "Boombox 'Kazakhstan-102-stereo'" or deviceName == "Vinyl player 'Elektronika S1-01'") then
  22.                 --my change end
  23.                 ISTCBoomboxWindow.activate( _player, _item);
  24.             else
  25.                 -- we need to execute the original ISRadioWindow.activate method
  26.                 TCMusic.oldISRadioWindow_activate( _player, _item, bol );
  27.             end
  28.         else
  29.             TCMusic.oldISRadioWindow_activate( _player, _item, bol );
  30.         end
  31.     end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment