Compare commits

...

2 Commits

Author SHA1 Message Date
Kei-Luna
7507d10072 Updater fixes due to changes in resource folders 2026-05-09 17:39:17 +09:00
Kei-Luna
8a7a919d04 Changed the Resources folder structure to match the official one. 2026-05-09 17:30:25 +09:00
28 changed files with 49 additions and 59 deletions

View File

@@ -1,6 +1,6 @@
namespace MikuSB.Data.Excel;
namespace MikuSB.Data.Excel;
[ResourceEntity("ar_item.json")]
[ResourceEntity("item/templates/ar_item.json")]
public class ArItemExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("break.json")]
[ResourceEntity("item/break.json")]
public class BreakExcel : ExcelResource
{
[JsonProperty("ID")] public int Id { get; set; }

View File

@@ -1,6 +1,6 @@
namespace MikuSB.Data.Excel;
namespace MikuSB.Data.Excel;
[ResourceEntity("break_level_limit.json")]
[ResourceEntity("item/break_level_limit.json")]
public class BreakLevelLimitExcel : ExcelResource
{
public int ID { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("call_item.json")]
[ResourceEntity("item/templates/call_item.json")]
public class CallItemExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -2,7 +2,7 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("card.json")]
[ResourceEntity("item/templates/card.json")]
public class CardExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -2,7 +2,7 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("card_skin.json")]
[ResourceEntity("item/templates/card_skin.json")]
public class CardSkinExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -2,7 +2,7 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("card_skin_parts.json")]
[ResourceEntity("item/templates/card_skin_parts.json")]
public class CardSkinPartsExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -1,6 +1,6 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("level.json")]
[ResourceEntity("chapter/level.json")]
public class ChapterLevelExcel : ExcelResource
{
public uint ID { get; set; }

View File

@@ -1,6 +1,6 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("daily_level.json")]
[ResourceEntity("daily/level.json")]
public class DailyLevelExcel : ExcelResource
{
public uint ID { get; set; }

View File

@@ -2,7 +2,7 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("manifestation.json")]
[ResourceEntity("item/templates/manifestation.json")]
public class ManifestationExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -1,9 +1,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
// nodecondition.json: NodeConditionId → NodeXCost per sub-node (1-9)
[ResourceEntity("nodecondition.json")]
[ResourceEntity("item/skill/nodecondition.json")]
public class NodeConditionExcel : ExcelResource
{
[JsonProperty("ID")] public uint Id { get; set; }

View File

@@ -1,6 +1,6 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("profile.json")]
[ResourceEntity("item/templates/profile.json")]
public class ProfileExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("recycle.json")]
[ResourceEntity("item/recycle.json")]
public class RecycleExcel : ExcelResource
{
public int ID { get; set; }

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("dailybuff.json")]
[ResourceEntity("dlc/rogue3d/dailybuff.json")]
public class Rogue3DDailyBuffExcel : ExcelResource
{
[JsonProperty("ID")] public uint Id { get; set; }

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("server_01_difficult.json")]
[ResourceEntity("dlc/rogue3d/server_01_difficult.json")]
public class Rogue3DDifficultExcel : ExcelResource
{
[JsonProperty("DifficultID")] public uint DifficultId { get; set; }

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("server_10_season.json")]
[ResourceEntity("dlc/rogue3d/server_10_season.json")]
public class Rogue3DSeasonExcel : ExcelResource
{
[JsonProperty("SeasonID")] public uint SeasonId { get; set; }

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("server_03_talent.json")]
[ResourceEntity("dlc/rogue3d/server_03_talent.json")]
public class Rogue3DTalentExcel : ExcelResource
{
[JsonProperty("TalentID")] public uint TalentId { get; set; }

View File

@@ -1,9 +1,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
// spine.json: SpineId → Node{i}Req (nodecondition ID per master node index)
[ResourceEntity("spine.json")]
[ResourceEntity("item/skill/spine.json")]
public class SpineExcel : ExcelResource
{
[JsonProperty("ID")] public uint Id { get; set; }

View File

@@ -1,9 +1,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("suplies.json")]
[ResourceEntity("item/templates/suplies.json")]
public class SuppliesExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("support_card.json")]
[ResourceEntity("item/templates/support_card.json")]
public class SupportCardExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -1,9 +1,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("upgrade_exp.json")]
[ResourceEntity("item/upgrade_exp.json")]
public class UpgradeExpExcel : ExcelResource
{
public int Lv { get; set; }

View File

@@ -1,9 +1,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("weapon.json")]
[ResourceEntity("item/templates/weapon.json")]
public class WeaponExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -2,7 +2,7 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("weapon_parts.json")]
[ResourceEntity("item/templates/weapon_parts.json")]
public class WeaponPartsExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("weapon_skin.json")]
[ResourceEntity("item/templates/weapon_skin.json")]
public class WeaponSkinExcel : ExcelResource
{
public uint Genre { get; set; }

View File

@@ -46,7 +46,7 @@ public class ResourceManager
foreach (var fileName in attribute.FileName)
try
{
var path = ConfigManager.Config.Path.ResourcePath + "/ExcelOutput/" + fileName;
var path = ConfigManager.Config.Path.ResourcePath + "/" + fileName;
var file = new FileInfo(path);
if (!file.Exists)
{

View File

@@ -102,11 +102,6 @@ static void UpdateResources(string resourcePackagePath, string resourceTargetDir
ZipFile.ExtractToDirectory(resourcePackagePath, resourceStagingDirectory, overwriteFiles: true);
var extractedRoot = Directory.GetDirectories(resourceStagingDirectory).FirstOrDefault() ?? resourceStagingDirectory;
var excelOutputSource = Path.Combine(extractedRoot, "ExcelOutput");
if (!Directory.Exists(excelOutputSource))
throw new DirectoryNotFoundException($"ExcelOutput directory was not found in resource package: {excelOutputSource}");
var excelOutputTarget = Path.Combine(resourceTargetDirectory, "ExcelOutput");
Directory.CreateDirectory(excelOutputTarget);
CopyDirectory(excelOutputSource, excelOutputTarget);
Directory.CreateDirectory(resourceTargetDirectory);
CopyDirectory(extractedRoot, resourceTargetDirectory);
}

View File

@@ -24,8 +24,8 @@ public static class UpdateService
"https://github.com/Kei-Luna/MikuSB-Resource/archive/refs/heads/main.zip";
private static readonly string[] RequiredResourceFiles =
[
"card.json",
"weapon.json"
"item/templates/card.json",
"item/templates/weapon.json"
];
public static async Task<bool> TryStartSelfUpdateAsync()
@@ -160,11 +160,11 @@ public static class UpdateService
private static bool AreRequiredResourcesPresent()
{
var excelOutputPath = Path.Combine(AppContext.BaseDirectory, ConfigManager.Config.Path.ResourcePath, "ExcelOutput");
if (!Directory.Exists(excelOutputPath))
var resourcePath = Path.Combine(AppContext.BaseDirectory, ConfigManager.Config.Path.ResourcePath);
if (!Directory.Exists(resourcePath))
return false;
return RequiredResourceFiles.All(fileName => File.Exists(Path.Combine(excelOutputPath, fileName)));
return RequiredResourceFiles.All(fileName => File.Exists(Path.Combine(resourcePath, fileName)));
}
private static async Task DownloadAndInstallResourcesAsync()
@@ -187,13 +187,8 @@ public static class UpdateService
ZipFile.ExtractToDirectory(resourcePackagePath, resourceStagingDirectory, overwriteFiles: true);
var extractedRoot = Directory.GetDirectories(resourceStagingDirectory).FirstOrDefault() ?? resourceStagingDirectory;
var excelOutputSource = Path.Combine(extractedRoot, "ExcelOutput");
if (!Directory.Exists(excelOutputSource))
throw new DirectoryNotFoundException($"ExcelOutput directory was not found in resource package: {excelOutputSource}");
var excelOutputTarget = Path.Combine(resourceTargetDirectory, "ExcelOutput");
Directory.CreateDirectory(excelOutputTarget);
CopyDirectory(excelOutputSource, excelOutputTarget);
Directory.CreateDirectory(resourceTargetDirectory);
CopyDirectory(extractedRoot, resourceTargetDirectory);
}
private static bool ConfirmUpdate(string latestVersion)

View File

@@ -1 +1 @@
v=1.9
v=2.0