improve end screen

This commit is contained in:
Arnaud Vergnet 2021-04-23 23:25:32 +02:00
parent b9c2985632
commit 1275b624a8
22 changed files with 925 additions and 16 deletions

View file

@ -1 +1 @@
{"glossary":[{"extra":"","id":"1618913698-364","name":"fermer","text":"Utilisateur habitué à cette fonctionnalité. Il nest pas déboussolé face à une nouveauté.","title":"Téléphone verrouillé","type":1},{"extra":"","id":"1618913732-731","name":"ouvert","text":"Donne à lentreprise une image moderne et éco-responsable. Possibilité de fidéliser des clients qui dépensent plus habituellement.","title":"Téléphone déverrouillé","type":1}],"variables":[{"id":"1618954308-648","name":"jauge_travail","type":0,"value":"0"},{"id":"1618954325-787","name":"jauge_education","type":0,"value":"0"},{"id":"1618954333-366","name":"jauge_financier","type":0,"value":"0"},{"id":"1618954344-146","name":"jauge_ecologie","type":0,"value":"0"},{"id":"1618954357-918","name":"jauge_social","type":0,"value":""},{"id":"1618954386-970","name":"relation_jm","type":0,"value":"0"},{"id":"1618954375-483","name":"relation_evelyne","type":0,"value":"0"},{"id":"1616657225-648","name":"choix_tel_ouvert","type":0,"value":"0"},{"id":"1619183465-648","name":"current_phase","type":0,"value":"0"}]}
{"glossary":[{"extra":"","id":"1618913698-364","name":"fermer","text":"Utilisateur habitué à cette fonctionnalité. Il nest pas déboussolé face à une nouveauté.","title":"Téléphone verrouillé","type":1},{"extra":"","id":"1618913732-731","name":"ouvert","text":"Donne à lentreprise une image moderne et éco-responsable. Possibilité de fidéliser des clients qui dépensent plus habituellement.","title":"Téléphone déverrouillé","type":1}],"variables":[{"id":"1618954386-970","name":"relation_jm","type":0,"value":"0"},{"id":"1618954375-483","name":"relation_evelyne","type":0,"value":"0"},{"id":"1616657225-648","name":"choix_tel_ouvert","type":0,"value":"0"},{"id":"1619183465-648","name":"current_phase","type":0,"value":"0"},{"id":"1618954344-146","name":"jauge_ecologie","type":0,"value":"10"},{"id":"1618954325-787","name":"jauge_education","type":0,"value":"50"},{"id":"1618954333-366","name":"jauge_financier","type":0,"value":"5"},{"id":"1618954357-918","name":"jauge_social","type":0,"value":"70"},{"id":"1618954308-648","name":"jauge_travail","type":0,"value":"30"}]}

