EDIT diverse correction/ameliorations.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 520 B |
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
BIN
addons/kh_window/icon.png
Normal file
After Width: | Height: | Size: 246 B |
|
@ -14,7 +14,7 @@ export( Color ) var content_color = Color( 1.0, 1.0, 1.0, 1.0 )# test
|
||||||
export( Color ) var background_color = Color( 1.0, 1.0, 1.0, 1.0 )
|
export( Color ) var background_color = Color( 1.0, 1.0, 1.0, 1.0 )
|
||||||
export( Texture ) var background_texture = null
|
export( Texture ) var background_texture = null
|
||||||
|
|
||||||
export( Vector2 ) var min_size= Vector2( 128, 128 )
|
export( Vector2 ) var min_size = Vector2( 128, 128 )
|
||||||
export( Rect2 ) var content_margin = Rect2( 8, 8, 8, 8 )
|
export( Rect2 ) var content_margin = Rect2( 8, 8, 8, 8 )
|
||||||
|
|
||||||
signal window_clicked( window )
|
signal window_clicked( window )
|
||||||
|
@ -115,7 +115,6 @@ func _enter_tree():
|
||||||
background.patch_margin_bottom = 4
|
background.patch_margin_bottom = 4
|
||||||
|
|
||||||
background.self_modulate = background_color
|
background.self_modulate = background_color
|
||||||
|
|
||||||
self.add_window_part( background )
|
self.add_window_part( background )
|
||||||
# background.set_owner( self )
|
# background.set_owner( self )
|
||||||
###
|
###
|
||||||
|
@ -174,7 +173,7 @@ func _enter_tree():
|
||||||
|
|
||||||
var tex_quit = ImageTexture.new()
|
var tex_quit = ImageTexture.new()
|
||||||
var img_quit = Image.new()
|
var img_quit = Image.new()
|
||||||
var stream_texture = load( "res://addons/ui_window/button_quit.png")
|
var stream_texture = load( "res://addons/kh_window/button_quit.png")
|
||||||
img_quit = stream_texture.get_data()
|
img_quit = stream_texture.get_data()
|
||||||
tex_quit.create_from_image( img_quit )
|
tex_quit.create_from_image( img_quit )
|
||||||
quit_button.texture_normal = tex_quit
|
quit_button.texture_normal = tex_quit
|
||||||
|
@ -193,7 +192,7 @@ func _enter_tree():
|
||||||
|
|
||||||
var tex_close = ImageTexture.new()
|
var tex_close = ImageTexture.new()
|
||||||
var img_close = Image.new()
|
var img_close = Image.new()
|
||||||
var stream_texture = load("res://addons/ui_window/button_close.png")
|
var stream_texture = load("res://addons/kh_window/button_close.png")
|
||||||
img_close = stream_texture.get_data()
|
img_close = stream_texture.get_data()
|
||||||
tex_close.create_from_image( img_close )
|
tex_close.create_from_image( img_close )
|
||||||
close_button.texture_normal = tex_close
|
close_button.texture_normal = tex_close
|
||||||
|
@ -212,7 +211,7 @@ func _enter_tree():
|
||||||
|
|
||||||
var tex_open = ImageTexture.new()
|
var tex_open = ImageTexture.new()
|
||||||
var img_open = Image.new()
|
var img_open = Image.new()
|
||||||
var stream_texture = load("res://addons/ui_window/button_open.png")
|
var stream_texture = load("res://addons/kh_window/button_open.png")
|
||||||
img_open = stream_texture.get_data()
|
img_open = stream_texture.get_data()
|
||||||
tex_open.create_from_image( img_open )
|
tex_open.create_from_image( img_open )
|
||||||
open_button.texture_normal = tex_open
|
open_button.texture_normal = tex_open
|
||||||
|
@ -332,15 +331,16 @@ func _enter_tree():
|
||||||
|
|
||||||
var tex_resize = ImageTexture.new()
|
var tex_resize = ImageTexture.new()
|
||||||
var img_resize = Image.new()
|
var img_resize = Image.new()
|
||||||
var stream_texture = load("res://addons/ui_window/button_resize.png")
|
var stream_texture = load("res://addons/kh_window/button_resize.png")
|
||||||
img_resize = stream_texture.get_data()
|
img_resize = stream_texture.get_data()
|
||||||
tex_resize.create_from_image( img_resize )
|
tex_resize.create_from_image( img_resize )
|
||||||
resize_button.texture_normal = tex_resize
|
resize_button.texture_normal = tex_resize
|
||||||
resize_button.mouse_default_cursor_shape = CURSOR_FDIAGSIZE
|
resize_button.mouse_default_cursor_shape = CURSOR_FDIAGSIZE
|
||||||
resize_button.action_mode = Button.ACTION_MODE_BUTTON_PRESS
|
resize_button.action_mode = Button.ACTION_MODE_BUTTON_PRESS
|
||||||
|
# resize_button.mouse_filter = MOUSE_FILTER_STOP
|
||||||
footer.add_child( resize_button )
|
footer.add_child( resize_button )
|
||||||
# resize_button.set_owner( footer )
|
# resize_button.set_owner( footer )
|
||||||
resize_button.connect ( "pressed", self, "_on_Resize_pressed" )
|
resize_button.connect ( "button_down", self, "_on_Resize_pressed" )
|
||||||
###er_label.set_owner( footer )
|
###er_label.set_owner( footer )
|
||||||
###
|
###
|
||||||
|
|
||||||
|
@ -417,20 +417,24 @@ func get_footer():
|
||||||
|
|
||||||
|
|
||||||
func close():
|
func close():
|
||||||
if not is_borderless:
|
if not self.is_borderless:
|
||||||
header_box.get_node( "header/close" ).visible = false
|
self.header_box.get_node( "header/close" ).visible = false
|
||||||
header_box.get_node( "header/open" ).visible = true
|
self.header_box.get_node( "header/open" ).visible = true
|
||||||
content_box.visible = false
|
self.content_box.visible = false
|
||||||
footer_box.visible = false
|
self.footer_box.visible = false
|
||||||
current_rect_size = self.rect_size
|
self.current_rect_size = self.rect_size
|
||||||
self.rect_size = Vector2( 0, 0 )
|
self.rect_size = Vector2( 0, 0 )
|
||||||
|
$background.rect_size = Vector2( 0, 0 )
|
||||||
|
$background.rect_min_size = Vector2( 0, 0 )
|
||||||
else:
|
else:
|
||||||
header_box.get_node( "header/close" ).visible = false
|
self.header_box.get_node( "header/close" ).visible = false
|
||||||
header_box.get_node( "header/open" ).visible = false
|
self.header_box.get_node( "header/open" ).visible = false
|
||||||
content_box.visible = false
|
self.content_box.visible = false
|
||||||
footer_box.visible = false
|
self.footer_box.visible = false
|
||||||
current_rect_size = self.rect_size
|
self.current_rect_size = self.rect_size
|
||||||
self.rect_size = Vector2( 0, 0 )
|
self.rect_size = Vector2( 0, 0 )
|
||||||
|
$background.rect_size = Vector2( 0, 0 )
|
||||||
|
$background.rect_min_size = Vector2( 0, 0 )
|
||||||
|
|
||||||
|
|
||||||
func _on_Close_pressed():
|
func _on_Close_pressed():
|
|
@ -4,9 +4,9 @@ extends EditorPlugin
|
||||||
func _enter_tree():
|
func _enter_tree():
|
||||||
# Initialization of the plugin goes here
|
# Initialization of the plugin goes here
|
||||||
# Add the new type with a name, a parent type, a script and an icon
|
# Add the new type with a name, a parent type, a script and an icon
|
||||||
add_custom_type("ui_window", "MarginContainer", preload("ui_window.gd"), preload("icon.png"))
|
add_custom_type("kh_window", "MarginContainer", preload("kh_window.gd"), preload("icon.png"))
|
||||||
|
|
||||||
func _exit_tree():
|
func _exit_tree():
|
||||||
# Clean-up of the plugin goes here
|
# Clean-up of the plugin goes here
|
||||||
# Always remember to remove it from the engine when deactivated
|
# Always remember to remove it from the engine when deactivated
|
||||||
remove_custom_type("ui_window")
|
remove_custom_type("kh_window")
|
|
@ -1,7 +1,7 @@
|
||||||
[plugin]
|
[plugin]
|
||||||
|
|
||||||
name="UI Window"
|
name="KH Window"
|
||||||
description="A custom window control."
|
description="A custom window control."
|
||||||
author="Osquallo"
|
author="Osquallo"
|
||||||
version="1.0.0"
|
version="1.0.0"
|
||||||
script="ui_window_plugin.gd"
|
script="kh_window_plugin.gd"
|
Before Width: | Height: | Size: 620 B |
BIN
assets/fonts/ryzom.ttf
Normal file
BIN
assets/fonts/ryzom_monospace.ttf
Normal file
|
@ -1,8 +1,8 @@
|
||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/interfaces/debug_window/debug_window.gd" type="Script" id=1]
|
[ext_resource path="res://assets/interfaces/debug_window/debug_window.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://addons/ui_window/ui_window.gd" type="Script" id=2]
|
[ext_resource path="res://addons/kh_window/kh_window.gd" type="Script" id=2]
|
||||||
[ext_resource path="res://addons/ui_window/background_default.jpg" type="Texture" id=3]
|
[ext_resource path="res://addons/kh_window/background_default.jpg" type="Texture" id=3]
|
||||||
|
|
||||||
[node name="debug_window" type="Control"]
|
[node name="debug_window" type="Control"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
|
@ -15,147 +15,146 @@ __meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="ui_window" type="MarginContainer" parent="."]
|
[node name="kh_window" type="MarginContainer" parent="."]
|
||||||
margin_right = 40.0
|
margin_right = 128.0
|
||||||
margin_bottom = 40.0
|
margin_bottom = 128.0
|
||||||
|
mouse_filter = 1
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
title = "Debug/Tests"
|
title = "Debug/Tests"
|
||||||
background_texture = ExtResource( 3 )
|
background_texture = ExtResource( 3 )
|
||||||
min_size = Vector2( 256, 256 )
|
min_size = Vector2( 256, 256 )
|
||||||
|
|
||||||
[node name="v_box_container" type="VBoxContainer" parent="ui_window"]
|
[node name="v_box_container" type="VBoxContainer" parent="kh_window"]
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 138.0
|
margin_bottom = 138.0
|
||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="sky_label" type="Label" parent="ui_window/v_box_container"]
|
[node name="sky_label" type="Label" parent="kh_window/v_box_container"]
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 14.0
|
margin_bottom = 14.0
|
||||||
text = "Sky:"
|
text = "Sky:"
|
||||||
|
|
||||||
[node name="sky_box" type="VBoxContainer" parent="ui_window/v_box_container"]
|
[node name="sky_box" type="VBoxContainer" parent="kh_window/v_box_container"]
|
||||||
margin_top = 18.0
|
margin_top = 18.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 34.0
|
margin_bottom = 34.0
|
||||||
|
|
||||||
[node name="time_of_day" type="HBoxContainer" parent="ui_window/v_box_container/sky_box"]
|
[node name="time_of_day" type="HBoxContainer" parent="kh_window/v_box_container/sky_box"]
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 16.0
|
margin_bottom = 16.0
|
||||||
|
|
||||||
[node name="label" type="Label" parent="ui_window/v_box_container/sky_box/time_of_day"]
|
[node name="label" type="Label" parent="kh_window/v_box_container/sky_box/time_of_day"]
|
||||||
margin_top = 1.0
|
margin_top = 1.0
|
||||||
margin_right = 74.0
|
margin_right = 74.0
|
||||||
margin_bottom = 15.0
|
margin_bottom = 15.0
|
||||||
size_flags_horizontal = 10
|
size_flags_horizontal = 10
|
||||||
text = "Time of day"
|
text = "Time of day"
|
||||||
|
|
||||||
[node name="value" type="HSlider" parent="ui_window/v_box_container/sky_box/time_of_day"]
|
[node name="value" type="HSlider" parent="kh_window/v_box_container/sky_box/time_of_day"]
|
||||||
margin_left = 78.0
|
margin_left = 78.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 16.0
|
margin_bottom = 16.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
max_value = 24.0
|
max_value = 24.0
|
||||||
step = 0.1
|
step = 0.1
|
||||||
value = 12.0
|
value = 12.0
|
||||||
|
|
||||||
[node name="mist_label" type="Label" parent="ui_window/v_box_container"]
|
[node name="mist_label" type="Label" parent="kh_window/v_box_container"]
|
||||||
margin_top = 38.0
|
margin_top = 38.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 52.0
|
margin_bottom = 52.0
|
||||||
text = "Mist:"
|
text = "Mist:"
|
||||||
|
|
||||||
[node name="mist_box" type="VBoxContainer" parent="ui_window/v_box_container"]
|
[node name="mist_box" type="VBoxContainer" parent="kh_window/v_box_container"]
|
||||||
margin_top = 56.0
|
margin_top = 56.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 72.0
|
margin_bottom = 72.0
|
||||||
|
|
||||||
[node name="mist_level" type="HBoxContainer" parent="ui_window/v_box_container/mist_box"]
|
[node name="mist_level" type="HBoxContainer" parent="kh_window/v_box_container/mist_box"]
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 16.0
|
margin_bottom = 16.0
|
||||||
|
|
||||||
[node name="label" type="Label" parent="ui_window/v_box_container/mist_box/mist_level"]
|
[node name="label" type="Label" parent="kh_window/v_box_container/mist_box/mist_level"]
|
||||||
margin_top = 1.0
|
margin_top = 1.0
|
||||||
margin_right = 63.0
|
margin_right = 63.0
|
||||||
margin_bottom = 15.0
|
margin_bottom = 15.0
|
||||||
size_flags_horizontal = 10
|
size_flags_horizontal = 10
|
||||||
text = "Mist level"
|
text = "Mist level"
|
||||||
|
|
||||||
[node name="value" type="HSlider" parent="ui_window/v_box_container/mist_box/mist_level"]
|
[node name="value" type="HSlider" parent="kh_window/v_box_container/mist_box/mist_level"]
|
||||||
margin_left = 67.0
|
margin_left = 67.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 16.0
|
margin_bottom = 16.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
max_value = 1.0
|
max_value = 1.0
|
||||||
step = 0.1
|
step = 0.1
|
||||||
|
|
||||||
[node name="fears_label" type="Label" parent="ui_window/v_box_container"]
|
[node name="fears_label" type="Label" parent="kh_window/v_box_container"]
|
||||||
margin_top = 76.0
|
margin_top = 76.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 90.0
|
margin_bottom = 90.0
|
||||||
text = "Fears:"
|
text = "Fears:"
|
||||||
|
|
||||||
[node name="fears_box" type="VBoxContainer" parent="ui_window/v_box_container"]
|
[node name="fears_box" type="VBoxContainer" parent="kh_window/v_box_container"]
|
||||||
margin_top = 94.0
|
margin_top = 94.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 138.0
|
margin_bottom = 138.0
|
||||||
|
|
||||||
[node name="oubli" type="HBoxContainer" parent="ui_window/v_box_container/fears_box"]
|
[node name="oubli" type="HBoxContainer" parent="kh_window/v_box_container/fears_box"]
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
|
|
||||||
[node name="label" type="Label" parent="ui_window/v_box_container/fears_box/oubli"]
|
[node name="label" type="Label" parent="kh_window/v_box_container/fears_box/oubli"]
|
||||||
margin_left = 16.0
|
margin_left = 32.0
|
||||||
margin_top = 3.0
|
margin_top = 3.0
|
||||||
margin_right = 51.0
|
margin_right = 67.0
|
||||||
margin_bottom = 17.0
|
margin_bottom = 17.0
|
||||||
size_flags_horizontal = 10
|
size_flags_horizontal = 10
|
||||||
text = "Oubli"
|
text = "Oubli"
|
||||||
|
|
||||||
[node name="minus" type="Button" parent="ui_window/v_box_container/fears_box/oubli"]
|
[node name="minus" type="Button" parent="kh_window/v_box_container/fears_box/oubli"]
|
||||||
margin_left = 55.0
|
margin_left = 71.0
|
||||||
margin_right = 80.0
|
margin_right = 96.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
text = "-1"
|
text = "-1"
|
||||||
|
|
||||||
[node name="plus" type="Button" parent="ui_window/v_box_container/fears_box/oubli"]
|
[node name="plus" type="Button" parent="kh_window/v_box_container/fears_box/oubli"]
|
||||||
margin_left = 84.0
|
margin_left = 100.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
text = "+1"
|
text = "+1"
|
||||||
|
|
||||||
[node name="douleur" type="HBoxContainer" parent="ui_window/v_box_container/fears_box"]
|
[node name="douleur" type="HBoxContainer" parent="kh_window/v_box_container/fears_box"]
|
||||||
margin_top = 24.0
|
margin_top = 24.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 44.0
|
margin_bottom = 44.0
|
||||||
|
|
||||||
[node name="label" type="Label" parent="ui_window/v_box_container/fears_box/douleur"]
|
[node name="label" type="Label" parent="kh_window/v_box_container/fears_box/douleur"]
|
||||||
|
margin_left = 16.0
|
||||||
margin_top = 3.0
|
margin_top = 3.0
|
||||||
margin_right = 51.0
|
margin_right = 67.0
|
||||||
margin_bottom = 17.0
|
margin_bottom = 17.0
|
||||||
size_flags_horizontal = 10
|
size_flags_horizontal = 10
|
||||||
text = "Douleur"
|
text = "Douleur"
|
||||||
|
|
||||||
[node name="minus" type="Button" parent="ui_window/v_box_container/fears_box/douleur"]
|
[node name="minus" type="Button" parent="kh_window/v_box_container/fears_box/douleur"]
|
||||||
margin_left = 55.0
|
margin_left = 71.0
|
||||||
margin_right = 80.0
|
margin_right = 96.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
text = "-1"
|
text = "-1"
|
||||||
|
|
||||||
[node name="plus" type="Button" parent="ui_window/v_box_container/fears_box/douleur"]
|
[node name="plus" type="Button" parent="kh_window/v_box_container/fears_box/douleur"]
|
||||||
margin_left = 84.0
|
margin_left = 100.0
|
||||||
margin_right = 112.0
|
margin_right = 128.0
|
||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
text = "+1"
|
text = "+1"
|
||||||
[connection signal="mouse_exited" from="." to="." method="_on_debug_window_mouse_exited"]
|
[connection signal="mouse_exited" from="." to="." method="_on_debug_window_mouse_exited"]
|
||||||
[connection signal="value_changed" from="ui_window/v_box_container/sky_box/time_of_day/value" to="." method="_on_time_of_day_value_changed"]
|
[connection signal="value_changed" from="kh_window/v_box_container/sky_box/time_of_day/value" to="." method="_on_time_of_day_value_changed"]
|
||||||
[connection signal="value_changed" from="ui_window/v_box_container/mist_box/mist_level/value" to="." method="_on_mist_level_value_changed"]
|
[connection signal="value_changed" from="kh_window/v_box_container/mist_box/mist_level/value" to="." method="_on_mist_level_value_changed"]
|
||||||
[connection signal="pressed" from="ui_window/v_box_container/fears_box/oubli/minus" to="." method="_on_oubli_minus_pressed"]
|
[connection signal="pressed" from="kh_window/v_box_container/fears_box/oubli/minus" to="." method="_on_oubli_minus_pressed"]
|
||||||
[connection signal="pressed" from="ui_window/v_box_container/fears_box/oubli/plus" to="." method="_on_oubli_plus_pressed"]
|
[connection signal="pressed" from="kh_window/v_box_container/fears_box/oubli/plus" to="." method="_on_oubli_plus_pressed"]
|
||||||
[connection signal="pressed" from="ui_window/v_box_container/fears_box/douleur/minus" to="." method="_on_douleur_minus_pressed"]
|
[connection signal="pressed" from="kh_window/v_box_container/fears_box/douleur/minus" to="." method="_on_douleur_minus_pressed"]
|
||||||
[connection signal="pressed" from="ui_window/v_box_container/fears_box/douleur/plus" to="." method="_on_douleur_plus_pressed"]
|
[connection signal="pressed" from="kh_window/v_box_container/fears_box/douleur/plus" to="." method="_on_douleur_plus_pressed"]
|
||||||
|
|
BIN
assets/interfaces/unknow_icon.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
assets/items/equippables/pendo_teddy/pendo_teddy.material
Normal file
BIN
assets/items/equippables/pendo_teddy/pendo_teddy.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 418 KiB After Width: | Height: | Size: 418 KiB |
Before Width: | Height: | Size: 2 MiB After Width: | Height: | Size: 2 MiB |
Before Width: | Height: | Size: 503 KiB After Width: | Height: | Size: 503 KiB |
|
@ -20,6 +20,11 @@ _global_script_classes=[ {
|
||||||
"path": "res://ressources/scripts/items/equippable.gd"
|
"path": "res://ressources/scripts/items/equippable.gd"
|
||||||
}, {
|
}, {
|
||||||
"base": "Node",
|
"base": "Node",
|
||||||
|
"class": "Inventory",
|
||||||
|
"language": "GDScript",
|
||||||
|
"path": "res://ressources/scripts/items/inventory.gd"
|
||||||
|
}, {
|
||||||
|
"base": "Node",
|
||||||
"class": "Item",
|
"class": "Item",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
"path": "res://ressources/scripts/items/item.gd"
|
"path": "res://ressources/scripts/items/item.gd"
|
||||||
|
@ -37,6 +42,7 @@ _global_script_classes=[ {
|
||||||
_global_script_class_icons={
|
_global_script_class_icons={
|
||||||
"Creature": "",
|
"Creature": "",
|
||||||
"Equippable": "",
|
"Equippable": "",
|
||||||
|
"Inventory": "",
|
||||||
"Item": "",
|
"Item": "",
|
||||||
"Mannequiny": "",
|
"Mannequiny": "",
|
||||||
"Ra": ""
|
"Ra": ""
|
||||||
|
@ -68,7 +74,7 @@ window/size/height=720
|
||||||
|
|
||||||
[editor_plugins]
|
[editor_plugins]
|
||||||
|
|
||||||
enabled=PoolStringArray( "kh_slider", "ui_window" )
|
enabled=PoolStringArray( "kh_slider", "kh_window" )
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
@ -128,7 +134,7 @@ music_manager={
|
||||||
}
|
}
|
||||||
debug_window={
|
debug_window={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":73,"unicode":0,"echo":false,"script":null)
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":79,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
free_look={
|
free_look={
|
||||||
|
@ -161,6 +167,11 @@ toggle_sprint={
|
||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777241,"unicode":0,"echo":false,"script":null)
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777241,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
inventory_window={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":73,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[khanat]
|
[khanat]
|
||||||
|
|
||||||
|
@ -173,4 +184,5 @@ name_casing=2
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
threads/thread_model=2
|
||||||
environment/default_environment="res://default_env.tres"
|
environment/default_environment="res://default_env.tres"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"label": "Pendo Teddy",
|
"label": "Pendo Teddy",
|
||||||
|
"icon": "pendo_teddy/pendo_teddy.png",
|
||||||
"scene": "pendo_teddy/pendo_teddy.tscn",
|
"scene": "pendo_teddy/pendo_teddy.tscn",
|
||||||
"attachment": "hand_r_attachment"
|
"attachment": "hand_r_attachment"
|
||||||
}
|
}
|
|
@ -1,11 +1,12 @@
|
||||||
extends "res://ressources/scripts/creatures/creature.gd"
|
extends "res://ressources/scripts/creatures/creature.gd"
|
||||||
class_name Ra
|
class_name Ra
|
||||||
|
|
||||||
var inventory = []
|
var inventory = null
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func from_dict( datas ):
|
func from_dict( datas ):
|
||||||
.creature( datas )
|
.from_dict( datas )
|
||||||
|
var new_inventory = Inventory.new()
|
||||||
self.inventory = datas.get( "inventory", self.inventory )
|
new_inventory.from_dict( datas.get( "inventory", [] ) )
|
||||||
|
self.inventory = new_inventory
|
||||||
|
|
|
@ -6,7 +6,12 @@ var attachment = ""
|
||||||
|
|
||||||
|
|
||||||
func from_dict( datas ):
|
func from_dict( datas ):
|
||||||
.item( datas )
|
.from_dict( datas )
|
||||||
|
|
||||||
|
var icon_filename = datas.get( "icon", null )
|
||||||
|
if icon_filename:
|
||||||
|
print( icon_filename )
|
||||||
|
self.icon = load( "res://assets/items/equippables/"+icon_filename )
|
||||||
|
|
||||||
self.scene = datas.get( "scene", self.scene )
|
self.scene = datas.get( "scene", self.scene )
|
||||||
self.attachment = datas.get( "attachment", self.attachment )
|
self.attachment = datas.get( "attachment", self.attachment )
|
||||||
|
|
18
ressources/scripts/items/inventory.gd
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
extends Node
|
||||||
|
class_name Inventory
|
||||||
|
|
||||||
|
var items = []
|
||||||
|
|
||||||
|
func from_dict( datas ):
|
||||||
|
|
||||||
|
for item in datas:
|
||||||
|
var extension = item.get_extension()
|
||||||
|
|
||||||
|
if extension == "equippable":
|
||||||
|
var new_item = Equippable.new()
|
||||||
|
var file = File.new()
|
||||||
|
if file.open( "res://ressources/files/items/equippables/" + item, File.READ) == OK:
|
||||||
|
var json = JSON.parse( file.get_as_text() )
|
||||||
|
if json.result:
|
||||||
|
new_item.from_dict( json.result )
|
||||||
|
self.items.push_back( new_item )
|
|
@ -2,8 +2,11 @@ extends Node
|
||||||
class_name Item
|
class_name Item
|
||||||
|
|
||||||
var label = ""
|
var label = ""
|
||||||
|
var icon = null
|
||||||
|
|
||||||
func from_dict( datas ):
|
func from_dict( datas ):
|
||||||
|
|
||||||
self.label = datas.get( "label", self.label )
|
self.label = datas.get( "label", self.label )
|
||||||
|
# var icon_filename = datas.get( "icon", null )
|
||||||
|
# if icon_filename:
|
||||||
|
# self.icon = load( "res://assets/items/"+icon_filename )
|
||||||
|
|
|
@ -16,8 +16,11 @@ var heightmap = null
|
||||||
func _ready():
|
func _ready():
|
||||||
|
|
||||||
var player_ra = Ra.new()
|
var player_ra = Ra.new()
|
||||||
|
var file = File.new()
|
||||||
|
if file.open("res://ressources/files/creatures/test.creature", File.READ) == OK:
|
||||||
|
player_ra.from_dict( JSON.parse( file.get_as_text() ).result )
|
||||||
|
|
||||||
|
$game_ui/inventory_window.get_content_child( "content_box/inventory_box" ).set_inventory( player_ra.inventory )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,6 +65,14 @@ func _input( event ):
|
||||||
self.mouse_delta = self.mouse_old_position - event.position
|
self.mouse_delta = self.mouse_old_position - event.position
|
||||||
self.mouse_old_position = event.position
|
self.mouse_old_position = event.position
|
||||||
|
|
||||||
|
|
||||||
|
if event.is_action_released( "inventory_window" ):
|
||||||
|
if not $inventory_window.visible:
|
||||||
|
$inventory_window.show()
|
||||||
|
else:
|
||||||
|
$inventory_window.hide()
|
||||||
|
|
||||||
|
|
||||||
func _process( delta ):
|
func _process( delta ):
|
||||||
|
|
||||||
$creatures/player.rotate_camera_arm( Vector3( 0.0, 1.0, 0.0 ), deg2rad( self.mouse_delta.x ) )
|
$creatures/player.rotate_camera_arm( Vector3( 0.0, 1.0, 0.0 ), deg2rad( self.mouse_delta.x ) )
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=23 format=2]
|
[gd_scene load_steps=22 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://scenes/player/player.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://scenes/player/player.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://scenes/decors/terrains/demo/demo.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://scenes/decors/terrains/demo/demo.tscn" type="PackedScene" id=2]
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
[ext_resource path="res://scenes/game/sky.gd" type="Script" id=6]
|
[ext_resource path="res://scenes/game/sky.gd" type="Script" id=6]
|
||||||
[ext_resource path="res://assets/mist/mist.shader" type="Shader" id=7]
|
[ext_resource path="res://assets/mist/mist.shader" type="Shader" id=7]
|
||||||
[ext_resource path="res://assets/interfaces/debug_window/debug_window.tscn" type="PackedScene" id=8]
|
[ext_resource path="res://assets/interfaces/debug_window/debug_window.tscn" type="PackedScene" id=8]
|
||||||
[ext_resource path="res://assets/interfaces/themes/khanat_theme.theme" type="Theme" id=9]
|
|
||||||
[ext_resource path="res://assets/decors/terrains/demo/water/water_fx.shader" type="Shader" id=10]
|
[ext_resource path="res://assets/decors/terrains/demo/water/water_fx.shader" type="Shader" id=10]
|
||||||
[ext_resource path="res://scenes/interfaces/game_menu/game_ui.tscn" type="PackedScene" id=11]
|
[ext_resource path="res://scenes/interfaces/game_menu/game_ui.tscn" type="PackedScene" id=11]
|
||||||
|
|
||||||
|
@ -25,8 +24,8 @@ noise = SubResource( 1 )
|
||||||
[sub_resource type="ShaderMaterial" id=3]
|
[sub_resource type="ShaderMaterial" id=3]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
shader = ExtResource( 5 )
|
shader = ExtResource( 5 )
|
||||||
shader_param/iTime = 3.93876
|
shader_param/iTime = 444.652
|
||||||
shader_param/iFrame = 307
|
shader_param/iFrame = 25808
|
||||||
shader_param/COVERAGE = 0.5
|
shader_param/COVERAGE = 0.5
|
||||||
shader_param/THICKNESS = 25.0
|
shader_param/THICKNESS = 25.0
|
||||||
shader_param/ABSORPTION = 1.031
|
shader_param/ABSORPTION = 1.031
|
||||||
|
@ -77,17 +76,17 @@ shader_param/mist_height = 0.0
|
||||||
shader_param/mist_distance = 25.0
|
shader_param/mist_distance = 25.0
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=10]
|
[sub_resource type="ShaderMaterial" id=10]
|
||||||
|
shader = ExtResource( 4 )
|
||||||
|
shader_param/mist_level = 0.0
|
||||||
|
shader_param/blur_amount = null
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id=11]
|
||||||
shader = ExtResource( 10 )
|
shader = ExtResource( 10 )
|
||||||
shader_param/mist_level = 0.0
|
shader_param/mist_level = 0.0
|
||||||
shader_param/mist_color = Color( 0.0156863, 0.411765, 0.545098, 1 )
|
shader_param/mist_color = Color( 0.0156863, 0.411765, 0.545098, 1 )
|
||||||
shader_param/mist_height = 0.0
|
shader_param/mist_height = 0.0
|
||||||
shader_param/mist_distance = 5.0
|
shader_param/mist_distance = 5.0
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=11]
|
|
||||||
shader = ExtResource( 4 )
|
|
||||||
shader_param/mist_level = 0.0
|
|
||||||
shader_param/blur_amount = null
|
|
||||||
|
|
||||||
[node name="game" type="Spatial"]
|
[node name="game" type="Spatial"]
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
@ -129,13 +128,13 @@ extra_cull_margin = 16384.0
|
||||||
mesh = SubResource( 8 )
|
mesh = SubResource( 8 )
|
||||||
material/0 = SubResource( 9 )
|
material/0 = SubResource( 9 )
|
||||||
|
|
||||||
[node name="water_fx" type="MeshInstance" parent="."]
|
[node name="trauma_fx" type="MeshInstance" parent="."]
|
||||||
cast_shadow = 0
|
cast_shadow = 0
|
||||||
extra_cull_margin = 16384.0
|
extra_cull_margin = 16384.0
|
||||||
mesh = SubResource( 8 )
|
mesh = SubResource( 8 )
|
||||||
material/0 = SubResource( 10 )
|
material/0 = SubResource( 10 )
|
||||||
|
|
||||||
[node name="trauma_fx" type="MeshInstance" parent="."]
|
[node name="water_fx" type="MeshInstance" parent="."]
|
||||||
cast_shadow = 0
|
cast_shadow = 0
|
||||||
extra_cull_margin = 16384.0
|
extra_cull_margin = 16384.0
|
||||||
mesh = SubResource( 8 )
|
mesh = SubResource( 8 )
|
||||||
|
@ -144,12 +143,10 @@ material/0 = SubResource( 11 )
|
||||||
[node name="game_ui" parent="." instance=ExtResource( 11 )]
|
[node name="game_ui" parent="." instance=ExtResource( 11 )]
|
||||||
|
|
||||||
[node name="debug_window" parent="." instance=ExtResource( 8 )]
|
[node name="debug_window" parent="." instance=ExtResource( 8 )]
|
||||||
margin_left = 972.873
|
margin_left = 908.654
|
||||||
margin_top = 52.3552
|
margin_top = 51.8173
|
||||||
margin_right = -51.1268
|
margin_right = -115.346
|
||||||
margin_bottom = -411.645
|
margin_bottom = -412.183
|
||||||
focus_mode = 1
|
|
||||||
theme = ExtResource( 9 )
|
|
||||||
[connection signal="douleur_minus_pressed" from="debug_window" to="." method="_on_debug_window_douleur_minus_pressed"]
|
[connection signal="douleur_minus_pressed" from="debug_window" to="." method="_on_debug_window_douleur_minus_pressed"]
|
||||||
[connection signal="douleur_plus_pressed" from="debug_window" to="." method="_on_debug_window_douleur_plus_pressed"]
|
[connection signal="douleur_plus_pressed" from="debug_window" to="." method="_on_debug_window_douleur_plus_pressed"]
|
||||||
[connection signal="mist_level_changed" from="debug_window" to="." method="_on_debug_window_mist_level_changed"]
|
[connection signal="mist_level_changed" from="debug_window" to="." method="_on_debug_window_mist_level_changed"]
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
[gd_scene load_steps=5 format=2]
|
[gd_scene load_steps=7 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://addons/ui_window/ui_window.gd" type="Script" id=1]
|
[ext_resource path="res://addons/kh_window/kh_window.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://scenes/interfaces/game_menu/game_ui.gd" type="Script" id=2]
|
[ext_resource path="res://scenes/interfaces/game_menu/game_ui.gd" type="Script" id=2]
|
||||||
[ext_resource path="res://assets/interfaces/jauges/peurs_oubli_douleur.png" type="Texture" id=3]
|
[ext_resource path="res://assets/interfaces/jauges/peurs_oubli_douleur.png" type="Texture" id=3]
|
||||||
[ext_resource path="res://assets/interfaces/jauges/peurs_trauma.png" type="Texture" id=4]
|
[ext_resource path="res://assets/interfaces/jauges/peurs_trauma.png" type="Texture" id=4]
|
||||||
|
[ext_resource path="res://scenes/interfaces/inventory_window/inventory_box.tscn" type="PackedScene" id=5]
|
||||||
|
[ext_resource path="res://scenes/interfaces/inventory_window/inventory_window.tscn" type="PackedScene" id=6]
|
||||||
|
|
||||||
[node name="game_ui" type="Control"]
|
[node name="game_ui" type="Control"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
|
@ -65,6 +67,13 @@ fill_mode = 8
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="inventory_window" parent="." instance=ExtResource( 6 )]
|
||||||
|
|
||||||
|
[node name="inventory_box" parent="inventory_window" instance=ExtResource( 5 )]
|
||||||
|
margin_left = 0.0
|
||||||
|
margin_right = 128.0
|
||||||
|
margin_bottom = 128.0
|
||||||
[connection signal="value_changed" from="stats_window/douleur" to="." method="_on_douleur_value_changed"]
|
[connection signal="value_changed" from="stats_window/douleur" to="." method="_on_douleur_value_changed"]
|
||||||
[connection signal="value_changed" from="stats_window/oubli" to="." method="_on_oubli_value_changed"]
|
[connection signal="value_changed" from="stats_window/oubli" to="." method="_on_oubli_value_changed"]
|
||||||
[connection signal="value_changed" from="stats_window/trauma" to="." method="_on_trauma_value_changed"]
|
[connection signal="value_changed" from="stats_window/trauma" to="." method="_on_trauma_value_changed"]
|
||||||
|
|
27
scenes/interfaces/inventory_window/inventory_box.gd
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
extends VBoxContainer
|
||||||
|
|
||||||
|
signal inventory_item_hovered( item )
|
||||||
|
signal inventory_item_gui_input( item, event, node )
|
||||||
|
|
||||||
|
func _on_inventory_item_hovered( item ):
|
||||||
|
emit_signal( "inventory_item_hovered", item )
|
||||||
|
|
||||||
|
func _on_inventory_item_gui_input( item, event, node ):
|
||||||
|
emit_signal( "inventory_item_gui_input", item, event, node )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func clean_inventory():
|
||||||
|
for child in $scroll_item_box/items_box.get_children():
|
||||||
|
$scroll_item_box/items_box.remove_child( child )
|
||||||
|
child.queue_free()
|
||||||
|
|
||||||
|
func set_inventory( p_inventory ):
|
||||||
|
self.clean_inventory()
|
||||||
|
if p_inventory:
|
||||||
|
for item in p_inventory.items:
|
||||||
|
print( item )
|
||||||
|
var new_item_box = preload( "res://scenes/interfaces/inventory_window/item_box.tscn").instance()
|
||||||
|
new_item_box.item = item
|
||||||
|
new_item_box.update()
|
||||||
|
$scroll_item_box/items_box.add_child( new_item_box )
|
38
scenes/interfaces/inventory_window/inventory_box.tscn
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
[gd_scene load_steps=6 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/fonts/IMMORTAL.ttf" type="DynamicFontData" id=1]
|
||||||
|
[ext_resource path="res://scenes/interfaces/inventory_window/items_box.gd" type="Script" id=2]
|
||||||
|
[ext_resource path="res://scenes/interfaces/inventory_window/inventory_box.gd" type="Script" id=4]
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=1]
|
||||||
|
size = 10
|
||||||
|
outline_size = 2
|
||||||
|
outline_color = Color( 0, 0, 0, 1 )
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[sub_resource type="Theme" id=2]
|
||||||
|
default_font = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="inventory_box" type="VBoxContainer"]
|
||||||
|
margin_left = 474.0
|
||||||
|
margin_right = 506.0
|
||||||
|
size_flags_horizontal = 11
|
||||||
|
script = ExtResource( 4 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="scroll_item_box" type="ScrollContainer" parent="."]
|
||||||
|
margin_right = 32.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 11
|
||||||
|
scroll_horizontal_enabled = false
|
||||||
|
|
||||||
|
[node name="items_box" type="GridContainer" parent="scroll_item_box"]
|
||||||
|
margin_right = 32.0
|
||||||
|
size_flags_horizontal = 11
|
||||||
|
theme = SubResource( 2 )
|
||||||
|
custom_constants/vseparation = 8
|
||||||
|
custom_constants/hseparation = 8
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
[connection signal="resized" from="scroll_item_box/items_box" to="scroll_item_box/items_box" method="_on_items_box_resized"]
|
34
scenes/interfaces/inventory_window/inventory_window.tscn
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://addons/kh_window/kh_window.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://scenes/interfaces/inventory_window/inventory_box.tscn" type="PackedScene" id=2]
|
||||||
|
[ext_resource path="res://assets/interfaces/windows/window_frame.png" type="Texture" id=3]
|
||||||
|
|
||||||
|
[node name="inventory_window" type="MarginContainer"]
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
margin_left = -642.158
|
||||||
|
margin_top = -360.0
|
||||||
|
margin_right = -514.158
|
||||||
|
margin_bottom = -232.0
|
||||||
|
rect_min_size = Vector2( 128, 128 )
|
||||||
|
size_flags_horizontal = 2
|
||||||
|
size_flags_vertical = 2
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
title = "inventaire"
|
||||||
|
background_texture = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="content_box" type="VBoxContainer" parent="."]
|
||||||
|
margin_right = 128.0
|
||||||
|
margin_bottom = 128.0
|
||||||
|
|
||||||
|
[node name="inventory_box" parent="content_box" instance=ExtResource( 2 )]
|
||||||
|
margin_left = 0.0
|
||||||
|
margin_right = 128.0
|
||||||
|
margin_bottom = 128.0
|
||||||
|
size_flags_vertical = 3
|
31
scenes/interfaces/inventory_window/item_box.gd
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
extends MarginContainer
|
||||||
|
|
||||||
|
signal item_hovered( item )
|
||||||
|
signal item_gui_input( item, event, node )
|
||||||
|
|
||||||
|
var item = null
|
||||||
|
|
||||||
|
func _on_icon_mouse_entered():
|
||||||
|
emit_signal( "item_hovered", self.item )
|
||||||
|
|
||||||
|
|
||||||
|
func _on_icon_gui_input(event):
|
||||||
|
emit_signal( "item_gui_input", self.item, event, self.name )
|
||||||
|
|
||||||
|
func update():
|
||||||
|
|
||||||
|
if self.item.icon:
|
||||||
|
$icon.texture = self.item.icon
|
||||||
|
elif not $icon.texture:
|
||||||
|
$icon.texture = preload( "res://assets/interfaces/unknow_icon.png" )
|
||||||
|
$label.text = self.item.label
|
||||||
|
# if self.item.number > 1:
|
||||||
|
# $number.text = str(self.item.number)
|
||||||
|
# else:
|
||||||
|
# $number.text = ""
|
||||||
|
#
|
||||||
|
# if not self.item.is_stackable and self.item.number_uses > 1:
|
||||||
|
# $number.text = str(self.item.number_uses)
|
||||||
|
|
||||||
|
|
||||||
|
|
37
scenes/interfaces/inventory_window/item_box.tscn
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/interfaces/unknow_icon.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://scenes/interfaces/inventory_window/item_box.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[node name="item_box" type="MarginContainer"]
|
||||||
|
margin_right = 32.0
|
||||||
|
margin_bottom = 32.0
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="icon" type="TextureRect" parent="."]
|
||||||
|
margin_right = 32.0
|
||||||
|
margin_bottom = 32.0
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="label" type="Label" parent="."]
|
||||||
|
margin_right = 32.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
text = "name"
|
||||||
|
clip_text = true
|
||||||
|
|
||||||
|
[node name="number" type="Label" parent="."]
|
||||||
|
margin_top = 18.0
|
||||||
|
margin_right = 32.0
|
||||||
|
margin_bottom = 32.0
|
||||||
|
size_flags_horizontal = 9
|
||||||
|
size_flags_vertical = 8
|
||||||
|
text = "99"
|
||||||
|
align = 2
|
||||||
|
valign = 2
|
||||||
|
clip_text = true
|
||||||
|
[connection signal="gui_input" from="icon" to="." method="_on_icon_gui_input"]
|
||||||
|
[connection signal="mouse_entered" from="icon" to="." method="_on_icon_mouse_entered"]
|
7
scenes/interfaces/inventory_window/items_box.gd
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
extends GridContainer
|
||||||
|
|
||||||
|
func _on_items_box_resized():
|
||||||
|
var inventory_window = self.find_parent("inventory_window")
|
||||||
|
if inventory_window:
|
||||||
|
var nb_columns = ( inventory_window.get_size().x - 32 ) / 32
|
||||||
|
self.set_columns( nb_columns )
|
|
@ -4,7 +4,6 @@
|
||||||
[ext_resource path="res://assets/interfaces/themes/khanat_theme.theme" type="Theme" id=2]
|
[ext_resource path="res://assets/interfaces/themes/khanat_theme.theme" type="Theme" id=2]
|
||||||
[ext_resource path="res://scenes/interfaces/main_menu/main_menu.gd" type="Script" id=3]
|
[ext_resource path="res://scenes/interfaces/main_menu/main_menu.gd" type="Script" id=3]
|
||||||
|
|
||||||
|
|
||||||
[node name="main_menu" type="Control"]
|
[node name="main_menu" type="Control"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[gd_scene load_steps=2 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://assets/items/equippable/pendo_teddy/pendo_teddy.glb" type="PackedScene" id=1]
|
|
||||||
|
|
||||||
[node name="pendo_teddy" instance=ExtResource( 1 )]
|
|
6
scenes/items/equippables/pendo_teddy/pendo_teddy.tscn
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/items/equippables/pendo_teddy/pendo_teddy.glb" type="PackedScene" id=1]
|
||||||
|
|
||||||
|
|
||||||
|
[node name="pendo_teddy" instance=ExtResource( 1 )]
|