mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
Test beep boops
This commit is contained in:
BIN
nui/beep.ogg
Normal file
BIN
nui/beep.ogg
Normal file
Binary file not shown.
16
nui/radar.js
16
nui/radar.js
@@ -11,6 +11,13 @@
|
||||
// Variables
|
||||
var resourceName;
|
||||
|
||||
const audioNames =
|
||||
{
|
||||
beep: "beep.ogg",
|
||||
xmit_on: "xmit_on.ogg",
|
||||
xmit_off: "xmit_off.ogg",
|
||||
}
|
||||
|
||||
// Setup the main const element structure, this way we can easily access elements without having the mess
|
||||
// that was in the JS file for WraithRS
|
||||
const elements =
|
||||
@@ -299,6 +306,12 @@ function settingUpdate( ants, fast )
|
||||
}
|
||||
}
|
||||
|
||||
function playAudio( name )
|
||||
{
|
||||
let audio = new Audio( audioNames[name] );
|
||||
audio.play();
|
||||
}
|
||||
|
||||
// This function is used to send data back through to the LUA side
|
||||
function sendData( name, data ) {
|
||||
$.post( "http://" + resourceName + "/" + name, JSON.stringify( data ), function( datab ) {
|
||||
@@ -365,6 +378,9 @@ window.addEventListener( "message", function( event ) {
|
||||
case "settingUpdate":
|
||||
settingUpdate( item.antennaData, item.fast );
|
||||
break;
|
||||
case "audio":
|
||||
playAudio( item.name );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
BIN
nui/xmit_off.ogg
Normal file
BIN
nui/xmit_off.ogg
Normal file
Binary file not shown.
BIN
nui/xmit_on.ogg
Normal file
BIN
nui/xmit_on.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user