BIN
images/end-circle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/end-circle.png-d28c2c57c825972045c052af694eb0fe.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/end-circle.png"
dest_files=[ "res://.import/end-circle.png-d28c2c57c825972045c052af694eb0fe.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

66
images/end-circle.svg Normal file
View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="200mm"
height="200mm"
viewBox="0 0 200 200"
version="1.1"
id="svg8"
inkscape:version="1.0.2 (1.0.2+r75+1)"
sodipodi:docname="end-circle.svg"
inkscape:export-filename="/home/vergnet/Godot/pir-serious-game-ethics/images/end-circle.png"
inkscape:export-xdpi="25.4"
inkscape:export-ydpi="25.4">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="323.75819"
inkscape:cy="398.51597"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
inkscape:pagecheckerboard="true"
inkscape:snap-page="true"
inkscape:window-width="1920"
inkscape:window-height="1003"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<circle
style="fill:#ffffff;fill-opacity:1;stroke:#9cbac7;stroke-width:0.0969529;stroke-dasharray:0.0969529, 0.0969529"
id="path833"
cx="99.999969"
cy="99.999969"
r="90.903267" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/end-circle.svg-104b9604fc9c791a71c7b208a04ea658.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/end-circle.svg"
dest_files=[ "res://.import/end-circle.svg-104b9604fc9c791a71c7b208a04ea658.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/end-progress.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/end-progress.png-bd1e009633a59c2a96b99c1748916b47.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/end-progress.png"
dest_files=[ "res://.import/end-progress.png-bd1e009633a59c2a96b99c1748916b47.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

66
images/end-progress.svg Normal file
View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="200mm"
height="200mm"
viewBox="0 0 200 200"
version="1.1"
id="svg859"
sodipodi:docname="end-progress.svg"
inkscape:version="1.0.2 (1.0.2+r75+1)"
inkscape:export-filename="/home/vergnet/Godot/pir-serious-game-ethics/images/end-progress.png"
inkscape:export-xdpi="25.4"
inkscape:export-ydpi="25.4">
<defs
id="defs853" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="473.8861"
inkscape:cy="414.21127"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
width="200mm"
inkscape:pagecheckerboard="true"
inkscape:window-width="1920"
inkscape:window-height="1003"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-page="false" />
<metadata
id="metadata856">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
id="rect899"
style="fill:#ffffff;stroke:#9cbac7;stroke-width:0.1;stroke-dasharray:0.1, 0.1"
d="M 0,0 H 200 V 102.05357 200 H 0 Z"
sodipodi:nodetypes="cccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/end-progress.svg-6f4d667f5c44017c4755304f487c90c9.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/end-progress.svg"
dest_files=[ "res://.import/end-progress.svg-6f4d667f5c44017c4755304f487c90c9.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -94,4 +94,7 @@ dialogic_next={
[rendering]
quality/intended_usage/framebuffer_allocation=0
quality/intended_usage/framebuffer_allocation.mobile=0
quality/filters/msaa=1
environment/default_environment="res://default_env.tres"

View file

@ -1,11 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/EndRecap.gd" type="Script" id=1]
[node name="EndRecap" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -0,0 +1,10 @@
extends ProgressBar
onready var tween = $Tween
func _ready():
tween.interpolate_property(self, "value", 0, 100, 1.5, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
tween.start()

View file

@ -0,0 +1,32 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://scenes/end-screen/AnimatedProgress.gd" type="Script" id=2]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.486275, 0.196078, 0.772549, 1 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 0, 0, 0, 0.192157 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[node name="AnimatedProgress" type="ProgressBar"]
anchor_right = 1.0
margin_bottom = 107.0
custom_styles/fg = SubResource( 1 )
custom_styles/bg = SubResource( 2 )
step = 0.1
value = 20.0
percent_visible = false
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Tween" type="Tween" parent="."]

View file

@ -0,0 +1,56 @@
extends Control
export(String) var choice_name = ""
export(String) var dilemma_name = ""
export(float) var deferred_show = 0
onready var tween = $Tween
onready var hover_tween = $HoverTween
onready var timer = $Timer
onready var container = $VBoxContainer
onready var choice_label = $VBoxContainer/ChoiceLabel
onready var dilemma_label = $VBoxContainer/DilemmaLabel
onready var texture = $VBoxContainer/TextureRect
onready var button = $TextureButton
func _ready():
button.connect("mouse_entered", self, '_on_mouse_entered')
button.connect("mouse_exited", self, '_on_mouse_exited')
button.connect("pressed", self, '_on_button_pressed')
container.hide()
choice_label.text = choice_name
dilemma_label.text = dilemma_name
tween.interpolate_property(container, "rect_scale", Vector2(0, 0), Vector2(1, 1), 1, Tween.TRANS_ELASTIC, Tween.EASE_IN_OUT)
tween.interpolate_property(container, "rect_position", Vector2(75, 75), Vector2(0, 0), 1, Tween.TRANS_ELASTIC, Tween.EASE_IN_OUT)
if deferred_show > 0:
timer.wait_time = deferred_show
timer.start()
else:
start_anim()
func start_anim():
container.rect_scale = Vector2(0, 0)
container.rect_position = Vector2(75, 75)
container.show()
tween.start()
func _on_Timer_timeout():
start_anim()
func _on_mouse_exited():
hover_tween.interpolate_property(texture, "modulate", null, Color(1, 1, 1, 1), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
hover_tween.start()
func _on_mouse_entered():
hover_tween.interpolate_property(texture, "modulate", null, Color("#615ea4"), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
hover_tween.start()
func _on_button_pressed():
print("pressed")

View file

@ -0,0 +1,68 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://images/end-circle.png" type="Texture" id=1]
[ext_resource path="res://scenes/end-screen/ChoiceCircle.gd" type="Script" id=2]
[ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=3]
[sub_resource type="DynamicFont" id=1]
size = 20
font_data = ExtResource( 3 )
[node name="ChoiceCircle" type="Control"]
margin_right = 150.0
margin_bottom = 150.0
rect_min_size = Vector2( 150, 200 )
rect_rotation = -0.0875701
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
rect_min_size = Vector2( 150, 200 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ChoiceLabel" type="Label" parent="VBoxContainer"]
margin_right = 150.0
margin_bottom = 28.0
custom_fonts/font = SubResource( 1 )
text = "Choix"
align = 1
[node name="TextureRect" type="TextureRect" parent="VBoxContainer"]
margin_top = 32.0
margin_right = 150.0
margin_bottom = 168.0
mouse_default_cursor_shape = 2
size_flags_vertical = 3
texture = ExtResource( 1 )
expand = true
stretch_mode = 6
[node name="DilemmaLabel" type="Label" parent="VBoxContainer"]
margin_top = 172.0
margin_right = 150.0
margin_bottom = 200.0
custom_fonts/font = SubResource( 1 )
text = "Dilemme"
align = 1
[node name="Tween" type="Tween" parent="."]
[node name="HoverTween" type="Tween" parent="."]
[node name="Timer" type="Timer" parent="."]
one_shot = true
[node name="TextureButton" type="TextureButton" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_default_cursor_shape = 2
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]

View file

@ -0,0 +1,28 @@
extends Control
export(Texture) var texture_normal
export(Texture) var texture_hover
onready var button = $TextureButton
onready var hover_tween = $HoverTween
func _ready():
button.texture_normal = texture_normal
button.texture_hover = texture_hover
button.connect("mouse_entered", self, '_on_mouse_entered')
button.connect("mouse_exited", self, '_on_mouse_exited')
button.connect("pressed", self, '_on_button_pressed')
func _on_mouse_exited():
hover_tween.interpolate_property(button, "modulate", null, Color(1, 1, 1, 1), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
hover_tween.start()
func _on_mouse_entered():
hover_tween.interpolate_property(button, "modulate", null, Color("#615ea4"), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
hover_tween.start()
func _on_button_pressed():
print("pressed")

View file

@ -0,0 +1,26 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://characters/Evelyne/evelyne_neutre.png" type="Texture" id=1]
[ext_resource path="res://scenes/end-screen/EndCharacter.gd" type="Script" id=2]
[node name="EndCharacter" type="Control"]
margin_right = 400.0
margin_bottom = 659.0
rect_min_size = Vector2( 400, 0 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureButton" type="TextureButton" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 1 )
expand = true
stretch_mode = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HoverTween" type="Tween" parent="."]

View file

@ -8,10 +8,19 @@ var gauges_names := ["travail", "education", "financier", "ecologie", "social"]
var relations_names := ["evelyne", "jm"]
var choices_names := ["tel_ouvert"]
var gauges_ranges := [[-11, 14], [-9, 23], [-23, 24], [-13, 16], [-16, 17]]
var relations_ranges := [[-5, 6], [-3, 5]]
var gauges := {}
var relations := {}
var choices := {}
onready var progress_container = $VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer
onready var gauges_timer = $GaugesTimer
var shown_gauge_index = 0
func _ready():
var definitions = Dialogic.get_definitions()
# Get relations and gauges from variables
@ -30,3 +39,16 @@ func _ready():
print(relations)
print("--")
print(choices)
gauges_timer.start()
func _on_GaugesTimer_timeout():
var c = progress_container.get_child(shown_gauge_index)
c.progress = float(gauges[gauges_names[shown_gauge_index]]["value"])
shown_gauge_index += 1
if shown_gauge_index >= progress_container.get_child_count():
gauges_timer.stop()
func _on_ExitButton_pressed():
get_tree().change_scene("res://scenes/MainMenu.tscn")

View file

@ -0,0 +1,301 @@
[gd_scene load_steps=18 format=2]
[ext_resource path="res://scenes/end-screen/EndRecap.gd" type="Script" id=1]
[ext_resource path="res://backgrounds/bureauGroupe-1.jpg" type="Texture" id=2]
[ext_resource path="res://fonts/open-sans/OpenSans-ExtraBold.ttf" type="DynamicFontData" id=3]
[ext_resource path="res://scenes/typo/Button.tscn" type="PackedScene" id=4]
[ext_resource path="res://characters/Jean-Michel/Jean-Michel_bien_joue_petit.png" type="Texture" id=5]
[ext_resource path="res://scenes/end-screen/EndCharacter.tscn" type="PackedScene" id=6]
[ext_resource path="res://scenes/end-screen/ChoiceCircle.tscn" type="PackedScene" id=7]
[ext_resource path="res://scenes/end-screen/AnimatedProgress.tscn" type="PackedScene" id=8]
[ext_resource path="res://scenes/end-screen/GaugeProgress.tscn" type="PackedScene" id=9]
[ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=10]
[ext_resource path="res://characters/Evelyne/evelyne_satisfaite.png" type="Texture" id=11]
[ext_resource path="res://characters/Evelyne/evelyne_neutre.png" type="Texture" id=12]
[ext_resource path="res://characters/Jean-Michel/Jean-Michel_narquois.png" type="Texture" id=13]
[sub_resource type="DynamicFont" id=1]
size = 80
outline_size = 5
outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
font_data = ExtResource( 3 )
[sub_resource type="DynamicFont" id=2]
size = 50
outline_size = 3
outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
font_data = ExtResource( 3 )
[sub_resource type="StyleBoxFlat" id=3]
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
shadow_color = Color( 0, 0, 0, 0.392157 )
shadow_size = 40
shadow_offset = Vector2( 10, 10 )
[sub_resource type="DynamicFont" id=4]
size = 30
outline_size = 2
outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
font_data = ExtResource( 10 )
[node name="EndRecap" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Background" type="TextureRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 2 )
expand = true
stretch_mode = 7
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="EndLabel" type="Label" parent="VBoxContainer"]
margin_right = 1920.0
margin_bottom = 110.0
custom_fonts/font = SubResource( 1 )
text = "FIN"
align = 1
[node name="TitleLabel" type="Label" parent="VBoxContainer"]
margin_top = 114.0
margin_right = 1920.0
margin_bottom = 183.0
custom_fonts/font = SubResource( 2 )
text = "Serious Game on Ethics"
align = 1
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 187.0
margin_right = 1920.0
margin_bottom = 846.0
size_flags_vertical = 3
[node name="Evelyne" parent="VBoxContainer/HBoxContainer" instance=ExtResource( 6 )]
texture_normal = ExtResource( 12 )
texture_hover = ExtResource( 11 )
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 404.0
margin_right = 1516.0
margin_bottom = 659.0
size_flags_horizontal = 3
custom_constants/margin_right = 100
custom_constants/margin_top = 50
custom_constants/margin_left = 100
custom_constants/margin_bottom = 50
[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer/MarginContainer"]
margin_left = 100.0
margin_top = 50.0
margin_right = 1012.0
margin_bottom = 609.0
size_flags_horizontal = 3
custom_styles/panel = SubResource( 3 )
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
custom_constants/margin_right = 20
custom_constants/margin_top = 20
custom_constants/margin_left = 20
custom_constants/margin_bottom = 20
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer"]
margin_left = 20.0
margin_top = 20.0
margin_right = 892.0
margin_bottom = 539.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer"]
margin_right = 872.0
margin_bottom = 42.0
custom_fonts/font = SubResource( 4 )
text = "Récapitulatif"
align = 1
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer"]
margin_top = 46.0
margin_right = 872.0
margin_bottom = 463.0
size_flags_vertical = 3
custom_constants/margin_top = 40
custom_constants/margin_bottom = 40
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer"]
margin_top = 40.0
margin_right = 872.0
margin_bottom = 377.0
size_flags_vertical = 3
alignment = 1
[node name="WorkProgress" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer" instance=ExtResource( 9 )]
margin_left = 128.0
margin_right = 248.0
margin_bottom = 337.0
gauge_name = "Travail"
gauge_color = Color( 0.576471, 0.345098, 0.313726, 1 )
[node name="EducationProgress" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer" instance=ExtResource( 9 )]
margin_left = 252.0
margin_right = 372.0
margin_bottom = 337.0
gauge_name = "Éducation"
gauge_color = Color( 0.0627451, 0.764706, 0.933333, 1 )
[node name="FinancesProgress" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer" instance=ExtResource( 9 )]
margin_left = 376.0
margin_right = 496.0
margin_bottom = 337.0
gauge_name = "Finances"
gauge_color = Color( 0.996078, 0.403922, 0.2, 1 )
[node name="EcologyProgress" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer" instance=ExtResource( 9 )]
margin_left = 500.0
margin_right = 620.0
margin_bottom = 337.0
gauge_name = "Écologie"
gauge_color = Color( 0.984314, 0.752941, 0.156863, 1 )
[node name="SocialProgress" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer" instance=ExtResource( 9 )]
margin_left = 624.0
margin_right = 744.0
margin_bottom = 337.0
gauge_name = "Social"
gauge_color = Color( 0.839216, 0.556863, 0.192157, 1 )
[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer"]
margin_top = 467.0
margin_right = 872.0
margin_bottom = 519.0
[node name="ExitButton" parent="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/CenterContainer" instance=ExtResource( 4 )]
margin_left = 269.0
margin_top = 0.0
margin_right = 603.0
margin_bottom = 52.0
text = "Sauvegarder et quitter"
[node name="JM" parent="VBoxContainer/HBoxContainer" instance=ExtResource( 6 )]
margin_left = 1520.0
margin_right = 1920.0
texture_normal = ExtResource( 13 )
texture_hover = ExtResource( 5 )
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
margin_top = 850.0
margin_right = 1920.0
margin_bottom = 1080.0
[node name="ColorRect" type="ColorRect" parent="VBoxContainer/MarginContainer"]
margin_right = 1920.0
margin_bottom = 230.0
color = Color( 0, 0, 0, 0.478431 )
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MarginContainer"]
margin_right = 1920.0
margin_bottom = 230.0
custom_constants/margin_right = 100
custom_constants/margin_top = 20
custom_constants/margin_left = 100
custom_constants/margin_bottom = 10
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MarginContainer/MarginContainer"]
margin_left = 100.0
margin_top = 20.0
margin_right = 1820.0
margin_bottom = 220.0
custom_constants/margin_right = 75
custom_constants/margin_top = 70
custom_constants/margin_left = 75
custom_constants/margin_bottom = 70
[node name="AnimatedProgress" parent="VBoxContainer/MarginContainer/MarginContainer/MarginContainer" instance=ExtResource( 8 )]
anchor_right = 0.0
margin_left = 75.0
margin_top = 70.0
margin_right = 1645.0
margin_bottom = 130.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/MarginContainer/MarginContainer"]
margin_left = 100.0
margin_top = 20.0
margin_right = 1820.0
margin_bottom = 220.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ChoiceCircle" parent="VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2" instance=ExtResource( 7 )]
margin_bottom = 200.0
rect_rotation = 0.0
choice_name = "Choice 1"
dilemma_name = "Dilemma 1"
[node name="Spacer" type="Control" parent="VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2"]
margin_left = 154.0
margin_right = 781.0
margin_bottom = 200.0
size_flags_horizontal = 3
[node name="ChoiceCircle2" parent="VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2" instance=ExtResource( 7 )]
margin_left = 785.0
margin_right = 935.0
margin_bottom = 200.0
rect_rotation = 0.0
choice_name = "Choice 2"
dilemma_name = "Dilemma 2"
deferred_show = 0.3
[node name="Spacer2" type="Control" parent="VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2"]
margin_left = 939.0
margin_right = 1566.0
margin_bottom = 200.0
size_flags_horizontal = 3
[node name="ChoiceCircle3" parent="VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2" instance=ExtResource( 7 )]
margin_left = 1570.0
margin_right = 1720.0
margin_bottom = 200.0
rect_rotation = 0.0
choice_name = "Choice 3"
dilemma_name = "Dilemma 2"
deferred_show = 0.7
[node name="GaugesTimer" type="Timer" parent="."]
wait_time = 0.5
[connection signal="pressed" from="VBoxContainer/HBoxContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/CenterContainer/ExitButton" to="." method="_on_ExitButton_pressed"]
[connection signal="timeout" from="GaugesTimer" to="." method="_on_GaugesTimer_timeout"]

View file

@ -0,0 +1,49 @@
extends MarginContainer
export(String) var gauge_name = ""
export(Color) var gauge_color = Color.white
var progress : float = 0 setget set_progress
onready var tween = $Tween
onready var hover_tween = $HoverTween
onready var container = $VBoxContainer
onready var progress_bar = $VBoxContainer/ProgressBar
onready var label = $VBoxContainer/Label
onready var button = $TextureButton
func _ready():
button.connect("mouse_entered", self, '_on_mouse_entered')
button.connect("mouse_exited", self, '_on_mouse_exited')
button.connect("pressed", self, '_on_button_pressed')
container.hide()
label.text = gauge_name
progress_bar.tint_progress = gauge_color
container.modulate = Color(1, 1, 1, 0)
func start_anim():
tween.start()
container.show()
func set_progress(new_value: float):
progress = new_value
tween.interpolate_property(progress_bar, "value", 0, progress, 1.5, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
tween.interpolate_property(container, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), 1, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
start_anim()
func _on_mouse_exited():
hover_tween.interpolate_property(progress_bar, "tint_progress", null, gauge_color, 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
hover_tween.start()
func _on_mouse_entered():
hover_tween.interpolate_property(progress_bar, "tint_progress", null, Color("#615ea4"), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
hover_tween.start()
func _on_button_pressed():
print("pressed")

View file

@ -0,0 +1,56 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://images/end-progress.png" type="Texture" id=1]
[ext_resource path="res://scenes/end-screen/GaugeProgress.gd" type="Script" id=2]
[ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=3]
[sub_resource type="DynamicFont" id=1]
font_data = ExtResource( 3 )
[node name="GaugeProgress" type="MarginContainer"]
margin_right = 41.0
margin_bottom = 473.0
rect_min_size = Vector2( 120, 0 )
mouse_filter = 1
custom_constants/margin_right = 20
custom_constants/margin_left = 20
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
gauge_name = "test"
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 20.0
margin_right = 100.0
margin_bottom = 473.0
[node name="ProgressBar" type="TextureProgress" parent="VBoxContainer"]
margin_right = 80.0
margin_bottom = 446.0
rect_min_size = Vector2( 40, 0 )
size_flags_vertical = 3
step = 0.01
allow_lesser = true
texture_progress = ExtResource( 1 )
fill_mode = 3
tint_progress = Color( 0.698039, 0.0705882, 0.0705882, 1 )
nine_patch_stretch = true
[node name="Label" type="Label" parent="VBoxContainer"]
margin_top = 450.0
margin_right = 80.0
margin_bottom = 473.0
custom_fonts/font = SubResource( 1 )
text = "Gauge"
align = 1
[node name="Tween" type="Tween" parent="."]
[node name="HoverTween" type="Tween" parent="."]
[node name="TextureButton" type="TextureButton" parent="."]
margin_left = 20.0
margin_right = 100.0
margin_bottom = 473.0
mouse_default_cursor_shape = 2

View file

@ -52,10 +52,11 @@ corner_radius_bottom_right = 6
corner_radius_bottom_left = 6
[node name="CustomButton" type="Button"]
margin_left = -1.33484
margin_top = -1.33484
margin_right = 113.665
margin_bottom = 50.6652
margin_left = -1.0
margin_top = -1.0
margin_right = -846.0
margin_bottom = -489.0
rect_pivot_offset = Vector2( 0.5, 0 )
mouse_default_cursor_shape = 2
custom_styles/hover = SubResource( 1 )
custom_styles/pressed = SubResource( 2 )