Commit 07b552ec authored by Test's avatar Test

convert service class to service object

parent a1f680b9
<html>
<meta charset="utf-8">
<link rel="stylesheet" href="mechanic.css">
<script src="../vue.js"></script>
<script src="../../../vue.js"></script>
<body>
<div id="app">
<div class="b3-close" id="close-button" @click="exit">X</div>
<div class="b3-service" id="sp0-button" @click="sp0">No Spoiler</div>
<div class="b3-service" id="sp1-button" @click="sp1">Spoiler 1</div>
<div class="b3-service" id="sp2-button" @click="sp2">Spoiler 2</div>
<div class="b3-service" id="sp3-button" @click="sp3">Spoiler 3</div>
<div class="b1-service">
<div>
<div class="b1-summ-info">{{ engine }}</div>
</div>
<div>
<div class="b1-summ">{{ horn }}</div>
<div class="b1-summ-info">{{ breaks }}</div>
<div class="b1-summ-info">{{ wheels }}</div>
</div>
</div>
</div>
</body>
</html>
......@@ -18,17 +25,30 @@
const app = new Vue({
el: '#app',
data: {
engine: -1,
horn: -1,
breaks: -1,
transmission: -1,
suspension: -1,
turbo: -1,
xenon: -1,
tint: -1,
plate: -1,
boost: -1,
spoiler: -1,
fbumper: -1,
rbumper: -1,
skirt: -1,
armor: -1,
hydraulics: -1,
wheels: -1
},
methods: {
changeCamRotation: function() {
mp.trigger("cChangeHeading", this.camRotation);
},
exit: function() {
mp.trigger("cCloseCefAndDestroyCam");
},
sp0: function() {
mp.trigger("cAutoShop-CallServerEvent", sAutoShop-Mod, 0, -1);
mp.trigger("cAutoShop-CallServerEvent", z-Mod, 0, -1);
},
sp1: function() {
mp.trigger("cAutoShop-CallServerEvent", sAutoShop-Mod, 0, 0);
......@@ -36,5 +56,9 @@ const app = new Vue({
sp2: function() {
mp.trigger("cAutoShop-CallServerEvent", sAutoShop-Mod, 0, 1);
},
exit: function() {
mp.trigger("cCloseCefAndDestroyCam");
}
}
});
</script>
\ No newline at end of file
......@@ -4,6 +4,33 @@ const misc = require('../cMisc');
const player = mp.players.local;
const vehicle = player.vehicle
mp.game.streaming.requestIpl("apa_v_mp_h_02_c");
mp.game.streaming.requestIpl("imp_dt1_02_modgarage")
mp.game.streaming.requestIpl("imp_dt1_02_cargarage_a")
mp.game.streaming.requestIpl("imp_dt1_02_cargarage_b")
mp.game.streaming.requestIpl("imp_dt1_02_cargarage_c")
mp.game.streaming.requestIpl("imp_dt1_11_modgarage")
mp.game.streaming.requestIpl("imp_dt1_11_cargarage_a")
mp.game.streaming.requestIpl("imp_dt1_11_cargarage_b")
mp.game.streaming.requestIpl("imp_dt1_11_cargarage_c")
mp.game.streaming.requestIpl("imp_sm_13_modgarage")
mp.game.streaming.requestIpl("imp_sm_13_cargarage_a")
mp.game.streaming.requestIpl("imp_sm_13_cargarage_b")
mp.game.streaming.requestIpl("imp_sm_13_cargarage_c")
mp.game.streaming.requestIpl("imp_sm_15_modgarage")
mp.game.streaming.requestIpl("imp_sm_15_cargarage_a")
mp.game.streaming.requestIpl("imp_sm_15_cargarage_b")
mp.game.streaming.requestIpl("imp_sm_15_cargarage_c")
mp.game.streaming.requestIpl("imp_impexp_interior_placement")
mp.game.streaming.requestIpl("imp_impexp_interior_placement_interior_0_impexp_int_01_milo_")
mp.game.streaming.requestIpl("imp_impexp_interior_placement_interior_3_impexp_int_02_milo_")
mp.game.streaming.requestIpl("imp_impexp_interior_placement_interior_1_impexp_intwaremed_milo_")
mp.game.streaming.requestIpl("imp_impexp_interior_placement_interior_2_imptexp_mod_int_01_milo_")
mp.events.add(
{
"cAutoShop-ShowPaintMenu" : (service) => {
......@@ -16,10 +43,10 @@ mp.events.add(
// },3000)
},
"cAutoShop-ShowMechanicMenu" : () => {
"cAutoShop-ShowMechanicMenu" : (execute) => {
misc.prepareToCef();
misc.openCef("package://RP/Browsers/Business/AutoShop/Mechanic/mechanic.html");
//misc.injectCef(inject);
misc.injectCef(execute);
misc.createPointedCam(110.48, 6631.676, 31.787, 0, 0, 0, 80, 109.888, 6626.924, 31.787)
//setTimeout(function(){
// misc.destroyCam();
......
......@@ -23,25 +23,31 @@ mp.blips.new(524, new mp.Vector3(111.08, 6626.702, 31.444),
scale: 0.75,
})
// Service Class. Tracks where your car is.
class service {
constructor() {
this.garage = ''
this.service = ''
this.primeColor = -1
this.secondaryColor = -1
this.mod = -1
this.engine = -1
this.horn = -1
this.breaks = -1
this.transmission = -1
this.suspension = -1
this.turbo = -1
this.xenon = -1
this.tint = -1
this.plate = -1
this.boost = -1
}
let service = {
garage: '',
service: '',
primeColor: -1,
secondaryColor: -1,
mod: -1,
engine: -1,
horn: -1,
breaks: -1,
transmission: -1,
suspension: -1,
turbo: -1,
xenon: -1,
tint: -1,
plate: -1,
boost: -1,
spoiler: -1,
fbumper: -1,
rbumper: -1,
skirt: -1,
armor: -1,
hydraulics: -1,
wheels: -1
}
// Menu Class. Tracks what Menu to deliver based on which garage slot the users car is in.
class menu {
constructor() {
......@@ -74,6 +80,13 @@ function colShapeEntered(player, shape){
service.tint = player.vehicle.getMod(46)
service.plate = player.vehicle.getMod(62)
service.boost = player.vehicle.getMod(40)
service.spoiler = player.vehicle.getMod(0)
service.fbumper = player.vehicle.getMod(1)
service.rbumper = player.vehicle.getMod(2)
service.skirt = player.vehicle.getMod(3)
service.armor = player.vehicle.getMod(16)
service.hydraulics = player.vehicle.getMod(38)
service.wheels = player.vehicle.getMod(23)
const str = `boost: ${service.boost} Turbo: ${service.turbo}`
player.notify(str)
player.notify(`Get out and see the mechanic.`)
......@@ -139,10 +152,29 @@ mp.events.add({"sKeys-E" : (player) => {
//player.call("cAutoShop-ShowPaintMenu", service)
}
else if (menu.garage == true) {
//player.notify(`Those custom parts aren't in yet.`)
const servicevehicle = mp.vehicles.forEachInRange(111.08, 6626.702, 31.444, 2, 0, 70);
player.notify(`${ servicevehicle }`)
player.call("cAutoShop-ShowMechanicMenu")
//player.notify(`Those custom parts aren't in yet.`)
//const servicevehicle = mp.vehicles.forEachInRange(111.08, 6626.702, 31.444, 2, 0, 70);
//player.notify(`${ servicevehicle }`)
let execute = `app.engine = ${service.engine};`
execute += `app.horn = ${service.horn};`
execute += `app.breaks = ${service.breaks};`
execute += `app.transmission = ${service.transmission};`
execute += `app.suspension = ${service.suspension};`
execute += `app.turbo = ${service.turbo};`
execute += `app.xenon = ${service.xenon};`
execute += `app.tint = ${service.tint};`
execute += `app.plate = ${service.plate};`
execute += `app.boost = ${service.boost};`
execute += `app.spoiler = ${service.spoiler};`
execute += `app.fbumper = ${service.fbumper};`
execute += `app.rbumper = ${service.rbumper};`
execute += `app.skirt = ${service.skirt};`
execute += `app.armor = ${service.armor};`
execute += `app.hyrdraulics = ${service.hydraulics};`
execute += `app.wheels = ${service.wheels};`
//const execute = JSON.stringify(service)
player.call("cAutoShop-ShowMechanicMenu", [execute])
}
else {
player.call("cAutoShop-ShowDevMenu")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment