From c170d98f3c0cb34016cb55dbb7aa9946ca179a46 Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 19 Mar 2026 23:12:02 +0100 Subject: [PATCH] Skill-Eintraege im Skillbuch mit halbtransparentem Hintergrund Co-Authored-By: Claude Sonnet 4.6 --- skill_panel.gd | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/skill_panel.gd b/skill_panel.gd index 6d84618..ae1fc66 100644 --- a/skill_panel.gd +++ b/skill_panel.gd @@ -33,21 +33,32 @@ func _refresh_skills(): child.queue_free() for skill in player.available_skills: + # Hintergrund-Panel für Lesbarkeit + var panel = PanelContainer.new() + var style = StyleBoxFlat.new() + style.bg_color = Color(0.9, 0.85, 0.75, 0.18) + style.set_corner_radius_all(4) + panel.add_theme_stylebox_override("panel", style) + panel.mouse_filter = Control.MOUSE_FILTER_STOP + var hbox = HBoxContainer.new() hbox.add_theme_constant_override("separation", 8) + hbox.mouse_filter = Control.MOUSE_FILTER_IGNORE + panel.add_child(hbox) # Icon var icon_rect = TextureRect.new() var tex = load(skill["icon"]) if tex: icon_rect.texture = tex - icon_rect.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL + icon_rect.expand_mode = TextureRect.EXPAND_IGNORE_SIZE icon_rect.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED icon_rect.custom_minimum_size = Vector2(36, 36) + icon_rect.size = Vector2(36, 36) icon_rect.mouse_filter = Control.MOUSE_FILTER_IGNORE hbox.add_child(icon_rect) - # Name + Beschreibung + # Name var label = Label.new() label.text = skill["name"] label.add_theme_font_size_override("font_size", 14) @@ -57,16 +68,14 @@ func _refresh_skills(): hbox.add_child(label) # Tooltip - hbox.tooltip_text = skill["name"] + "\n" + skill["description"] - hbox.custom_minimum_size = Vector2(0, 40) - hbox.mouse_filter = Control.MOUSE_FILTER_STOP + panel.tooltip_text = skill["name"] + "\n" + skill["description"] # Drag starten bei Linksklick var skill_id = skill["id"] var skill_icon_path = skill["icon"] - hbox.gui_input.connect(_on_skill_input.bind(skill_id, skill_icon_path)) + panel.gui_input.connect(_on_skill_input.bind(skill_id, skill_icon_path)) - skill_list.add_child(hbox) + skill_list.add_child(panel) func _on_skill_input(event: InputEvent, skill_id: String, icon_path: String): if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed: