Browse Source

improve end screen and add animals

Arnaud Vergnet 2 years ago
parent
commit
3c5acc9b85

+ 1
- 1
dialogic/timelines/timeline-1616659306.json View File

@@ -1 +1 @@
1
-{"events":[{"change_timeline":"timeline-1619379308.json"},{"wait_seconds":1}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659306.json","name":"00_start"}}
1
+{"events":[{"change_timeline":"timeline-1616662258.json"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616659306.json","name":"00_start"}}

+ 1
- 1
dialogic/timelines/timeline-1616662258.json View File

@@ -1 +1 @@
1
-{"events":[{"wait_seconds":1},{"character":"","portrait":"","text":"Fin de la démo, merci d'avoir joué !"},{"action":"leaveall","character":"[All]"}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616662258.json","name":"00_end"}}
1
+{"events":[{"background":"res://backgrounds/bureauGroupe-2.jpg"},{"wait_seconds":1},{"character":"","portrait":"","text":"Fin de la démo, merci d'avoir joué !"},{"action":"leaveall","character":"[All]"},{"emit_signal":"end_game"},{"wait_seconds":10}],"metadata":{"dialogic-version":"1.1","file":"timeline-1616662258.json","name":"00_end"}}

+ 8
- 0
fonts/PanelContentFont.tres View File

@@ -0,0 +1,8 @@
1
+[gd_resource type="DynamicFont" load_steps=2 format=2]
2
+
3
+[ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=1]
4
+
5
+[resource]
6
+outline_size = 1
7
+outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
8
+font_data = ExtResource( 1 )

+ 9
- 0
fonts/PanelTitleFont.tres View File

@@ -0,0 +1,9 @@
1
+[gd_resource type="DynamicFont" load_steps=2 format=2]
2
+
3
+[ext_resource path="res://fonts/open-sans/OpenSans-Bold.ttf" type="DynamicFontData" id=1]
4
+
5
+[resource]
6
+size = 30
7
+outline_size = 3
8
+outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
9
+font_data = ExtResource( 1 )

BIN
images/animals/abeille.png View File


+ 34
- 0
images/animals/abeille.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/abeille.png-25a3782f77363162b5b714b9943275ec.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://images/animals/abeille.png"
13
+dest_files=[ "res://.import/abeille.png-25a3782f77363162b5b714b9943275ec.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
images/animals/castor.png View File


+ 34
- 0
images/animals/castor.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/castor.png-9af29423cb152ed1cdb83f54d1a20220.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://images/animals/castor.png"
13
+dest_files=[ "res://.import/castor.png-9af29423cb152ed1cdb83f54d1a20220.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
images/animals/chien.png View File


+ 34
- 0
images/animals/chien.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/chien.png-8d9e96a3b768f6bf57813de024c7160f.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://images/animals/chien.png"
13
+dest_files=[ "res://.import/chien.png-8d9e96a3b768f6bf57813de024c7160f.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
images/animals/dauphin.png View File


+ 34
- 0
images/animals/dauphin.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/dauphin.png-e50553bc0d5e7b67da559b6124f3cec8.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://images/animals/dauphin.png"
13
+dest_files=[ "res://.import/dauphin.png-e50553bc0d5e7b67da559b6124f3cec8.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
images/animals/renard.png View File


+ 34
- 0
images/animals/renard.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/renard.png-1f378da00747e5b174a138f2a71e88e1.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://images/animals/renard.png"
13
+dest_files=[ "res://.import/renard.png-1f378da00747e5b174a138f2a71e88e1.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 2
- 3
scenes/Main.gd View File

@@ -29,7 +29,6 @@ func play_music():
29 29
 
30 30
 
31 31
 func _on_Dialogic_signal_received(value: String):
32
-	print("signal received")
33 32
 	var args = value.split(" ")
34 33
 	if args.size() > 0:
35 34
 		var type = args[0];
@@ -43,6 +42,8 @@ func _on_Dialogic_signal_received(value: String):
43 42
 					setup_minigame(args[1], args[2], args[3])
44 43
 				else:
45 44
 					print("not enough arguments for start_minigame")
45
+			"end_game":
46
+				Transit.change_scene("res://scenes/animal/AnimalScene.tscn", 1)
46 47
 			_:
47 48
 				print("wrong type")
48 49
 
@@ -56,8 +57,6 @@ func start_minigame():
56 57
 
57 58
 
58 59
 func _on_MiniGame_game_over(next_timeline: String):
59
-	print("Game over received")
60
-	print("next timeline: " + next_timeline)
61 60
 	dialogic_node = Dialogic.start(next_timeline)
62 61
 	dialogic_node.connect('dialogic_signal', self, "_on_Dialogic_signal_received")
63 62
 	add_child_below_node($MiniGame, dialogic_node)

+ 6
- 0
scenes/MainMenu.gd View File

@@ -3,11 +3,17 @@ extends Control
3 3
 var MAIN_MENU_MUSIC = "res://music/menu_principal.ogg"
4 4
 
5 5
 onready var exit_button = $MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton
6
+onready var continue_button = $MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/ContinueButton
7
+
8
+var save_available := false
6 9
 
7 10
 func _ready():
8 11
 	BackgroundMusic.crossfade_to(MAIN_MENU_MUSIC, -10, 1)
9 12
 	if OS.get_name() == "HTML5":
10 13
 		exit_button.hide()
14
+	save_available = not Dialogic.get_current_timeline().empty()
15
+	if not save_available:
16
+		continue_button.hide()
11 17
 
12 18
 
13 19
 func load_main_game():

+ 15
- 15
scenes/MainMenu.tscn View File

@@ -30,32 +30,32 @@ __meta__ = {
30 30
 [node name="MarginContainer" type="MarginContainer" parent="."]
31 31
 anchor_right = 1.0
32 32
 anchor_bottom = 1.0
33
-custom_constants/margin_right = 100
33
+custom_constants/margin_right = 75
34 34
 custom_constants/margin_top = 10
35
-custom_constants/margin_left = 100
35
+custom_constants/margin_left = 75
36 36
 custom_constants/margin_bottom = 10
37 37
 __meta__ = {
38 38
 "_edit_use_anchors_": false
39 39
 }
40 40
 
41 41
 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
42
-margin_left = 100.0
42
+margin_left = 75.0
43 43
 margin_top = 10.0
44
-margin_right = 1820.0
44
+margin_right = 1845.0
45 45
 margin_bottom = 1070.0
46 46
 __meta__ = {
47 47
 "_edit_use_anchors_": false
48 48
 }
49 49
 
50 50
 [node name="Title" type="Label" parent="MarginContainer/VBoxContainer"]
51
-margin_right = 1720.0
51
+margin_right = 1770.0
52 52
 margin_bottom = 137.0
53 53
 custom_fonts/font = ExtResource( 6 )
54 54
 text = "Serious Game on Ethics"
55 55
 
56 56
 [node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
57 57
 margin_top = 141.0
58
-margin_right = 1720.0
58
+margin_right = 1770.0
59 59
 margin_bottom = 1042.0
60 60
 size_flags_vertical = 3
61 61
 __meta__ = {
@@ -63,7 +63,7 @@ __meta__ = {
63 63
 }
64 64
 
65 65
 [node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
66
-margin_right = 350.0
66
+margin_right = 300.0
67 67
 margin_bottom = 901.0
68 68
 __meta__ = {
69 69
 "_edit_use_anchors_": false
@@ -71,9 +71,9 @@ __meta__ = {
71 71
 
72 72
 [node name="Panel" type="Panel" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer"]
73 73
 margin_top = 200.0
74
-margin_right = 350.0
74
+margin_right = 300.0
75 75
 margin_bottom = 700.0
76
-rect_min_size = Vector2( 350, 500 )
76
+rect_min_size = Vector2( 300, 500 )
77 77
 custom_styles/panel = ExtResource( 5 )
78 78
 
79 79
 [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel"]
@@ -92,13 +92,13 @@ __meta__ = {
92 92
 [node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer"]
93 93
 margin_left = 20.0
94 94
 margin_top = 20.0
95
-margin_right = 330.0
95
+margin_right = 280.0
96 96
 margin_bottom = 480.0
97 97
 
98 98
 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer"]
99
-margin_left = 37.0
99
+margin_left = 12.0
100 100
 margin_top = 46.0
101
-margin_right = 272.0
101
+margin_right = 247.0
102 102
 margin_bottom = 414.0
103 103
 custom_constants/separation = 20
104 104
 __meta__ = {
@@ -152,8 +152,8 @@ margin_bottom = 102.0
152 152
 text = "Quitter"
153 153
 
154 154
 [node name="Characters" type="Control" parent="MarginContainer/VBoxContainer/HBoxContainer"]
155
-margin_left = 354.0
156
-margin_right = 1720.0
155
+margin_left = 304.0
156
+margin_right = 1770.0
157 157
 margin_bottom = 901.0
158 158
 size_flags_horizontal = 3
159 159
 
@@ -195,7 +195,7 @@ __meta__ = {
195 195
 
196 196
 [node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
197 197
 margin_top = 1046.0
198
-margin_right = 1720.0
198
+margin_right = 1770.0
199 199
 margin_bottom = 1060.0
200 200
 text = "Serious Game on Ethics v0.1"
201 201
 align = 2

+ 45
- 0
scenes/animal/AnimalScene.gd View File

@@ -0,0 +1,45 @@
1
+extends "res://util/StatsHandler.gd"
2
+
3
+
4
+onready var text_container = $MarginContainer
5
+onready var animal_container = $CenterContainer
6
+onready var animal_texture = $CenterContainer/AnimalTexture
7
+onready var animal_name = $MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer/Title
8
+onready var animal_description = $MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer/Content
9
+onready var tween = $Tween
10
+
11
+var animation_played := false
12
+
13
+
14
+export(Array, Texture) var animals := []
15
+export(Array, String) var names := []
16
+export(Array, String, MULTILINE) var descriptions := []
17
+
18
+
19
+var max_gauge : String
20
+
21
+
22
+func _ready() -> void:
23
+	var max_gauge = gauges_values.find(gauges_values.max())
24
+	if max_gauge < animals.size() and max_gauge < names.size() and max_gauge < descriptions.size():
25
+		animal_texture.texture = animals[max_gauge]
26
+		animal_name.text = names[max_gauge]
27
+		animal_description.text = descriptions[max_gauge]
28
+	BackgroundMusic.crossfade_to("res://music/menu_principal.ogg", -10, 1)
29
+
30
+
31
+func play_start_animation():
32
+		tween.interpolate_property(text_container, "rect_position", null, Vector2(0, 0), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
33
+		tween.interpolate_property(animal_container, "rect_position", null, Vector2(0, -100), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
34
+		tween.interpolate_property(animal_texture, "rect_scale", null, Vector2(0.8, 0.8), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
35
+		tween.start()
36
+
37
+
38
+func _input(event: InputEvent) -> void:
39
+	if event.is_action_pressed("dialogic_next"):
40
+		if not animation_played:
41
+			animation_played = true
42
+			play_start_animation()
43
+		else:
44
+			Transit.change_scene("res://scenes/end-screen/EndRecap.tscn", 2)
45
+

+ 126
- 0
scenes/animal/AnimalScene.tscn View File

@@ -0,0 +1,126 @@
1
+[gd_scene load_steps=11 format=2]
2
+
3
+[ext_resource path="res://images/animals/castor.png" type="Texture" id=1]
4
+[ext_resource path="res://scenes/animal/AnimalScene.gd" type="Script" id=2]
5
+[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=3]
6
+[ext_resource path="res://fonts/PanelTitleFont.tres" type="DynamicFont" id=4]
7
+[ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=5]
8
+[ext_resource path="res://images/animals/renard.png" type="Texture" id=6]
9
+[ext_resource path="res://images/animals/chien.png" type="Texture" id=7]
10
+[ext_resource path="res://images/animals/dauphin.png" type="Texture" id=8]
11
+[ext_resource path="res://images/animals/abeille.png" type="Texture" id=9]
12
+
13
+[sub_resource type="DynamicFont" id=1]
14
+size = 25
15
+outline_size = 1
16
+outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
17
+font_data = ExtResource( 5 )
18
+
19
+[node name="AnimalScene" type="Control"]
20
+anchor_right = 1.0
21
+anchor_bottom = 1.0
22
+script = ExtResource( 2 )
23
+__meta__ = {
24
+"_edit_use_anchors_": false
25
+}
26
+animals = [ ExtResource( 1 ), ExtResource( 8 ), ExtResource( 6 ), ExtResource( 9 ), ExtResource( 7 ) ]
27
+names = [ "Castor", "Dauphin", "Renard", "Abeille", "Chien" ]
28
+descriptions = [ "Au fil de toutes vos décisions lors de ce jeu, vous avez majoritairement priorisé le travail à accomplir devant toute forme de distraction. Vous êtes sérieux, attentif et veillez au bon déroulement des projets auxquels vous êtes associés. Attention cependant à ne pas négliger les relations sociales, une pause peut être bienvenue par moment.", "Au fil de toutes vos décisions lors de ce jeu, vous n’avez pas hésité à vous nourrir des informations à votre portée. Vous appréciez vous former par vous même sur des sujets qui vous intéressent mais aussi apprendre des autres qui sont pour vous une source inépuisable de savoir. Attention cependant que cette curiosité ne devienne pas compulsive et nuise au respect d’autrui.", "Au fil de toutes vos décisions lors de ce jeu, vous avez veillé majoritairement à mettre votre santé financière ou bien celle de votre entreprise au premier plan. Pour vous, l’argent a une place importante autant dans la société que dans le monde du travail et en posséder représente un avantage de taille. Attention cependant à ne pas négliger d’autres valeurs qui peuvent sembler moins avantageuse du point de vue financier. ", "Au fil de vos décisions lors de ce jeu, vous avez majoritairement favorisé des choix éco-responsables. L’écologie est importante pour vous et vous avez à cœur de prendre des décisions qui permettent un avancement concernant la protection de l’environnement. Attention cependant à ne pas prendre des décisions trop utopiques qui pourraient ne pas se révéler efficaces et réalisables.", "Au fil de vos décisions lors de ce jeu, le bien-être et le respect d’autrui ont été au centre de vos choix. Vous prêtez beaucoup attention aux personnes qui vous entourent et vous veillez à développer au maximum vos relations, aussi bien avec vos collègues de travail qu’avec vos relations personnelles. Attention cependant à ne pas oublier votre propre bien-être en dépit de celui des autres. " ]
29
+
30
+[node name="ColorRect" type="ColorRect" parent="."]
31
+anchor_right = 1.0
32
+anchor_bottom = 1.0
33
+mouse_filter = 1
34
+color = Color( 0.113725, 0.113725, 0.113725, 1 )
35
+__meta__ = {
36
+"_edit_use_anchors_": false
37
+}
38
+
39
+[node name="CenterContainer" type="CenterContainer" parent="."]
40
+anchor_right = 1.0
41
+anchor_bottom = 1.0
42
+__meta__ = {
43
+"_edit_use_anchors_": false
44
+}
45
+
46
+[node name="AnimalTexture" type="TextureRect" parent="CenterContainer"]
47
+margin_left = 560.0
48
+margin_top = 140.0
49
+margin_right = 1360.0
50
+margin_bottom = 940.0
51
+rect_min_size = Vector2( 800, 800 )
52
+rect_pivot_offset = Vector2( 400, 400 )
53
+texture = ExtResource( 1 )
54
+expand = true
55
+stretch_mode = 6
56
+
57
+[node name="MarginContainer" type="MarginContainer" parent="."]
58
+anchor_right = 1.0
59
+anchor_bottom = 1.0
60
+margin_top = 400.0
61
+margin_bottom = 400.0
62
+custom_constants/margin_top = 700
63
+custom_constants/margin_bottom = 0
64
+__meta__ = {
65
+"_edit_use_anchors_": false
66
+}
67
+
68
+[node name="CenterContainer" type="CenterContainer" parent="MarginContainer"]
69
+margin_top = 700.0
70
+margin_right = 1920.0
71
+margin_bottom = 1080.0
72
+
73
+[node name="Panel" type="Panel" parent="MarginContainer/CenterContainer"]
74
+margin_left = 509.0
75
+margin_top = 14.0
76
+margin_right = 1409.0
77
+margin_bottom = 364.0
78
+rect_min_size = Vector2( 900, 350 )
79
+custom_styles/panel = ExtResource( 3 )
80
+__meta__ = {
81
+"_edit_group_": true,
82
+"_edit_use_anchors_": false
83
+}
84
+
85
+[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer/Panel"]
86
+anchor_right = 1.0
87
+anchor_bottom = 1.0
88
+custom_constants/margin_right = 20
89
+custom_constants/margin_top = 20
90
+custom_constants/margin_left = 20
91
+custom_constants/margin_bottom = 20
92
+__meta__ = {
93
+"_edit_use_anchors_": false
94
+}
95
+
96
+[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/Panel/MarginContainer"]
97
+margin_left = 20.0
98
+margin_top = 20.0
99
+margin_right = 880.0
100
+margin_bottom = 330.0
101
+__meta__ = {
102
+"_edit_use_anchors_": false
103
+}
104
+
105
+[node name="Title" type="Label" parent="MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer"]
106
+margin_right = 860.0
107
+margin_bottom = 42.0
108
+custom_fonts/font = ExtResource( 4 )
109
+text = "Le Castor"
110
+align = 1
111
+__meta__ = {
112
+"_edit_use_anchors_": false
113
+}
114
+
115
+[node name="Content" type="Label" parent="MarginContainer/CenterContainer/Panel/MarginContainer/VBoxContainer"]
116
+margin_top = 46.0
117
+margin_right = 860.0
118
+margin_bottom = 310.0
119
+size_flags_vertical = 3
120
+custom_fonts/font = SubResource( 1 )
121
+text = "Au fil de toutes vos décisions lors de ce jeu, vous avez majoritairement priorisé le travail à accomplir devant toute forme de distraction. Vous êtes sérieux, attentif et veillez au bon déroulement des projets auxquels vous êtes associés. Attention cependant à ne pas négliger les relations sociales, une pause peut être bienvenue par moment.
122
+"
123
+align = 3
124
+autowrap = true
125
+
126
+[node name="Tween" type="Tween" parent="."]

+ 2
- 2
scenes/end-screen/ChoiceCircle.gd View File

@@ -7,7 +7,7 @@ export(Array, String, MULTILINE) var choices_descriptions = []
7 7
 
8 8
 
9 9
 var choice : int = 0 setget set_choice
10
-
10
+export(float) var info_panel_height := 500.0
11 11
 
12 12
 onready var tween = $Tween
13 13
 onready var hover_control = $HoverControl
@@ -25,6 +25,7 @@ func _ready():
25 25
 	hover_control.infobox_position = "top"
26 26
 	hover_control.info_panel.title = ""
27 27
 	hover_control.info_panel.content = ""
28
+	hover_control.info_panel_height = info_panel_height
28 29
 
29 30
 
30 31
 func start_anim():
@@ -48,7 +49,6 @@ func _set_description():
48 49
 
49 50
 
50 51
 func set_choice(new_value: int):
51
-	print("setting choice")
52 52
 	choice = new_value
53 53
 	_set_description()
54 54
 	start_anim()

+ 1
- 1
scenes/end-screen/EndCharacter.tscn View File

@@ -19,7 +19,7 @@ anchor_bottom = 1.0
19 19
 mouse_default_cursor_shape = 2
20 20
 texture = ExtResource( 1 )
21 21
 expand = true
22
-stretch_mode = 5
22
+stretch_mode = 6
23 23
 __meta__ = {
24 24
 "_edit_use_anchors_": false
25 25
 }

+ 26
- 66
scenes/end-screen/EndRecap.gd View File

@@ -1,27 +1,9 @@
1
-extends Control
2
-
3
-var GAUGE_PREFIX = "jauge_"
4
-var RELATIONS_PREFIX = "relation_"
5
-var CHOICES_PREFIX = "choix_"
6
-
7
-var gauges_names := ["travail", "education", "financier", "ecologie", "social"]
8
-var relations_names := ["evelyne", "jm"]
9
-var choices_names := ["tel_ouvert"]
10
-
11
-var gauges_ranges := [[-11, 14], [-9, 23], [-23, 24], [-13, 16], [-16, 17]]
12
-var relations_ranges := [[-5, 6], [-3, 5]]
13
-
14
-var gauges_values := []
15
-var relations_values := []
16
-var choices_values := []
17
-
18
-var gauges := {}
19
-var relations := {}
20
-var choices := {}
1
+extends "res://util/StatsHandler.gd"
21 2
 
22 3
 onready var progress_container = $VBoxContainer/Control/RecapContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/GaugesContainer
23 4
 onready var choices_container = $VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2
24 5
 onready var main_container = $VBoxContainer/Control
6
+onready var main_tween = $VBoxContainer/Control/Tween
25 7
 onready var recap_container = $VBoxContainer/Control/RecapContainer
26 8
 onready var characters_container = $VBoxContainer/Control/CharactersContainer
27 9
 onready var gauges_timer = $GaugesTimer
@@ -33,10 +15,6 @@ var shown_choice_index = 0
33 15
 func _ready():
34 16
 	progress_container.connect("mouse_entered", self, '_on_mouse_entered')
35 17
 	progress_container.connect("mouse_exited", self, '_on_mouse_exited')
36
-	_recover_variables()
37
-	gauges_values = _get_percentages(gauges, gauges_names, gauges_ranges)
38
-	relations_values = _get_percentages(relations, relations_names, relations_ranges)
39
-	choices_values = _get_choices_array()
40 18
 	
41 19
 	_set_characters_relations()
42 20
 	
@@ -48,56 +26,40 @@ func _ready():
48 26
 	# Do not wait to show the first choice
49 27
 	_on_ChoicesTimer_timeout()
50 28
 	choices_timer.start()
29
+	
30
+	_play_start_animation()
51 31
 
52 32
 
53
-func _on_mouse_exited():
54
-	main_container.move_child(recap_container, 0)
33
+
34
+func _play_start_animation():
35
+	main_tween.interpolate_property(recap_container, "rect_position", Vector2(0, recap_container.rect_size.y/3), Vector2(0, 0), 0.8, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
36
+	main_tween.interpolate_property(recap_container, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), 0.8, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
55 37
 	
38
+	_setup_character_animation(characters_container.get_child(0), true)
39
+	_setup_character_animation(characters_container.get_child(2), false)
40
+	main_tween.start()
41
+
42
+
43
+func _setup_character_animation(character: Control, is_left: bool):
44
+	var delay = 0.3 if is_left else 0.5
45
+	var x_pos = character.rect_position.x - character.rect_size.x/3 if is_left else character.rect_position.x + character.rect_size.x/3
46
+	character.modulate = Color(1, 1, 1, 0)
47
+	main_tween.interpolate_property(character, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), 0.8, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT, delay)
48
+	main_tween.interpolate_property(character, "rect_position", Vector2(x_pos, character.rect_position.y), character.rect_position, 0.8, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT, delay)
56 49
 	
50
+
51
+
52
+func _on_mouse_exited():
53
+	main_container.move_child(recap_container, 0)
54
+
55
+
57 56
 func _on_mouse_entered():
58 57
 	# Make sure the recap is behind the characters
59 58
 	# This allows showing the infobox above the recap
60 59
 	main_container.move_child(recap_container, 1)
61 60
 
62 61
 
63
-func _recover_variables():
64
-	var definitions = Dialogic.get_definitions()
65
-	# Get relations and gauges from variables
66
-	for d in definitions["variables"]:
67
-		for g in gauges_names:
68
-			if d["name"] == GAUGE_PREFIX + g:
69
-				gauges[g] = d
70
-		for r in relations_names:
71
-			if d["name"] == RELATIONS_PREFIX + r:
72
-				relations[r] = d
73
-		for c in choices_names:
74
-			if d["name"] == CHOICES_PREFIX + c:
75
-				choices[c] = d
76
-	print(gauges)
77
-	print("--")
78
-	print(relations)
79
-	print("--")
80
-	print(choices)
81
-
82
-
83
-func _get_percentages(data: Dictionary, names: Array, ranges: Array) -> Array:
84
-	var final_array := []
85
-	for i in range(0, data.size()):
86
-		var val = float(data[names[i]]["value"])
87
-		var min_max = ranges[i]
88
-		# Adjust offset
89
-		val -= min_max[0]
90
-		# Get whole range
91
-		var total_range = min_max[1] - min_max[0]
92
-		final_array.append(100 * val / total_range)
93
-	return final_array
94
-
95
-
96
-func _get_choices_array() -> Array:
97
-	var final_array := []
98
-	for i in range(0, choices.size()):
99
-		final_array.append(choices[choices_names[i]]["value"])
100
-	return final_array
62
+
101 63
 
102 64
 
103 65
 func _set_characters_relations():
@@ -118,11 +80,9 @@ func _on_GaugesTimer_timeout() -> void:
118 80
 
119 81
 
120 82
 func _on_ChoicesTimer_timeout() -> void:
121
-	print("timeout")
122 83
 	# take spacers into account
123 84
 	var c = choices_container.get_child(shown_choice_index * 2)
124 85
 	if shown_choice_index < choices_values.size():
125
-		print(choices_values[shown_choice_index / 2])
126 86
 		c.choice = int(choices_values[shown_choice_index / 2])
127 87
 		shown_choice_index += 1
128 88
 		if shown_choice_index >= choices_container.get_child_count():

+ 25
- 6
scenes/end-screen/EndRecap.tscn View File

@@ -167,6 +167,9 @@ margin_right = 248.0
167 167
 margin_bottom = 337.0
168 168
 gauge_name = "Travail"
169 169
 gauge_color = Color( 0.576471, 0.345098, 0.313726, 1 )
170
+description_bad = "Le travail n’est pas une valeur au centre de vos priorités et vous vous laissez facilement distraire. Vous préférez profiter de la vie et saisir les opportunités qui se présentent à vous parfois en dépit de votre travail."
171
+description_neutral = "Pour vous le travail est une valeur importante mais pas capitale. Vous avez à cœur de vous investir et de mener à bien vos projets mais vous vous laissez parfois distraire. "
172
+description_good = "Prioriser le travail à accomplir devant toute forme de distraction est capital pour vous. Vous êtes sérieux, attentif et veillez au bon déroulement des projets auxquels vous êtes associés ce qui fait de vous un employé efficace."
170 173
 
171 174
 [node name="EducationProgress" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/GaugesContainer" instance=ExtResource( 9 )]
172 175
 margin_left = 252.0
@@ -174,6 +177,9 @@ margin_right = 372.0
174 177
 margin_bottom = 337.0
175 178
 gauge_name = "Éducation"
176 179
 gauge_color = Color( 0.0627451, 0.764706, 0.933333, 1 )
180
+description_bad = "Vous vous contentez des connaissances apportées par votre environnement et ne cherchez pas à approfondir certains sujets."
181
+description_neutral = "Être curieux et apprendre de nouvelles choses est quelque chose d’important pour vous mais vous vous contentez parfois de vos connaissances sans chercher à en apprendre d’avantage."
182
+description_good = "Vous n'hésitez pas à vous nourrir des informations à votre portée. Vous appréciez vous former par vous même sur des sujets qui vous intéressent mais aussi apprendre des autres qui sont pour vous une source inépuisable de savoir."
177 183
 
178 184
 [node name="FinancesProgress" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/GaugesContainer" instance=ExtResource( 9 )]
179 185
 margin_left = 376.0
@@ -181,6 +187,9 @@ margin_right = 496.0
181 187
 margin_bottom = 337.0
182 188
 gauge_name = "Finances"
183 189
 gauge_color = Color( 0.996078, 0.403922, 0.2, 1 )
190
+description_bad = "Vous ne prêtez pas attention à l’argent et ne basez pas vos décisions sur l’aspect financier. Pour vous d’autres valeurs sont plus essentielles. Cependant, attention à ne pas oublier que l’argent reste omniprésent dans la société actuelle. "
191
+description_neutral = "Pour vous l’argent est un moyen de réaliser vos projets mais n’est pas une fin en soi. Vous êtes conscient qu’il a une place importante autant dans la société que dans le monde du travail mais ne basez pas toutes vos décisions dans ce sens. "
192
+description_good = "Vous veillez à mettre votre santé financière ou bien celle de votre entreprise au premier plan. Pour vous, l’argent a une place importante autant dans la société que dans le monde du travail et en posséder représente un avantage de taille."
184 193
 
185 194
 [node name="EcologyProgress" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/GaugesContainer" instance=ExtResource( 9 )]
186 195
 margin_left = 500.0
@@ -188,6 +197,9 @@ margin_right = 620.0
188 197
 margin_bottom = 337.0
189 198
 gauge_name = "Écologie"
190 199
 gauge_color = Color( 0.984314, 0.752941, 0.156863, 1 )
200
+description_bad = "Pour vous les enjeux autour de la protection de l’environnement et de l’écologie ne sont pas capitaux et d’actualité. Selon vous, il y a d’autres problèmes plus majeurs à prioriser. "
201
+description_neutral = "Vous êtes conscient de l’importance des enjeux concernant la protection de l’environnement et l’écologie. Vous faites votre maximum pour adopter un mode de vie éco-responsable mais vous avez parfois des difficultés à réaliser ces objectifs."
202
+description_good = "L’écologie est importante pour vous et vous avez à cœur de prendre des décisions qui permettent un avancement concernant la protection de l’environnement. Vous valorisez un mode de vie éco-responsable et essayez au maximum de sensibiliser vos collègues et amis à ce sujet."
191 203
 
192 204
 [node name="SocialProgress" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/MarginContainer/GaugesContainer" instance=ExtResource( 9 )]
193 205
 margin_left = 624.0
@@ -195,6 +207,9 @@ margin_right = 744.0
195 207
 margin_bottom = 337.0
196 208
 gauge_name = "Social"
197 209
 gauge_color = Color( 0.839216, 0.556863, 0.192157, 1 )
210
+description_bad = " Vous êtes un loup solitaire, les relations sociales ne sont pas votre priorité. Vous accordez plus d’importance à d’autres aspects de la vie et du travail qu’à l’entretien de relations qu’elles soient amicales ou avec vos collègues."
211
+description_neutral = "Vous prêtez attention aux personnes qui vous entourent et leur bien-être vous importe. Vous veillez à ce que vos relations, aussi bien avec vos collègues de travail qu’avec vos relations personnelles, restent cordiales."
212
+description_good = "Le bien-être et le respect d’autrui ont été au centre de vos choix. Vous prêtez beaucoup attention aux personnes qui vous entourent et vous veillez à développer au maximum vos relations, aussi bien avec vos collègues de travail qu’avec vos relations personnelles."
198 213
 
199 214
 [node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel/MarginContainer/VBoxContainer"]
200 215
 margin_top = 467.0
@@ -202,11 +217,11 @@ margin_right = 872.0
202 217
 margin_bottom = 519.0
203 218
 
204 219
 [node name="ExitButton" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel/MarginContainer/VBoxContainer/CenterContainer" instance=ExtResource( 4 )]
205
-margin_left = 269.0
220
+margin_left = 321.0
206 221
 margin_top = 0.0
207
-margin_right = 603.0
222
+margin_right = 550.0
208 223
 margin_bottom = 52.0
209
-text = "Sauvegarder et quitter"
224
+text = "Menu Principal"
210 225
 
211 226
 [node name="SpacerRight" type="Control" parent="VBoxContainer/Control/RecapContainer"]
212 227
 margin_left = 1520.0
@@ -257,6 +272,8 @@ description_bad = "bad"
257 272
 description_neutral = "neutral"
258 273
 description_good = "good"
259 274
 
275
+[node name="Tween" type="Tween" parent="VBoxContainer/Control"]
276
+
260 277
 [node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
261 278
 margin_top = 850.0
262 279
 margin_right = 1920.0
@@ -309,7 +326,9 @@ margin_top = 0.0
309 326
 margin_right = 150.0
310 327
 margin_bottom = 200.0
311 328
 rect_rotation = 0.0
312
-dilemma_name = "Dilemma 1"
329
+dilemma_name = "Dilemme 1"
330
+choices_names = [ "Téléphone fermé", "Téléphone ouvert" ]
331
+choices_descriptions = [ "Vous avez choisi de faire en sorte que l’utilisateur ne puisse pas avoir accès aux composants de son téléphone. Cela permet de développer un téléphone toujours plus innovant et à la pointe de la technologie qui serait donc très attractif sur le marché. De plus, les utilisateurs n’ayant pas la possibilité de réparer leur téléphones, ils se tourneront plus facilement vers des modèles neufs ce qui peut générer plus de chiffre d'affaires pour l’entreprise. En revanche, cela encourage la surconsommation qui a un impact désastreux sur l’environnement. Lors de la phase utilisateur il vous a donc été plus difficile de remplacer votre écran cassé, cependant, parmi vos amis vous aviez le téléphone le plus esthétique.", "Vous avez choisi de faire en sorte que l’utilisateur puisse ouvrir son téléphone. Cela permet donc d’encourager le remplacement et le recyclage de pièces,d’aller à l’encontre de la surconsommation et de promouvoir une image éco-responsable pour l’entreprise. En revanche, cela signifie aussi renoncer à certaines innovations non compatibles avec le fait que le téléphone puisse s’ouvrir et renoncer à une certaine part de marché habitué aux innovations. Lors de la phase utilisateur il vous a donc été plus simple de remplacer votre écran cassé , cependant, parmi vos amis vous n’aviez pas le téléphone le plus esthétique." ]
313 332
 
314 333
 [node name="Spacer" type="Control" parent="VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2"]
315 334
 margin_left = 154.0
@@ -323,7 +342,7 @@ margin_top = 0.0
323 342
 margin_right = 815.0
324 343
 margin_bottom = 200.0
325 344
 rect_rotation = 0.0
326
-dilemma_name = "Dilemma 2"
345
+dilemma_name = "Dilemme 2"
327 346
 
328 347
 [node name="Spacer2" type="Control" parent="VBoxContainer/MarginContainer/MarginContainer/HBoxContainer2"]
329 348
 margin_left = 819.0
@@ -337,7 +356,7 @@ margin_top = 0.0
337 356
 margin_right = 1480.0
338 357
 margin_bottom = 200.0
339 358
 rect_rotation = 0.0
340
-dilemma_name = "Dilemma 2"
359
+dilemma_name = "Dilemme 3"
341 360
 
342 361
 [node name="GaugesTimer" type="Timer" parent="."]
343 362
 wait_time = 0.5

+ 9
- 1
scenes/end-screen/HoverControl.gd View File

@@ -4,6 +4,9 @@ var selection_object: Control
4 4
 var infobox_position := "left"
5 5
 
6 6
 
7
+var info_panel_height := 200.0 setget set_info_panel_height
8
+
9
+
7 10
 onready var hover_tween = $HoverTween
8 11
 onready var info_panel = $Control/InfoPanel
9 12
 
@@ -13,6 +16,7 @@ func _ready():
13 16
 	connect("mouse_entered", self, '_on_mouse_entered')
14 17
 	connect("mouse_exited", self, '_on_mouse_exited')
15 18
 	hover_tween.connect("tween_completed", self, "_on_HoverTween_tween_completed")
19
+	info_panel.rect_size.y = info_panel_height
16 20
 
17 21
 
18 22
 func _on_mouse_exited():
@@ -55,4 +59,8 @@ func set_infobox_position():
55 59
 func _on_HoverTween_tween_completed(object: Object, key: NodePath):
56 60
 	if object == info_panel and info_panel.modulate == Color(1, 1, 1, 0):
57 61
 		info_panel.hide()
58
-		
62
+
63
+
64
+func set_info_panel_height(new_value: float):
65
+	info_panel_height = new_value
66
+	info_panel.rect_size.y = info_panel_height

+ 2
- 2
scenes/end-screen/HoverControl.tscn View File

@@ -42,8 +42,8 @@ __meta__ = {
42 42
 [node name="InfoPanel" parent="Control" instance=ExtResource( 1 )]
43 43
 visible = false
44 44
 margin_left = 960.0
45
-margin_right = 1320.0
46
-margin_bottom = 360.0
45
+margin_right = 1360.0
46
+size_flags_vertical = 3
47 47
 custom_styles/panel = SubResource( 1 )
48 48
 
49 49
 [node name="HoverTween" type="Tween" parent="."]

+ 14
- 23
scenes/end-screen/InfoPanel.tscn View File

@@ -1,24 +1,14 @@
1
-[gd_scene load_steps=7 format=2]
1
+[gd_scene load_steps=5 format=2]
2 2
 
3
-[ext_resource path="res://fonts/open-sans/OpenSans-Bold.ttf" type="DynamicFontData" id=1]
4
-[ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=2]
3
+[ext_resource path="res://fonts/PanelTitleFont.tres" type="DynamicFont" id=1]
4
+[ext_resource path="res://fonts/PanelContentFont.tres" type="DynamicFont" id=2]
5 5
 [ext_resource path="res://scenes/end-screen/InfoPanel.gd" type="Script" id=3]
6 6
 [ext_resource path="res://styles/Panel.tres" type="StyleBox" id=4]
7 7
 
8
-[sub_resource type="DynamicFont" id=1]
9
-size = 30
10
-outline_size = 3
11
-outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
12
-font_data = ExtResource( 1 )
13
-
14
-[sub_resource type="DynamicFont" id=2]
15
-outline_size = 1
16
-outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
17
-font_data = ExtResource( 2 )
18
-
19 8
 [node name="InfoPanel" type="Panel"]
20
-anchor_right = 1.0
21
-anchor_bottom = 1.0
9
+margin_right = 400.0
10
+margin_bottom = 200.0
11
+rect_min_size = Vector2( 400, 300 )
22 12
 mouse_filter = 2
23 13
 custom_styles/panel = ExtResource( 4 )
24 14
 script = ExtResource( 3 )
@@ -41,14 +31,14 @@ __meta__ = {
41 31
 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
42 32
 margin_left = 20.0
43 33
 margin_top = 20.0
44
-margin_right = 1900.0
45
-margin_bottom = 1060.0
34
+margin_right = 380.0
35
+margin_bottom = 280.0
46 36
 mouse_filter = 2
47 37
 
48 38
 [node name="Title" type="Label" parent="MarginContainer/VBoxContainer"]
49
-margin_right = 1880.0
39
+margin_right = 360.0
50 40
 margin_bottom = 42.0
51
-custom_fonts/font = SubResource( 1 )
41
+custom_fonts/font = ExtResource( 1 )
52 42
 text = "Title"
53 43
 align = 1
54 44
 __meta__ = {
@@ -57,12 +47,13 @@ __meta__ = {
57 47
 
58 48
 [node name="Content" type="RichTextLabel" parent="MarginContainer/VBoxContainer"]
59 49
 margin_top = 46.0
60
-margin_right = 1880.0
61
-margin_bottom = 1040.0
50
+margin_right = 360.0
51
+margin_bottom = 260.0
62 52
 mouse_filter = 2
63 53
 size_flags_vertical = 3
64
-custom_fonts/normal_font = SubResource( 2 )
54
+custom_fonts/normal_font = ExtResource( 2 )
65 55
 text = "Content"
56
+scroll_active = false
66 57
 __meta__ = {
67 58
 "_edit_use_anchors_": false
68 59
 }

+ 63
- 0
util/StatsHandler.gd View File

@@ -0,0 +1,63 @@
1
+extends Control
2
+
3
+var GAUGE_PREFIX = "jauge_"
4
+var RELATIONS_PREFIX = "relation_"
5
+var CHOICES_PREFIX = "choix_"
6
+
7
+var gauges_names := ["travail", "education", "financier", "ecologie", "social"]
8
+var relations_names := ["evelyne", "jm"]
9
+var choices_names := ["tel_ouvert", "mdr"]
10
+
11
+var gauges_ranges := [[-11, 14], [-9, 23], [-23, 24], [-13, 16], [-16, 17]]
12
+var relations_ranges := [[-5, 6], [-3, 5]]
13
+
14
+var gauges_values := []
15
+var relations_values := []
16
+var choices_values := []
17
+
18
+var gauges := {}
19
+var relations := {}
20
+var choices := {}
21
+
22
+
23
+func _ready() -> void:
24
+	_recover_variables()
25
+	gauges_values = _get_percentages(gauges, gauges_names, gauges_ranges)
26
+	relations_values = _get_percentages(relations, relations_names, relations_ranges)
27
+	choices_values = _get_choices_array()
28
+
29
+
30
+func _recover_variables():
31
+	var definitions = Dialogic.get_definitions()
32
+	# Get relations and gauges from variables
33
+	for d in definitions["variables"]:
34
+		for g in gauges_names:
35
+			if d["name"] == GAUGE_PREFIX + g:
36
+				gauges[g] = d
37
+		for r in relations_names:
38
+			if d["name"] == RELATIONS_PREFIX + r:
39
+				relations[r] = d
40
+		for c in choices_names:
41
+			if d["name"] == CHOICES_PREFIX + c:
42
+				choices[c] = d
43
+	print(choices)
44
+
45
+
46
+func _get_percentages(data: Dictionary, names: Array, ranges: Array) -> Array:
47
+	var final_array := []
48
+	for i in range(0, data.size()):
49
+		var val = float(data[names[i]]["value"])
50
+		var min_max = ranges[i]
51
+		# Adjust offset
52
+		val -= min_max[0]
53
+		# Get whole range
54
+		var total_range = min_max[1] - min_max[0]
55
+		final_array.append(100 * val / total_range)
56
+	return final_array
57
+
58
+
59
+func _get_choices_array() -> Array:
60
+	var final_array := []
61
+	for i in range(0, choices.size()):
62
+		final_array.append(choices[choices_names[i]]["value"])
63
+	return final_array

Loading…
Cancel
Save