foitin/engine/scenes/title.gd
m3ultra 4e2004e740 Settings page, pause menu, menu navigation; fix packed-app portraits
- select screen portraits load via pck-safe loader (the blank-cards bug
  in the shipped build)
- Settings (title menu + persisted user://settings.json): fullscreen,
  hitbox viewer default, master volume
- Esc: pause menu in fights (resume/rematch/select/menu), back-to-title
  from select/editor/settings
- FOITIN_SHOT env hook smoke-tests exported builds end-to-end

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 21:31:16 +10:00

52 lines
1.7 KiB
GDScript

extends Node2D
## Title screen: PLAY -> character select, EDITOR -> content editor.
func _ready() -> void:
# export smoke-test hook: FOITIN_SHOT=1 boots straight into a demo fight
# that saves user://shot.png and quits (match_engine reads the env too)
if OS.get_environment("FOITIN_SHOT") != "":
GameState.p1_pick = "kachujin"
GameState.p2_pick = "decks"
get_tree().change_scene_to_file.call_deferred("res://engine/scenes/Fight.tscn")
return
var bg := ColorRect.new()
bg.color = Color("#101218")
bg.size = Vector2(1280, 720)
add_child(bg)
var title := Label.new()
title.text = "F O I T I N"
title.add_theme_font_size_override("font_size", 110)
title.position = Vector2(400, 170)
add_child(title)
var sub := Label.new()
sub.text = "digitized fighting"
sub.modulate = Color(1, 1, 1, 0.45)
sub.add_theme_font_size_override("font_size", 26)
sub.position = Vector2(540, 300)
add_child(sub)
Settings.load_and_apply()
_button("PLAY", Vector2(540, 400), func():
get_tree().change_scene_to_file("res://engine/scenes/Select.tscn"))
_button("EDITOR", Vector2(540, 470), func():
get_tree().change_scene_to_file("res://engine/scenes/Editor.tscn"))
_button("SETTINGS", Vector2(540, 540), func():
get_tree().change_scene_to_file("res://engine/scenes/Settings.tscn"))
var hint := Label.new()
hint.text = "P1: WASD + J/K P2: arrows + O/P"
hint.modulate = Color(1, 1, 1, 0.35)
hint.position = Vector2(470, 660)
add_child(hint)
func _button(text: String, pos: Vector2, cb: Callable) -> void:
var b := Button.new()
b.text = text
b.position = pos
b.size = Vector2(200, 56)
b.add_theme_font_size_override("font_size", 28)
b.pressed.connect(cb)
add_child(b)