fix(home): fit layout without scrollbar and give Crumb a cutout
Removes the Home scroll container and tightens spacing so all controls fit at 360x640, including 1.3x text size. Creates a transparent Crumb card cutout for the guest-of-day mascot.
This commit is contained in:
1 parent
3cdc3567f3
commit
a7a238e418
3 files changed
+33
-38
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 275 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 79 KiB |
+33
-38
@@ -43,21 +43,17 @@ func _ready() -> void:
|
|||||||
margin.add_theme_constant_override("margin_bottom", UI.safe_bottom())
|
margin.add_theme_constant_override("margin_bottom", UI.safe_bottom())
|
||||||
add_child(margin)
|
add_child(margin)
|
||||||
|
|
||||||
var scroll := ScrollContainer.new()
|
|
||||||
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
|
||||||
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
|
||||||
margin.add_child(scroll)
|
|
||||||
var column := VBoxContainer.new()
|
var column := VBoxContainer.new()
|
||||||
column.add_theme_constant_override("separation", 6)
|
column.add_theme_constant_override("separation", 4)
|
||||||
column.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
column.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
scroll.add_child(column)
|
margin.add_child(column)
|
||||||
|
|
||||||
var hub := HBoxContainer.new()
|
var hub := HBoxContainer.new()
|
||||||
hub.add_theme_constant_override("separation", 0)
|
hub.add_theme_constant_override("separation", 0)
|
||||||
column.add_child(hub)
|
column.add_child(hub)
|
||||||
|
|
||||||
var left := CenterContainer.new()
|
var left := CenterContainer.new()
|
||||||
left.custom_minimum_size = Vector2(56, 56)
|
left.custom_minimum_size = Vector2(48, 48)
|
||||||
avatar_holder = left
|
avatar_holder = left
|
||||||
hub.add_child(left)
|
hub.add_child(left)
|
||||||
_build_avatar()
|
_build_avatar()
|
||||||
@@ -66,53 +62,53 @@ func _ready() -> void:
|
|||||||
center.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
center.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
hub.add_child(center)
|
hub.add_child(center)
|
||||||
|
|
||||||
progress_pill = UI.button("5 / 25 guests", false, 38)
|
progress_pill = UI.button("5 / 25 guests", false, 34)
|
||||||
progress_pill.custom_minimum_size = Vector2(130, 38)
|
progress_pill.custom_minimum_size = Vector2(130, 34)
|
||||||
UI.set_font_size(progress_pill, 13)
|
UI.set_font_size(progress_pill, 13)
|
||||||
progress_pill.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
progress_pill.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||||
progress_pill.pressed.connect(func() -> void: guest_book_pressed.emit())
|
progress_pill.pressed.connect(func() -> void: guest_book_pressed.emit())
|
||||||
center.add_child(progress_pill)
|
center.add_child(progress_pill)
|
||||||
|
|
||||||
var settings := UI.round_button("res://assets/icons/settings.svg", 48)
|
var settings := UI.round_button("res://assets/icons/settings.svg", 44)
|
||||||
settings.tooltip_text = "Settings"
|
settings.tooltip_text = "Settings"
|
||||||
settings.pressed.connect(func() -> void: settings_pressed.emit())
|
settings.pressed.connect(func() -> void: settings_pressed.emit())
|
||||||
var right := CenterContainer.new()
|
var right := CenterContainer.new()
|
||||||
right.custom_minimum_size = Vector2(52, 52)
|
right.custom_minimum_size = Vector2(48, 48)
|
||||||
right.add_child(settings)
|
right.add_child(settings)
|
||||||
hub.add_child(right)
|
hub.add_child(right)
|
||||||
|
|
||||||
column.add_child(UI.spacer(4))
|
column.add_child(UI.spacer(2))
|
||||||
column.add_child(UI.heading("Ratdoku", 46))
|
column.add_child(UI.heading("Ratdoku", 38))
|
||||||
column.add_child(UI.label("A cozy rat hotel puzzle", 15, Palette.MUTED))
|
column.add_child(UI.label("A cozy rat hotel puzzle", 13, Palette.MUTED))
|
||||||
|
|
||||||
event_button = UI.button("Hotel event", false, 34)
|
event_button = UI.button("Hotel event", false, 30)
|
||||||
event_button.custom_minimum_size = Vector2(0, 34)
|
event_button.custom_minimum_size = Vector2(0, 30)
|
||||||
UI.set_font_size(event_button, 12)
|
UI.set_font_size(event_button, 12)
|
||||||
event_button.clip_text = true
|
event_button.clip_text = true
|
||||||
event_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
event_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
event_button.pressed.connect(_open_event)
|
event_button.pressed.connect(_open_event)
|
||||||
column.add_child(event_button)
|
column.add_child(event_button)
|
||||||
|
|
||||||
daily_button = UI.button("Daily room", false, 40)
|
daily_button = UI.button("Daily room", false, 36)
|
||||||
daily_button.custom_minimum_size = Vector2(0, 40)
|
daily_button.custom_minimum_size = Vector2(0, 36)
|
||||||
daily_button.clip_text = true
|
daily_button.clip_text = true
|
||||||
daily_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
daily_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
UI.set_font_size(daily_button, 11)
|
UI.set_font_size(daily_button, 11)
|
||||||
daily_button.pressed.connect(func() -> void: daily_pressed.emit())
|
daily_button.pressed.connect(func() -> void: daily_pressed.emit())
|
||||||
freeplay_button = UI.button("Free play", false, 40)
|
freeplay_button = UI.button("Free play", false, 36)
|
||||||
freeplay_button.custom_minimum_size = Vector2(0, 40)
|
freeplay_button.custom_minimum_size = Vector2(0, 36)
|
||||||
freeplay_button.clip_text = true
|
freeplay_button.clip_text = true
|
||||||
freeplay_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
freeplay_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
UI.set_font_size(freeplay_button, 11)
|
UI.set_font_size(freeplay_button, 11)
|
||||||
freeplay_button.pressed.connect(func() -> void: freeplay_pressed.emit())
|
freeplay_button.pressed.connect(func() -> void: freeplay_pressed.emit())
|
||||||
streak_button = UI.button("Streak ›", false, 40)
|
streak_button = UI.button("Streak ›", false, 36)
|
||||||
streak_button.custom_minimum_size = Vector2(0, 40)
|
streak_button.custom_minimum_size = Vector2(0, 36)
|
||||||
streak_button.clip_text = true
|
streak_button.clip_text = true
|
||||||
streak_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
streak_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
UI.set_font_size(streak_button, 11)
|
UI.set_font_size(streak_button, 11)
|
||||||
streak_button.pressed.connect(func() -> void: streak_pressed.emit())
|
streak_button.pressed.connect(func() -> void: streak_pressed.emit())
|
||||||
var daily_row := HBoxContainer.new()
|
var daily_row := HBoxContainer.new()
|
||||||
daily_row.add_theme_constant_override("separation", 6)
|
daily_row.add_theme_constant_override("separation", 4)
|
||||||
daily_row.add_child(daily_button)
|
daily_row.add_child(daily_button)
|
||||||
daily_row.add_child(freeplay_button)
|
daily_row.add_child(freeplay_button)
|
||||||
daily_row.add_child(streak_button)
|
daily_row.add_child(streak_button)
|
||||||
@@ -139,11 +135,11 @@ func _ready() -> void:
|
|||||||
column.add_child(card)
|
column.add_child(card)
|
||||||
_apply_mascot_scale()
|
_apply_mascot_scale()
|
||||||
|
|
||||||
mascot_caption = UI.label("Crumb, innkeeper", 12, Palette.MUTED)
|
mascot_caption = UI.label("Crumb, innkeeper", 11, Palette.MUTED)
|
||||||
column.add_child(mascot_caption)
|
column.add_child(mascot_caption)
|
||||||
mascot_note = UI.label("Guest of the day · tap to cycle", 10, Palette.MUTED)
|
mascot_note = UI.label("Guest of the day · tap to cycle", 9, Palette.MUTED)
|
||||||
column.add_child(mascot_note)
|
column.add_child(mascot_note)
|
||||||
hint_label = UI.label(UI.place_hint(), 11, Palette.MUTED)
|
hint_label = UI.label(UI.place_hint(), 10, Palette.MUTED)
|
||||||
column.add_child(hint_label)
|
column.add_child(hint_label)
|
||||||
|
|
||||||
var bottom_space := Control.new()
|
var bottom_space := Control.new()
|
||||||
@@ -151,8 +147,8 @@ func _ready() -> void:
|
|||||||
bottom_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
bottom_space.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
column.add_child(bottom_space)
|
column.add_child(bottom_space)
|
||||||
|
|
||||||
primary = UI.button("Check in", true, 54)
|
primary = UI.button("Check in", true, 48)
|
||||||
primary.custom_minimum_size = Vector2(300, 54)
|
primary.custom_minimum_size = Vector2(300, 48)
|
||||||
primary.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
primary.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||||
primary.pressed.connect(func() -> void: play_pressed.emit())
|
primary.pressed.connect(func() -> void: play_pressed.emit())
|
||||||
column.add_child(primary)
|
column.add_child(primary)
|
||||||
@@ -162,22 +158,21 @@ func _ready() -> void:
|
|||||||
secondary.add_theme_constant_override("separation", 8)
|
secondary.add_theme_constant_override("separation", 8)
|
||||||
column.add_child(secondary)
|
column.add_child(secondary)
|
||||||
|
|
||||||
var book := UI.button("Guest Book", false, 46)
|
var book := UI.button("Guest Book", false, 40)
|
||||||
book.custom_minimum_size = Vector2(146, 46)
|
book.custom_minimum_size = Vector2(146, 40)
|
||||||
UI.set_font_size(book, 15)
|
UI.set_font_size(book, 15)
|
||||||
book.pressed.connect(func() -> void: guest_book_pressed.emit())
|
book.pressed.connect(func() -> void: guest_book_pressed.emit())
|
||||||
secondary.add_child(book)
|
secondary.add_child(book)
|
||||||
|
|
||||||
var rules := UI.button("House Rules", false, 46)
|
var rules := UI.button("House Rules", false, 40)
|
||||||
rules.custom_minimum_size = Vector2(146, 46)
|
rules.custom_minimum_size = Vector2(146, 40)
|
||||||
UI.set_font_size(rules, 15)
|
UI.set_font_size(rules, 15)
|
||||||
rules.pressed.connect(func() -> void: rules_pressed.emit())
|
rules.pressed.connect(func() -> void: rules_pressed.emit())
|
||||||
secondary.add_child(rules)
|
secondary.add_child(rules)
|
||||||
|
|
||||||
column.add_child(UI.label("No ads. No lives. Just rats.", 10, Palette.MUTED))
|
column.add_child(UI.label("No ads. No lives. Just rats.", 9, Palette.MUTED))
|
||||||
column.add_child(UI.label(Version.BUILD_LABEL, 9, Palette.MUTED))
|
column.add_child(UI.label(Version.BUILD_LABEL, 8, Palette.MUTED))
|
||||||
|
|
||||||
UI.pass_scroll_input(column)
|
|
||||||
_build_event_layer()
|
_build_event_layer()
|
||||||
SaveGame.progress_changed.connect(refresh)
|
SaveGame.progress_changed.connect(refresh)
|
||||||
SaveGame.settings_changed.connect(refresh)
|
SaveGame.settings_changed.connect(refresh)
|
||||||
@@ -188,8 +183,8 @@ func _apply_mascot_scale() -> void:
|
|||||||
if mascot_card == null or mascot_art == null:
|
if mascot_card == null or mascot_art == null:
|
||||||
return
|
return
|
||||||
var scale := UI.ui_scale()
|
var scale := UI.ui_scale()
|
||||||
var card_base := 140 if mascot_cycling else 160
|
var card_base := 104 if mascot_cycling else 120
|
||||||
var art_base := 120 if mascot_cycling else 138
|
var art_base := 90 if mascot_cycling else 104
|
||||||
var card_size := int(card_base / scale)
|
var card_size := int(card_base / scale)
|
||||||
var art_size := int(art_base / scale)
|
var art_size := int(art_base / scale)
|
||||||
mascot_card.custom_minimum_size = Vector2(card_size, card_size)
|
mascot_card.custom_minimum_size = Vector2(card_size, card_size)
|
||||||
@@ -328,7 +323,7 @@ func _refresh_avatar() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _make_mascot(id: String) -> Control:
|
func _make_mascot(id: String) -> Control:
|
||||||
var path := "res://art/crumb.png" if id == "crumb" else Guests.portrait(id, "cards")
|
var path := "res://art/guests/cards/crumb.png" if id == "crumb" else Guests.portrait(id, "cards")
|
||||||
if ResourceLoader.exists(path):
|
if ResourceLoader.exists(path):
|
||||||
var texture_rect := TextureRect.new()
|
var texture_rect := TextureRect.new()
|
||||||
texture_rect.texture = load(path)
|
texture_rect.texture = load(path)
|
||||||
|
|||||||
Reference in new issue
Block a user