mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 08:28:39 +00:00
Added Lucky Dip to LBP3 & changed category desc (#551)
* Added Lucky Dip to LBP3 & changed category desc * Changed "lbp2luckydip" to "luckydip" * Fixed the tab * Fixed the thing Slendy wanted me to fix lol * Removed "Most Hearted" as i havent made it yet Co-authored-by: Dagg <32235163+daggintosh@users.noreply.github.com>
This commit is contained in:
parent
b0d780b91e
commit
505b5eb03b
6 changed files with 31 additions and 5 deletions
|
@ -12,6 +12,7 @@ public static class CategoryHelper
|
|||
Categories.Add(new NewestLevelsCategory());
|
||||
Categories.Add(new QueueCategory());
|
||||
Categories.Add(new HeartedCategory());
|
||||
Categories.Add(new LuckyDipCategory());
|
||||
|
||||
using Database database = new();
|
||||
foreach (DatabaseCategory category in database.CustomCategories) Categories.Add(new CustomCategory(category));
|
||||
|
|
|
@ -12,8 +12,8 @@ namespace LBPUnion.ProjectLighthouse.Levels.Categories;
|
|||
public class HeartedCategory : CategoryWithUser
|
||||
{
|
||||
public override string Name { get; set; } = "My Hearted Levels";
|
||||
public override string Description { get; set; } = "Levels you've hearted in the past";
|
||||
public override string IconHash { get; set; } = "g820607";
|
||||
public override string Description { get; set; } = "Content you've hearted";
|
||||
public override string IconHash { get; set; } = "g820611";
|
||||
public override string Endpoint { get; set; } = "hearted";
|
||||
public override Slot? GetPreviewSlot(Database database, User user) // note: developer slots act up in LBP3 when listed here, so I omitted it
|
||||
=> database.HeartedLevels.Where(h => h.UserId == user.UserId)
|
||||
|
|
25
ProjectLighthouse/Levels/Categories/LuckyDipCategory.cs
Normal file
25
ProjectLighthouse/Levels/Categories/LuckyDipCategory.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using LBPUnion.ProjectLighthouse.Extensions;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Levels.Categories;
|
||||
|
||||
public class LuckyDipCategory : Category
|
||||
{
|
||||
public override string Name { get; set; } = "Lucky Dip";
|
||||
public override string Description { get; set; } = "Randomized uploaded content";
|
||||
public override string IconHash { get; set; } = "g820605";
|
||||
public override string Endpoint { get; set; } = "lbp2luckydip";
|
||||
public override Slot? GetPreviewSlot(Database database) => database.Slots.Where(s => s.Type == SlotType.User).OrderByDescending(_ => EF.Functions.Random()).FirstOrDefault();
|
||||
public override IEnumerable<Slot> GetSlots
|
||||
(Database database, int pageStart, int pageSize)
|
||||
=> database.Slots.ByGameVersion(GameVersion.LittleBigPlanet3, false, true)
|
||||
.OrderByDescending(_ => EF.Functions.Random())
|
||||
.Skip(Math.Max(0, pageStart - 1))
|
||||
.Take(Math.Min(pageSize, 20));
|
||||
public override int GetTotalSlots(Database database) => database.Slots.Count(s => s.Type == SlotType.User);
|
||||
}
|
|
@ -10,7 +10,7 @@ namespace LBPUnion.ProjectLighthouse.Levels.Categories;
|
|||
public class NewestLevelsCategory : Category
|
||||
{
|
||||
public override string Name { get; set; } = "Newest Levels";
|
||||
public override string Description { get; set; } = "Levels recently published";
|
||||
public override string Description { get; set; } = "The most recently published content";
|
||||
public override string IconHash { get; set; } = "g820623";
|
||||
public override string Endpoint { get; set; } = "newest";
|
||||
public override Slot? GetPreviewSlot(Database database) => database.Slots.Where(s => s.Type == SlotType.User).OrderByDescending(s => s.FirstUploaded).FirstOrDefault();
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace LBPUnion.ProjectLighthouse.Levels.Categories;
|
|||
public class QueueCategory : CategoryWithUser
|
||||
{
|
||||
public override string Name { get; set; } = "My Queue";
|
||||
public override string Description { get; set; } = "Your queued levels";
|
||||
public override string Description { get; set; } = "Your queued content";
|
||||
public override string IconHash { get; set; } = "g820614";
|
||||
public override string Endpoint { get; set; } = "queue";
|
||||
public override Slot? GetPreviewSlot(Database database, User user)
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace LBPUnion.ProjectLighthouse.Levels.Categories;
|
|||
public class TeamPicksCategory : Category
|
||||
{
|
||||
public override string Name { get; set; } = "Team Picks";
|
||||
public override string Description { get; set; } = "Levels given awards by your instance admin";
|
||||
public override string Description { get; set; } = "Community Team Picks";
|
||||
public override string IconHash { get; set; } = "g820626";
|
||||
public override string Endpoint { get; set; } = "team_picks";
|
||||
public override Slot? GetPreviewSlot(Database database) => database.Slots.OrderByDescending(s => s.FirstUploaded).FirstOrDefault(s => s.TeamPick);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue