Miese Corona Zeiten push für Lenhardt

This commit is contained in:
Siga
2020-05-10 19:19:53 +02:00
parent 15e4cec8ee
commit efbff34c21
159 changed files with 8042 additions and 8695 deletions

View File

@@ -10,35 +10,35 @@ using ReallifeGamemode.Server.Extensions;
namespace ReallifeGamemode.Server.Shop.Clothing
{
public class ClotheShop
{
public int category { get; set; }
public Vector3 vector { get; set; }
public List<ShopClothe> clotheList = new List<ShopClothe>();
public ClotheShop(int category, Vector3 vector)
{
this.category = category;
this.vector = vector;
LoadClothes();
}
public int category { get; set; }
public Vector3 vector { get; set; }
public List<ShopClothe> clotheList = new List<ShopClothe>();
public void LoadClothes()
{
using (var dbContext = new DatabaseContext())
{
clotheList = dbContext.ShopClothes.ToList().FindAll(c => c.Category == category);
}
}
public ClotheShop(int category, Vector3 vector)
{
this.category = category;
this.vector = vector;
LoadClothes();
}
public void LoadShopNUI(Player client)
{
bool gender = client.GetUser().GetCharacter().Gender;
List<ShopClothe> tops = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 11);
List<ShopClothe> legs = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 4);
List<ShopClothe> shoes = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 6);
List<ShopClothe> accessoires = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 7);
public void LoadClothes()
{
using (var dbContext = new DatabaseContext())
{
clotheList = dbContext.ShopClothes.ToList().FindAll(c => c.Category == category);
}
}
List<Array> clothes = new List<Array>
public void LoadShopNUI(Player client)
{
bool gender = client.GetUser().GetCharacter().Gender;
List<ShopClothe> tops = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 11);
List<ShopClothe> legs = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 4);
List<ShopClothe> shoes = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 6);
List<ShopClothe> accessoires = clotheList.ToList().FindAll(c => c.Gender == gender && c.ComponentId == 7);
List<Array> clothes = new List<Array>
{
tops.ToArray(),
legs.ToArray(),
@@ -46,7 +46,7 @@ namespace ReallifeGamemode.Server.Shop.Clothing
accessoires.ToArray()
};
client.TriggerEvent("clothesMenu:updateData", JsonConvert.SerializeObject(category), JsonConvert.SerializeObject(clothes.ToArray()), gender);
client.TriggerEvent("clothesMenu:updateData", JsonConvert.SerializeObject(category), JsonConvert.SerializeObject(clothes.ToArray()), gender);
}
}
}
}

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GTANetworkAPI;
using Newtonsoft.Json;
using ReallifeGamemode.Database.Entities;
@@ -12,33 +10,34 @@ using ReallifeGamemode.Server.Managers;
namespace ReallifeGamemode.Server.Shop.SevenEleven
{
public class ItemShop
{
public Vector3 vector3;
public int id;
public List<ShopItem> shopItems = new List<ShopItem>();
{
public Vector3 vector3;
public int id;
public List<ShopItem> shopItems = new List<ShopItem>();
public ItemShop(Vector3 vector3, int id)
{
this.vector3 = vector3;
this.id = id;
}
public ItemShop(Vector3 vector3, int id)
{
this.vector3 = vector3;
this.id = id;
}
public void LoadItems()
{
using(var dbContext = new DatabaseContext())
{
shopItems = dbContext.ShopItems.ToList().FindAll(i => i.ShopId == id);
}
public void LoadItems()
{
using (var dbContext = new DatabaseContext())
{
shopItems = dbContext.ShopItems.ToList().FindAll(i => i.ShopId == id);
}
}
public void LoadShopNUI(Player client)
{
List<ShopItem> itemList = shopItems.ToList().FindAll(s => s.Amount > 0);
List<IItem> items = new List<IItem>();
foreach (var item in itemList)
{
items.Add(InventoryManager.GetItemById(item.ItemId));
}
client.TriggerEvent("itemMenu:updateData", JsonConvert.SerializeObject(items.ToArray()));
}
}
public void LoadShopNUI(Player client)
{
List<ShopItem> itemList = shopItems.ToList().FindAll(s => s.Amount > 0);
List<IItem> items = new List<IItem>();
foreach(var item in itemList)
{
items.Add(InventoryManager.GetItemById(item.ItemId));
}
client.TriggerEvent("itemMenu:updateData", JsonConvert.SerializeObject(items.ToArray()));
}
}
}