Merge branch 'feature/look' into develop
This commit is contained in:
@@ -9,6 +9,44 @@ var screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
|
||||
export default function vehicleMenu(globalData: IGlobalData) {
|
||||
let menuBrowser: BrowserMp = null;
|
||||
var lastDriversBrowser: BrowserMp = null;
|
||||
|
||||
var lastDrivers = null;
|
||||
|
||||
mp.events.add('lookLastDrivers', (lastDriversParam) => {
|
||||
lastDrivers = JSON.parse(lastDriversParam);
|
||||
|
||||
if (lastDriversBrowser !== null) {
|
||||
lastDriversBrowser.destroy();
|
||||
lastDriversBrowser = null;
|
||||
globalData.InMenu = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
else if (!globalData.InMenu) {
|
||||
globalData.InMenu = true;
|
||||
lastDriversBrowser = mp.browsers.new('package://assets/vehicle/lastPlayers.html');
|
||||
mp.gui.chat.activate(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("CEF:VehicleLook_Loaded", () => {
|
||||
lastDriversBrowser.execute(`setDrivers('${JSON.stringify(lastDrivers)}');`);
|
||||
});
|
||||
|
||||
mp.events.add("removeLookMenu", () => {
|
||||
if (lastDriversBrowser == null) {
|
||||
return;
|
||||
}
|
||||
else if (globalData.InMenu) {
|
||||
lastDriversBrowser.destroy();
|
||||
lastDriversBrowser = null;
|
||||
globalData.InMenu = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add('ToggleVehicleMenu', () => {
|
||||
if (menuBrowser !== null) {
|
||||
|
||||
16
ReallifeGamemode.Client/assets/html/vehiclemenu/script.js
Normal file
16
ReallifeGamemode.Client/assets/html/vehiclemenu/script.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
|
||||
function ad_row(id, name, faction, ping) {
|
||||
var table_id = "t1";
|
||||
var table = document.getElementById(table_id);
|
||||
var rows = table.getElementsByTagName('tr').length;
|
||||
var tr = table.insertRow(rows);
|
||||
var td1 = document.createElement('td');
|
||||
var td2 = document.createElement('td');
|
||||
var td3 = document.createElement('td');
|
||||
var td4 = document.createElement('td');
|
||||
var test = faction;
|
||||
td1.innerHTML = ''+driver;
|
||||
tr.appendChild(td1);
|
||||
}
|
||||
67
ReallifeGamemode.Client/assets/html/vehiclemenu/style.css
Normal file
67
ReallifeGamemode.Client/assets/html/vehiclemenu/style.css
Normal file
@@ -0,0 +1,67 @@
|
||||
/* style.css für Tabliste */
|
||||
.greyFont {
|
||||
color: gray;
|
||||
font-size: 14px;
|
||||
width: 250px;
|
||||
}
|
||||
div {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 500;
|
||||
color: #222;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
margin:5px;
|
||||
padding: 5px;
|
||||
border: 1px solid #808080;
|
||||
width: 20.75em;
|
||||
}
|
||||
.TabWrapper {
|
||||
background: rgba(0,0,0,0.6);
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
left: 32%;
|
||||
top: 10%;
|
||||
}
|
||||
th, td {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
width:10%;
|
||||
text-align: left;
|
||||
}
|
||||
.scroll {
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
font-size: 12px;
|
||||
overflow: auto;
|
||||
}
|
||||
.force-overflow {
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar-thumb {
|
||||
background-color: #FF0040;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
26
ReallifeGamemode.Client/assets/vehicle/application.js
Normal file
26
ReallifeGamemode.Client/assets/vehicle/application.js
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
let close = document.getElementById('close');
|
||||
|
||||
$(document).ready(function () {
|
||||
mp.trigger("CEF:VehicleLook_Loaded");
|
||||
});
|
||||
|
||||
function setDrivers(driversJson) {
|
||||
var drivers = JSON.parse(driversJson);
|
||||
var listTag = $("#drivers-list");
|
||||
drivers.forEach(driver => {
|
||||
var name = driver.Name;
|
||||
var dateTime = new Date(driver.Time);
|
||||
|
||||
var date = `${dateTime.getDay()}.${dateTime.getMonth()}.${dateTime.getFullYear()}`;
|
||||
var time = `${dateTime.getHours()}:${dateTime.getMinutes()}:${dateTime.getSeconds()}`;
|
||||
|
||||
var infoLine = `${name} am ${date} um ${time} Uhr`;
|
||||
var listItemTag = `<li>${infoLine}</li>`;
|
||||
listTag.append(listItemTag);
|
||||
});
|
||||
}
|
||||
|
||||
close.onclick = function closeWindow() {
|
||||
mp.trigger('removeLookMenu');
|
||||
}
|
||||
29
ReallifeGamemode.Client/assets/vehicle/lastPlayers.html
Normal file
29
ReallifeGamemode.Client/assets/vehicle/lastPlayers.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Eingabe | Life of German</title>
|
||||
|
||||
<link rel="stylesheet" href="package://assets/css/Introduction/style.css" />
|
||||
<link rel="stylesheet" href="../../font/font-awesome/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="../../font/font-awesome/css/regular.min.css">
|
||||
<link rel="stylesheet" href="../../font/roboto-mono/include_500.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<div class="input-main">
|
||||
<h1>Letze Fahrer</h1>
|
||||
</div>
|
||||
<div id="content" class="form" role="form">
|
||||
<ul id="drivers-list">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<a id="close" href="#"></a>
|
||||
</main>
|
||||
<script src="../js/jquery-3.3.1.min.js"></script>
|
||||
<script src="./application.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
67
ReallifeGamemode.Client/assets/vehicle/style.css
Normal file
67
ReallifeGamemode.Client/assets/vehicle/style.css
Normal file
@@ -0,0 +1,67 @@
|
||||
/* style.css für Tabliste */
|
||||
.greyFont {
|
||||
color: gray;
|
||||
font-size: 14px;
|
||||
width: 250px;
|
||||
}
|
||||
div {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 500;
|
||||
color: #222;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
margin:5px;
|
||||
padding: 5px;
|
||||
border: 1px solid #808080;
|
||||
width: 20.75em;
|
||||
}
|
||||
.TabWrapper {
|
||||
background: rgba(0,0,0,0.6);
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
left: 32%;
|
||||
top: 10%;
|
||||
}
|
||||
th, td {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
width:10%;
|
||||
text-align: left;
|
||||
}
|
||||
.scroll {
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
font-size: 12px;
|
||||
overflow: auto;
|
||||
}
|
||||
.force-overflow {
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar-thumb {
|
||||
background-color: #FF0040;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user