Commit a1f680b9 authored by Test's avatar Test

garage mods applied outside of vehicle is functional

parent 9c7cb919
......@@ -19,6 +19,15 @@
z-index: 2;
}
.b3-service {
background: rgb(39, 218, 98);
width: 6vh;
height: 3vh;
font-size: 2vh;
transition: 0.3s;
z-index: 2;
}
.b3-close:hover {
background: tomato;
}
......
......@@ -4,7 +4,11 @@
<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>
</body>
</html>
......@@ -23,5 +27,14 @@ const app = new Vue({
exit: function() {
mp.trigger("cCloseCefAndDestroyCam");
},
sp0: function() {
mp.trigger("cAutoShop-CallServerEvent", sAutoShop-Mod, 0, -1);
},
sp1: function() {
mp.trigger("cAutoShop-CallServerEvent", sAutoShop-Mod, 0, 0);
},
sp2: function() {
mp.trigger("cAutoShop-CallServerEvent", sAutoShop-Mod, 0, 1);
},
});
</script>
\ No newline at end of file
......@@ -8,32 +8,59 @@
<div class="b3-close" id="close-button" @click="exit">X</div>
<h1>{{ titleText }}</h1>
<div style="position:absolute; left:280px; top:10px;">
<h1>{{ prime }}</h1>
<h1>{{ second }}</h1>
<div>
toHEXString = <span id="hex-str"></span><br />
toRGBString = <span id="rgb-str"></span><br />
R, G, B = <span id="rgb"></span><br />
H, S, V = <span id="hsv"></span>
</div>
<input class="jscolor {onFineChange:'update(this)'}" value="ffcc00">
<input class="jscolor {onFineChange:'prime(this)'}" value="ffcc00">
<div>
toHEXString = <span id="hex-str2"></span><br />
toRGBString = <span id="rgb-str2"></span><br />
R, G, B = <span id="rgb2"></span><br />
H, S, V = <span id="hsv2"></span>
</div>
<input class="jscolor {onFineChange:'second(this)'}" value="ffcc00">
</div>
</body>
</html>
<script>
class service {
constructor() {
this.prime = ""
this.second = ""
}
}
function update(picker) {
function prime(picker) {
document.getElementById('hex-str').innerHTML = picker.toHEXString();
document.getElementById('rgb-str').innerHTML = picker.toRGBString();
document.getElementById('rgb').innerHTML =
Math.round(picker.rgb[0]) + ', ' +
Math.round(picker.rgb[1]) + ', ' +
Math.round(picker.rgb[2]);
service.prime =
Math.round(picker.rgb[0]) + ', ' +
Math.round(picker.rgb[1]) + ', ' +
Math.round(picker.rgb[2]);
}
document.getElementById('hsv').innerHTML =
Math.round(picker.hsv[0]) + '&deg;, ' +
Math.round(picker.hsv[1]) + '%, ' +
Math.round(picker.hsv[2]) + '%';
function second(picker) {
document.getElementById('hex-str2').innerHTML = picker.toHEXString();
document.getElementById('rgb-str2').innerHTML = picker.toRGBString();
document.getElementById('rgb2').innerHTML =
Math.round(picker.rgb[0]) + ', ' +
Math.round(picker.rgb[1]) + ', ' +
Math.round(picker.rgb[2]);
service.second =
Math.round(picker.rgb[0]) + ', ' +
Math.round(picker.rgb[1]) + ', ' +
Math.round(picker.rgb[2]);
}
const app = new Vue({
......@@ -43,9 +70,6 @@
prime: service.primeColor,
second: service.secondaryColor,
},
methods: {
changeCamRotation: function() {
mp.trigger("cChangeHeading", this.camRotation);
......
......@@ -17,13 +17,13 @@ mp.events.add(
},
"cAutoShop-ShowMechanicMenu" : () => {
//misc.prepareToCef();
//misc.openCef("package://RP/Browsers/Business/AutoShop/Mechanic/mechanic.html");
misc.prepareToCef();
misc.openCef("package://RP/Browsers/Business/AutoShop/Mechanic/mechanic.html");
//misc.injectCef(inject);
misc.createPointedCam(110.48, 6631.676, 31.787, 0, 0, 0, 80, 109.888, 6626.924, 31.787)
setTimeout(function(){
misc.destroyCam();
},3000)
//setTimeout(function(){
// misc.destroyCam();
//},3000)
},
"cAutoShop-ShowDevMenu" : () => {
......@@ -31,7 +31,7 @@ mp.events.add(
misc.openCef("package://RP/Browsers/Business/AutoShop/Paint/paint.html")
},
"cMisc-CallServerEvent" : (eventName, id, price) => mp.events.callRemote(eventName, id, price),
"cAutoShop-CallServerEvent" : (eventName, a, b) => mp.events.callRemote(eventName, a, b),
......
......@@ -34,7 +34,7 @@ class TimeSingleton {
}
changeTime(currentDate, isFirstRunning) {
mp.world.time.hour = currentDate.getHours();
mp.world.time.hour = currentDate.getHours() + 12;
mp.world.time.minute = currentDate.getMinutes();
if (isFirstRunning) return false;
this.everyMinuteEvent();
......
......@@ -27,19 +27,19 @@ class service {
constructor() {
this.garage = ''
this.service = ''
this.primeColor = ''
this.secondaryColor = ''
this.mod = ''
this.engine = ''
this.horn = ''
this.breaks = ''
this.transmission = ''
this.suspension = ''
this.turbo = ''
this.xenon = ''
this.tint = ''
this.plate = ''
this.boost = ''
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
}
}
// Menu Class. Tracks what Menu to deliver based on which garage slot the users car is in.
......@@ -74,6 +74,8 @@ function colShapeEntered(player, shape){
service.tint = player.vehicle.getMod(46)
service.plate = player.vehicle.getMod(62)
service.boost = player.vehicle.getMod(40)
const str = `boost: ${service.boost} Turbo: ${service.turbo}`
player.notify(str)
player.notify(`Get out and see the mechanic.`)
service.garage = 'ingarage'
}
......@@ -126,14 +128,21 @@ function colShapeExited(player, shape) {
// RAGE Event Declarations
mp.events.add("playerEnterColshape", colShapeEntered)
mp.events.add("playerExitColshape", colShapeExited)
mp.events.add({
"sAutoShop-Mod" : ( a, b ) => {
player.vehicle.setMod(parseInt(a), parseInt(b))
}
})
mp.events.add({"sKeys-E" : (player) => {
if (colshapeloc.location == 'menuactive') {
if (menu.paint == true) {
player.call("cAutoShop-ShowPaintMenu", service)
//player.call("cAutoShop-ShowPaintMenu", service)
}
else if (menu.garage == true) {
//player.notify(`Those custom parts aren't in yet.`)
player.call("cAutoShop-ShowMechanicMenu", service)
//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")
}
else {
player.call("cAutoShop-ShowDevMenu")
......@@ -143,4 +152,15 @@ mp.events.add({"sKeys-E" : (player) => {
return
}
}
})
mp.events.addCommand('mod', (player, fullText, a , b) => {
player.vehicle.setMod(parseInt(a), parseInt(b));
});
mp.events.addCommand('modtest', () => {
mp.vehicles.forEachInRange(new mp.Vector3(111.08, 6626.702, 31.444), 3,
(vehicle) => {
vehicle.setMod(0,1)
}
);
})
\ No newline at end of file
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