diff options
Diffstat (limited to 'ui/login')
-rw-r--r-- | ui/login/character_selection_item.gd | 57 | ||||
-rw-r--r-- | ui/login/character_selection_item.tscn | 64 | ||||
-rw-r--r-- | ui/login/character_selection_status.gd | 19 | ||||
-rw-r--r-- | ui/login/character_selection_status.tscn | 291 | ||||
-rw-r--r-- | ui/login/character_server_button.tscn | 11 | ||||
-rw-r--r-- | ui/login/character_server_button_style_box.tres | 16 |
6 files changed, 458 insertions, 0 deletions
diff --git a/ui/login/character_selection_item.gd b/ui/login/character_selection_item.gd new file mode 100644 index 0000000..7ad77b6 --- /dev/null +++ b/ui/login/character_selection_item.gd @@ -0,0 +1,57 @@ +class_name CharacterSelectionItem +extends PanelContainer + + +signal selected + +static var selected_item: CharacterSelectionItem: + set(value): + var previous_item = selected_item + selected_item = value + if previous_item: + previous_item.draw_highlight(false) + +var is_hovered := false + + +func initialize_with_info(info: CharacterInformation): + %Head.texture = load( + "%s/%s/000.png" % [ + "res://client_data/data/sprite", + Constants.FilePaths.get_player_head(info.gender, info.head), + ] + ) + + %Body.texture = load( + "%s/%s/000.png" % [ + "res://client_data/data/sprite", + Constants.FilePaths.get_player_body(info.gender, info.job), + ] + ) + + %Name.text = info.name + + +func draw_highlight(is_highlighted: bool): + if selected_item == self: + is_highlighted = true + + var style_box: StyleBoxFlat = get_theme_stylebox("panel").duplicate() + style_box.draw_center = is_highlighted + add_theme_stylebox_override("panel", style_box) + + +func _on_gui_input(event: InputEvent) -> void: + if event.is_pressed(): + selected_item = self + draw_highlight(true) + selected.emit() + + +func _on_mouse_entered() -> void: + is_hovered = true + draw_highlight(is_hovered) + +func _on_mouse_exited() -> void: + is_hovered = false + draw_highlight(is_hovered) diff --git a/ui/login/character_selection_item.tscn b/ui/login/character_selection_item.tscn new file mode 100644 index 0000000..adc37bb --- /dev/null +++ b/ui/login/character_selection_item.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=6 format=3 uid="uid://rrd131rq74n5"] + +[ext_resource type="Script" uid="uid://bsglhorusc7ug" path="res://ui/login/character_selection_item.gd" id="1_25yur"] +[ext_resource type="Texture2D" uid="uid://danymuvfjf4o1" path="res://client_data/data/sprite/Àΰ£Á·/¸Ó¸®Åë/³²/16_³²/000.png" id="2_aqbfs"] +[ext_resource type="Texture2D" uid="uid://cwqgdd00sf7pu" path="res://client_data/data/sprite/Àΰ£Á·/¸öÅë/³²/Ãʺ¸ÀÚ_³²/000.png" id="3_xv3pn"] +[ext_resource type="Theme" uid="uid://c6y6r8kcnbb10" path="res://ui/theme_clear.tres" id="4_u21ok"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_u21ok"] +bg_color = Color(0, 0, 0, 0.0980392) +draw_center = false +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.760784, 0.760784, 0.760784, 1) + +[node name="CharacterSelectionItem" type="PanelContainer"] +custom_minimum_size = Vector2(150, 150) +offset_right = 150.0 +offset_bottom = 163.0 +mouse_default_cursor_shape = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_u21ok") +script = ExtResource("1_25yur") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 2 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_top = 4 +theme_override_constants/margin_right = 4 +theme_override_constants/margin_bottom = 4 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="Sprite" type="VBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 6 +theme_override_constants/separation = -8 + +[node name="Head" type="TextureRect" parent="MarginContainer/VBoxContainer/Sprite"] +unique_name_in_owner = true +z_index = 1 +texture_filter = 1 +layout_mode = 2 +texture = ExtResource("2_aqbfs") +stretch_mode = 3 + +[node name="Body" type="TextureRect" parent="MarginContainer/VBoxContainer/Sprite"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +texture = ExtResource("3_xv3pn") +stretch_mode = 3 + +[node name="Name" type="Label" parent="MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme = ExtResource("4_u21ok") +text = "Name" +horizontal_alignment = 1 + +[connection signal="gui_input" from="." to="." method="_on_gui_input"] +[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"] +[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"] diff --git a/ui/login/character_selection_status.gd b/ui/login/character_selection_status.gd new file mode 100644 index 0000000..2c0e450 --- /dev/null +++ b/ui/login/character_selection_status.gd @@ -0,0 +1,19 @@ +extends PanelContainer + + +func set_info(info: CharacterInformation): + %Name.text = info.name + %Job.text = Constants.Job.find_key(info.job) + %Level.text = str(info.level) + %Exp.text = str(info.experience) + %Hp.text = str(info.maximum_health_points) + %Sp.text = str(info.maximum_spell_points) + + %Str.text = str(info.strength) + %Agi.text = str(info.agility) + %Vit.text = str(info.vitality) + %Int.text = str(info.intelligence) + %Dex.text = str(info.dexterity) + %Luk.text = str(info.luck) + + %Map.text = info.map_name.substr(0, info.map_name.length() - 4) diff --git a/ui/login/character_selection_status.tscn b/ui/login/character_selection_status.tscn new file mode 100644 index 0000000..0de1865 --- /dev/null +++ b/ui/login/character_selection_status.tscn @@ -0,0 +1,291 @@ +[gd_scene load_steps=4 format=3 uid="uid://uo7qgv3ydh0q"] + +[ext_resource type="Theme" uid="uid://c6y6r8kcnbb10" path="res://ui/theme_clear.tres" id="1_o7mxo"] +[ext_resource type="Script" uid="uid://ceh4g7d15wopd" path="res://ui/login/character_selection_status.gd" id="2_nhn0f"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_qjr2b"] + +[node name="CharacterSelectionStatus" type="PanelContainer"] +offset_right = 360.0 +offset_bottom = 158.0 +theme = ExtResource("1_o7mxo") +theme_override_styles/panel = SubResource("StyleBoxEmpty_qjr2b") +script = ExtResource("2_nhn0f") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 2 +theme_override_constants/separation = 8 + +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "NAME" + +[node name="Name" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/HBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "STR" + +[node name="Str" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/HBoxContainer2"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer2/HBoxContainer"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "JOB" + +[node name="Job" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer2/HBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer2/HBoxContainer2"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "AGI" + +[node name="Agi" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer2/HBoxContainer2"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer3/HBoxContainer"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "Lv." + +[node name="Level" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer3/HBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "VIT" + +[node name="Vit" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer4"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer4/HBoxContainer"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "EXP" + +[node name="Exp" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer4/HBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer4"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer4/HBoxContainer2"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "INT" + +[node name="Int" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer4/HBoxContainer2"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer5" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer5"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer5/HBoxContainer"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "HP" + +[node name="Hp" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer5/HBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer5"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer5/HBoxContainer2"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "DEX" + +[node name="Dex" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer5/HBoxContainer2"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer6" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer6"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer6/HBoxContainer"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "SP" + +[node name="Sp" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer6/HBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer6"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer6/HBoxContainer2"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "LUK" + +[node name="Luk" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer6/HBoxContainer2"] +unique_name_in_owner = true +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(45, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel" +text = "MAP" + +[node name="Map" type="Label" parent="VBoxContainer/HBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(307, 0) +layout_mode = 2 +theme = ExtResource("1_o7mxo") +theme_type_variation = &"CharacterSelectionStatusLabel2" +text = "value" diff --git a/ui/login/character_server_button.tscn b/ui/login/character_server_button.tscn new file mode 100644 index 0000000..2244f3c --- /dev/null +++ b/ui/login/character_server_button.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=3 uid="uid://f2urhroq21t0"] + +[ext_resource type="Theme" uid="uid://c6y6r8kcnbb10" path="res://ui/theme_clear.tres" id="1_antln"] + +[node name="CharacterServerButton" type="Button"] +offset_right = 8.0 +offset_bottom = 8.0 +mouse_default_cursor_shape = 2 +theme = ExtResource("1_antln") +theme_type_variation = &"CharacterServerButton" +text = "Name" diff --git a/ui/login/character_server_button_style_box.tres b/ui/login/character_server_button_style_box.tres new file mode 100644 index 0000000..92ed6f6 --- /dev/null +++ b/ui/login/character_server_button_style_box.tres @@ -0,0 +1,16 @@ +[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://ct2l6hbb04p5o"] + +[sub_resource type="Gradient" id="Gradient_re72a"] +offsets = PackedFloat32Array(0, 0.4, 0.6, 1) +colors = PackedColorArray(1, 1, 1, 0, 0.792157, 0.87451, 0.984314, 0.392157, 0.792157, 0.87451, 0.984314, 0.392157, 1, 1, 1, 0) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_re72a"] +gradient = SubResource("Gradient_re72a") +repeat = 2 + +[resource] +content_margin_left = 2.0 +content_margin_top = 3.0 +content_margin_right = 2.0 +content_margin_bottom = 2.0 +texture = SubResource("GradientTexture2D_re72a") |