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()
|
||||
== 7
|
||||
)
|
||||
net_page.call("_select_view", TheNetPage.View.LIFETIME)
|
||||
await process_frame
|
||||
_validate_fishnet_bounds(net_page)
|
||||
await _validate_unavailable_fishnet_layout()
|
||||
|
||||
var wallet_before: int = player.wallet.get_balance()
|
||||
|
|
@ -261,6 +264,29 @@ func _validate_unavailable_fishnet_layout() -> void:
|
|||
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:
|
||||
var fish_count: int = 0
|
||||
var insect_count: int = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue