Added tool slot selection, some progress on the BuildSystem.
parent
f555eceffc
commit
10d44a8f7b
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -2,7 +2,7 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cx3x4l20q17xh"
|
||||
uid="uid://d4cjmc3svg7ie"
|
||||
path="res://.godot/imported/fence_fortified.png-1ae65c603e478020bc26d4e987d66517.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
|
|
@ -3,6 +3,3 @@
|
|||
[ext_resource type="PackedScene" uid="uid://cg5cy35mk8nba" path="res://assets/3rdparty/kenney/survival-kit/Models/fence-fortified.glb" id="1_bm7wh"]
|
||||
|
||||
[node name="fence-fortified" instance=ExtResource("1_bm7wh")]
|
||||
|
||||
[node name="fence-fortified" parent="." index="0"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.222241)
|
||||
|
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -3,15 +3,15 @@
|
|||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cwplac1y0x13c"
|
||||
path="res://.godot/imported/floor.png-7ce8f44de2a77036c73a390ab70d03ae.ctex"
|
||||
path="res://.godot/imported/floor.png-b9879e04f7313063744ab2deb5053a27.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/3rdparty/kenney/survival-kit/Previews/floor.png"
|
||||
dest_files=["res://.godot/imported/floor.png-7ce8f44de2a77036c73a390ab70d03ae.ctex"]
|
||||
source_file="res://assets/resources/floor.png"
|
||||
dest_files=["res://.godot/imported/floor.png-b9879e04f7313063744ab2deb5053a27.ctex"]
|
||||
|
||||
[params]
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bfn60u0e11o8u"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://putll6r03s1i" path="res://assets/3rdparty/kenney/survival-kit/Models/floor.glb" id="1_i3lij"]
|
||||
|
||||
[node name="floor2" instance=ExtResource("1_i3lij")]
|
|
@ -1,12 +1,12 @@
|
|||
[gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://c714vj3s6cnqg"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cx3x4l20q17xh" path="res://assets/resources/fence_fortified.png" id="1_hyv8l"]
|
||||
[ext_resource type="Texture2D" uid="uid://d4cjmc3svg7ie" path="res://assets/resources/fence_fortified.png" id="1_hyv8l"]
|
||||
[ext_resource type="Script" path="res://model/item.gd" id="1_u43c0"]
|
||||
[ext_resource type="PackedScene" uid="uid://dv60qx8nqw3vg" path="res://assets/resources/fence_fortified.tscn" id="2_8ttdv"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_u43c0")
|
||||
name = ""
|
||||
name = "Fence Fortified"
|
||||
scene = ExtResource("2_8ttdv")
|
||||
icon = ExtResource("1_hyv8l")
|
||||
max_stack_size = 64
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
[gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://cepy03xrewibs"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cwplac1y0x13c" path="res://assets/resources/floor.png" id="1_fe6dh"]
|
||||
[ext_resource type="Script" path="res://model/item.gd" id="1_piayo"]
|
||||
[ext_resource type="PackedScene" uid="uid://bfn60u0e11o8u" path="res://assets/resources/floor.tscn" id="2_1360y"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_piayo")
|
||||
name = "Floor"
|
||||
scene = ExtResource("2_1360y")
|
||||
icon = ExtResource("1_fe6dh")
|
||||
max_stack_size = 64
|
|
@ -0,0 +1,11 @@
|
|||
[gd_resource type="Resource" script_class="Recipe" load_steps=4 format=3 uid="uid://dbij72n3ia8te"]
|
||||
|
||||
[ext_resource type="Script" path="res://model/recipe.gd" id="1_sqajm"]
|
||||
[ext_resource type="Resource" uid="uid://dmjr6pmb17l2y" path="res://data/items/woodplanks.tres" id="1_y7d3a"]
|
||||
[ext_resource type="Resource" uid="uid://cepy03xrewibs" path="res://data/items/floor.tres" id="2_m3y1r"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_sqajm")
|
||||
name = "Floor"
|
||||
ingredients = Array[Resource("res://model/item.gd")]([ExtResource("1_y7d3a"), ExtResource("1_y7d3a")])
|
||||
results = Array[Resource("res://model/item.gd")]([ExtResource("2_m3y1r")])
|
17
game_ui.gd
17
game_ui.gd
|
@ -42,6 +42,23 @@ func activate_game_scene(game_scene:Node3D) -> void:
|
|||
|
||||
game_menu_ui.hide()
|
||||
|
||||
func _process(_delta):
|
||||
if _player == null:
|
||||
# TODO: make sure game ui is deactivated when no game running
|
||||
return
|
||||
|
||||
assert(_player != null and tool_container.get_child_count() >= _player.selected_tool_slot_index)
|
||||
|
||||
for i in range(tool_container.get_child_count()):
|
||||
var item_slot:ItemSlot = tool_container.get_child(i) as ItemSlot
|
||||
|
||||
assert(item_slot != null)
|
||||
|
||||
if i == _player.selected_tool_slot_index:
|
||||
item_slot.highlighted = true
|
||||
else:
|
||||
item_slot.highlighted = false
|
||||
|
||||
|
||||
func _on_message_timer_timeout():
|
||||
%MessagesContainer.visible = false
|
||||
|
|
16
inventory.gd
16
inventory.gd
|
@ -2,10 +2,18 @@ class_name Inventory
|
|||
|
||||
var _content:Array[ItemStack] = []
|
||||
const INVENTORY_SIZE:int = 36
|
||||
const INVENTORY_TOOL_START:int = 36 - 9
|
||||
|
||||
func _init() -> void:
|
||||
clear()
|
||||
|
||||
func get_free_tool_stack_index() -> int:
|
||||
for i:int in range(INVENTORY_TOOL_START, _content.size()):
|
||||
if _content[i].count == 0:
|
||||
return i
|
||||
|
||||
return -1
|
||||
|
||||
func get_free_item_stack_index() -> int:
|
||||
for i:int in range(_content.size()):
|
||||
if _content[i].count == 0:
|
||||
|
@ -25,7 +33,13 @@ func add_item(item:Item) -> bool:
|
|||
item_stack.count = item_stack.count + 1
|
||||
return true
|
||||
|
||||
var item_stack_index:int = get_free_item_stack_index()
|
||||
# First try to put it into the tool stacks...
|
||||
var item_stack_index:int = get_free_tool_stack_index()
|
||||
|
||||
# ... and if that failed try use the regular inventory.
|
||||
if item_stack_index < 0:
|
||||
item_stack_index = get_free_item_stack_index()
|
||||
|
||||
if item_stack_index >= 0:
|
||||
_content[item_stack_index].item = item
|
||||
_content[item_stack_index].count = 1
|
||||
|
|
|
@ -12,6 +12,7 @@ const JUMP_VELOCITY = 2.5
|
|||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
var inventory:Inventory = Inventory.new()
|
||||
var selected_tool_slot_index:int = 0
|
||||
|
||||
var look_direction:Vector3 = Vector3.BACK
|
||||
var look_direction_damper:SpringDamper = SpringDamper.new(Vector3.ZERO)
|
||||
|
@ -68,6 +69,30 @@ func on_item_picked_up(item:Item):
|
|||
func get_actionable_global_transform() -> Vector3:
|
||||
return build_location.global_position
|
||||
|
||||
|
||||
func _handle_tool_slot_input_events(_event:InputEvent) -> bool:
|
||||
var key_event:InputEventKey = _event as InputEventKey
|
||||
|
||||
if key_event and key_event.is_released():
|
||||
if key_event.keycode >= KEY_1 and key_event.keycode <= KEY_9:
|
||||
selected_tool_slot_index = key_event.keycode - KEY_1
|
||||
get_viewport().set_input_as_handled()
|
||||
return true
|
||||
|
||||
if _event.is_action_released("item_next"):
|
||||
selected_tool_slot_index = (selected_tool_slot_index + 1) % (inventory.get_tool_item_stacks().size())
|
||||
get_viewport().set_input_as_handled()
|
||||
return true
|
||||
|
||||
if _event.is_action_released("item_prev"):
|
||||
var tool_slot_size = inventory.get_tool_item_stacks().size()
|
||||
selected_tool_slot_index = (selected_tool_slot_index + tool_slot_size - 1) % (tool_slot_size)
|
||||
get_viewport().set_input_as_handled()
|
||||
return true
|
||||
|
||||
return false
|
||||
|
||||
|
||||
func _unhandled_input(_event: InputEvent) -> void:
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
var actionables = actionable_detector.get_overlapping_areas()
|
||||
|
@ -83,4 +108,6 @@ func _unhandled_input(_event: InputEvent) -> void:
|
|||
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
|
||||
|
||||
if _handle_tool_slot_input_events(_event):
|
||||
return
|
||||
|
|
|
@ -48,8 +48,3 @@ shape = SubResource("SphereShape3D_wrkyq")
|
|||
[node name="BuildLocation" type="Node3D" parent="Geometry"]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(2.5, 0, 0, 0, 2.5, 0, 0, 0, 2.5, 0, 0, 2.4682)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 0.639707, 0.768619, 0, -0.768619, 0.639707, 0, 2.23862, 1.4653)
|
||||
current = true
|
||||
|
|
|
@ -31,6 +31,10 @@ project/assembly_name="UIAndInteractionTests"
|
|||
|
||||
enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg")
|
||||
|
||||
[gui]
|
||||
|
||||
theme/custom="res://ui/ui_theme.tres"
|
||||
|
||||
[input]
|
||||
|
||||
ui_accept={
|
||||
|
@ -123,9 +127,36 @@ toggle_inventory={
|
|||
}
|
||||
interaction={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
|
||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
|
||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":108,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
toggle_build_mode={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
rotate_clockwise={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":99,"echo":false,"script":null)
|
||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":5,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
rotate_counter_clockwise={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":101,"echo":false,"script":null)
|
||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":4,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
item_next={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":5,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
item_prev={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":4,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -135,4 +166,5 @@ locale/translations_pot_files=PackedStringArray("res://dialogue/bridge_builder_m
|
|||
|
||||
[layer_names]
|
||||
|
||||
3d_physics/layer_1="World"
|
||||
3d_physics/layer_5="Actionables"
|
||||
|
|
233
root_ui.tscn
233
root_ui.tscn
|
@ -1,15 +1,199 @@
|
|||
[gd_scene load_steps=11 format=3 uid="uid://c73t0nbuqp68e"]
|
||||
[gd_scene load_steps=33 format=3 uid="uid://c73t0nbuqp68e"]
|
||||
|
||||
[ext_resource type="Script" path="res://root_ui.gd" id="1_7fnkg"]
|
||||
[ext_resource type="PackedScene" uid="uid://bo788o53t4rbq" path="res://scenes/startup_scene.tscn" id="2_1untt"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqie4cy0uy1t0" path="res://scenes/game.tscn" id="3_w1gpn"]
|
||||
[ext_resource type="Theme" uid="uid://dmk7hc81l8gbw" path="res://ui/ui_theme.tres" id="4_el4q2"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnwqllx51sdg2" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/buttonLong_grey.png" id="4_3iys8"]
|
||||
[ext_resource type="Script" path="res://game_ui.gd" id="5_jkbjp"]
|
||||
[ext_resource type="StyleBox" uid="uid://bh2a2lhk5hwi1" path="res://ui/ui_theme_panel_style.tres" id="5_o771r"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4quo8qstm60p" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/panelInset_blue.png" id="6_tso5a"]
|
||||
[ext_resource type="Script" path="res://ui/inventory_dialog.gd" id="6_y58iw"]
|
||||
[ext_resource type="FontFile" uid="uid://cjxqdamvrjlij" path="res://assets/fonts/upheaval/upheavtt.ttf" id="7_mj4qa"]
|
||||
[ext_resource type="PackedScene" uid="uid://dp3fi0g53qrt2" path="res://ui/item_slot.tscn" id="7_pv315"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwui4acukq4x6" path="res://ui/ItemGrid.tscn" id="8_anyub"]
|
||||
[ext_resource type="Script" path="res://ui/game_menu_ui.gd" id="9_g2mav"]
|
||||
[ext_resource type="Script" path="res://ui/item_grid.gd" id="10_5ufsm"]
|
||||
[ext_resource type="Texture2D" uid="uid://57o4ow08ky5q" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/buttonSquare_blue_pressed.png" id="10_rpger"]
|
||||
[ext_resource type="Texture2D" uid="uid://beaqo323661rh" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/panel_blue.png" id="11_jrvnp"]
|
||||
[ext_resource type="Texture2D" uid="uid://bi6q381bmdonq" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/buttonSquare_grey.png" id="12_033wf"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1ume3"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.3)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rm8a3"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(1, 1, 1, 0.75)
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_right = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_a84rd"]
|
||||
texture = ExtResource("4_3iys8")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
modulate_color = Color(0.621524, 0.621524, 0.621524, 1)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_votra"]
|
||||
texture = ExtResource("4_3iys8")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 2
|
||||
axis_stretch_vertical = 2
|
||||
modulate_color = Color(0.509286, 0.509286, 0.509286, 1)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_bpyb5"]
|
||||
texture = ExtResource("4_3iys8")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 2
|
||||
axis_stretch_vertical = 2
|
||||
modulate_color = Color(0.408329, 0.408329, 0.408329, 1)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_72pk6"]
|
||||
texture = ExtResource("6_tso5a")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 2
|
||||
axis_stretch_vertical = 1
|
||||
modulate_color = Color(0.821789, 0.821789, 0.821789, 1)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_kl7i7"]
|
||||
texture = ExtResource("6_tso5a")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 2
|
||||
axis_stretch_vertical = 2
|
||||
modulate_color = Color(0.821789, 0.821789, 0.821789, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_supoq"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_72rto"]
|
||||
texture = ExtResource("10_rpger")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 1
|
||||
axis_stretch_vertical = 1
|
||||
modulate_color = Color(1, 0.0666667, 0.156863, 1)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_th1h8"]
|
||||
texture = ExtResource("12_033wf")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 1
|
||||
axis_stretch_vertical = 1
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_47eau"]
|
||||
texture = ExtResource("10_rpger")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 2
|
||||
axis_stretch_vertical = 2
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_lnfi0"]
|
||||
texture = ExtResource("11_jrvnp")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xw22e"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tyjme"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_22g74"]
|
||||
texture = ExtResource("6_tso5a")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
axis_stretch_horizontal = 2
|
||||
axis_stretch_vertical = 2
|
||||
modulate_color = Color(0.760784, 0.760784, 0.760784, 1)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_4dhdu"]
|
||||
default_font = ExtResource("7_mj4qa")
|
||||
default_font_size = 24
|
||||
Button/colors/font_color = Color(0.875, 0.875, 0.875, 1)
|
||||
Button/colors/font_disabled_color = Color(0.875, 0.875, 0.875, 0.5)
|
||||
Button/colors/font_focus_color = Color(0.95, 0.95, 0.95, 1)
|
||||
Button/colors/font_hover_color = Color(0.95, 0.95, 0.95, 1)
|
||||
Button/colors/font_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_outline_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_disabled_color = Color(1, 1, 1, 0.4)
|
||||
Button/colors/icon_focus_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_hover_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_normal_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/constants/h_separation = 4
|
||||
Button/constants/icon_max_width = 0
|
||||
Button/constants/outline_size = 0
|
||||
Button/styles/disabled = SubResource("StyleBoxFlat_1ume3")
|
||||
Button/styles/focus = SubResource("StyleBoxFlat_rm8a3")
|
||||
Button/styles/hover = SubResource("StyleBoxTexture_a84rd")
|
||||
Button/styles/normal = SubResource("StyleBoxTexture_votra")
|
||||
Button/styles/panel = ExtResource("5_o771r")
|
||||
Button/styles/pressed = SubResource("StyleBoxTexture_bpyb5")
|
||||
Control/styles/normal = SubResource("StyleBoxTexture_72pk6")
|
||||
ItemList/styles/normal = SubResource("StyleBoxTexture_kl7i7")
|
||||
Label/colors/font_color = Color(1, 1, 1, 1)
|
||||
Label/colors/font_outline_color = Color(1, 1, 1, 1)
|
||||
Label/colors/font_shadow_color = Color(0.223103, 0.223103, 0.223103, 0.843137)
|
||||
Label/constants/line_spacing = 3
|
||||
Label/constants/outline_size = 0
|
||||
Label/constants/shadow_offset_x = 1
|
||||
Label/constants/shadow_offset_y = 1
|
||||
Label/constants/shadow_outline_size = 1
|
||||
Label/fonts/font = ExtResource("7_mj4qa")
|
||||
Label/styles/normal = SubResource("StyleBoxEmpty_supoq")
|
||||
Label/styles/panel = SubResource("StyleBoxTexture_72rto")
|
||||
MarginContainer/styles/normal = SubResource("StyleBoxTexture_th1h8")
|
||||
Panel/styles/highlighted = SubResource("StyleBoxTexture_72rto")
|
||||
Panel/styles/normal = SubResource("StyleBoxTexture_47eau")
|
||||
Panel/styles/panel = SubResource("StyleBoxTexture_lnfi0")
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxEmpty_xw22e")
|
||||
RedButton/styles/panel = SubResource("StyleBoxFlat_tyjme")
|
||||
Tree/styles/panel = SubResource("StyleBoxTexture_22g74")
|
||||
|
||||
[node name="RootUI" type="CanvasLayer"]
|
||||
unique_name_in_owner = true
|
||||
|
@ -17,8 +201,9 @@ script = ExtResource("1_7fnkg")
|
|||
startup_scene = ExtResource("2_1untt")
|
||||
game_scene = ExtResource("3_w1gpn")
|
||||
|
||||
[node name="MainMenuUI" type="PanelContainer" parent="."]
|
||||
[node name="MainMenuUI" type="Panel" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
|
@ -30,10 +215,14 @@ offset_right = 199.0
|
|||
offset_bottom = 134.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("4_el4q2")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MainMenuUI"]
|
||||
layout_mode = 2
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 60
|
||||
theme_override_constants/margin_top = 60
|
||||
theme_override_constants/margin_right = 60
|
||||
|
@ -87,7 +276,7 @@ theme_override_constants/margin_bottom = 8
|
|||
layout_mode = 2
|
||||
text = "Quit"
|
||||
|
||||
[node name="NewGameUI" type="PanelContainer" parent="."]
|
||||
[node name="NewGameUI" type="Panel" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
anchors_preset = 8
|
||||
|
@ -101,10 +290,14 @@ offset_right = 291.0
|
|||
offset_bottom = 144.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("4_el4q2")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="NewGameUI"]
|
||||
layout_mode = 2
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 60
|
||||
theme_override_constants/margin_top = 60
|
||||
theme_override_constants/margin_right = 60
|
||||
|
@ -176,7 +369,6 @@ text = "Start
|
|||
|
||||
[node name="GameUI" type="Control" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
@ -186,7 +378,6 @@ grow_vertical = 2
|
|||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
mouse_filter = 1
|
||||
theme = ExtResource("4_el4q2")
|
||||
script = ExtResource("5_jkbjp")
|
||||
|
||||
[node name="MessagesContainer" type="MarginContainer" parent="GameUI"]
|
||||
|
@ -278,7 +469,7 @@ text = "Recipes"
|
|||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme = ExtResource("4_el4q2")
|
||||
theme = SubResource("Theme_4dhdu")
|
||||
item_count = 2
|
||||
item_0/text = "Blab"
|
||||
item_1/text = "Bloobalb"
|
||||
|
@ -384,7 +575,7 @@ layout_mode = 2
|
|||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="GameMenuUI" type="PanelContainer" parent="GameUI"]
|
||||
[node name="GameMenuUI" type="Panel" parent="GameUI"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
@ -399,11 +590,16 @@ offset_right = 199.0
|
|||
offset_bottom = 215.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("4_el4q2")
|
||||
theme = SubResource("Theme_4dhdu")
|
||||
script = ExtResource("9_g2mav")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="GameUI/GameMenuUI"]
|
||||
layout_mode = 2
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 60
|
||||
theme_override_constants/margin_top = 60
|
||||
theme_override_constants/margin_right = 60
|
||||
|
@ -497,6 +693,15 @@ columns = 9
|
|||
script = ExtResource("10_5ufsm")
|
||||
slot_scene = ExtResource("7_pv315")
|
||||
|
||||
[node name="ItemSlot" parent="GameUI/ToolSlots/PanelContainer/ToolContainer" instance=ExtResource("7_pv315")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot2" parent="GameUI/ToolSlots/PanelContainer/ToolContainer" instance=ExtResource("7_pv315")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot3" parent="GameUI/ToolSlots/PanelContainer/ToolContainer" instance=ExtResource("7_pv315")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Scene" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
extends Node3D
|
||||
|
||||
@onready var camera = %Camera
|
||||
@onready var player = %Player
|
||||
|
||||
@onready var build_system = %BuildSystem
|
||||
|
||||
var _player_camera_offset:Vector3 = Vector3.ZERO
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
_player_camera_offset = camera.global_position - player.global_position + Vector3.UP * 1
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
if build_system.is_active:
|
||||
player.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
else:
|
||||
player.process_mode = Node.PROCESS_MODE_ALWAYS
|
||||
|
||||
camera.global_position = player.global_position + _player_camera_offset
|
||||
camera.look_at(player.global_position)
|
|
@ -1,10 +1,11 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://cqie4cy0uy1t0"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://cqie4cy0uy1t0"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/game.gd" id="1_kl6si"]
|
||||
[ext_resource type="PackedScene" uid="uid://ch0s3dxx3rpir" path="res://objects/player.tscn" id="2_rjgxk"]
|
||||
[ext_resource type="Script" path="res://systems/QuestSystem.gd" id="4_8oxap"]
|
||||
[ext_resource type="Script" path="res://systems/BuildSystem.gd" id="4_iqdys"]
|
||||
[ext_resource type="Resource" uid="uid://c714vj3s6cnqg" path="res://data/items/fence_fortified.tres" id="5_ii2f8"]
|
||||
[ext_resource type="PackedScene" uid="uid://dmagdl5pi6jdj" path="res://world/level.tscn" id="6_svjo8"]
|
||||
[ext_resource type="Resource" uid="uid://cepy03xrewibs" path="res://data/items/floor.tres" id="6_xdkny"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_y65pc"]
|
||||
|
||||
|
@ -18,6 +19,7 @@ ambient_light_source = 3
|
|||
ambient_light_color = Color(0.662452, 0.662452, 0.662452, 1)
|
||||
|
||||
[node name="Game" type="Node3D"]
|
||||
script = ExtResource("1_kl6si")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_v85yo")
|
||||
|
@ -31,17 +33,20 @@ shadow_enabled = true
|
|||
[node name="Player" parent="." instance=ExtResource("2_rjgxk")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Camera" type="Camera3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 0.662829, 0.748771, 0, -0.748771, 0.662829, 0, 2.12698, 2.04901)
|
||||
|
||||
[node name="QuestSystem" type="Node" parent="."]
|
||||
script = ExtResource("4_8oxap")
|
||||
|
||||
[node name="BuildSystem" type="Node" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("4_iqdys")
|
||||
build_item = ExtResource("5_ii2f8")
|
||||
build_item = ExtResource("6_xdkny")
|
||||
|
||||
[node name="BuildPreview" type="Node3D" parent="BuildSystem"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="BuiltStructures" type="Node" parent="BuildSystem"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[editable path="Player"]
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
class_name BuildSystem
|
||||
extends Node
|
||||
|
||||
const CAMERA_SPEED = 4.0
|
||||
|
||||
@onready var build_preview = %BuildPreview
|
||||
@onready var player = %Player
|
||||
@onready var built_structures = %BuiltStructures
|
||||
|
||||
@onready var camera:Camera3D = %Camera
|
||||
|
||||
@export var build_item:Item = null
|
||||
|
||||
var camera_velocity:Vector3 = Vector3.ZERO
|
||||
var is_active:bool = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
@ -21,13 +28,46 @@ func update_build_preview_item() -> void:
|
|||
if build_preview.get_child_count() == 0 and build_item != null:
|
||||
build_preview.add_child(build_item.scene.instantiate())
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
||||
func move_build_camera(delta):
|
||||
var input_dir = Input.get_vector("walk_left", "walk_right", "walk_forward", "walk_back")
|
||||
var direction = (camera.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
|
||||
if direction:
|
||||
camera_velocity.x = direction.x * CAMERA_SPEED
|
||||
camera_velocity.z = direction.z * CAMERA_SPEED
|
||||
else:
|
||||
camera_velocity.x = move_toward(camera_velocity.x, 0, CAMERA_SPEED)
|
||||
camera_velocity.z = move_toward(camera_velocity.z, 0, CAMERA_SPEED)
|
||||
|
||||
camera_velocity.y = 0
|
||||
|
||||
camera.global_position = camera.global_position + camera_velocity * delta
|
||||
|
||||
|
||||
func update_build_preview():
|
||||
var mouse_view_coords = get_viewport().get_mouse_position() # / get_viewport().get_visible_rect().size
|
||||
var mouse_ray_origin = camera.project_ray_origin(mouse_view_coords)
|
||||
var mouse_ray_normal = camera.project_ray_normal(mouse_view_coords)
|
||||
|
||||
var world_space_state = camera.get_world_3d().direct_space_state
|
||||
var ray_query:PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.create(mouse_ray_origin, mouse_ray_origin + mouse_ray_normal * 100)
|
||||
var ray_result:Dictionary = world_space_state.intersect_ray(ray_query)
|
||||
|
||||
if not ray_result.is_empty() and Vector3.UP.dot(ray_result["normal"]) > 0.9:
|
||||
var build_location:Vector3 = ray_result["position"]
|
||||
build_location = Vector3(roundf(build_location.x * 4), build_location.y, roundf(build_location.z * 4)) * 0.25
|
||||
build_preview.global_position = build_location
|
||||
|
||||
|
||||
func _physics_process(_delta):
|
||||
if not is_active:
|
||||
return
|
||||
|
||||
update_build_preview_item()
|
||||
|
||||
var build_location:Vector3 = player.get_actionable_global_transform()
|
||||
build_location = Vector3(roundf(build_location.x * 2), build_location.y, roundf(build_location.z * 2)) * 0.5
|
||||
build_preview.global_position = build_location
|
||||
#move_build_camera(delta)
|
||||
|
||||
update_build_preview()
|
||||
|
||||
if build_item != null and Input.is_action_just_pressed("interaction"):
|
||||
var new_structure:Node3D = build_item.scene.instantiate()
|
||||
|
@ -35,3 +75,21 @@ func _physics_process(_delta):
|
|||
built_structures.add_child(new_structure)
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
|
||||
|
||||
func _unhandled_input(_event: InputEvent) -> void:
|
||||
if Input.is_action_just_pressed("toggle_build_mode"):
|
||||
is_active = not is_active
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
|
||||
if not is_active:
|
||||
build_preview.hide()
|
||||
return
|
||||
|
||||
build_preview.show()
|
||||
|
||||
if Input.is_action_just_pressed("rotate_clockwise"):
|
||||
build_preview.global_basis = build_preview.basis.rotated(Vector3.UP, deg_to_rad(45))
|
||||
if Input.is_action_just_pressed("rotate_counter_clockwise"):
|
||||
build_preview.global_basis = build_preview.basis.rotated(Vector3.UP, -deg_to_rad(45))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends PanelContainer
|
||||
extends Panel
|
||||
|
||||
func _unhandled_key_input(event:InputEvent):
|
||||
var key_event:InputEventKey = event as InputEventKey
|
||||
|
|
|
@ -16,7 +16,7 @@ func displayStacks(item_stacks:Array[ItemStack]):
|
|||
|
||||
if item_stack != null:
|
||||
slot.display(item_stack)
|
||||
|
||||
|
||||
var item_count = rows * columns
|
||||
|
||||
while get_child_count() < item_count:
|
||||
|
|
|
@ -1,17 +1,23 @@
|
|||
class_name ItemSlot
|
||||
extends PanelContainer
|
||||
extends Panel
|
||||
|
||||
enum {
|
||||
ALLOW_DRAG = 1,
|
||||
ALLOW_DROP = 2
|
||||
}
|
||||
|
||||
@onready var highlight_panel = %HighlightPanel
|
||||
@onready var texture_rect:TextureRect = %TextureRect
|
||||
@onready var count_label = %CountLabel
|
||||
|
||||
var drag_drop_flags:int = 0
|
||||
var _item_stack:ItemStack = null
|
||||
|
||||
var highlighted:bool = false : set = _set_highlighted
|
||||
|
||||
func _set_highlighted(new_state):
|
||||
highlight_panel.visible = new_state
|
||||
|
||||
func set_drag_drop_flags(flags:int) -> void:
|
||||
drag_drop_flags = flags
|
||||
|
||||
|
@ -22,6 +28,8 @@ func _process(_delta)->void:
|
|||
if _item_stack == null:
|
||||
return
|
||||
|
||||
theme_type_variation = "PanelHighlighted"
|
||||
|
||||
if _item_stack.count == 0:
|
||||
texture_rect.texture = null
|
||||
update_quantity_text(0)
|
||||
|
|
|
@ -1,18 +1,69 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dp3fi0g53qrt2"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dp3fi0g53qrt2"]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/item_slot.gd" id="1_7v5l8"]
|
||||
[ext_resource type="Texture2D" uid="uid://16ro4vt2obea" path="res://assets/resources/tree_log.png" id="2_v3rb5"]
|
||||
|
||||
[node name="ItemSlot" type="PanelContainer"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vadli"]
|
||||
bg_color = Color(0.6, 0.6, 0.6, 0)
|
||||
border_width_left = 4
|
||||
border_width_top = 4
|
||||
border_width_right = 4
|
||||
border_width_bottom = 4
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
expand_margin_left = 3.0
|
||||
expand_margin_top = 3.0
|
||||
expand_margin_right = 3.0
|
||||
expand_margin_bottom = 3.0
|
||||
anti_aliasing = false
|
||||
|
||||
[node name="ItemSlot" type="Panel"]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
script = ExtResource("1_7v5l8")
|
||||
|
||||
[node name="HighlightPanel" type="Panel" 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
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_vadli")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -32.0
|
||||
offset_top = -32.0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("2_v3rb5")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="CountLabel" type="Label" parent="."]
|
||||
[node name="CountLabel" type="Label" parent="TextureRect"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -10.0
|
||||
offset_top = -23.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 8
|
||||
text = "4"
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://viy2a4n6vl74"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bwui4acukq4x6" path="res://ui/ItemGrid.tscn" id="1_1xrix"]
|
||||
[ext_resource type="PackedScene" uid="uid://dp3fi0g53qrt2" path="res://ui/item_slot.tscn" id="2_gy0b5"]
|
||||
|
||||
[node name="ThemePreview" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Panel" type="PanelContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="ItemGrid" parent="Panel" instance=ExtResource("1_1xrix")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot2" parent="Panel/ItemGrid" instance=ExtResource("2_gy0b5")]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HighlightedPanel"
|
||||
|
||||
[node name="ItemSlot3" parent="Panel/ItemGrid" instance=ExtResource("2_gy0b5")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot4" parent="Panel/ItemGrid" instance=ExtResource("2_gy0b5")]
|
||||
layout_mode = 2
|
|
@ -1,10 +1,44 @@
|
|||
[gd_resource type="Theme" load_steps=14 format=3 uid="uid://dmk7hc81l8gbw"]
|
||||
[gd_resource type="Theme" load_steps=21 format=3 uid="uid://dmk7hc81l8gbw"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://cjxqdamvrjlij" path="res://assets/fonts/upheaval/upheavtt.ttf" id="1_7nu7u"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnwqllx51sdg2" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/buttonLong_grey.png" id="1_46x8x"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4quo8qstm60p" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/panelInset_blue.png" id="2_oiu0i"]
|
||||
[ext_resource type="Texture2D" uid="uid://beaqo323661rh" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/panel_blue.png" id="2_p2gq5"]
|
||||
[ext_resource type="StyleBox" uid="uid://bh2a2lhk5hwi1" path="res://ui/ui_theme_panel_style.tres" id="4_g0sjm"]
|
||||
[ext_resource type="Texture2D" uid="uid://devo76y2eb4k5" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/panel_beigeLight.png" id="5_h2fxn"]
|
||||
[ext_resource type="Texture2D" uid="uid://beaqo323661rh" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/panel_blue.png" id="8_caxsj"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1ume3"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.3)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rm8a3"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(1, 1, 1, 0.75)
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_right = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_a84rd"]
|
||||
texture = ExtResource("1_46x8x")
|
||||
|
@ -44,6 +78,21 @@ axis_stretch_horizontal = 2
|
|||
axis_stretch_vertical = 1
|
||||
modulate_color = Color(0.821789, 0.821789, 0.821789, 1)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_k8b76"]
|
||||
texture = ExtResource("8_caxsj")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
modulate_color = Color(1, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_1pdgo"]
|
||||
texture = ExtResource("5_h2fxn")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
texture_margin_bottom = 8.0
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_kl7i7"]
|
||||
texture = ExtResource("2_oiu0i")
|
||||
texture_margin_left = 8.0
|
||||
|
@ -56,8 +105,8 @@ modulate_color = Color(0.821789, 0.821789, 0.821789, 1)
|
|||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_supoq"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_47eau"]
|
||||
texture = ExtResource("2_p2gq5")
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_g78k6"]
|
||||
texture = ExtResource("8_caxsj")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
|
@ -65,6 +114,10 @@ texture_margin_bottom = 8.0
|
|||
axis_stretch_horizontal = 2
|
||||
axis_stretch_vertical = 2
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xw22e"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tyjme"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_22g74"]
|
||||
texture = ExtResource("2_oiu0i")
|
||||
texture_margin_left = 8.0
|
||||
|
@ -78,10 +131,32 @@ modulate_color = Color(0.760784, 0.760784, 0.760784, 1)
|
|||
[resource]
|
||||
default_font = ExtResource("1_7nu7u")
|
||||
default_font_size = 24
|
||||
Button/colors/font_color = Color(0.875, 0.875, 0.875, 1)
|
||||
Button/colors/font_disabled_color = Color(0.875, 0.875, 0.875, 0.5)
|
||||
Button/colors/font_focus_color = Color(0.95, 0.95, 0.95, 1)
|
||||
Button/colors/font_hover_color = Color(0.95, 0.95, 0.95, 1)
|
||||
Button/colors/font_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_outline_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_disabled_color = Color(1, 1, 1, 0.4)
|
||||
Button/colors/icon_focus_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_hover_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_normal_color = Color(1, 1, 1, 1)
|
||||
Button/colors/icon_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/constants/h_separation = 4
|
||||
Button/constants/icon_max_width = 0
|
||||
Button/constants/outline_size = 0
|
||||
Button/styles/disabled = SubResource("StyleBoxFlat_1ume3")
|
||||
Button/styles/focus = SubResource("StyleBoxFlat_rm8a3")
|
||||
Button/styles/hover = SubResource("StyleBoxTexture_a84rd")
|
||||
Button/styles/normal = SubResource("StyleBoxTexture_votra")
|
||||
Button/styles/panel = ExtResource("4_g0sjm")
|
||||
Button/styles/pressed = SubResource("StyleBoxTexture_bpyb5")
|
||||
Control/styles/normal = SubResource("StyleBoxTexture_72pk6")
|
||||
HighlightedPanel/base_type = &"Panel"
|
||||
HighlightedPanel/styles/normal = SubResource("StyleBoxTexture_k8b76")
|
||||
HighlightedPanel/styles/panel = SubResource("StyleBoxTexture_1pdgo")
|
||||
ItemList/styles/normal = SubResource("StyleBoxTexture_kl7i7")
|
||||
Label/colors/font_color = Color(1, 1, 1, 1)
|
||||
Label/colors/font_outline_color = Color(1, 1, 1, 1)
|
||||
|
@ -93,8 +168,11 @@ Label/constants/shadow_offset_y = 1
|
|||
Label/constants/shadow_outline_size = 1
|
||||
Label/fonts/font = ExtResource("1_7nu7u")
|
||||
Label/styles/normal = SubResource("StyleBoxEmpty_supoq")
|
||||
MarginContainer/styles/normal = ExtResource("4_g0sjm")
|
||||
Panel/styles/normal = SubResource("StyleBoxTexture_47eau")
|
||||
Panel/styles/panel = ExtResource("4_g0sjm")
|
||||
PanelContainer/styles/panel = ExtResource("4_g0sjm")
|
||||
Label/styles/panel = null
|
||||
MarginContainer/styles/normal = null
|
||||
Panel/styles/highlighted = null
|
||||
Panel/styles/normal = null
|
||||
Panel/styles/panel = SubResource("StyleBoxTexture_g78k6")
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxEmpty_xw22e")
|
||||
RedButton/styles/panel = SubResource("StyleBoxFlat_tyjme")
|
||||
Tree/styles/panel = SubResource("StyleBoxTexture_22g74")
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://bh2a2lhk5hwi1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://beaqo323661rh" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/panel_blue.png" id="1_2n7cr"]
|
||||
[ext_resource type="Texture2D" uid="uid://57o4ow08ky5q" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/buttonSquare_blue_pressed.png" id="1_2u4x2"]
|
||||
|
||||
[resource]
|
||||
texture = ExtResource("1_2n7cr")
|
||||
texture = ExtResource("1_2u4x2")
|
||||
texture_margin_left = 8.0
|
||||
texture_margin_top = 8.0
|
||||
texture_margin_right = 8.0
|
||||
|
|
|
@ -33,7 +33,6 @@ func calc(x, xt, h:float):
|
|||
|
||||
func calc_clamped_speed(x, xt, h:float, s_max:float):
|
||||
var x_old = x
|
||||
var v_old = v
|
||||
|
||||
var x_new = calc(x, xt, h)
|
||||
var vel_new = (x_new - x_old) / h
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue