diff options
66 files changed, 1063 insertions, 123 deletions
diff --git a/dice_configuration.tres b/dice_configuration.tres new file mode 100644 index 0000000..9fb8917 --- /dev/null +++ b/dice_configuration.tres @@ -0,0 +1,50 @@ +[gd_resource type="Resource" script_class="DiceConfiguration" load_steps=9 format=3 uid="uid://c5up64wq06lx1"] + +[ext_resource type="Script" uid="uid://dnklife8p0m35" path="res://stage/dice_throw/dice_face_configuration.gd" id="1_kr22n"] +[ext_resource type="Script" uid="uid://6rit5abkk1rw" path="res://stage/dice_throw/dice_configuration.gd" id="2_5vhl7"] + +[sub_resource type="Resource" id="Resource_arxo3"] +script = ExtResource("1_kr22n") +type = 1 +value = 1 +metadata/_custom_type_script = "uid://dnklife8p0m35" + +[sub_resource type="Resource" id="Resource_ms37x"] +script = ExtResource("1_kr22n") +type = 4 +value = 1 +metadata/_custom_type_script = "uid://dnklife8p0m35" + +[sub_resource type="Resource" id="Resource_tk6el"] +script = ExtResource("1_kr22n") +type = 0 +value = 1 +metadata/_custom_type_script = "uid://dnklife8p0m35" + +[sub_resource type="Resource" id="Resource_l28ne"] +script = ExtResource("1_kr22n") +type = 2 +value = 1 +metadata/_custom_type_script = "uid://dnklife8p0m35" + +[sub_resource type="Resource" id="Resource_eguj2"] +script = ExtResource("1_kr22n") +type = 3 +value = 1 +metadata/_custom_type_script = "uid://dnklife8p0m35" + +[sub_resource type="Resource" id="Resource_c3r23"] +script = ExtResource("1_kr22n") +type = 4 +value = 1 +metadata/_custom_type_script = "uid://dnklife8p0m35" + +[resource] +script = ExtResource("2_5vhl7") +front_face = SubResource("Resource_tk6el") +back_face = SubResource("Resource_arxo3") +left_face = SubResource("Resource_l28ne") +right_face = SubResource("Resource_eguj2") +top_face = SubResource("Resource_c3r23") +bottom_face = SubResource("Resource_ms37x") +metadata/_custom_type_script = "uid://6rit5abkk1rw" @@ -7,3 +7,22 @@ var overlay := CanvasLayer.new() func _ready() -> void: overlay.name = "Overlay" get_tree().root.add_child.call_deferred(overlay) + + +enum Face { + FRONT, + BACK, + LEFT, + RIGHT, + TOP, + BOTTOM, +} + + +enum FaceType { + MOVE, + ATTACK, + DEFEND, + ABILITY, + ENTITY, +} @@ -4,17 +4,67 @@ extends Control func _ready() -> void: Network.connected.connect(_on_connected) + show_menu(%MultiPlayer) %HostButton.grab_focus() -func _on_button_pressed() -> void: +func _input(event: InputEvent) -> void: + if event.is_action_pressed("right_click"): + var current_menu: Control + for node in get_children(): + if node is Control and node.visible: + current_menu = node + var back_button = current_menu.find_children("*BackButton", "Button") + if back_button.size() > 0: + back_button[0].pressed.emit() + + +func show_menu(menu_node: Control) -> void: + for node in get_children(): + if node is Control: + node.visible = false + + menu_node.visible = true + + var button = menu_node.find_children("*", "Button") + if button.size() > 0: + button[0].grab_focus() + + +func _on_connected() -> void: + get_tree().change_scene_to_file("res://stage/stage.tscn") + + +func _on_single_player_button_pressed() -> void: + show_menu(%SinglePlayer) + + +func _on_multi_player_button_pressed() -> void: + show_menu(%MultiPlayer) + + +func _on_deck_manager_button_pressed() -> void: + #get_tree().change_scene_to_file("res://ui/deck_manager/deck_manager.tscn") + get_tree().change_scene_to_file("res://ui/dice_configurator.tscn") + # Dice Manager? + # add dice to decks + # but from a pool of dice + # and configure dice seperately + # can configure dice when adding to deck as well? + + +func _on_single_player_back_button_pressed() -> void: + show_menu(%Main) + + +func _on_host_button_pressed() -> void: Network.host() get_tree().change_scene_to_file("res://stage/stage.tscn") -func _on_button_2_pressed() -> void: +func _on_join_button_pressed() -> void: Network.join() -func _on_connected() -> void: - get_tree().change_scene_to_file("res://stage/stage.tscn") +func _on_multi_player_back_button_pressed() -> void: + show_menu(%Main) @@ -1,7 +1,13 @@ -[gd_scene load_steps=4 format=3 uid="uid://c3sdm0knce1fx"] +[gd_scene load_steps=6 format=3 uid="uid://c3sdm0knce1fx"] [ext_resource type="Script" uid="uid://dm77sa5w5jdgo" path="res://main.gd" id="1_ig7tw"] +[sub_resource type="InputEventAction" id="InputEventAction_0xm2m"] +action = &"left_click" + +[sub_resource type="Shortcut" id="Shortcut_h2yge"] +events = [SubResource("InputEventAction_0xm2m")] + [sub_resource type="InputEventAction" id="InputEventAction_ig7tw"] action = &"left_click" @@ -17,7 +23,38 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_ig7tw") -[node name="CenterContainer" type="CenterContainer" parent="."] +[node name="Main" type="CenterContainer" parent="."] +unique_name_in_owner = true +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Main"] +layout_mode = 2 + +[node name="SinglePlayerButton" type="Button" parent="Main/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] +layout_mode = 2 +shortcut_context = NodePath(".") +shortcut = SubResource("Shortcut_h2yge") +text = "Singleplayer" + +[node name="MultiPlayerButton" type="Button" parent="Main/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] +layout_mode = 2 +shortcut_context = NodePath(".") +shortcut = SubResource("Shortcut_h2yge") +text = "Multiplayer" + +[node name="DeckManagerButton" type="Button" parent="Main/VBoxContainer"] +layout_mode = 2 +text = "Deck Manager" + +[node name="SinglePlayer" type="CenterContainer" parent="."] +unique_name_in_owner = true +visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -25,22 +62,51 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="SinglePlayer"] +layout_mode = 2 + +[node name="SinglePlayerBackButton" type="Button" parent="SinglePlayer/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] layout_mode = 2 +shortcut_context = NodePath(".") +shortcut = SubResource("Shortcut_h2yge") +text = "Back" -[node name="HostButton" type="Button" parent="CenterContainer/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] +[node name="MultiPlayer" type="CenterContainer" parent="."] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MultiPlayer"] +layout_mode = 2 + +[node name="HostButton" type="Button" parent="MultiPlayer/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] unique_name_in_owner = true layout_mode = 2 shortcut_context = NodePath(".") shortcut = SubResource("Shortcut_0xm2m") text = "Host" -[node name="JoinButton" type="Button" parent="CenterContainer/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] +[node name="JoinButton" type="Button" parent="MultiPlayer/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] unique_name_in_owner = true layout_mode = 2 shortcut_context = NodePath(".") shortcut = SubResource("Shortcut_0xm2m") text = "Join" -[connection signal="pressed" from="CenterContainer/VBoxContainer/HostButton" to="." method="_on_button_pressed"] -[connection signal="pressed" from="CenterContainer/VBoxContainer/JoinButton" to="." method="_on_button_2_pressed"] +[node name="MultiPlayerBackButton" type="Button" parent="MultiPlayer/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] +layout_mode = 2 +shortcut_context = NodePath(".") +shortcut = SubResource("Shortcut_h2yge") +text = "Back" + +[connection signal="pressed" from="Main/VBoxContainer/SinglePlayerButton" to="." method="_on_single_player_button_pressed"] +[connection signal="pressed" from="Main/VBoxContainer/MultiPlayerButton" to="." method="_on_multi_player_button_pressed"] +[connection signal="pressed" from="Main/VBoxContainer/DeckManagerButton" to="." method="_on_deck_manager_button_pressed"] +[connection signal="pressed" from="SinglePlayer/VBoxContainer/SinglePlayerBackButton" to="." method="_on_single_player_back_button_pressed"] +[connection signal="pressed" from="MultiPlayer/VBoxContainer/HostButton" to="." method="_on_host_button_pressed"] +[connection signal="pressed" from="MultiPlayer/VBoxContainer/JoinButton" to="." method="_on_join_button_pressed"] +[connection signal="pressed" from="MultiPlayer/VBoxContainer/MultiPlayerBackButton" to="." method="_on_multi_player_back_button_pressed"] diff --git a/project.godot b/project.godot index c79e706..580107d 100644 --- a/project.godot +++ b/project.godot @@ -26,6 +26,11 @@ window/size/viewport_width=480 window/size/viewport_height=320 window/stretch/mode="canvas_items" +[gui] + +theme/custom="uid://yjmw88mel6d3" +theme/custom_font="uid://d0tmhpr2i1v2o" + [input] right_click={ @@ -73,5 +78,6 @@ menu={ [rendering] +textures/canvas_textures/default_texture_filter=0 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" diff --git a/stage/dice_selection/dice_selection.gd b/stage/dice_selection/dice_selection.gd index 812005a..b56bebe 100644 --- a/stage/dice_selection/dice_selection.gd +++ b/stage/dice_selection/dice_selection.gd @@ -29,6 +29,9 @@ func _ready() -> void: func _input(event: InputEvent) -> void: if event.is_action_pressed("right_click"): dice_selected.emit([] as Array[DiceConfiguration]) + + if event.is_action_pressed("menu"): + %GoButton.grab_focus() func _on_deck_dice_selected(dice: Control) -> void: @@ -61,10 +64,10 @@ func _on_dice_focus_entered(dice: Control) -> void: var faces := [ dice_configuration.front_face, dice_configuration.back_face, - dice_configuration.top_face, - dice_configuration.bottom_face, dice_configuration.left_face, dice_configuration.right_face, + dice_configuration.top_face, + dice_configuration.bottom_face, ] %Label.text = "" diff --git a/stage/dice_selection/dice_selection.tscn b/stage/dice_selection/dice_selection.tscn index 934d3fc..1023cb9 100644 --- a/stage/dice_selection/dice_selection.tscn +++ b/stage/dice_selection/dice_selection.tscn @@ -50,6 +50,7 @@ unique_name_in_owner = true layout_mode = 2 [node name="GoButton" type="Button" parent="VBoxContainer/HBoxContainer/VBoxContainer" node_paths=PackedStringArray("shortcut_context")] +unique_name_in_owner = true layout_mode = 2 shortcut_context = NodePath(".") shortcut = SubResource("Shortcut_sn5id") diff --git a/stage/dice_selection/dice_selection_item.tscn b/stage/dice_selection/dice_selection_item.tscn index 4cedb3e..8a51b96 100644 --- a/stage/dice_selection/dice_selection_item.tscn +++ b/stage/dice_selection/dice_selection_item.tscn @@ -1,56 +1,9 @@ -[gd_scene load_steps=13 format=3 uid="uid://d280t78wjw3hc"] +[gd_scene load_steps=5 format=3 uid="uid://d280t78wjw3hc"] [ext_resource type="Script" uid="uid://bgaq754eqfs8g" path="res://stage/dice_selection/dice_selection_item.gd" id="1_v6plq"] [ext_resource type="Texture2D" uid="uid://blanietpri1be" path="res://icon.svg" id="2_1q4g0"] [ext_resource type="Texture2D" uid="uid://db0v50mdroaox" path="res://stage/assets/isometric-tile.png" id="2_p1an8"] -[ext_resource type="Script" uid="uid://dnklife8p0m35" path="res://stage/dice_throw/dice_face_configuration.gd" id="3_xogsa"] -[ext_resource type="Script" uid="uid://6rit5abkk1rw" path="res://stage/dice_throw/dice_configuration.gd" id="4_p1an8"] - -[sub_resource type="Resource" id="Resource_xogsa"] -script = ExtResource("3_xogsa") -type = "move" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_ye5qu"] -script = ExtResource("3_xogsa") -type = "attack" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_xub8r"] -script = ExtResource("3_xogsa") -type = "move" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_0m3mt"] -script = ExtResource("3_xogsa") -type = "defend" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_inbll"] -script = ExtResource("3_xogsa") -type = "ability" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_p1an8"] -script = ExtResource("3_xogsa") -type = "attack" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_f5jvy"] -script = ExtResource("4_p1an8") -front_face = SubResource("Resource_xub8r") -back_face = SubResource("Resource_xogsa") -top_face = SubResource("Resource_p1an8") -bottom_face = SubResource("Resource_ye5qu") -left_face = SubResource("Resource_0m3mt") -right_face = SubResource("Resource_inbll") -metadata/_custom_type_script = "uid://6rit5abkk1rw" +[ext_resource type="Resource" uid="uid://c5up64wq06lx1" path="res://dice_configuration.tres" id="4_xogsa"] [node name="DiceSelectionItem" type="TextureButton"] custom_minimum_size = Vector2(32, 32) @@ -61,6 +14,6 @@ texture_focused = ExtResource("2_p1an8") ignore_texture_size = true stretch_mode = 4 script = ExtResource("1_v6plq") -dice_configuration = SubResource("Resource_f5jvy") +dice_configuration = ExtResource("4_xogsa") [connection signal="gui_input" from="." to="." method="_on_gui_input"] diff --git a/stage/dice_throw/dice.tscn b/stage/dice_throw/dice.tscn index 5834cfb..6a8697d 100644 --- a/stage/dice_throw/dice.tscn +++ b/stage/dice_throw/dice.tscn @@ -1,61 +1,14 @@ -[gd_scene load_steps=22 format=3 uid="uid://dnq7fpof6w0mj"] +[gd_scene load_steps=14 format=3 uid="uid://dnq7fpof6w0mj"] [ext_resource type="Script" uid="uid://bajtxq3ucs8f4" path="res://stage/dice_throw/dice.gd" id="1_gwnix"] [ext_resource type="Texture2D" uid="uid://blanietpri1be" path="res://icon.svg" id="2_6tbdd"] -[ext_resource type="Script" uid="uid://dnklife8p0m35" path="res://stage/dice_throw/dice_face_configuration.gd" id="2_6vba1"] [ext_resource type="PackedScene" uid="uid://y1hkmpd41rrq" path="res://stage/dice_throw/dice_face.tscn" id="2_ee854"] -[ext_resource type="Script" uid="uid://6rit5abkk1rw" path="res://stage/dice_throw/dice_configuration.gd" id="3_juxel"] +[ext_resource type="Resource" uid="uid://c5up64wq06lx1" path="res://dice_configuration.tres" id="2_m3bw3"] [ext_resource type="Texture2D" uid="uid://dtltt171temec" path="res://stage/assets/tinyBlocks.png" id="3_t0umq"] [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_m7tx2"] bounce = 0.5 -[sub_resource type="Resource" id="Resource_arxo3"] -script = ExtResource("2_6vba1") -type = "move" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_ms37x"] -script = ExtResource("2_6vba1") -type = "attack" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_tk6el"] -script = ExtResource("2_6vba1") -type = "move" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_l28ne"] -script = ExtResource("2_6vba1") -type = "defend" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_eguj2"] -script = ExtResource("2_6vba1") -type = "ability" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_c3r23"] -script = ExtResource("2_6vba1") -type = "attack" -value = 1 -metadata/_custom_type_script = "uid://dnklife8p0m35" - -[sub_resource type="Resource" id="Resource_inr58"] -script = ExtResource("3_juxel") -front_face = SubResource("Resource_tk6el") -back_face = SubResource("Resource_arxo3") -top_face = SubResource("Resource_c3r23") -bottom_face = SubResource("Resource_ms37x") -left_face = SubResource("Resource_l28ne") -right_face = SubResource("Resource_eguj2") -metadata/_custom_type_script = "uid://6rit5abkk1rw" - [sub_resource type="BoxMesh" id="BoxMesh_gof22"] [sub_resource type="BoxShape3D" id="BoxShape3D_tqijt"] @@ -84,7 +37,7 @@ region = Rect2(72, 144, 18, 18) physics_material_override = SubResource("PhysicsMaterial_m7tx2") gravity_scale = 2.0 script = ExtResource("1_gwnix") -configuration = SubResource("Resource_inr58") +configuration = ExtResource("2_m3bw3") [node name="MeshInstance3D" type="MeshInstance3D" parent="."] mesh = SubResource("BoxMesh_gof22") diff --git a/stage/dice_throw/dice_configuration.gd b/stage/dice_throw/dice_configuration.gd index 48a7d22..a4fef90 100644 --- a/stage/dice_throw/dice_configuration.gd +++ b/stage/dice_throw/dice_configuration.gd @@ -4,7 +4,7 @@ extends Resource @export var front_face: DiceFaceConfiguration @export var back_face: DiceFaceConfiguration -@export var top_face: DiceFaceConfiguration -@export var bottom_face: DiceFaceConfiguration @export var left_face: DiceFaceConfiguration @export var right_face: DiceFaceConfiguration +@export var top_face: DiceFaceConfiguration +@export var bottom_face: DiceFaceConfiguration diff --git a/stage/dice_throw/dice_face.gd b/stage/dice_throw/dice_face.gd index f314a3f..71d40ae 100644 --- a/stage/dice_throw/dice_face.gd +++ b/stage/dice_throw/dice_face.gd @@ -4,3 +4,18 @@ extends Sprite3D @export var up_rotation: Vector3 @export var configuration: DiceFaceConfiguration + + +static func get_face_type_icon(type: Game.FaceType) -> ImageTexture: + if type == Game.FaceType.MOVE: + return load("res://ui/assets/face_type_move.png") + elif type == Game.FaceType.ATTACK: + return load("res://ui/assets/face_type_attack.png") + elif type == Game.FaceType.DEFEND: + return load("res://ui/assets/face_type_defend.png") + elif type == Game.FaceType.ABILITY: + return load("res://ui/assets/face_type_ability.png") + elif type == Game.FaceType.ENTITY: + return load("res://ui/assets/face_type_entity.png") + + return null diff --git a/stage/dice_throw/dice_face_configuration.gd b/stage/dice_throw/dice_face_configuration.gd index e75dd90..fd28d3e 100644 --- a/stage/dice_throw/dice_face_configuration.gd +++ b/stage/dice_throw/dice_face_configuration.gd @@ -2,5 +2,5 @@ class_name DiceFaceConfiguration extends Resource -@export var type: String +@export var type: Game.FaceType @export var value: int diff --git a/stage/dice_throw/dice_throw.gd b/stage/dice_throw/dice_throw.gd index d6bdc34..1e80f64 100644 --- a/stage/dice_throw/dice_throw.gd +++ b/stage/dice_throw/dice_throw.gd @@ -78,24 +78,28 @@ func _on_dice_throw_3d_throw_finished(thrown_dices: Array[Dice]) -> void: for idx in thrown_dices.size(): var dice := thrown_dices[idx] var top_face := top_faces[idx] - var node := get_node("%" + top_face.configuration.type) + + if top_face.configuration.type == Game.FaceType.ENTITY: + continue # skip for now + + var node := get_node("%" + Game.FaceType.keys()[top_face.configuration.type].to_lower()) var p3d = %Camera3D.project_position(node.position + node.size * 0.5, 1) tween.tween_property(dice, "position", p3d, 0.25) tween.tween_property(dice, "scale", Vector3(0.1, 0.1, 0.1), 0.25) - if top_face.configuration.type == "move": + if top_face.configuration.type == Game.FaceType.MOVE: #Network.current_player.set_current_move_points(Network.current_player.current_move_points + 1) Network.current_player.current_move_points += top_face.configuration.value %move.text = "Move: %s" % str(Network.current_player.current_move_points) - elif top_face.configuration.type == "attack": + elif top_face.configuration.type == Game.FaceType.ATTACK: #Network.current_player.set_current_attack_points(Network.current_player.current_attack_points + 1) Network.current_player.current_attack_points += top_face.configuration.value %attack.text = "Attack: %s" % str(Network.current_player.current_attack_points) - elif top_face.configuration.type == "defend": + elif top_face.configuration.type == Game.FaceType.DEFEND: #Network.current_player.set_current_defend_points(Network.current_player.current_defend_points + 1) Network.current_player.current_defend_points += top_face.configuration.value %defend.text = "Defend: %s" % str(Network.current_player.current_defend_points) - elif top_face.configuration.type == "ability": + elif top_face.configuration.type == Game.FaceType.ABILITY: #Network.current_player.set_current_ability_points(Network.current_player.current_ability_points + 1) Network.current_player.current_ability_points += top_face.configuration.value %ability.text = "Ability: %s" % str(Network.current_player.current_ability_points) diff --git a/stage/dice_throw/dice_throw.tscn b/stage/dice_throw/dice_throw.tscn index 286dca4..afbcc85 100644 --- a/stage/dice_throw/dice_throw.tscn +++ b/stage/dice_throw/dice_throw.tscn @@ -7,12 +7,12 @@ sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) -[sub_resource type="Sky" id="Sky_ij08j"] +[sub_resource type="Sky" id="Sky_kn6vl"] sky_material = SubResource("ProceduralSkyMaterial_cqep4") [sub_resource type="Environment" id="Environment_sn6lt"] background_mode = 2 -sky = SubResource("Sky_ij08j") +sky = SubResource("Sky_kn6vl") tonemap_mode = 2 [node name="DiceThrow" type="Control"] diff --git a/ui/assets/dice_configuration_face_preview.kra b/ui/assets/dice_configuration_face_preview.kra Binary files differnew file mode 100644 index 0000000..1017573 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview.kra diff --git a/ui/assets/dice_configuration_face_preview.kra~ b/ui/assets/dice_configuration_face_preview.kra~ Binary files differnew file mode 100644 index 0000000..c2eba1e --- /dev/null +++ b/ui/assets/dice_configuration_face_preview.kra~ diff --git a/ui/assets/dice_configuration_face_preview.png b/ui/assets/dice_configuration_face_preview.png Binary files differnew file mode 100644 index 0000000..ccacce3 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview.png diff --git a/ui/assets/dice_configuration_face_preview.png.import b/ui/assets/dice_configuration_face_preview.png.import new file mode 100644 index 0000000..8b238c4 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dlnccfl2nhsns" +path="res://.godot/imported/dice_configuration_face_preview.png-85a50bd68357ad017222e325e9f7630c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/dice_configuration_face_preview.png" +dest_files=["res://.godot/imported/dice_configuration_face_preview.png-85a50bd68357ad017222e325e9f7630c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/dice_configuration_face_preview_back.png b/ui/assets/dice_configuration_face_preview_back.png Binary files differnew file mode 100644 index 0000000..3c508f7 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_back.png diff --git a/ui/assets/dice_configuration_face_preview_back.png.import b/ui/assets/dice_configuration_face_preview_back.png.import new file mode 100644 index 0000000..d216fb9 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_back.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bt3o87povgkrf" +path="res://.godot/imported/dice_configuration_face_preview_back.png-1f85e8fbe48b810d9c9582dfd8fd2db2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/dice_configuration_face_preview_back.png" +dest_files=["res://.godot/imported/dice_configuration_face_preview_back.png-1f85e8fbe48b810d9c9582dfd8fd2db2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/dice_configuration_face_preview_back.png~ b/ui/assets/dice_configuration_face_preview_back.png~ Binary files differnew file mode 100644 index 0000000..338cace --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_back.png~ diff --git a/ui/assets/dice_configuration_face_preview_bottom.png b/ui/assets/dice_configuration_face_preview_bottom.png Binary files differnew file mode 100644 index 0000000..b7d8f82 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_bottom.png diff --git a/ui/assets/dice_configuration_face_preview_bottom.png.import b/ui/assets/dice_configuration_face_preview_bottom.png.import new file mode 100644 index 0000000..1b9a303 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_bottom.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://doc7kidhonhsy" +path="res://.godot/imported/dice_configuration_face_preview_bottom.png-592f671a25b4525a1def72a19e78af20.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/dice_configuration_face_preview_bottom.png" +dest_files=["res://.godot/imported/dice_configuration_face_preview_bottom.png-592f671a25b4525a1def72a19e78af20.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/dice_configuration_face_preview_front.png b/ui/assets/dice_configuration_face_preview_front.png Binary files differnew file mode 100644 index 0000000..3bec4c4 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_front.png diff --git a/ui/assets/dice_configuration_face_preview_front.png.import b/ui/assets/dice_configuration_face_preview_front.png.import new file mode 100644 index 0000000..6469826 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_front.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpndubw65vuyv" +path="res://.godot/imported/dice_configuration_face_preview_front.png-e362e739c72b027d38d57eb7d1d43a92.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/dice_configuration_face_preview_front.png" +dest_files=["res://.godot/imported/dice_configuration_face_preview_front.png-e362e739c72b027d38d57eb7d1d43a92.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/dice_configuration_face_preview_front.png~ b/ui/assets/dice_configuration_face_preview_front.png~ Binary files differnew file mode 100644 index 0000000..fe06e54 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_front.png~ diff --git a/ui/assets/dice_configuration_face_preview_left.png b/ui/assets/dice_configuration_face_preview_left.png Binary files differnew file mode 100644 index 0000000..432bf15 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_left.png diff --git a/ui/assets/dice_configuration_face_preview_left.png.import b/ui/assets/dice_configuration_face_preview_left.png.import new file mode 100644 index 0000000..5ea0dc8 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_left.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dg5acffpapq51" +path="res://.godot/imported/dice_configuration_face_preview_left.png-bfec2e1e410a73d716c33e1d7d7f4a5b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/dice_configuration_face_preview_left.png" +dest_files=["res://.godot/imported/dice_configuration_face_preview_left.png-bfec2e1e410a73d716c33e1d7d7f4a5b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/dice_configuration_face_preview_right.png b/ui/assets/dice_configuration_face_preview_right.png Binary files differnew file mode 100644 index 0000000..8ddba17 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_right.png diff --git a/ui/assets/dice_configuration_face_preview_right.png.import b/ui/assets/dice_configuration_face_preview_right.png.import new file mode 100644 index 0000000..b4a78ad --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_right.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cixfa4nsi78pb" +path="res://.godot/imported/dice_configuration_face_preview_right.png-82cac3c3b033bc925ac79c606105d95b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/dice_configuration_face_preview_right.png" +dest_files=["res://.godot/imported/dice_configuration_face_preview_right.png-82cac3c3b033bc925ac79c606105d95b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/dice_configuration_face_preview_top.png b/ui/assets/dice_configuration_face_preview_top.png Binary files differnew file mode 100644 index 0000000..d97c6ca --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_top.png diff --git a/ui/assets/dice_configuration_face_preview_top.png.import b/ui/assets/dice_configuration_face_preview_top.png.import new file mode 100644 index 0000000..c1a4536 --- /dev/null +++ b/ui/assets/dice_configuration_face_preview_top.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bg27hbeenysq2" +path="res://.godot/imported/dice_configuration_face_preview_top.png-bf77231a88ec696a40bce575447a384e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/dice_configuration_face_preview_top.png" +dest_files=["res://.godot/imported/dice_configuration_face_preview_top.png-bf77231a88ec696a40bce575447a384e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/face_type_ability.kra b/ui/assets/face_type_ability.kra Binary files differnew file mode 100644 index 0000000..82dc3e4 --- /dev/null +++ b/ui/assets/face_type_ability.kra diff --git a/ui/assets/face_type_ability.png b/ui/assets/face_type_ability.png Binary files differnew file mode 100644 index 0000000..031b831 --- /dev/null +++ b/ui/assets/face_type_ability.png diff --git a/ui/assets/face_type_ability.png.import b/ui/assets/face_type_ability.png.import new file mode 100644 index 0000000..10f9cbb --- /dev/null +++ b/ui/assets/face_type_ability.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://sy0f5oylro3p" +path="res://.godot/imported/face_type_ability.png-f26afb3548d77a5869faf5ff752f6b85.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/face_type_ability.png" +dest_files=["res://.godot/imported/face_type_ability.png-f26afb3548d77a5869faf5ff752f6b85.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/face_type_attack.kra b/ui/assets/face_type_attack.kra Binary files differnew file mode 100644 index 0000000..956840a --- /dev/null +++ b/ui/assets/face_type_attack.kra diff --git a/ui/assets/face_type_attack.kra~ b/ui/assets/face_type_attack.kra~ Binary files differnew file mode 100644 index 0000000..e9df7f6 --- /dev/null +++ b/ui/assets/face_type_attack.kra~ diff --git a/ui/assets/face_type_attack.png b/ui/assets/face_type_attack.png Binary files differnew file mode 100644 index 0000000..3e7a984 --- /dev/null +++ b/ui/assets/face_type_attack.png diff --git a/ui/assets/face_type_attack.png.import b/ui/assets/face_type_attack.png.import new file mode 100644 index 0000000..eb43070 --- /dev/null +++ b/ui/assets/face_type_attack.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://btela72ck0q2m" +path="res://.godot/imported/face_type_attack.png-221534c252f337295d9a186bd970b674.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/face_type_attack.png" +dest_files=["res://.godot/imported/face_type_attack.png-221534c252f337295d9a186bd970b674.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/face_type_attack.png~ b/ui/assets/face_type_attack.png~ Binary files differnew file mode 100644 index 0000000..0c79c81 --- /dev/null +++ b/ui/assets/face_type_attack.png~ diff --git a/ui/assets/face_type_defend.kra b/ui/assets/face_type_defend.kra Binary files differnew file mode 100644 index 0000000..5152d17 --- /dev/null +++ b/ui/assets/face_type_defend.kra diff --git a/ui/assets/face_type_defend.kra~ b/ui/assets/face_type_defend.kra~ Binary files differnew file mode 100644 index 0000000..359ef9c --- /dev/null +++ b/ui/assets/face_type_defend.kra~ diff --git a/ui/assets/face_type_defend.png b/ui/assets/face_type_defend.png Binary files differnew file mode 100644 index 0000000..43f6230 --- /dev/null +++ b/ui/assets/face_type_defend.png diff --git a/ui/assets/face_type_defend.png.import b/ui/assets/face_type_defend.png.import new file mode 100644 index 0000000..26a5265 --- /dev/null +++ b/ui/assets/face_type_defend.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bhiw3i8vrynbn" +path="res://.godot/imported/face_type_defend.png-69b914afe4896442f79b89b6887fa114.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/face_type_defend.png" +dest_files=["res://.godot/imported/face_type_defend.png-69b914afe4896442f79b89b6887fa114.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/face_type_entity.kra b/ui/assets/face_type_entity.kra Binary files differnew file mode 100644 index 0000000..3d3ce1c --- /dev/null +++ b/ui/assets/face_type_entity.kra diff --git a/ui/assets/face_type_entity.kra~ b/ui/assets/face_type_entity.kra~ Binary files differnew file mode 100644 index 0000000..c62e8d3 --- /dev/null +++ b/ui/assets/face_type_entity.kra~ diff --git a/ui/assets/face_type_entity.png b/ui/assets/face_type_entity.png Binary files differnew file mode 100644 index 0000000..22ba0e4 --- /dev/null +++ b/ui/assets/face_type_entity.png diff --git a/ui/assets/face_type_entity.png.import b/ui/assets/face_type_entity.png.import new file mode 100644 index 0000000..f515869 --- /dev/null +++ b/ui/assets/face_type_entity.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c0worc080m63l" +path="res://.godot/imported/face_type_entity.png-84ab1a09b753f8fb9b6c1137acc3522e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/assets/face_type_entity.png" +dest_files=["res://.godot/imported/face_type_entity.png-84ab1a09b753f8fb9b6c1137acc3522e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ui/assets/face_type_move.kra b/ui/assets/face_type_move.kra Binary files differnew file mode 100644 index 0000000..67d3e24 --- /dev/null +++ b/ui/assets/face_type_move.kra diff --git a/ui/assets/face_type_move.kra~ b/ui/assets/face_type_move.kra~ Binary files differnew file mode 100644 index 0000000..7c60010 --- /dev/null +++ b/ui/assets/face_type_move.kra~ diff --git a/ui/assets/face_type_move.png b/ui/assets/face_type_move.png Binary files differnew file mode 100644 index 0000000..b341c63 --- /dev/null +++ b/ui/assets/face_type_move.png diff --git a/ui/assets/face_type_move.png.import b/ui/assets/face_type_move.png.import new file mode 100644 index 0000000..3a530e0 --- /dev/null +++ b/ui/assets/face_type_move.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c4aqalwcd7y14" +path.s3tc="res://.godot/imported/face_type_move.png-72beb4fceed1e8ed5c19a646c7edc2a1.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://ui/assets/face_type_move.png" +dest_files=["res://.godot/imported/face_type_move.png-72beb4fceed1e8ed5c19a646c7edc2a1.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/ui/assets/face_type_move.png~ b/ui/assets/face_type_move.png~ Binary files differnew file mode 100644 index 0000000..3857888 --- /dev/null +++ b/ui/assets/face_type_move.png~ diff --git a/ui/assets/fonts/PressStart2P.ttf b/ui/assets/fonts/PressStart2P.ttf Binary files differnew file mode 100644 index 0000000..12168fb --- /dev/null +++ b/ui/assets/fonts/PressStart2P.ttf diff --git a/ui/assets/fonts/PressStart2P.ttf.import b/ui/assets/fonts/PressStart2P.ttf.import new file mode 100644 index 0000000..44c4ebe --- /dev/null +++ b/ui/assets/fonts/PressStart2P.ttf.import @@ -0,0 +1,35 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://d0tmhpr2i1v2o" +path="res://.godot/imported/PressStart2P.ttf-248e19e0a1c3711d6dfb51d4b4807827.fontdata" + +[deps] + +source_file="res://ui/assets/fonts/PressStart2P.ttf" +dest_files=["res://.godot/imported/PressStart2P.ttf-248e19e0a1c3711d6dfb51d4b4807827.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/ui/deck_manager/deck_manager.gd b/ui/deck_manager/deck_manager.gd new file mode 100644 index 0000000..e07a0bf --- /dev/null +++ b/ui/deck_manager/deck_manager.gd @@ -0,0 +1 @@ +extends Control diff --git a/ui/deck_manager/deck_manager.gd.uid b/ui/deck_manager/deck_manager.gd.uid new file mode 100644 index 0000000..452d421 --- /dev/null +++ b/ui/deck_manager/deck_manager.gd.uid @@ -0,0 +1 @@ +uid://ctamvdo7qpov8 diff --git a/ui/deck_manager/deck_manager.tscn b/ui/deck_manager/deck_manager.tscn new file mode 100644 index 0000000..03c1f66 --- /dev/null +++ b/ui/deck_manager/deck_manager.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=2 format=3 uid="uid://crunggpl7ihhe"] + +[ext_resource type="Script" uid="uid://ctamvdo7qpov8" path="res://ui/deck_manager/deck_manager.gd" id="1_mf1mb"] + +[node name="DeckManager" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_mf1mb") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="GridContainer" type="GridContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 + +[node name="BackButton" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "Back" diff --git a/ui/deck_manager/deck_preview.tscn b/ui/deck_manager/deck_preview.tscn new file mode 100644 index 0000000..9cdf7d4 --- /dev/null +++ b/ui/deck_manager/deck_preview.tscn @@ -0,0 +1,8 @@ +[gd_scene format=3 uid="uid://vpq0tp5e4sbu"] + +[node name="DeckPreview" type="TextureButton"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 diff --git a/ui/dice_configurator/dice_configuration_face_preview.gd b/ui/dice_configurator/dice_configuration_face_preview.gd new file mode 100644 index 0000000..525134c --- /dev/null +++ b/ui/dice_configurator/dice_configuration_face_preview.gd @@ -0,0 +1,55 @@ +@tool +extends Control + + +@export var face: Game.Face: set = set_face +@export var type: Game.FaceType: set = set_type +@export var value: int: set = set_value +@export var active: bool = false: set = set_active + + +func _ready() -> void: + set_face(face) + set_type(type) + set_value(value) + set_active(active) + + +func set_face(v: Game.Face) -> void: + face = v + + if face == Game.Face.FRONT: + %Face.texture = load("res://ui/assets/dice_configuration_face_preview_front.png") + elif face == Game.Face.BACK: + %Face.texture = load("res://ui/assets/dice_configuration_face_preview_back.png") + elif face == Game.Face.LEFT: + %Face.texture = load("res://ui/assets/dice_configuration_face_preview_left.png") + elif face == Game.Face.RIGHT: + %Face.texture = load("res://ui/assets/dice_configuration_face_preview_right.png") + elif face == Game.Face.TOP: + %Face.texture = load("res://ui/assets/dice_configuration_face_preview_top.png") + elif face == Game.Face.BOTTOM: + %Face.texture = load("res://ui/assets/dice_configuration_face_preview_bottom.png") + + +func set_type(v: Game.FaceType) -> void: + type = v + %Type.texture_normal = DiceFace.get_face_type_icon(type) + + +func set_value(v: int) -> void: + value = v + if has_node("%Value"): + %Value.text = str(value) + + +func set_active(v: bool) -> void: + active = v + if active: + %Face.self_modulate = Color.hex(0xafff00ff) + else: + %Face.self_modulate = Color.hex(0x00fec164) + + +func _on_child_focus_entered() -> void: + focus_entered.emit() diff --git a/ui/dice_configurator/dice_configuration_face_preview.gd.uid b/ui/dice_configurator/dice_configuration_face_preview.gd.uid new file mode 100644 index 0000000..08a3c72 --- /dev/null +++ b/ui/dice_configurator/dice_configuration_face_preview.gd.uid @@ -0,0 +1 @@ +uid://dmh6116blc558 diff --git a/ui/dice_configurator/dice_configuration_face_preview.tscn b/ui/dice_configurator/dice_configuration_face_preview.tscn new file mode 100644 index 0000000..86f6dab --- /dev/null +++ b/ui/dice_configurator/dice_configuration_face_preview.tscn @@ -0,0 +1,43 @@ +[gd_scene load_steps=4 format=3 uid="uid://dff1mvgcacrxs"] + +[ext_resource type="Script" uid="uid://dmh6116blc558" path="res://ui/dice_configurator/dice_configuration_face_preview.gd" id="1_gt5fx"] +[ext_resource type="Texture2D" uid="uid://dlnccfl2nhsns" path="res://ui/assets/dice_configuration_face_preview.png" id="2_ic0ok"] +[ext_resource type="Texture2D" uid="uid://bpndubw65vuyv" path="res://ui/assets/dice_configuration_face_preview_front.png" id="3_nyrct"] + +[node name="DiceConfigurationFacePreview" type="HBoxContainer"] +offset_right = 143.0 +offset_bottom = 30.0 +script = ExtResource("1_gt5fx") +value = 1 + +[node name="AspectRatioContainer" type="AspectRatioContainer" parent="."] +layout_mode = 2 +size_flags_horizontal = 10 +focus_mode = 2 + +[node name="Dice" type="TextureRect" parent="AspectRatioContainer"] +layout_mode = 2 +texture = ExtResource("2_ic0ok") +stretch_mode = 5 + +[node name="Face" type="TextureRect" parent="AspectRatioContainer"] +unique_name_in_owner = true +self_modulate = Color(0, 0.996078, 0.756863, 0.392157) +layout_mode = 2 +texture = ExtResource("3_nyrct") +stretch_mode = 5 + +[node name="Type" type="TextureButton" parent="."] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 10 +stretch_mode = 5 + +[node name="Value" type="Label" parent="."] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 2 +focus_mode = 2 +text = "1" + +[connection signal="focus_entered" from="Type" to="." method="_on_child_focus_entered"] diff --git a/ui/dice_configurator/dice_configurator.gd b/ui/dice_configurator/dice_configurator.gd new file mode 100644 index 0000000..c347dd7 --- /dev/null +++ b/ui/dice_configurator/dice_configurator.gd @@ -0,0 +1,62 @@ +extends Control + + +@export var dice_configuration: DiceConfiguration + +var rotate_tween: Tween + + +func _ready() -> void: + %FaceFront.texture = DiceFace.get_face_type_icon(dice_configuration.front_face.type) + %FaceBack.texture = DiceFace.get_face_type_icon(dice_configuration.back_face.type) + %FaceLeft.texture = DiceFace.get_face_type_icon(dice_configuration.left_face.type) + %FaceRight.texture = DiceFace.get_face_type_icon(dice_configuration.right_face.type) + %FaceTop.texture = DiceFace.get_face_type_icon(dice_configuration.top_face.type) + %FaceBottom.texture = DiceFace.get_face_type_icon(dice_configuration.bottom_face.type) + + rotate_tween = get_tree().create_tween() + + %DiceConfigurationFacePreviewFront.grab_focus() + + +func set_face_active(face: Control) -> void: + for node in %DiceConfigurationPreview.get_children(): + node.active = false + + face.active = true + + +func rotate_dice(target: Vector3) -> void: + rotate_tween.stop() + rotate_tween = get_tree().create_tween() + rotate_tween.tween_property(%Dice, "rotation", target, 0.5) + + +func _on_dice_configuration_face_preview_front_focus_entered() -> void: + rotate_dice(Vector3.ZERO) + set_face_active(%DiceConfigurationFacePreviewFront) + + +func _on_dice_configuration_face_preview_back_focus_entered() -> void: + rotate_dice(Vector3(0, deg_to_rad(180), 0)) + set_face_active(%DiceConfigurationFacePreviewBack) + + +func _on_dice_configuration_face_preview_left_focus_entered() -> void: + rotate_dice(Vector3(0, deg_to_rad(90), 0)) + set_face_active(%DiceConfigurationFacePreviewLeft) + + +func _on_dice_configuration_face_preview_right_focus_entered() -> void: + rotate_dice(Vector3(0, deg_to_rad(-90), 0)) + set_face_active(%DiceConfigurationFacePreviewRight) + + +func _on_dice_configuration_face_preview_top_focus_entered() -> void: + rotate_dice(Vector3(deg_to_rad(90), 0, 0)) + set_face_active(%DiceConfigurationFacePreviewTop) + + +func _on_dice_configuration_face_preview_bottom_focus_entered() -> void: + rotate_dice(Vector3(deg_to_rad(-90), 0, 0)) + set_face_active(%DiceConfigurationFacePreviewBottom) diff --git a/ui/dice_configurator/dice_configurator.gd.uid b/ui/dice_configurator/dice_configurator.gd.uid new file mode 100644 index 0000000..ff61cd9 --- /dev/null +++ b/ui/dice_configurator/dice_configurator.gd.uid @@ -0,0 +1 @@ +uid://bqsugmudjex17 diff --git a/ui/dice_configurator/dice_configurator.tscn b/ui/dice_configurator/dice_configurator.tscn new file mode 100644 index 0000000..fc102ed --- /dev/null +++ b/ui/dice_configurator/dice_configurator.tscn @@ -0,0 +1,168 @@ +[gd_scene load_steps=9 format=3 uid="uid://c37w1i0h4qau"] + +[ext_resource type="Script" uid="uid://bqsugmudjex17" path="res://ui/dice_configurator/dice_configurator.gd" id="1_8dqw1"] +[ext_resource type="Texture2D" uid="uid://c4aqalwcd7y14" path="res://ui/assets/face_type_move.png" id="2_dc0wu"] +[ext_resource type="PackedScene" uid="uid://dff1mvgcacrxs" path="res://ui/dice_configurator/dice_configuration_face_preview.tscn" id="2_ga5up"] +[ext_resource type="Resource" uid="uid://c5up64wq06lx1" path="res://dice_configuration.tres" id="2_yfcgx"] + +[sub_resource type="BoxMesh" id="BoxMesh_8dqw1"] + +[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ga5up"] +sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) +ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) + +[sub_resource type="Sky" id="Sky_ij08j"] +sky_material = SubResource("ProceduralSkyMaterial_ga5up") + +[sub_resource type="Environment" id="Environment_dc0wu"] +background_mode = 2 +sky = SubResource("Sky_ij08j") +tonemap_mode = 2 + +[node name="DiceConfigurator" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_8dqw1") +dice_configuration = ExtResource("2_yfcgx") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="DiceConfigurationPreview" type="GridContainer" parent="VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +columns = 3 + +[node name="DiceConfigurationFacePreviewFront" parent="VBoxContainer/DiceConfigurationPreview" instance=ExtResource("2_ga5up")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 2 + +[node name="DiceConfigurationFacePreviewLeft" parent="VBoxContainer/DiceConfigurationPreview" instance=ExtResource("2_ga5up")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 2 +face = 2 +type = 2 + +[node name="DiceConfigurationFacePreviewTop" parent="VBoxContainer/DiceConfigurationPreview" instance=ExtResource("2_ga5up")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 2 +face = 4 +type = 4 + +[node name="DiceConfigurationFacePreviewBack" parent="VBoxContainer/DiceConfigurationPreview" instance=ExtResource("2_ga5up")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 2 +face = 1 +type = 1 + +[node name="DiceConfigurationFacePreviewRight" parent="VBoxContainer/DiceConfigurationPreview" instance=ExtResource("2_ga5up")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 2 +face = 3 +type = 3 + +[node name="DiceConfigurationFacePreviewBottom" parent="VBoxContainer/DiceConfigurationPreview" instance=ExtResource("2_ga5up")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 2 +face = 5 +type = 4 + +[node name="SubViewportContainer" type="SubViewportContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +stretch = true + +[node name="SubViewport" type="SubViewport" parent="VBoxContainer/SubViewportContainer"] +transparent_bg = true +handle_input_locally = false +size = Vector2i(480, 248) +render_target_update_mode = 4 + +[node name="Dice" type="Node3D" parent="VBoxContainer/SubViewportContainer/SubViewport"] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice"] +mesh = SubResource("BoxMesh_8dqw1") + +[node name="Faces" type="Node3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice"] + +[node name="FaceFront" type="Sprite3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice/Faces"] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.51) +texture_filter = 0 +texture = ExtResource("2_dc0wu") + +[node name="FaceBack" type="Sprite3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice/Faces"] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.51) +texture_filter = 0 +texture = ExtResource("2_dc0wu") + +[node name="FaceLeft" type="Sprite3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice/Faces"] +unique_name_in_owner = true +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.51, 0, 0) +texture_filter = 0 +texture = ExtResource("2_dc0wu") + +[node name="FaceRight" type="Sprite3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice/Faces"] +unique_name_in_owner = true +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.51, 0, 0) +texture_filter = 0 +texture = ExtResource("2_dc0wu") + +[node name="FaceTop" type="Sprite3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice/Faces"] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.51, 0) +texture_filter = 0 +texture = ExtResource("2_dc0wu") + +[node name="FaceBottom" type="Sprite3D" parent="VBoxContainer/SubViewportContainer/SubViewport/Dice/Faces"] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.51, 0) +texture_filter = 0 +texture = ExtResource("2_dc0wu") + +[node name="Camera3D" type="Camera3D" parent="VBoxContainer/SubViewportContainer/SubViewport"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.75) + +[node name="WorldEnvironment" type="WorldEnvironment" parent="VBoxContainer/SubViewportContainer/SubViewport"] +environment = SubResource("Environment_dc0wu") + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="VBoxContainer/SubViewportContainer/SubViewport"] +transform = Transform3D(1, 0, 0, 0, 0.173648, 0.984808, 0, -0.984808, 0.173648, 0, 25, 16.062) +shadow_enabled = true + +[connection signal="focus_entered" from="VBoxContainer/DiceConfigurationPreview/DiceConfigurationFacePreviewFront" to="." method="_on_dice_configuration_face_preview_front_focus_entered"] +[connection signal="focus_entered" from="VBoxContainer/DiceConfigurationPreview/DiceConfigurationFacePreviewLeft" to="." method="_on_dice_configuration_face_preview_left_focus_entered"] +[connection signal="focus_entered" from="VBoxContainer/DiceConfigurationPreview/DiceConfigurationFacePreviewTop" to="." method="_on_dice_configuration_face_preview_top_focus_entered"] +[connection signal="focus_entered" from="VBoxContainer/DiceConfigurationPreview/DiceConfigurationFacePreviewBack" to="." method="_on_dice_configuration_face_preview_back_focus_entered"] +[connection signal="focus_entered" from="VBoxContainer/DiceConfigurationPreview/DiceConfigurationFacePreviewRight" to="." method="_on_dice_configuration_face_preview_right_focus_entered"] +[connection signal="focus_entered" from="VBoxContainer/DiceConfigurationPreview/DiceConfigurationFacePreviewBottom" to="." method="_on_dice_configuration_face_preview_bottom_focus_entered"] diff --git a/ui/theme.tres b/ui/theme.tres new file mode 100644 index 0000000..22cccd6 --- /dev/null +++ b/ui/theme.tres @@ -0,0 +1,5 @@ +[gd_resource type="Theme" format=3 uid="uid://yjmw88mel6d3"] + +[resource] +Button/font_sizes/font_size = 16 +Label/font_sizes/font_size = 8 |