Normalize logbook creature portraits
This commit is contained in:
parent
7f5a522ae5
commit
8b13ba1d7d
3 changed files with 90 additions and 4 deletions
|
|
@ -162,6 +162,8 @@ func _validate_page() -> void:
|
|||
|
||||
var shared_material: Material
|
||||
var silhouette_count: int = 0
|
||||
var smallest_silhouette_area: float = INF
|
||||
var largest_silhouette_area: float = 0.0
|
||||
for category: LogbookCatalog.Category in [
|
||||
LogbookCatalog.Category.FRESH_WATER,
|
||||
LogbookCatalog.Category.SALT_WATER,
|
||||
|
|
@ -192,8 +194,15 @@ func _validate_page() -> void:
|
|||
assert(portrait != null)
|
||||
assert(portrait.source_texture == fish.display_texture)
|
||||
assert(
|
||||
portrait.custom_minimum_size
|
||||
== LogbookPage.CATALOG_PORTRAIT_SIZE
|
||||
portrait.custom_minimum_size.x
|
||||
<= LogbookPage.CATALOG_PORTRAIT_SIZE.x
|
||||
and portrait.custom_minimum_size.y
|
||||
<= LogbookPage.CATALOG_PORTRAIT_SIZE.y
|
||||
)
|
||||
assert(portrait.get_parent() is CenterContainer)
|
||||
assert(
|
||||
(portrait.get_parent() as CenterContainer).custom_minimum_size
|
||||
== LogbookPage.CATALOG_PORTRAIT_SIZE
|
||||
)
|
||||
assert(
|
||||
portrait.expand_mode
|
||||
|
|
@ -209,6 +218,19 @@ func _validate_page() -> void:
|
|||
else:
|
||||
assert(portrait.material == shared_material)
|
||||
assert(_texture_has_transparency(portrait.texture))
|
||||
var silhouette_area: float = (
|
||||
portrait.custom_minimum_size.x
|
||||
* portrait.custom_minimum_size.y
|
||||
)
|
||||
assert(silhouette_area > 0.0)
|
||||
smallest_silhouette_area = minf(
|
||||
smallest_silhouette_area,
|
||||
silhouette_area,
|
||||
)
|
||||
largest_silhouette_area = maxf(
|
||||
largest_silhouette_area,
|
||||
silhouette_area,
|
||||
)
|
||||
silhouette_count += 1
|
||||
for candidate: FishDataType in CatalogResource.candidates:
|
||||
assert(not entry.text.contains(candidate.display_name))
|
||||
|
|
@ -223,6 +245,9 @@ func _validate_page() -> void:
|
|||
)
|
||||
)
|
||||
assert(silhouette_count == 310)
|
||||
assert(
|
||||
largest_silhouette_area / smallest_silhouette_area <= 1.12
|
||||
)
|
||||
|
||||
page.call("_select_category", LogbookCatalog.Category.SHELLFISH)
|
||||
await create_timer(0.25).timeout
|
||||
|
|
@ -269,6 +294,11 @@ func _validate_page() -> void:
|
|||
assert(known_portrait != null)
|
||||
assert(known_portrait.source_texture == bluegill.display_texture)
|
||||
assert(known_portrait.material == null)
|
||||
assert(known_portrait.get_parent() is CenterContainer)
|
||||
assert(
|
||||
(known_portrait.get_parent() as CenterContainer).custom_minimum_size
|
||||
== LogbookPage.CATALOG_PORTRAIT_SIZE
|
||||
)
|
||||
assert(known.button_pressed)
|
||||
_validate_handwritten_logbook_font(page)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue