Keep Fishnet lifetime jobs within the laptop layout
This commit is contained in:
parent
e4ddf4e5a6
commit
779e3d983e
2 changed files with 34 additions and 1 deletions
|
|
@ -86,6 +86,9 @@ func _run() -> void:
|
||||||
(player_menu.get_node("%NavigationCluster") as Control).get_child_count()
|
(player_menu.get_node("%NavigationCluster") as Control).get_child_count()
|
||||||
== 7
|
== 7
|
||||||
)
|
)
|
||||||
|
net_page.call("_select_view", TheNetPage.View.LIFETIME)
|
||||||
|
await process_frame
|
||||||
|
_validate_fishnet_bounds(net_page)
|
||||||
await _validate_unavailable_fishnet_layout()
|
await _validate_unavailable_fishnet_layout()
|
||||||
|
|
||||||
var wallet_before: int = player.wallet.get_balance()
|
var wallet_before: int = player.wallet.get_balance()
|
||||||
|
|
@ -261,6 +264,29 @@ func _validate_unavailable_fishnet_layout() -> void:
|
||||||
await process_frame
|
await process_frame
|
||||||
|
|
||||||
|
|
||||||
|
func _validate_fishnet_bounds(page: TheNetPage) -> void:
|
||||||
|
var laptop := page.get_node("UtilityMainBox") as PanelContainer
|
||||||
|
var forecast_column := page.find_child(
|
||||||
|
"ForecastColumn", true, false
|
||||||
|
) as VBoxContainer
|
||||||
|
var refresh_label := page.find_child(
|
||||||
|
"DailyRefreshLabel", true, false
|
||||||
|
) as Label
|
||||||
|
var jobs_scroll := page.find_child("JobsScroll", true, false) as ScrollContainer
|
||||||
|
assert(laptop != null)
|
||||||
|
assert(forecast_column != null and refresh_label != null)
|
||||||
|
assert(jobs_scroll != null)
|
||||||
|
var laptop_rect: Rect2 = laptop.get_global_rect()
|
||||||
|
assert(forecast_column.get_global_rect().end.x <= laptop_rect.end.x)
|
||||||
|
assert(refresh_label.get_global_rect().end.x <= laptop_rect.end.x)
|
||||||
|
assert(refresh_label.get_global_rect().end.y <= laptop_rect.end.y)
|
||||||
|
assert(jobs_scroll.horizontal_scroll_mode == ScrollContainer.SCROLL_MODE_DISABLED)
|
||||||
|
var list := page.get("_list") as VBoxContainer
|
||||||
|
assert(list != null)
|
||||||
|
for row: Control in list.get_children():
|
||||||
|
assert(row.size.x <= jobs_scroll.size.x + 0.5)
|
||||||
|
|
||||||
|
|
||||||
func _validate_creature_jobs(jobs: PlayerJobService) -> void:
|
func _validate_creature_jobs(jobs: PlayerJobService) -> void:
|
||||||
var fish_count: int = 0
|
var fish_count: int = 0
|
||||||
var insect_count: int = 0
|
var insect_count: int = 0
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ func _build_laptop() -> void:
|
||||||
margin.add_child(layout)
|
margin.add_child(layout)
|
||||||
|
|
||||||
var title_row := HBoxContainer.new()
|
var title_row := HBoxContainer.new()
|
||||||
|
title_row.name = "FishnetTitleRow"
|
||||||
title_row.add_theme_constant_override("separation", 16)
|
title_row.add_theme_constant_override("separation", 16)
|
||||||
layout.add_child(title_row)
|
layout.add_child(title_row)
|
||||||
var header_left := VBoxContainer.new()
|
var header_left := VBoxContainer.new()
|
||||||
|
|
@ -197,13 +198,14 @@ func _build_laptop() -> void:
|
||||||
tab.text = ["daily jobs", "lifetime jobs", "payments"][view_index]
|
tab.text = ["daily jobs", "lifetime jobs", "payments"][view_index]
|
||||||
tab.toggle_mode = true
|
tab.toggle_mode = true
|
||||||
tab.pressed.connect(_select_view.bind(view_index as View))
|
tab.pressed.connect(_select_view.bind(view_index as View))
|
||||||
UtilityPageStyle.apply_ocean_button(tab)
|
UtilityPageStyle.apply_compact_ocean_button(tab)
|
||||||
_tabs.add_child(tab)
|
_tabs.add_child(tab)
|
||||||
var refresh_alignment_spacer := Control.new()
|
var refresh_alignment_spacer := Control.new()
|
||||||
refresh_alignment_spacer.custom_minimum_size.y = 20.0
|
refresh_alignment_spacer.custom_minimum_size.y = 20.0
|
||||||
refresh_alignment_spacer.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
refresh_alignment_spacer.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
header_left.add_child(refresh_alignment_spacer)
|
header_left.add_child(refresh_alignment_spacer)
|
||||||
var forecast_column := VBoxContainer.new()
|
var forecast_column := VBoxContainer.new()
|
||||||
|
forecast_column.name = "ForecastColumn"
|
||||||
forecast_column.custom_minimum_size.x = 292.0
|
forecast_column.custom_minimum_size.x = 292.0
|
||||||
forecast_column.size_flags_horizontal = Control.SIZE_SHRINK_END
|
forecast_column.size_flags_horizontal = Control.SIZE_SHRINK_END
|
||||||
forecast_column.add_theme_constant_override("separation", 3)
|
forecast_column.add_theme_constant_override("separation", 3)
|
||||||
|
|
@ -237,6 +239,7 @@ func _build_laptop() -> void:
|
||||||
_forecast_list.add_theme_constant_override("separation", 6)
|
_forecast_list.add_theme_constant_override("separation", 6)
|
||||||
forecast_stack.add_child(_forecast_list)
|
forecast_stack.add_child(_forecast_list)
|
||||||
_refresh_label = Label.new()
|
_refresh_label = Label.new()
|
||||||
|
_refresh_label.name = "DailyRefreshLabel"
|
||||||
_refresh_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
_refresh_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||||
_refresh_label.add_theme_font_size_override("font_size", 14)
|
_refresh_label.add_theme_font_size_override("font_size", 14)
|
||||||
_refresh_label.add_theme_color_override(
|
_refresh_label.add_theme_color_override(
|
||||||
|
|
@ -251,6 +254,7 @@ func _build_laptop() -> void:
|
||||||
layout.add_child(jobs_column)
|
layout.add_child(jobs_column)
|
||||||
|
|
||||||
_jobs_scroll = ScrollContainer.new()
|
_jobs_scroll = ScrollContainer.new()
|
||||||
|
_jobs_scroll.name = "JobsScroll"
|
||||||
_jobs_scroll.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
_jobs_scroll.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
_jobs_scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
_jobs_scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||||
_jobs_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
_jobs_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||||
|
|
@ -320,6 +324,8 @@ func _build_job_rows(jobs: Array[Dictionary], empty_text: String) -> void:
|
||||||
content.add_child(text_column)
|
content.add_child(text_column)
|
||||||
var title := Label.new()
|
var title := Label.new()
|
||||||
title.text = str(job.get("title", "job"))
|
title.text = str(job.get("title", "job"))
|
||||||
|
title.clip_text = true
|
||||||
|
title.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
||||||
title.add_theme_font_size_override("font_size", 20)
|
title.add_theme_font_size_override("font_size", 20)
|
||||||
title.add_theme_color_override(
|
title.add_theme_color_override(
|
||||||
"font_color", UtilityPageStyle.OCEAN_TEXT_PRIMARY
|
"font_color", UtilityPageStyle.OCEAN_TEXT_PRIMARY
|
||||||
|
|
@ -327,6 +333,7 @@ func _build_job_rows(jobs: Array[Dictionary], empty_text: String) -> void:
|
||||||
text_column.add_child(title)
|
text_column.add_child(title)
|
||||||
var description := Label.new()
|
var description := Label.new()
|
||||||
description.text = str(job.get("description", ""))
|
description.text = str(job.get("description", ""))
|
||||||
|
description.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||||
description.add_theme_font_size_override("font_size", 16)
|
description.add_theme_font_size_override("font_size", 16)
|
||||||
description.add_theme_color_override(
|
description.add_theme_color_override(
|
||||||
"font_color", UtilityPageStyle.OCEAN_TEXT_SECONDARY
|
"font_color", UtilityPageStyle.OCEAN_TEXT_SECONDARY
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue