From d6ecbe6fce69572b2a3cca3aab9168bd4c1d4324 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sat, 20 Jun 2026 06:21:41 +0900 Subject: [PATCH] Use generated textures for bamboo gutters --- README.md | 2 +- scripts/scenes/battle_scene.gd | 15 ++++++++++----- tools/smoke_visual_assets.gd | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ebe08f3..c136179 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Godot 4 tactical RPG prototype inspired by classic turn-based Romance of the Thr - Pre-battle prep commands use compact icon buttons with active selection state and Korean hover labels for chapters, shop, talks, armory, roster, formation, and save records. - Post-move tactic and item pickers use generated command/item icons, compact two-line option rows, and hover details instead of dense single-line text. - Target preview badges, minimap hover badges, and battlefield target markers include generated jade panel surfaces plus action icons for move, attack, threat, support, objective, terrain, and item outcomes. -- Story, briefing, dialogue, and result ribbon ornaments use generated seal/panel textures instead of flat color boxes. +- Story, briefing, dialogue, mission-detail, and result ribbon/bamboo ornaments use generated seal/panel textures instead of flat color boxes. - Battlefield hover info badges use generated jade panel texture plus terrain, supply, tactic, objective, and threat icons, keeping raw grid coordinates out of visible play text. - Battle, top-toolbar, and pre-battle command buttons now prefer generated high-resolution bronze/parchment icon art under `art/ui/icons` and generated lacquer/jade/cinnabar button surfaces under `art/ui/buttons`, with procedural icon drawing and flat button styles kept only as fallbacks. - Battle maps blend generated terrain texture tiles for plains, forests, hills, wasteland, roads, water, villages, and castles over the high-resolution battlefield backdrop, with generated transparent feature overlays for road connections, water, villages, castles, and wasteland accents. diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index 1ec1d81..2b8f649 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -1920,7 +1920,7 @@ func _make_edict_title_strip(labels: Array, width: float = 0.0, height: float = return row -func _make_generated_ornament_panel(node_name: String, size: Vector2, variant: String = "command_seal", expand_horizontal: bool = false) -> PanelContainer: +func _make_generated_ornament_panel(node_name: String, size: Vector2, variant: String = "command_seal", expand_horizontal: bool = false, trim_content_margins: bool = false) -> PanelContainer: var panel := PanelContainer.new() panel.name = node_name panel.custom_minimum_size = size @@ -1928,6 +1928,13 @@ func _make_generated_ornament_panel(node_name: String, size: Vector2, variant: S if expand_horizontal: panel.size_flags_horizontal = Control.SIZE_EXPAND_FILL _apply_panel_style(panel, variant) + if trim_content_margins: + var stylebox := panel.get_theme_stylebox("panel") + if stylebox != null: + stylebox.content_margin_left = 0 + stylebox.content_margin_right = 0 + stylebox.content_margin_top = 0 + stylebox.content_margin_bottom = 0 return panel @@ -2258,11 +2265,9 @@ func _make_bamboo_gutter(width: float = 18.0, height: float = 0.0) -> HBoxContai row.add_theme_constant_override("separation", 2) var strip_width := maxf(3.0, floorf((width - 4.0) / 3.0)) for index in range(3): - var strip := ColorRect.new() - strip.color = UI_BAMBOO if index == 1 else UI_BAMBOO_DARK - strip.custom_minimum_size = Vector2(strip_width, height) + var strip := _make_generated_ornament_panel("GeneratedBambooSlip%d" % (index + 1), Vector2(strip_width, height), "hud_info", false, true) strip.size_flags_vertical = Control.SIZE_EXPAND_FILL - strip.mouse_filter = Control.MOUSE_FILTER_IGNORE + strip.modulate = Color(1.0, 1.0, 1.0, 1.0) if index == 1 else Color(0.70, 0.76, 0.64, 0.92) row.add_child(strip) return row diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index f59b338..0e874c6 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -3707,6 +3707,9 @@ func _check_bamboo_gutter(failures: Array[String], node: Node, label: String) -> return if gutter.get_child_count() != 3: failures.append("%s should use three bamboo slips" % label) + return + for index in range(gutter.get_child_count()): + _check_panel_uses_generated_ornament_texture(failures, gutter.get_child(index) as PanelContainer, "%s slip %d" % [label, index]) func _check_edict_marker_stack(failures: Array[String], panel: PanelContainer, label: String) -> void: @@ -3841,6 +3844,24 @@ func _check_panel_uses_generated_texture(failures: Array[String], panel: PanelCo _check_panel_style_texture(failures, stylebox as StyleBoxTexture, label) +func _check_panel_uses_generated_ornament_texture(failures: Array[String], panel: PanelContainer, label: String) -> void: + if panel == null: + failures.append("%s missing" % label) + return + var stylebox := panel.get_theme_stylebox("panel") + if not (stylebox is StyleBoxTexture): + failures.append("%s should use a generated ornament texture" % label) + return + var style := stylebox as StyleBoxTexture + if style.texture == null: + failures.append("%s generated ornament texture is missing its texture" % label) + return + if style.texture.get_width() < 512 or style.texture.get_height() < 512: + failures.append("%s generated ornament texture should keep high-resolution source pixels: %dx%d" % [label, style.texture.get_width(), style.texture.get_height()]) + if style.texture_margin_left < 24 or style.texture_margin_top < 24: + failures.append("%s generated ornament texture should define a visible frame slice margin" % label) + + func _colors_nearly_equal(left: Color, right: Color) -> bool: return ( absf(left.r - right.r) < 0.01