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

- - -