2026-11-15 12:42:29 -06:00
|
|
|
class_name BuildModeHint
|
|
|
|
|
extends RefCounted
|
2026-11-29 14:58:56 -06:00
|
|
|
## Play mode tells new players that Build mode exists: the card palette is
|
|
|
|
|
## greyed under a notice with "Switch to Build" (CardPalette), and the ☰ menu
|
|
|
|
|
## has a greyed "New card". Clicking a greyed palette item explains, offers
|
|
|
|
|
## "Switch to Build" and makes the Build switch pulse.
|
2026-11-15 12:42:29 -06:00
|
|
|
|
|
|
|
|
const MESSAGE := "Cards are added and edited in Build mode."
|
2026-11-29 14:58:56 -06:00
|
|
|
const PALETTE_MESSAGE := "Cards are added in Build mode."
|
2026-11-15 12:42:29 -06:00
|
|
|
const TIP := "Switch to Build mode (top left) to add and edit cards"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## The ☰ menu's greyed "New card" in Play (Actions.background).
|
|
|
|
|
static func menu_item() -> Dictionary:
|
|
|
|
|
return {"text": "New card", "disabled": true, "tip": TIP}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func explain(m: Main) -> void:
|
|
|
|
|
m.top_bar.toast_action(MESSAGE, "Switch to Build", func() -> void: m.set_mode(Main.Mode.BUILD))
|
|
|
|
|
pulse(m.top_bar._build_button)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Flashes a button three times to draw the eye.
|
|
|
|
|
static func pulse(b: Control) -> void:
|
|
|
|
|
if b == null or not b.is_inside_tree():
|
|
|
|
|
return
|
|
|
|
|
var tween := b.create_tween()
|
|
|
|
|
for i in 3:
|
|
|
|
|
tween.tween_property(b, "modulate", Color(1.6, 1.4, 0.8), 0.18)
|
|
|
|
|
tween.tween_property(b, "modulate", Color.WHITE, 0.22)
|