Add skybox system: admin management + client 3D application

- SkyboxDefinition entity (catalog schema) with static/animated support
- EF migration: catalog.skybox_definitions table
- content.get_skybox_config handler returns active skybox definition
- SkyboxManagerPage.razor: full CRUD admin UI with inline editing,
  activate/deactivate, and animated frame config
- NavMenu.razor: Skyboxes link under Content section
- game_screen.gd: fetches active skybox on ready; applies as
  PanoramaSkyMaterial on WorldEnvironment; animated skyboxes cycle
  frames via Timer; procedural sky kept as fallback when none active

Also fixes inverted camera pan (delta.x / -delta.y signs corrected).

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-21 08:55:45 -04:00
co-authored by Claude Happy
parent 7c0b0f1953
commit 5b66f459c0
11 changed files with 1173 additions and 6 deletions
@@ -0,0 +1,39 @@
namespace SOR.Content.Handlers;
using Microsoft.EntityFrameworkCore;
using SOR.Database.Contexts;
using SOR.Networking.Abstractions.Messaging;
using SOR.Networking.Abstractions.Transport;
using SOR.Shared.Networking;
/// <summary>
/// content.get_skybox_config — returns the currently active skybox definition, or null if none.
/// The client applies it to the WorldEnvironment in the gameplay scene.
/// </summary>
internal sealed class ContentGetSkyboxConfigHandler : IMessageHandler
{
private readonly CatalogDbContext _catalogDb;
public ContentGetSkyboxConfigHandler(CatalogDbContext catalogDb)
{
_catalogDb = catalogDb;
}
public string MessageType => "content.get_skybox_config";
public async Task<IServerMessage?> HandleAsync(
IClientMessage message,
AuthenticatedConnection connection,
CancellationToken ct)
{
var skybox = await _catalogDb.SkyboxDefinitions
.AsNoTracking()
.Where(s => s.IsActive)
.OrderByDescending(s => s.CreatedAt)
.Select(s => new SkyboxDefinitionDto(s.Id, s.Name, s.IsAnimated, s.CdnPath, s.FrameCount, s.Fps))
.FirstOrDefaultAsync(ct);
return ServerMessage.Reply("content.get_skybox_config.ack", message.Seq,
new GetSkyboxConfigResponse(skybox));
}
}