forked from woofmeow/straywild
test: align validation with current systems
This commit is contained in:
parent
95c6b8b053
commit
7f184db0dc
4 changed files with 23 additions and 12 deletions
|
|
@ -225,14 +225,13 @@ func _run() -> void:
|
||||||
chat_ui.refocus_gameplay()
|
chat_ui.refocus_gameplay()
|
||||||
chat_ui.open_chat()
|
chat_ui.open_chat()
|
||||||
assert(chat_ui.is_open())
|
assert(chat_ui.is_open())
|
||||||
typed_chat_entry.text = "/not-a-real-command"
|
typed_chat_entry.text = "validation message"
|
||||||
chat_ui.call("_send")
|
chat_ui.call("_send")
|
||||||
assert(not chat_ui.is_open())
|
assert(not chat_ui.is_open())
|
||||||
assert(not typed_chat_entry.has_focus())
|
assert(not typed_chat_entry.has_focus())
|
||||||
assert(not bool(chat_ui.get("_input_lock_applied")))
|
assert(not bool(chat_ui.get("_input_lock_applied")))
|
||||||
assert(chat_status.visible)
|
assert(not chat_status.visible)
|
||||||
assert(chat_status.text == "Unknown command: /not-a-real-command")
|
assert(chat_status.text.is_empty())
|
||||||
chat_ui.call("_set_status", "")
|
|
||||||
var quick_menu := game_ui.get_node(
|
var quick_menu := game_ui.get_node(
|
||||||
"%QuickRadialMenu"
|
"%QuickRadialMenu"
|
||||||
) as QuickRadialMenu
|
) as QuickRadialMenu
|
||||||
|
|
|
||||||
|
|
@ -161,13 +161,19 @@ func _run_multiplayer_client() -> void:
|
||||||
var shop_service := main.get_node("%NetworkShopService") as NetworkShopService
|
var shop_service := main.get_node("%NetworkShopService") as NetworkShopService
|
||||||
sale_service.local_sale_finished.connect(_on_sale_finished)
|
sale_service.local_sale_finished.connect(_on_sale_finished)
|
||||||
shop_service.local_purchase_finished.connect(_on_shop_finished)
|
shop_service.local_purchase_finished.connect(_on_shop_finished)
|
||||||
|
assert(player.inventory_layout.restore_backpack_level(
|
||||||
|
PlayerInventoryLayout.MAX_BACKPACK_LEVEL
|
||||||
|
))
|
||||||
|
assert(player.cooler_capacity.restore_level(PlayerCoolerCapacity.MAX_LEVEL))
|
||||||
|
player.inventory.set_inventory_layout(null)
|
||||||
var catch_ids: Array[StringName] = []
|
var catch_ids: Array[StringName] = []
|
||||||
for fish: FishData in catalog.candidates:
|
for fish: FishData in catalog.candidates:
|
||||||
if not fish.active:
|
if not fish.active:
|
||||||
continue
|
continue
|
||||||
var fish_catch := _make_catch(fish)
|
var fish_catch := _make_catch(fish)
|
||||||
player.inventory.add_catch(fish_catch)
|
assert(player.inventory.add_catch(fish_catch))
|
||||||
catch_ids.append(fish_catch.catch_id)
|
catch_ids.append(fish_catch.catch_id)
|
||||||
|
player.inventory.set_inventory_layout(player.inventory_layout)
|
||||||
await create_timer(1.0).timeout
|
await create_timer(1.0).timeout
|
||||||
_sale_result.clear()
|
_sale_result.clear()
|
||||||
assert(not sale_service.request_local_sale(catch_ids).is_empty())
|
assert(not sale_service.request_local_sale(catch_ids).is_empty())
|
||||||
|
|
@ -181,6 +187,8 @@ func _run_multiplayer_client() -> void:
|
||||||
for catch_id: StringName in catch_ids:
|
for catch_id: StringName in catch_ids:
|
||||||
assert(not player.inventory.contains_catch_id(catch_id))
|
assert(not player.inventory.contains_catch_id(catch_id))
|
||||||
assert(not sale_service.is_local_sale_pending())
|
assert(not sale_service.is_local_sale_pending())
|
||||||
|
assert(player.inventory_layout.restore_backpack_level(0))
|
||||||
|
assert(player.cooler_capacity.restore_level(0))
|
||||||
|
|
||||||
var interaction := main.get("_shop_interaction") as FishingShopInteraction
|
var interaction := main.get("_shop_interaction") as FishingShopInteraction
|
||||||
player.global_position = interaction.global_position
|
player.global_position = interaction.global_position
|
||||||
|
|
|
||||||
|
|
@ -89,10 +89,12 @@ func _run() -> void:
|
||||||
assert(not service.is_local_showcase_visible())
|
assert(not service.is_local_showcase_visible())
|
||||||
await _wait_for_held_fish_visibility(player, false)
|
await _wait_for_held_fish_visibility(player, false)
|
||||||
var saved_weather: WorldWeatherService.Weather = (
|
var saved_weather: WorldWeatherService.Weather = (
|
||||||
world_weather.get_weather()
|
world_weather.get_persistent_weather()
|
||||||
)
|
)
|
||||||
var saved_weather_seconds: float = world_weather.get_seconds_remaining()
|
var saved_weather_seconds: float = (
|
||||||
var saved_time_hours: float = world_time.get_time_hours()
|
world_weather.get_persistent_seconds_remaining()
|
||||||
|
)
|
||||||
|
var saved_time_hours: float = world_time.get_persistent_time_hours()
|
||||||
|
|
||||||
assert(save_manager.save_now())
|
assert(save_manager.save_now())
|
||||||
var save_path: String = str(save_manager.get("_save_path"))
|
var save_path: String = str(save_manager.get("_save_path"))
|
||||||
|
|
@ -143,10 +145,12 @@ func _run() -> void:
|
||||||
)
|
)
|
||||||
assert(save_manager.load_player_data())
|
assert(save_manager.load_player_data())
|
||||||
assert(player.experience.get_total_experience() == 125)
|
assert(player.experience.get_total_experience() == 125)
|
||||||
assert(absf(world_time.get_time_hours() - saved_time_hours) < 0.01)
|
# Loading a save must not replace the active RTC-authoritative clock.
|
||||||
assert(world_weather.get_weather() == saved_weather)
|
assert(absf(world_time.get_time_hours() - 8.0) < 0.01)
|
||||||
|
assert(world_weather.get_persistent_weather() == saved_weather)
|
||||||
assert(absf(
|
assert(absf(
|
||||||
world_weather.get_seconds_remaining() - saved_weather_seconds
|
world_weather.get_persistent_seconds_remaining()
|
||||||
|
- saved_weather_seconds
|
||||||
) < 2.0)
|
) < 2.0)
|
||||||
assert(player.experience.get_level() == 2)
|
assert(player.experience.get_level() == 2)
|
||||||
assert(player.hotbar.get_fish_catch_id(1) == fish_catch.catch_id)
|
assert(player.hotbar.get_fish_catch_id(1) == fish_catch.catch_id)
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ func _run_host() -> void:
|
||||||
# Authentication completes before the client has necessarily created and
|
# Authentication completes before the client has necessarily created and
|
||||||
# begun observing the host avatar. Give its gameplay scene a bounded moment
|
# begun observing the host avatar. Give its gameplay scene a bounded moment
|
||||||
# to settle before emitting the one-shot locomotion/action sequence.
|
# to settle before emitting the one-shot locomotion/action sequence.
|
||||||
await create_timer(1.0).timeout
|
await create_timer(3.0).timeout
|
||||||
var player := main.get("_player") as Player
|
var player := main.get("_player") as Player
|
||||||
player.configure_network_remote(true)
|
player.configure_network_remote(true)
|
||||||
player.apply_authoritative_network_input(_movement_input(1, true))
|
player.apply_authoritative_network_input(_movement_input(1, true))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue