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