Clothe change, Wanted List Change

This commit is contained in:
kookroach
2021-04-04 14:48:55 +02:00
parent 64343fc640
commit 0b64eef183
3 changed files with 27 additions and 23 deletions

View File

@@ -26,25 +26,25 @@ const Color = NativeUI.Color;
export default function clotheShopList(globalData: IGlobalData) { export default function clotheShopList(globalData: IGlobalData) {
const categoryTitles = { const categoryTitles = {
clothes: { clothes: {
1: "Masks", 1: "Masken",
2: "Hair Styles", 2: "Haar Stil",
3: "Torsos", 3: "Oberkörper",
4: "Legs", 4: "Hosen",
5: "Bags and Parachutes", 5: "Taschen und Fallschirme",
6: "Shoes", 6: "Schuhe",
7: "Accessories", 7: "Accessories",
8: "Undershirts", 8: "Undershirts",
9: "Body Armors", 9: "Schutzwesten",
10: "Decals", 10: "Decals",
11: "Tops" 11: "Oberteile"
}, },
props: { props: {
0: "Hats", 0: "Kopfbedeckungen",
1: "Glasses", 1: "Brillen",
2: "Ears", 2: "Ohrringe",
6: "Watches", 6: "Uhren",
7: "Bracelets" 7: "Armbänder"
} }
}; };
@@ -158,12 +158,12 @@ export default function clotheShopList(globalData: IGlobalData) {
return; return;
} }
} }
mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? "Prop category." : "Clothing category."}`)); mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? " " : " "}`));
// Create category menu // Create category menu
categoryMenu = new UIMenu("", categoryTitles[type][key].toUpperCase(), new Point(0, 0), bannerSprite.library, bannerSprite.texture); categoryMenu = new UIMenu("", categoryTitles[type][key].toUpperCase(), new Point(0, 0), bannerSprite.library, bannerSprite.texture);
categoryMenu.Visible = false; categoryMenu.Visible = false;
} else { } else {
mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? "Prop category." : "Clothing category."}`)); mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? " " : " "}`));
// Create category menu // Create category menu
categoryMenu = new UIMenu("", categoryTitles[type][key].toUpperCase(), new Point(0, 0), bannerSprite.library, bannerSprite.texture); categoryMenu = new UIMenu("", categoryTitles[type][key].toUpperCase(), new Point(0, 0), bannerSprite.library, bannerSprite.texture);
categoryMenu.Visible = false; categoryMenu.Visible = false;
@@ -175,24 +175,28 @@ export default function clotheShopList(globalData: IGlobalData) {
for (const item of value) { for (const item of value) {
if (item.ComponentId == key) { if (item.ComponentId == key) {
var txData = getClothingName(key, item.ClotheId, gender); var txData = getClothingName(key, item.ClotheId, gender);
let clotheUpperMenu = new UIMenu(mp.game.ui.getLabelText(txData[0].data[0].GXT), " ", new Point(0, 0), bannerSprite.library, bannerSprite.texture);
clotheUpperMenu.Visible = false;
for (const x of txData) { for (const x of txData) {
var itemDescription = (key === 11 ? mp.game.ui.getLabelText(x.undershirt[1].GXT) : "Clothing item."); var itemDescription = (key === 11 ? mp.game.ui.getLabelText(x.undershirt[1].GXT) : " ");
//var itemDescription = (key === 11 ? x.undershirt[1].GXT + " - " + x.id: "Clothing item."); //var itemDescription = (key === 11 ? x.undershirt[1].GXT + " - " + x.id: "Clothing item.");
if (itemDescription == "NULL") { if (itemDescription == "NULL") {
itemDescription = "Clothing item."; itemDescription = "";
} }
const tempItem = new UIMenuItem(mp.game.ui.getLabelText(x.data[0].GXT), itemDescription); const tempItem = new UIMenuItem(mp.game.ui.getLabelText(x.data[0].GXT), itemDescription);
//const tempItem = new UIMenuItem(x.data[0].GXT + " - " + x.id , itemDescription); //const tempItem = new UIMenuItem(x.data[0].GXT + " - " + x.id , itemDescription);
tempItem.SetRightLabel(`${item.Price > 0 ? `$${item.Price}` : "FREE"}`); tempItem.SetRightLabel(`${item.Price > 0 ? `$${item.Price}` : "KOSTENLOS"}`);
categoryMenu.AddItem(tempItem); clotheUpperMenu.AddItem(tempItem);
cloth.push(item); cloth.push(item);
tx.push(x); tx.push(x);
} }
categoryMenu.AddItem(clotheUpperMenu);
} }
} }

View File

@@ -169,7 +169,6 @@ export default function (globalData: IGlobalData) {
} else if (item === payItem) { } else if (item === payItem) {
mp.gui.chat.activate(true); mp.gui.chat.activate(true);
mp.gui.cursor.show(true, true); mp.gui.cursor.show(true, true);
globalData.InMenu = true;
var input = new InputHelper("Welchem Spieler möchtest du Geld geben (Name / ID)?", globalData); var input = new InputHelper("Welchem Spieler möchtest du Geld geben (Name / ID)?", globalData);
input.show(); input.show();
input.getValue(name => { input.getValue(name => {

View File

@@ -796,14 +796,15 @@ namespace ReallifeGamemode.Server.Managers
if (!player.IsLoggedIn()) return; if (!player.IsLoggedIn()) return;
List<Player> players = NAPI.Pools.GetAllPlayers(); List<Player> players = NAPI.Pools.GetAllPlayers();
var listPlayers = players.Select(p => new var listPlayers = players.Where(p => p.GetUser().Wanteds > 0)
.Select(p => new
{ {
Id = p.Handle.Value, Id = p.Handle.Value,
p.Name, p.Name,
wanted = p.GetUser().Wanteds, wanted = p.GetUser().Wanteds,
}) ; });
if(listPlayers.Count() > 0) if (listPlayers.Count() > 0)
player.TriggerEvent("showWantedlist", JsonConvert.SerializeObject(listPlayers)); player.TriggerEvent("showWantedlist", JsonConvert.SerializeObject(listPlayers));
else else
player.SendNotification("~r~[Fehler] ~w~Es gibt derzeitig keine Verbrecher!"); player.SendNotification("~r~[Fehler] ~w~Es gibt derzeitig keine Verbrecher!");