bissl formattiert
This commit is contained in:
@@ -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)
|
||||
{
|
||||
public int category { get; set; }
|
||||
public Vector3 vector { get; set; }
|
||||
public List<ShopClothe> clotheList = new List<ShopClothe>();
|
||||
this.category = category;
|
||||
this.vector = vector;
|
||||
LoadClothes();
|
||||
}
|
||||
|
||||
public ClotheShop(int category, Vector3 vector)
|
||||
{
|
||||
this.category = category;
|
||||
this.vector = vector;
|
||||
LoadClothes();
|
||||
}
|
||||
public void LoadClothes()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
clotheList = dbContext.ShopClothes.ToList().FindAll(c => c.Category == category);
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadClothes()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
clotheList = dbContext.ShopClothes.ToList().FindAll(c => c.Category == category);
|
||||
}
|
||||
}
|
||||
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 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>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,34 +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 ItemShop(Vector3 vector3, int id)
|
||||
{
|
||||
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 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()));
|
||||
}
|
||||
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 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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user