WIP: 360dp lobby redesign
Port the project to a 360x640 canvas with the redesigned lobby, settings sheet, and refreshed UI.
This commit is contained in:
1 parent
f6fd807e9a
commit
46b5764144
34 files changed
+1299
-261
No files matched your search
+90
-44
@@ -5,79 +5,125 @@ signal guest_book_pressed
|
||||
signal settings_pressed
|
||||
signal rules_pressed
|
||||
|
||||
var progress_pill: Button
|
||||
var primary: Button
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var margin := MarginContainer.new()
|
||||
margin.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
margin.add_theme_constant_override("margin_left", 28)
|
||||
margin.add_theme_constant_override("margin_right", 28)
|
||||
margin.add_theme_constant_override("margin_top", 28)
|
||||
margin.add_theme_constant_override("margin_bottom", 28)
|
||||
margin.add_theme_constant_override("margin_left", UI.MARGIN)
|
||||
margin.add_theme_constant_override("margin_right", UI.MARGIN)
|
||||
margin.add_theme_constant_override("margin_top", 12)
|
||||
margin.add_theme_constant_override("margin_bottom", 14)
|
||||
add_child(margin)
|
||||
|
||||
var column := VBoxContainer.new()
|
||||
column.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
column.add_theme_constant_override("separation", 10)
|
||||
column.add_theme_constant_override("separation", 6)
|
||||
margin.add_child(column)
|
||||
|
||||
column.add_child(UI.label("Ratdoku", 68))
|
||||
column.add_child(UI.label("A cozy rat hotel puzzle", 24, Palette.MUTED))
|
||||
var hub := HBoxContainer.new()
|
||||
hub.add_theme_constant_override("separation", 8)
|
||||
column.add_child(hub)
|
||||
|
||||
var gap := Control.new()
|
||||
gap.custom_minimum_size = Vector2(0, 14)
|
||||
column.add_child(gap)
|
||||
var avatar := Button.new()
|
||||
avatar.custom_minimum_size = Vector2(52, 52)
|
||||
avatar.flat = true
|
||||
avatar.icon = load("res://art/crumb_head.png")
|
||||
avatar.expand_icon = true
|
||||
avatar.tooltip_text = "Guest Book"
|
||||
avatar.pressed.connect(func() -> void: guest_book_pressed.emit())
|
||||
hub.add_child(avatar)
|
||||
|
||||
var portrait_center := CenterContainer.new()
|
||||
column.add_child(portrait_center)
|
||||
var card := UI.panel(Palette.CREAM, 40, 18)
|
||||
card.custom_minimum_size = Vector2(340, 340)
|
||||
portrait_center.add_child(card)
|
||||
var left_space := Control.new()
|
||||
left_space.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
left_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
hub.add_child(left_space)
|
||||
|
||||
progress_pill = UI.button("5 / 25 guests", false, 38)
|
||||
progress_pill.custom_minimum_size = Vector2(130, 38)
|
||||
progress_pill.add_theme_font_size_override("font_size", 13)
|
||||
progress_pill.pressed.connect(func() -> void: guest_book_pressed.emit())
|
||||
hub.add_child(progress_pill)
|
||||
|
||||
var right_space := Control.new()
|
||||
right_space.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
right_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
hub.add_child(right_space)
|
||||
|
||||
var settings := UI.round_button("res://assets/icons/settings.svg", 48)
|
||||
settings.tooltip_text = "Settings"
|
||||
settings.pressed.connect(func() -> void: settings_pressed.emit())
|
||||
hub.add_child(settings)
|
||||
|
||||
column.add_child(UI.spacer(4))
|
||||
column.add_child(UI.heading("Ratdoku", 46))
|
||||
column.add_child(UI.label("A cozy rat hotel puzzle", 15, Palette.MUTED))
|
||||
|
||||
var top_space := Control.new()
|
||||
top_space.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
top_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
column.add_child(top_space)
|
||||
|
||||
var card := UI.panel(Palette.CREAM, 26, 12)
|
||||
card.custom_minimum_size = Vector2(224, 224)
|
||||
card.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||
var mascot := _make_mascot()
|
||||
mascot.custom_minimum_size = Vector2(300, 300)
|
||||
mascot.custom_minimum_size = Vector2(200, 200)
|
||||
card.add_child(mascot)
|
||||
column.add_child(card)
|
||||
|
||||
column.add_child(UI.label("Crumb, innkeeper", 16, Palette.MUTED))
|
||||
column.add_child(UI.label("Every guest gets a room of their own.", 20))
|
||||
column.add_child(UI.label("Tap = X · Hold or right-click = check in", 16, Palette.MUTED))
|
||||
column.add_child(UI.label("Crumb, innkeeper", 12, Palette.MUTED))
|
||||
column.add_child(UI.label("Every guest gets a room of their own.", 15))
|
||||
column.add_child(UI.label("Tap = X · Hold or right-click = check in", 11, Palette.MUTED))
|
||||
|
||||
var gap2 := Control.new()
|
||||
gap2.custom_minimum_size = Vector2(0, 10)
|
||||
column.add_child(gap2)
|
||||
var bottom_space := Control.new()
|
||||
bottom_space.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
bottom_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
column.add_child(bottom_space)
|
||||
|
||||
var play := UI.button("Check in", true, 64)
|
||||
play.custom_minimum_size = Vector2(280, 64)
|
||||
var play_center := CenterContainer.new()
|
||||
play_center.add_child(play)
|
||||
column.add_child(play_center)
|
||||
play.pressed.connect(func() -> void: play_pressed.emit())
|
||||
primary = UI.button("Check in", true, 54)
|
||||
primary.custom_minimum_size = Vector2(300, 54)
|
||||
primary.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||
primary.pressed.connect(func() -> void: play_pressed.emit())
|
||||
column.add_child(primary)
|
||||
|
||||
var secondary := HBoxContainer.new()
|
||||
secondary.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
secondary.add_theme_constant_override("separation", 10)
|
||||
secondary.add_theme_constant_override("separation", 8)
|
||||
column.add_child(secondary)
|
||||
|
||||
var book := UI.button("Guest Book", false, 52)
|
||||
book.custom_minimum_size = Vector2(150, 52)
|
||||
var book := UI.button("Guest Book", false, 46)
|
||||
book.custom_minimum_size = Vector2(146, 46)
|
||||
book.add_theme_font_size_override("font_size", 15)
|
||||
book.pressed.connect(func() -> void: guest_book_pressed.emit())
|
||||
secondary.add_child(book)
|
||||
|
||||
var rules := UI.button("House Rules", false, 52)
|
||||
rules.custom_minimum_size = Vector2(160, 52)
|
||||
var rules := UI.button("House Rules", false, 46)
|
||||
rules.custom_minimum_size = Vector2(146, 46)
|
||||
rules.add_theme_font_size_override("font_size", 15)
|
||||
rules.pressed.connect(func() -> void: rules_pressed.emit())
|
||||
secondary.add_child(rules)
|
||||
|
||||
column.add_child(UI.label("No ads. No lives. Just rats.", 16, Palette.MUTED))
|
||||
column.add_child(UI.label("No ads. No lives. Just rats.", 10, Palette.MUTED))
|
||||
column.add_child(UI.label(Version.BUILD_LABEL, 9, Palette.MUTED))
|
||||
|
||||
var settings := UI.button("Settings", false, 40)
|
||||
settings.add_theme_font_size_override("font_size", 16)
|
||||
settings.set_anchors_preset(Control.PRESET_TOP_RIGHT)
|
||||
settings.offset_left = -150
|
||||
settings.offset_top = 24
|
||||
settings.offset_right = -24
|
||||
settings.offset_bottom = 64
|
||||
settings.pressed.connect(func() -> void: settings_pressed.emit())
|
||||
add_child(settings)
|
||||
SaveGame.progress_changed.connect(refresh)
|
||||
refresh()
|
||||
|
||||
|
||||
func refresh() -> void:
|
||||
var guests := Guests.all()
|
||||
var unlocked := SaveGame.unlocked_count(guests)
|
||||
progress_pill.text = "%d / %d guests" % [unlocked, guests.size()]
|
||||
|
||||
var last := int(SaveGame.data.get("last_room", 0))
|
||||
if last <= 0:
|
||||
primary.text = "Check in"
|
||||
elif last >= 30:
|
||||
primary.text = "Replay Room 30"
|
||||
else:
|
||||
primary.text = "Continue Room %d" % (last + 1)
|
||||
|
||||
|
||||
func _make_mascot() -> Control:
|
||||
|
||||
Reference in new issue
Block a user