change hover color, small fixes

This commit is contained in:
Nordup 2024-11-24 15:41:25 +04:00
parent ddae024043
commit 7ef4642582
9 changed files with 40 additions and 114 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,26 +1,19 @@
[gd_scene load_steps=7 format=3 uid="uid://82ca8so31njy"]
[gd_scene load_steps=8 format=3 uid="uid://82ca8so31njy"]
[ext_resource type="Script" path="res://scripts/ui/menu/bookmark_ui.gd" id="1_bpkqj"]
[ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_7i5yr"]
[ext_resource type="Texture2D" uid="uid://cykx425p6ylwr" path="res://assets/textures/background.png" id="3_kgutt"]
[ext_resource type="StyleBox" uid="uid://bllkg32sc4iam" path="res://assets/styles/bookmark.stylebox" id="3_tb1mf"]
[ext_resource type="StyleBox" uid="uid://bmxiecm3vkddl" path="res://assets/styles/bookmark_hover.stylebox" id="4_figib"]
[ext_resource type="LabelSettings" uid="uid://85ms8ndcmbn0" path="res://assets/styles/text_small.tres" id="4_xqjm8"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_40hft"]
bg_color = Color(0.113725, 0.117647, 0.14902, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.0862745, 0.0901961, 0.117647, 0.784314)
shadow_size = 4
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_od0ga"]
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[node name="Bookmark" type="Control" node_paths=PackedStringArray("image", "title")]
[node name="Bookmark" type="Control" node_paths=PackedStringArray("image", "title", "button")]
clip_children = 1
custom_minimum_size = Vector2(180, 100)
layout_mode = 3
@ -31,15 +24,22 @@ script = ExtResource("1_bpkqj")
gate_events = ExtResource("2_7i5yr")
image = NodePath("Mask/Image")
title = NodePath("Title")
button = NodePath("Button")
[node name="Panel" type="Panel" parent="."]
[node name="Button" type="Button" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_40hft")
focus_mode = 0
mouse_default_cursor_shape = 2
theme_override_styles/focus = ExtResource("3_tb1mf")
theme_override_styles/disabled = ExtResource("3_tb1mf")
theme_override_styles/hover = ExtResource("4_figib")
theme_override_styles/pressed = ExtResource("4_figib")
theme_override_styles/normal = ExtResource("3_tb1mf")
[node name="Mask" type="Panel" parent="."]
clip_children = 1
@ -52,7 +52,7 @@ offset_top = 15.0
offset_right = 20.0
offset_bottom = 55.0
grow_horizontal = 2
mouse_filter = 1
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_od0ga")
[node name="Image" type="TextureRect" parent="Mask"]
@ -65,6 +65,7 @@ grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
mouse_filter = 2
texture = ExtResource("3_kgutt")
expand_mode = 1
stretch_mode = 5
@ -86,77 +87,3 @@ label_settings = ExtResource("4_xqjm8")
horizontal_alignment = 1
vertical_alignment = 1
text_overrun_behavior = 3
[node name="BaseButton" type="BaseButton" parent="."]
_import_path = NodePath("")
unique_name_in_owner = false
process_mode = 0
process_priority = 0
process_physics_priority = 0
process_thread_group = 0
physics_interpolation_mode = 2
auto_translate_mode = 1
editor_description = ""
visible = true
modulate = Color(1, 1, 1, 1)
self_modulate = Color(1, 1, 1, 1)
show_behind_parent = false
top_level = false
clip_children = 0
light_mask = 1
visibility_layer = 1
z_index = 0
z_as_relative = true
y_sort_enabled = false
texture_filter = 0
texture_repeat = 0
material = null
use_parent_material = false
clip_contents = false
custom_minimum_size = Vector2(0, 0)
layout_direction = 0
layout_mode = 1
anchors_preset = 15
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 0.0
offset_top = 0.0
offset_right = 0.0
offset_bottom = 0.0
grow_horizontal = 2
grow_vertical = 2
rotation = 0.0
scale = Vector2(1, 1)
pivot_offset = Vector2(0, 0)
size_flags_horizontal = 1
size_flags_vertical = 1
size_flags_stretch_ratio = 1.0
localize_numeral_system = true
tooltip_text = ""
focus_neighbor_left = NodePath("")
focus_neighbor_top = NodePath("")
focus_neighbor_right = NodePath("")
focus_neighbor_bottom = NodePath("")
focus_next = NodePath("")
focus_previous = NodePath("")
focus_mode = 2
mouse_filter = 0
mouse_force_pass_scroll_events = true
mouse_default_cursor_shape = 2
theme = null
theme_type_variation = &""
disabled = false
toggle_mode = false
button_pressed = false
action_mode = 1
button_mask = 1
keep_pressed_outside = false
button_group = null
shortcut = null
shortcut_feedback = true
shortcut_in_tooltip = true
script = null
[connection signal="pressed" from="BaseButton" to="." method="_on_base_button_pressed"]

View file

@ -1,22 +1,15 @@
[gd_scene load_steps=8 format=3 uid="uid://b57n6cvtqn5b7"]
[ext_resource type="Script" path="res://scripts/ui/search/prompt.gd" id="1_7xv44"]
[ext_resource type="StyleBox" uid="uid://c6dqs0nhh726" path="res://assets/styles/prompt.stylebox" id="1_cbfrs"]
[ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_33m26"]
[ext_resource type="LabelSettings" uid="uid://bo2334w4lf3ug" path="res://assets/styles/text.tres" id="3_rbghg"]
[ext_resource type="Texture2D" uid="uid://d05w6jtfy01w2" path="res://assets/textures/clock.svg" id="4_lekwb"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_srt8r"]
bg_color = Color(0.172549, 0.184314, 0.239216, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_l81vq"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6fg0o"]
content_margin_left = 32.0
content_margin_bottom = 2.0
content_margin_left = 30.0
[node name="prompt" type="Button" node_paths=PackedStringArray("prompt_text")]
custom_minimum_size = Vector2(0, 32)
@ -26,13 +19,14 @@ anchor_right = 1.0
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/hover = SubResource("StyleBoxFlat_srt8r")
theme_override_styles/pressed = SubResource("StyleBoxFlat_srt8r")
mouse_default_cursor_shape = 2
theme_override_styles/hover = ExtResource("1_cbfrs")
theme_override_styles/pressed = ExtResource("1_cbfrs")
theme_override_styles/normal = SubResource("StyleBoxEmpty_l81vq")
script = ExtResource("1_7xv44")
gate_events = ExtResource("2_33m26")
prompt_text = NodePath("Label")
focus_style = SubResource("StyleBoxFlat_srt8r")
focus_style = ExtResource("1_cbfrs")
[node name="Label" type="Label" parent="."]
layout_mode = 1
@ -53,9 +47,9 @@ anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 10.0
offset_top = -8.0
offset_right = 26.0
offset_bottom = 8.0
offset_top = -7.0
offset_right = 24.0
offset_bottom = 7.0
grow_vertical = 2
mouse_filter = 1

View file

@ -19,7 +19,7 @@
[ext_resource type="PackedScene" uid="uid://b57n6cvtqn5b7" path="res://scenes/components/prompt.tscn" id="16_lbcsd"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hyysn"]
content_margin_left = 32.0
content_margin_left = 30.0
content_margin_top = 3.0
content_margin_right = 30.0
bg_color = Color(0.0862745, 0.0901961, 0.117647, 1)
@ -81,9 +81,9 @@ anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 10.0
offset_top = -8.0
offset_right = 26.0
offset_bottom = 8.0
offset_top = -7.0
offset_right = 24.0
offset_bottom = 7.0
grow_vertical = 2
mouse_filter = 1
script = ExtResource("3_3p1re")

View file

@ -66,11 +66,11 @@ layout_mode = 2
size_flags_horizontal = 3
[node name="MaxSizeContainer2" type="MarginContainer" parent="ScrollContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
custom_minimum_size = Vector2(300, 0)
custom_minimum_size = Vector2(300, 32)
layout_mode = 2
theme_override_constants/margin_left = 0
theme_override_constants/margin_left = 396
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_right = 396
theme_override_constants/margin_bottom = 0
script = ExtResource("2_ceb6w")
limit = Vector2(720, -1)
@ -87,9 +87,9 @@ custom_minimum_size = Vector2(180, 400)
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 2.0
theme_override_constants/margin_left = 0
theme_override_constants/margin_left = 281
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_right = 281
theme_override_constants/margin_bottom = 0
script = ExtResource("2_ceb6w")
limit = Vector2(950, -1)

View file

@ -1,13 +1,18 @@
extends Node
extends Control
class_name BookmarkUI
@export var gate_events: GateEvents
@export var image: TextureRect
@export var title: Label
@export var button: Button
var url: String
func _ready() -> void:
button.pressed.connect(on_pressed)
func fill(gate: Gate) -> void:
if gate == null: return
@ -16,6 +21,6 @@ func fill(gate: Gate) -> void:
image.texture = FileTools.load_external_tex(gate.image)
func _on_base_button_pressed() -> void:
func on_pressed() -> void:
if url.is_empty(): return
gate_events.open_gate_emit(url)