2023-04-19 09:58:07 +00:00
|
|
|
|
using GameBuilder.Pops;
|
|
|
|
|
using GameBuilder.Psp;
|
2023-04-21 06:21:21 +00:00
|
|
|
|
using LibChovy.Art;
|
2023-04-19 09:58:07 +00:00
|
|
|
|
using System;
|
2023-04-18 03:10:03 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2023-04-19 09:58:07 +00:00
|
|
|
|
using Vita.ContentManager;
|
2023-04-18 03:10:03 +00:00
|
|
|
|
|
|
|
|
|
namespace LibChovy
|
|
|
|
|
{
|
|
|
|
|
public class PopsParameters : ChovySignParameters
|
|
|
|
|
{
|
2023-04-19 09:58:07 +00:00
|
|
|
|
public PopsParameters(NpDrmInfo drmInfo, NpDrmRif rif) : base(drmInfo, rif)
|
|
|
|
|
{
|
|
|
|
|
Type = ChovyTypes.POPS;
|
2023-05-01 11:51:00 +00:00
|
|
|
|
discList = new List<PSInfo>();
|
2023-04-19 09:58:07 +00:00
|
|
|
|
}
|
|
|
|
|
private string? nameOverride;
|
2023-05-01 11:51:00 +00:00
|
|
|
|
private List<PSInfo> discList;
|
2023-04-19 09:58:07 +00:00
|
|
|
|
|
|
|
|
|
private byte[]? pic0;
|
|
|
|
|
private byte[]? pic1;
|
|
|
|
|
private byte[]? icon0;
|
|
|
|
|
|
2023-05-01 11:51:00 +00:00
|
|
|
|
public PSInfo FirstDisc
|
2023-04-19 09:58:07 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Discs.First();
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-18 03:10:03 +00:00
|
|
|
|
|
2023-04-19 09:58:07 +00:00
|
|
|
|
protected override string outputFolder
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (outputFolderOverride is null) return Path.Combine(SettingsReader.Ps1Folder, Account.AccountIdStr);
|
|
|
|
|
return outputFolderOverride;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
outputFolderOverride = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-18 03:10:03 +00:00
|
|
|
|
|
2023-04-19 09:58:07 +00:00
|
|
|
|
public override string OutputFolder
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Path.Combine(outputFolder, FirstDisc.DiscId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public byte[] Pic0
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (pic0 is null) return Resources.PIC0;
|
|
|
|
|
else return pic0;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
pic0 = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public byte[] Icon0
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (icon0 is null)
|
|
|
|
|
{
|
2023-04-21 06:21:21 +00:00
|
|
|
|
byte[] coverImg = Downloader.DownloadCover(FirstDisc).Result;
|
2023-04-19 09:58:07 +00:00
|
|
|
|
icon0 = coverImg;
|
|
|
|
|
return coverImg;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return icon0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
icon0 = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public byte[] Pic1
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (pic1 is null) return Resources.PIC1;
|
|
|
|
|
else return pic1;
|
|
|
|
|
}
|
2023-04-23 08:15:11 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
pic1 = value;
|
|
|
|
|
}
|
2023-04-19 09:58:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddCd(string cd)
|
|
|
|
|
{
|
2023-05-01 11:51:00 +00:00
|
|
|
|
PSInfo disc = new PSInfo(cd);
|
2023-04-19 09:58:07 +00:00
|
|
|
|
if (nameOverride is not null) disc.DiscName = nameOverride;
|
|
|
|
|
else discList.Add(disc);
|
|
|
|
|
}
|
|
|
|
|
public void RemoveCd(string cd)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < discList.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (discList[i].CueFile == cd)
|
|
|
|
|
{
|
|
|
|
|
discList.RemoveAt(i);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-01 11:51:00 +00:00
|
|
|
|
public PSInfo[] Discs
|
2023-04-19 09:58:07 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return discList.ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (nameOverride is null)
|
|
|
|
|
{
|
|
|
|
|
if (FirstDisc.DiscName == "") return FirstDisc.DiscId;
|
|
|
|
|
else return FirstDisc.DiscName;
|
|
|
|
|
}
|
|
|
|
|
else return nameOverride;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < discList.Count; i++)
|
|
|
|
|
discList[i].DiscName = value;
|
|
|
|
|
|
|
|
|
|
nameOverride = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-18 03:10:03 +00:00
|
|
|
|
public bool MultiDisc
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-04-19 09:58:07 +00:00
|
|
|
|
return Discs.Length > 1;
|
2023-04-18 03:10:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|