Live-star skybox: game activity feed + procedural star sky
Server: - GameActivityRegistry singleton tracks subscribed clients - game.subscribe_activity handler: registers client, returns active session IDs - game.unsubscribe_activity handler: deregisters client - BroadcastActivityAsync helper in GameHandlerBase (mirrors spectator push pattern) - GamePlaceArchSpiritHandler broadcasts "started" when both players have placed - FinalizeGameAsync broadcasts "ended" to all subscribers Client: - Settings.skybox_mode: "live" | "cdn" | "off" (default: "live"), persisted to cfg - Game.game_activity signal forwarded from game.activity push - game_screen.gd: live mode sets near-black procedural sky; subscribes to activity feed; each active session is an emissive sphere star (280-unit radius, blue-white) that fades in on start, twinkles via sine tween, and flash-explodes on end - CDN and Off modes preserved; hot-swap supported mid-game via Settings.settings_changed - InGameSettings: SkyboxModeOption OptionButton (Live / CDN / Off) 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:
@@ -37,6 +37,11 @@ signal inactive_warning(session_id: String)
|
||||
## Both players must wait — no concede or force-concede is allowed.
|
||||
signal both_idle_warning(session_id: String)
|
||||
|
||||
## Emitted when a game session starts or ends (from game.activity pushes).
|
||||
## Used by game_screen.gd to drive the live-star skybox.
|
||||
## event_type: "started" | "ended"
|
||||
signal game_activity(event_type: String, session_id: String)
|
||||
|
||||
# ── State ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
var session_id : String = ""
|
||||
@@ -555,3 +560,9 @@ func _on_server_push(type: String, payload: Variant) -> void:
|
||||
var sid : String = str(d.get("sessionId", ""))
|
||||
print("[Game] PUSH both_idle_warning session=", sid)
|
||||
both_idle_warning.emit(sid)
|
||||
|
||||
"game.activity":
|
||||
var d := payload as Dictionary
|
||||
var ev_type : String = str(d.get("eventType", ""))
|
||||
var ev_sid : String = str(d.get("sessionId", ""))
|
||||
game_activity.emit(ev_type, ev_sid)
|
||||
|
||||
@@ -12,6 +12,7 @@ extends Node
|
||||
const SAVE_PATH := "user://settings.cfg"
|
||||
const SECTION := "audio"
|
||||
const SECTION_GAMEPLAY := "gameplay"
|
||||
const SECTION_VISUAL := "visual"
|
||||
|
||||
## Audio bus names as configured in the Godot project.
|
||||
const BUS_MUSIC := "Music"
|
||||
@@ -54,6 +55,16 @@ var camera_follow_unit : bool = true :
|
||||
_save()
|
||||
settings_changed.emit()
|
||||
|
||||
## Skybox display mode in gameplay scenes.
|
||||
## "live" — near-black sky with emissive stars; each star = an active game session.
|
||||
## "cdn" — server-configured panoramic or animated skybox image.
|
||||
## "off" — default procedural sky (dark blue gradient).
|
||||
var skybox_mode : String = "live" :
|
||||
set(v):
|
||||
skybox_mode = v
|
||||
_save()
|
||||
settings_changed.emit()
|
||||
|
||||
# ── Lifecycle ─────────────────────────────────────────────────────────────────
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -88,6 +99,7 @@ func _load() -> void:
|
||||
sfx_volume = float(cfg.get_value(SECTION, "sfx_volume", 1.0))
|
||||
sfx_muted = bool(cfg.get_value(SECTION, "sfx_muted", false))
|
||||
camera_follow_unit = bool(cfg.get_value(SECTION_GAMEPLAY, "camera_follow_unit", true))
|
||||
skybox_mode = str(cfg.get_value(SECTION_VISUAL, "skybox_mode", "live"))
|
||||
|
||||
|
||||
func _save() -> void:
|
||||
@@ -97,4 +109,5 @@ func _save() -> void:
|
||||
cfg.set_value(SECTION, "sfx_volume", sfx_volume)
|
||||
cfg.set_value(SECTION, "sfx_muted", sfx_muted)
|
||||
cfg.set_value(SECTION_GAMEPLAY, "camera_follow_unit", camera_follow_unit)
|
||||
cfg.set_value(SECTION_VISUAL, "skybox_mode", skybox_mode)
|
||||
cfg.save(SAVE_PATH)
|
||||
|
||||
Reference in New Issue
Block a user