forked from sector3studios/r3e-spectator-overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathr3e.min.js
2 lines (2 loc) · 3.06 KB
/
r3e.min.js
1
2
window.r3e=function(){function n(n){return function(e,o){var r={};if(n.requiresArguments){if(r=e,!o)throw new Error("Callback is not set: "+n.call)}else o=e;if("function"!=typeof o)throw new Error("Callback is not a function: "+n.call);var i=t[n.pool](r);if(i.push(o),!(i.length>1)){var f={};f[n.call]=r;var l=JSON.stringify(f);window.r3e.gameClient(null,l)}}}function e(n){return function(e){if("undefined"==typeof e&&!n.noArgs)throw new Error("Args are not set: "+n.call);var o={};o[n.call]=e||{};var r=JSON.stringify(o);window.r3e.gameClient(null,r)}}function o(n){return function(e){if(!Number.isInteger(e))throw new Error("slotId is not an integer");window.r3e.gameClient(null,JSON.stringify({ChangeCamera:{slotId:e,camera:n}}))}}function r(n){return function(e){var o=t[n.pool]();o.persistent=!0,o.push(e)}}if(!window.gameClient)return console.warn("This depends on the R3E game client");var t=function(){var n={vehicleInfo:{},pitInfo:{},ptpInfo:{},extendedInfo:{},driverInfo:{},driversInfo:[],sessionInfo:[],eventInfo:[],resultsUpdate:[]};return{driverInfo:function(e){return n.driverInfo[e.slotId]||(n.driverInfo[e.slotId]=[]),n.driverInfo[e.slotId]},vehicleInfo:function(e){return n.vehicleInfo[e.slotId]||(n.vehicleInfo[e.slotId]=[]),n.vehicleInfo[e.slotId]},pitInfo:function(e){return n.pitInfo[e.slotId]||(n.pitInfo[e.slotId]=[]),n.pitInfo[e.slotId]},ptPInfo:function(e){return n.ptpInfo[e.slotId]||(n.ptpInfo[e.slotId]=[]),n.ptpInfo[e.slotId]},extendedInfo:function(e){return n.extendedInfo[e.slotId]||(n.extendedInfo[e.slotId]=[]),n.extendedInfo[e.slotId]},driversInfo:function(){return n.driversInfo},sessionInfo:function(){return n.sessionInfo},eventInfo:function(){return n.eventInfo},resultsUpdate:function(){return n.resultsUpdate}}}();return window.communicator=function(n,e){var o=t[n];if(o){var r=o(e),i=[];r.forEach(function(n){i.push(n)}),r.persistent||(r.length=0),i.forEach(function(n){n(e)})}},{getVehicleInfo:n({call:"GetVehicleInfo",pool:"vehicleInfo",requiresArguments:!0}),getPitInfo:n({call:"GetPitInfo",pool:"pitInfo",requiresArguments:!0}),getPushToPassInfo:n({call:"GetPtPInfo",pool:"ptPInfo",requiresArguments:!0}),getExtendedInfo:n({call:"GetExtendedInfo",pool:"extendedInfo",requiresArguments:!0}),getDriverInfo:n({call:"GetDriverInfo",pool:"driverInfo",requiresArguments:!0}),getDriversInfo:n({call:"GetDriversInfo",pool:"driversInfo"}),getSessionInfo:n({call:"GetSessionInfo",pool:"sessionInfo"}),getEventInfo:n({call:"GetEventInfo",pool:"eventInfo"}),showCursor:e({call:"ShowCursor"}),waitOnResults:e({call:"WaitForMe"}),goToNextEvent:e({call:"Proceed",noArgs:!0}),exit:e({call:"Exit",noArgs:!0}),setCamera:{nosecam:o("nosecam"),cockpit:o("cockpit"),swingman:o("swingman"),onboard:o("onboard"),trackside:o("trackside1"),onboard1:o("onboard_1"),onboard2:o("onboard_2"),frontCam:o("front_cam"),rearCam:o("rear_cam"),flFront:o("fl_front"),frFront:o("fr_front"),rlRear:o("rl_rear"),rrRear:o("rr_rear"),rlFront:o("rl_front"),rrFront:o("rr_front"),exhaust:o("exhaust"),wing:o("wing")},on:{resultsUpdate:r({pool:"resultsUpdate"})},gameClient:window.gameClient}}();
//# sourceMappingURL=r3e.min.js.map