aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2025-10-14 01:00:19 +0200
committernokoe <nokoe@mailbox.org>2025-10-14 01:00:45 +0200
commit3d0fc1e366cd60c5f4fb14c7c169dae240a2bb6b (patch)
tree283d192e30ec7a833e0a367bd384e0bda47d8abe
parentb4ffc1983f40764635d41b3ea7cb15e638ec0ebb (diff)
downloadhurrycurry-3d0fc1e366cd60c5f4fb14c7c169dae240a2bb6b.tar
hurrycurry-3d0fc1e366cd60c5f4fb14c7c169dae240a2bb6b.tar.bz2
hurrycurry-3d0fc1e366cd60c5f4fb14c7c169dae240a2bb6b.tar.zst
flip book for rtl
-rw-r--r--client/gui/menus/book/book.gd4
-rw-r--r--client/gui/menus/book/diagram.gd7
2 files changed, 6 insertions, 5 deletions
diff --git a/client/gui/menus/book/book.gd b/client/gui/menus/book/book.gd
index b9479bdd..f6d95c8a 100644
--- a/client/gui/menus/book/book.gd
+++ b/client/gui/menus/book/book.gd
@@ -39,6 +39,9 @@ func _ready():
super()
book_data = data
pages = book_data.data["pages"]
+ # Flip book for rtl languages
+ $Margin/HBoxContainer/Previous.flip_h = not is_layout_rtl()
+ $Margin/HBoxContainer/Next.flip_h = is_layout_rtl()
build_page()
func build_page() -> void:
@@ -83,6 +86,7 @@ func build_paragraph(m: String) -> Label:
label.add_theme_font_override("font", preload("res://gui/resources/fonts/font-josefin-sans.woff2"))
label.add_theme_font_size_override("font_size", 32)
label.add_theme_color_override("font_color", Color.BLACK)
+ label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
label.text = m
return label
diff --git a/client/gui/menus/book/diagram.gd b/client/gui/menus/book/diagram.gd
index 09dd03d1..65209c64 100644
--- a/client/gui/menus/book/diagram.gd
+++ b/client/gui/menus/book/diagram.gd
@@ -54,7 +54,8 @@ func _init(raw_: Dictionary, game: Game) -> void:
func _ready() -> void:
redraw_images()
item_rect_changed.connect(func():
- scale(Rect2(Vector2(HSIZE, HSIZE), Vector2(size.x - SIZE, size.y - SIZE)))
+ if size != Vector2(64, 64):
+ scale(Rect2(Vector2(HSIZE, HSIZE), Vector2(size.x - SIZE, size.y - SIZE)))
)
func redraw_images() -> void:
@@ -73,8 +74,6 @@ func redraw_images() -> void:
renderers.push_back(r)
func scale(bounds: Rect2) -> void:
- if bounds.abs() != bounds:
- return
var current := Rect2(Vector2(INF, INF), Vector2(-INF, -INF))
for n: DiagramNode in draw_nodes:
if n.position.x < current.position.x:
@@ -85,8 +84,6 @@ func scale(bounds: Rect2) -> void:
current.end.x = n.position.x
if n.position.y > current.end.y:
current.end.y = n.position.y
- if bounds.encloses(current):
- return
var s := bounds.size / current.size
for n: DiagramNode in nodes:
var p := n.position