From 068f3e2d916df1de1f8f4a8f903707ace2b108a6 Mon Sep 17 00:00:00 2001 From: Lukas Moungos Date: Wed, 4 Sep 2019 20:28:51 +0200 Subject: [PATCH] Added many things I can't recall but it has to do with inventory system and some minor fixes .. it's cool --- ReallifeGamemode.Client/Gui/playerlist.ts | 24 +- ReallifeGamemode.Client/Player/keys.ts | 2 +- .../assets/css/inventory/style.css | 32 +- .../assets/html/Playerlist/Tabliste.html | 30 ++ .../assets/html/Playerlist/script.js | 26 ++ .../assets/html/Playerlist/style.css | 64 +++ .../assets/html/inventory/index.html | 70 ++-- .../assets/html/inventory/vehicle/index.html | 47 +++ .../assets/html/inventory/vehicle/script.js | 375 +++++++++++++++--- .../assets/html/inventory/vehicle/style.css | 98 ++++- .../inventory/vehicle/vehicleInventory.html | 32 -- .../assets/js/inventory/script.js | 66 ++- .../inventory/inventory.ts | 45 ++- ReallifeGamemode.Client/tsconfig.json | 2 +- .../Commands/AdminCommands.cs | 2 +- .../Commands/UserCommands.cs | 2 +- .../Entities/VehicleItem.cs | 34 ++ ReallifeGamemode.Server/Events/Key.cs | 2 +- .../Inventory/Items/Aal.cs | 2 +- .../Inventory/Items/Barsch.cs | 2 +- .../Inventory/Items/Cannabis.cs | 23 ++ .../Items/{Chickenburger.cs => Cocain.cs} | 8 +- .../Inventory/Items/Hamburger.cs | 24 -- .../Inventory/Items/Holz.cs | 4 +- .../Inventory/Items/Kraftstoff.cs | 6 +- .../Inventory/Items/Lachs.cs | 2 +- .../Inventory/Items/Thunfisch.cs | 2 +- .../Inventory/Items/Zander.cs | 2 +- .../Managers/ManagerOfInventory.cs | 115 +++++- ...0190721184931_FactionWeaponsRemovedHash.cs | 23 -- ...> 20190805184145_VehicleItems.Designer.cs} | 72 +++- .../Migrations/20190805184145_VehicleItems.cs | 50 +++ .../DatabaseContextModelSnapshot.cs | 37 +- .../Models/DatabaseContext.cs | 1 + 34 files changed, 1057 insertions(+), 269 deletions(-) create mode 100644 ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html create mode 100644 ReallifeGamemode.Client/assets/html/Playerlist/script.js create mode 100644 ReallifeGamemode.Client/assets/html/Playerlist/style.css create mode 100644 ReallifeGamemode.Client/assets/html/inventory/vehicle/index.html delete mode 100644 ReallifeGamemode.Client/assets/html/inventory/vehicle/vehicleInventory.html create mode 100644 ReallifeGamemode.Server/Entities/VehicleItem.cs create mode 100644 ReallifeGamemode.Server/Inventory/Items/Cannabis.cs rename ReallifeGamemode.Server/Inventory/Items/{Chickenburger.cs => Cocain.cs} (72%) delete mode 100644 ReallifeGamemode.Server/Inventory/Items/Hamburger.cs delete mode 100644 ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.cs rename ReallifeGamemode.Server/Migrations/{20190721184931_FactionWeaponsRemovedHash.Designer.cs => 20190805184145_VehicleItems.Designer.cs} (94%) create mode 100644 ReallifeGamemode.Server/Migrations/20190805184145_VehicleItems.cs diff --git a/ReallifeGamemode.Client/Gui/playerlist.ts b/ReallifeGamemode.Client/Gui/playerlist.ts index e4d00a66..e4be88ad 100644 --- a/ReallifeGamemode.Client/Gui/playerlist.ts +++ b/ReallifeGamemode.Client/Gui/playerlist.ts @@ -1,6 +1,6 @@ /** * @overview Life of German Reallife - Gui Playerlist playerlist.js - * @author VegaZ + * @author VegaZ. Siga. * @copyright (c) 2008 - 2018 Life of German */ @@ -9,21 +9,25 @@ export default function playerList() { var playerlistBrowser var pList; - mp.events.add("showPlayerlist", () => { + mp.events.add("showPlayerlist", (playersJson) => { if (!playerlistBrowser) { - playerlistBrowser = mp.browsers.new('package://Gui/playerlist.html'); + playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); + pList = JSON.parse(playersJson); + pList.forEach((player) => { + playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`); + }); + } else { + playerlistBrowser.destroy(); + playerlistBrowser = null; + mp.gui.chat.activate(true); + mp.gui.cursor.show(false, false); } }); - mp.events.add("fetchPlayerList", (playersJson) => { - - pList = JSON.parse(playersJson); - - pList.forEach((player) => { - mp.gui.chat.push(player.Id + ", " + player.Name + ", " + player.Ping); - }); + mp.events.add("CEF:fetchPlayerList", () => { + }); } diff --git a/ReallifeGamemode.Client/Player/keys.ts b/ReallifeGamemode.Client/Player/keys.ts index 99cc6feb..996954b0 100644 --- a/ReallifeGamemode.Client/Player/keys.ts +++ b/ReallifeGamemode.Client/Player/keys.ts @@ -96,7 +96,7 @@ export default function keys(globalData: GlobalData) { //O //Spielerliste mp.keys.bind(0x4F, false, function () { - if (!globalData.InChat) { + if (!globalData.InChat && !globalData.InMenu) { mp.events.callRemote("keyPress:O"); //mp.events.call("showPlayerlist"); } diff --git a/ReallifeGamemode.Client/assets/css/inventory/style.css b/ReallifeGamemode.Client/assets/css/inventory/style.css index 32a97152..a4f76446 100644 --- a/ReallifeGamemode.Client/assets/css/inventory/style.css +++ b/ReallifeGamemode.Client/assets/css/inventory/style.css @@ -280,23 +280,10 @@ h5 { } /*Handelfenster */ #tf_betrag { - background-color: #313131; /* blau */ - border: none; - height: 30px; - width: 100% - text-align: center; - text-decoration: none; - display: inline-block; - font-size: 12px; - position: relative; - left: 1.5%; - color:#ffffff; -} -#tf_zahl { background-color: #313131; /* blau */ border: none; height: 30px; - width: 100%; + width: 124px; text-align: center; text-decoration: none; display: inline-block; @@ -305,6 +292,20 @@ h5 { left: 1.5%; color: #ffffff; } +#tf_zahl { + background-color: #313131; /* blau */ + border: none; + height: 30px; + width: 124px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 12px; + position: relative; + left: 42%; + top: 40%; + color: #ffffff; +} #tf_name { background-color: #313131; /* blau */ border: none; @@ -347,7 +348,8 @@ h5 { font-size: 16px; font-color: white; position: relative; - left: 1.5%; + left: 42%; + top: 40%; color: #ffffff; } diff --git a/ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html b/ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html new file mode 100644 index 00000000..33d0bb9b --- /dev/null +++ b/ReallifeGamemode.Client/assets/html/Playerlist/Tabliste.html @@ -0,0 +1,30 @@ + + + + + Tabliste + + + + + + + +
+
+ + + + + + + + + +
IDSpielernameLevelFraktionPing
+
+
+ + + + \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/html/Playerlist/script.js b/ReallifeGamemode.Client/assets/html/Playerlist/script.js new file mode 100644 index 00000000..5cd805e7 --- /dev/null +++ b/ReallifeGamemode.Client/assets/html/Playerlist/script.js @@ -0,0 +1,26 @@ + + + +function ad_row(id, name, level, 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 td5 = document.createElement('td'); + var test = level; + var test2 = faction; + td1.innerHTML = ''+id; + td2.innerHTML = name.slice(1, -1); + td3.innerHTML = 'WIP'; + td4.innerHTML = 'WIP'; + td5.innerHTML = ''+ping; + tr.appendChild(td1); + tr.appendChild(td2); + tr.appendChild(td3); + tr.appendChild(td4); + tr.appendChild(td5); +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/html/Playerlist/style.css b/ReallifeGamemode.Client/assets/html/Playerlist/style.css new file mode 100644 index 00000000..bc9e1add --- /dev/null +++ b/ReallifeGamemode.Client/assets/html/Playerlist/style.css @@ -0,0 +1,64 @@ +/* style.css für Tabliste */ +.greyFont { + color: gray; + font-size: 14px; + width: 250px; +} + +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; +} + + + + diff --git a/ReallifeGamemode.Client/assets/html/inventory/index.html b/ReallifeGamemode.Client/assets/html/inventory/index.html index 2484c44d..0e89e41f 100644 --- a/ReallifeGamemode.Client/assets/html/inventory/index.html +++ b/ReallifeGamemode.Client/assets/html/inventory/index.html @@ -6,52 +6,52 @@ - -
-
-

Inventar

-

0/25 kg

-
-
-

-

- -
- - - + +
+
+

Inventar

+

0/25 kg

- - -