add wanteds
This commit is contained in:
7
ReallifeGamemode.Client/Gui/wanteds.ts
Normal file
7
ReallifeGamemode.Client/Gui/wanteds.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function wanteds(globalData: GlobalData) {
|
||||
var browser = mp.browsers.new("package://assets/html/wanteds/index.html");
|
||||
|
||||
mp.events.add("SERVER:SetWanteds", (count: number) => {
|
||||
browser.execute(`setWanteds(${count});`);
|
||||
});
|
||||
}
|
||||
@@ -154,7 +154,7 @@ export default function tuning(globalData: GlobalData) {
|
||||
var localPlayer = mp.players.local;
|
||||
var localVehicle = localPlayer.vehicle;
|
||||
|
||||
localVehicle.setHalt(1.0, true, false);
|
||||
localVehicle.setHalt(1.0, 1, false);
|
||||
|
||||
globalData.InMenu = true;
|
||||
globalData.InTuning = true;
|
||||
|
||||
57
ReallifeGamemode.Client/assets/html/wanteds/index.html
Normal file
57
ReallifeGamemode.Client/assets/html/wanteds/index.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Wanteds</title>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wanteds {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
top: 40px;
|
||||
right: 20px;
|
||||
height: 50px;
|
||||
padding-top: 10px;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
#wanteds img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
#wanteds span {
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
font-size: 50px;
|
||||
color: white;
|
||||
font-family: 'Bebas Neue';
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wanteds" style="display: none;">
|
||||
<img src="package://assets/img/wanteds/star.svg" />
|
||||
<span id="wanted-count">10</span>
|
||||
</div>
|
||||
|
||||
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function setWanteds(count) {
|
||||
if (count === 0) {
|
||||
$("#wanteds").hide();
|
||||
} else {
|
||||
$("#wanteds").show();
|
||||
$("#wanted-count").text(count.toString());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
4
ReallifeGamemode.Client/assets/img/wanteds/star.svg
Normal file
4
ReallifeGamemode.Client/assets/img/wanteds/star.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240">
|
||||
<path fill="#F8D64E" d="m48,234 73-226 73,226-192-140h238z"/>
|
||||
</svg>
|
||||
@@ -25,6 +25,9 @@ var inMenu = false;
|
||||
|
||||
mp.game.vehicle.defaultEngineBehaviour = false;
|
||||
|
||||
import wanteds from './Gui/wanteds';
|
||||
wanteds(globalData);
|
||||
|
||||
import playerBlips from './Gui/blips';
|
||||
playerBlips();
|
||||
|
||||
|
||||
4
ReallifeGamemode.Client/package-lock.json
generated
4
ReallifeGamemode.Client/package-lock.json
generated
@@ -194,8 +194,8 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/ragemp-c": {
|
||||
"version": "git+https://github.com/sprayzcs/types-ragemp-c.git#5bad2bb24e8cd1f286d8ee26b30272891423d9f9",
|
||||
"from": "git+https://github.com/sprayzcs/types-ragemp-c.git#master",
|
||||
"version": "github:CocaColaBear/types-ragemp-c#6a118e6399b77a347ac67e07f6b15f842109b0ff",
|
||||
"from": "github:CocaColaBear/types-ragemp-c#master",
|
||||
"dev": true
|
||||
},
|
||||
"@webassemblyjs/ast": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@types/node": "^11.9.5",
|
||||
"@types/ragemp-c": "git+https://github.com/sprayzcs/types-ragemp-c.git#master",
|
||||
"@types/ragemp-c": "github:CocaColaBear/types-ragemp-c#master",
|
||||
"NativeUI": "https://github.com/sprayzcs/RageMP-NativeUI/tarball/master",
|
||||
"babel-loader": "^8.0.5",
|
||||
"copy-webpack-plugin": "^5.0.1",
|
||||
|
||||
Reference in New Issue
Block a user