A UI pass: prompts that tell the truth, and a HUD that does not collide
ci / verify (push) Successful in 53s
ci / verify (push) Successful in 53s
Prompts named the default keys whatever was bound. Every action is rebindable, but the HUD said "WASD move", "LMB fire", "hold F" and "1-4 use", the quartermaster said "E talk" and the upgrade screen "Close (E)". All of them now go through Settings.short_label(), and a test rebinds fire, escape, interact and a slot key and checks each prompt follows. The HUD's top-left was a developer's status line -- name, instance id, health as text, frame rate -- with the boss bar drawn over its right end and the level-up notice sharing a row with the escape bar. It is now name and level, where you are, health with its numbers, experience, escape and level-ups, stacked by a running cursor so nothing has a fixed row to collide on. Instance and fps moved behind F1, which is who they were for. Arrival protection is a centred banner rather than a note beside the health bar, because it is the one moment the rules change. A hit used to tint the whole screen red, which in a bullet hell dims the bullets at exactly the moment you are among them. It is an edge now, and the same edge pulses below a third of your health. New: a message feed above the inventory for what the server just confirmed -- items taken, used and dropped, levels gained -- and party health top-right in a dungeon, where the hub shows who is online. The pickup prompt now also names the dungeon under your feet when you stand on its ring, in the same order the server resolves that key: loot first, then the entrance. The boss bar used to announce the boss to anyone within the actor interest radius -- which passes through walls -- so a player in the entrance room was told the Warden was near. It waits until the fog has actually lit the boss once, then stays for the fight. Permadeath was announced only by the roster screen appearing. The client records its own death from the server's event and the roster says who fell, at what level, and where. The connect screen lost a name field that did nothing for a person -- it only named the characters bots create -- gained a proper panel, remembers the last server, and shows the protocol number a mismatch refusal will quote. And screenshot.tscn ran as the player's real account against their real character store, walking their character into dungeons for pictures -- with health now carried between runs, a stray hit would have stuck. It has its own store and account now, like every diagnostic, and a seeded character. The real store was checked: nothing it carries changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
069abdb3fa
commit
19d2295bec
14 files changed
+903
-229
No files matched your search
@@ -45,6 +45,11 @@ const SFX_BUS := "SFX"
|
||||
|
||||
static var master_volume: float = 0.8
|
||||
static var sfx_volume: float = 0.8
|
||||
## The server last joined, so the connect screen does not ask for the same
|
||||
## address every launch. Empty until the first join. Client-local like
|
||||
## everything else here -- it is where you play, not who you are.
|
||||
static var last_address: String = ""
|
||||
static var last_port: int = 0
|
||||
## action -> a serialisable description of its event. See _describe().
|
||||
static var bindings: Dictionary[String, Dictionary] = {}
|
||||
|
||||
@@ -64,6 +69,8 @@ static func load_and_apply() -> void:
|
||||
if cfg.load(path) == OK:
|
||||
master_volume = clampf(float(cfg.get_value("audio", "master", master_volume)), 0.0, 1.0)
|
||||
sfx_volume = clampf(float(cfg.get_value("audio", "sfx", sfx_volume)), 0.0, 1.0)
|
||||
last_address = String(cfg.get_value("connection", "address", ""))
|
||||
last_port = clampi(int(cfg.get_value("connection", "port", 0)), 0, 65535)
|
||||
bindings.clear()
|
||||
for action in REBINDABLE:
|
||||
var key := String(action[0])
|
||||
@@ -86,6 +93,9 @@ static func save() -> void:
|
||||
var cfg := ConfigFile.new()
|
||||
cfg.set_value("audio", "master", master_volume)
|
||||
cfg.set_value("audio", "sfx", sfx_volume)
|
||||
if not last_address.is_empty():
|
||||
cfg.set_value("connection", "address", last_address)
|
||||
cfg.set_value("connection", "port", last_port)
|
||||
for action in bindings:
|
||||
cfg.set_value("input", action, bindings[action])
|
||||
var err := cfg.save(path)
|
||||
@@ -93,6 +103,16 @@ static func save() -> void:
|
||||
GameLog.warn("settings", "could not write %s (error %d)" % [path, err])
|
||||
|
||||
|
||||
## Remember where the player just tried to connect.
|
||||
static func remember_server(address: String, port: int) -> void:
|
||||
var clean := address.strip_edges()
|
||||
if clean.is_empty() or port <= 0 or port > 65535:
|
||||
return
|
||||
last_address = clean
|
||||
last_port = port
|
||||
save()
|
||||
|
||||
|
||||
# --- Audio -------------------------------------------------------------------
|
||||
|
||||
## Ensure the SFX bus exists and push both volumes onto the mixer.
|
||||
@@ -191,6 +211,20 @@ static func binding_label(action: String) -> String:
|
||||
return describe_label(current_binding(action))
|
||||
|
||||
|
||||
## The binding as short as it can be said, for prompts on screen: "LMB" rather
|
||||
## than "Mouse Left", "Esc" rather than "Escape". Every key the game names to the
|
||||
## player goes through this, because every one of them is rebindable and a
|
||||
## prompt that names the default is wrong for anyone who changed it.
|
||||
static func short_label(action: String) -> String:
|
||||
var label := binding_label(action)
|
||||
match label:
|
||||
"Mouse Left": return "LMB"
|
||||
"Mouse Right": return "RMB"
|
||||
"Mouse Middle": return "MMB"
|
||||
"Escape": return "Esc"
|
||||
return label
|
||||
|
||||
|
||||
static func describe_label(described: Dictionary) -> String:
|
||||
match String(described.get("type", "")):
|
||||
"key":
|
||||
|
||||
Reference in new issue
Block a user