Merge sbb and blueprint asset directories (#1498)

## Description

This pull request merges `sbb` and `blueprint` directory trees into
single directory tree as discussed in #1403 searched twice, once to load
blueprint files, once to load sbb zon files.

## Links

Related to: #1403
Related to: #1408
This commit is contained in:
Krzysztof Wiśniewski 2025-05-24 13:23:51 +02:00 committed by GitHub
parent bb0289c738
commit 14c7fafce9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
53 changed files with 2 additions and 3 deletions

View File

@ -86,7 +86,7 @@ pub const Assets = struct {
addon.readAllZon(allocator, "biomes", true, &self.biomes, &self.biomeMigrations);
addon.readAllZon(allocator, "recipes", false, &self.recipes, null);
addon.readAllZon(allocator, "sbb", true, &self.structureBuildingBlocks, null);
addon.readAllBlueprints(allocator, &self.blueprints);
addon.readAllBlueprints(allocator, "sbb", &self.blueprints);
addon.readAllModels(allocator, &self.models);
}
}
@ -227,8 +227,7 @@ pub const Assets = struct {
}
}
pub fn readAllBlueprints(addon: Addon, allocator: NeverFailingAllocator, output: *BytesHashMap) void {
const subPath = "blueprints";
pub fn readAllBlueprints(addon: Addon, allocator: NeverFailingAllocator, subPath: []const u8, output: *BytesHashMap) void {
var assetsDirectory = addon.dir.openDir(subPath, .{.iterate = true}) catch |err| {
if(err != error.FileNotFound) {
std.log.err("Could not open addon directory {s}: {s}", .{subPath, @errorName(err)});