feature/templating-level (#74)
Co-authored-by: VAILLANT Jeremy <vaillant.jeremy@dev-crea.com> Reviewed-on: Athena/game-source#74 Co-authored-by: darknight <vaillant.jeremy@dev-crea.com> Co-committed-by: darknight <vaillant.jeremy@dev-crea.com>
This commit is contained in:
@@ -58,7 +58,5 @@ $RECYCLE.BIN/
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/godot,linux,windows
|
||||
|
||||
|
||||
# Ignore folders releases and build Android
|
||||
releases
|
||||
android
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/Main.gd" type="Script" id=1]
|
||||
[ext_resource path="res://scenes/UI/title/UI_title.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scenes/UI/title/Title.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scenes/UI/choose_scenes/ChooseScene.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://scenes/UI/settings/Settings.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://scenes/UI/Background.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://scenes/UI/UI_summary.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://scenes/UI/background/Background.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://scenes/UI/summary/Summary.tscn" type="PackedScene" id=8]
|
||||
|
||||
[node name="Main" type="Control"]
|
||||
anchor_right = 1.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
extends Control
|
||||
|
||||
export (PackedScene) var template = load("res://scenes/levels/Template.tscn")
|
||||
export (PackedScene) var template = load("res://scenes/levels/parts/Template.tscn")
|
||||
|
||||
onready var mlevel = load("res://db/MLevel.gd")
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/UI/Ending.gd" type="Script" id=1]
|
||||
[ext_resource path="res://scenes/UI/ending/Ending.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/sounds/victory.ogg" type="AudioStream" id=2]
|
||||
[ext_resource path="res://assets/fonts/MKX Title.ttf" type="DynamicFontData" id=3]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource path="res://scenes/UI/loading/parts/LoadingBare.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scenes/UI/loading/parts/TopPart.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scenes/UI/Background.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://scenes/UI/background/Background.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "BorderAnim"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[gd_scene load_steps=27 format=2]
|
||||
|
||||
[ext_resource path="res://assets/ui/themes/button-summary.jpg" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/bck-vert-grd.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/ui/icones/treasure.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/ui/themes/wood-tile.jpg" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/ui/themes/button-summary-hover.jpg" type="Texture" id=5]
|
||||
[ext_resource path="res://assets/ui/icones/treasure-hover.png" type="Texture" id=6]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=7]
|
||||
[ext_resource path="res://assets/fonts/text_outline.material" type="Material" id=8]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_title.tres" type="DynamicFont" id=9]
|
||||
[ext_resource path="res://assets/ui/themes/button-summary-hover.jpg" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/button-summary.jpg" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_title.tres" type="DynamicFont" id=4]
|
||||
[ext_resource path="res://assets/ui/icones/treasure.png" type="Texture" id=5]
|
||||
[ext_resource path="res://assets/fonts/text_outline.material" type="Material" id=6]
|
||||
[ext_resource path="res://assets/ui/icones/treasure-hover.png" type="Texture" id=7]
|
||||
[ext_resource path="res://assets/ui/themes/bck-vert-grd.png" type="Texture" id=8]
|
||||
[ext_resource path="res://assets/ui/themes/wood-tile.jpg" type="Texture" id=9]
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorOp" id=1]
|
||||
operator = 3
|
||||
@@ -40,7 +40,7 @@ operator = 2
|
||||
input_name = "screen_uv"
|
||||
|
||||
[sub_resource type="VisualShaderNodeTexture" id=11]
|
||||
texture = ExtResource( 4 )
|
||||
texture = ExtResource( 9 )
|
||||
texture_type = 1
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorCompose" id=12]
|
||||
@@ -179,7 +179,7 @@ __meta__ = {
|
||||
[node name="PanelWood" type="Panel" parent="."]
|
||||
material = SubResource( 17 )
|
||||
margin_right = 350.0
|
||||
margin_bottom = 720.0
|
||||
margin_bottom = 1080.0
|
||||
rect_min_size = Vector2( 350, 0 )
|
||||
size_flags_vertical = 3
|
||||
|
||||
@@ -196,45 +196,46 @@ __meta__ = {
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="PanelWood/VBoxContainer"]
|
||||
margin_right = 350.0
|
||||
margin_bottom = 128.0
|
||||
margin_bottom = 271.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TextureRect" type="TextureButton" parent="PanelWood/VBoxContainer/CenterContainer"]
|
||||
margin_left = 111.0
|
||||
margin_top = 71.0
|
||||
margin_right = 239.0
|
||||
margin_bottom = 128.0
|
||||
margin_bottom = 199.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 6 )
|
||||
texture_focused = ExtResource( 6 )
|
||||
texture_normal = ExtResource( 5 )
|
||||
texture_hover = ExtResource( 7 )
|
||||
texture_focused = ExtResource( 7 )
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="ButtonPuzzle" type="TextureButton" parent="PanelWood/VBoxContainer"]
|
||||
margin_top = 158.0
|
||||
margin_top = 301.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 235.0
|
||||
margin_bottom = 378.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_hover = ExtResource( 5 )
|
||||
texture_focused = ExtResource( 5 )
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 1 )
|
||||
texture_focused = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonPuzzle"]
|
||||
material = ExtResource( 8 )
|
||||
material = ExtResource( 6 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 9 )
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Puzzles"
|
||||
align = 1
|
||||
valign = 1
|
||||
@@ -244,26 +245,26 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="ButtonSetting" type="TextureButton" parent="PanelWood/VBoxContainer"]
|
||||
margin_top = 265.0
|
||||
margin_top = 408.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 342.0
|
||||
margin_bottom = 485.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_hover = ExtResource( 5 )
|
||||
texture_focused = ExtResource( 5 )
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 1 )
|
||||
texture_focused = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonSetting"]
|
||||
material = ExtResource( 8 )
|
||||
material = ExtResource( 6 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 9 )
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Paramètres"
|
||||
align = 1
|
||||
@@ -274,26 +275,26 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="ButtonCredits" type="TextureButton" parent="PanelWood/VBoxContainer"]
|
||||
margin_top = 372.0
|
||||
margin_top = 515.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 449.0
|
||||
margin_bottom = 592.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_hover = ExtResource( 5 )
|
||||
texture_focused = ExtResource( 5 )
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 1 )
|
||||
texture_focused = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonCredits"]
|
||||
material = ExtResource( 8 )
|
||||
material = ExtResource( 6 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 9 )
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Crédits"
|
||||
align = 1
|
||||
@@ -304,31 +305,31 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelWood/VBoxContainer"]
|
||||
margin_top = 479.0
|
||||
margin_top = 622.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 533.0
|
||||
margin_bottom = 893.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ButtonQuit" type="TextureButton" parent="PanelWood/VBoxContainer"]
|
||||
margin_top = 563.0
|
||||
margin_top = 923.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 640.0
|
||||
margin_bottom = 1000.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_hover = ExtResource( 5 )
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonQuit"]
|
||||
material = ExtResource( 8 )
|
||||
material = ExtResource( 6 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 7
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 9 )
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Quit"
|
||||
align = 1
|
||||
@@ -339,9 +340,9 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="ContainerVersion" type="HBoxContainer" parent="PanelWood/VBoxContainer"]
|
||||
margin_top = 670.0
|
||||
margin_top = 1030.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 690.0
|
||||
margin_bottom = 1050.0
|
||||
|
||||
[node name="MarginLeft" type="MarginContainer" parent="PanelWood/VBoxContainer/ContainerVersion"]
|
||||
margin_right = 283.0
|
||||
@@ -353,7 +354,7 @@ margin_left = 287.0
|
||||
margin_right = 334.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_vertical = 0
|
||||
custom_fonts/font = ExtResource( 7 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
custom_colors/font_color = Color( 0.741176, 0.478431, 0.372549, 1 )
|
||||
text = "v 0.0.0"
|
||||
align = 2
|
||||
@@ -366,19 +367,19 @@ size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.04
|
||||
|
||||
[node name="MarginContainerBottom" type="MarginContainer" parent="PanelWood/VBoxContainer"]
|
||||
margin_top = 720.0
|
||||
margin_top = 1080.0
|
||||
margin_right = 350.0
|
||||
margin_bottom = 720.0
|
||||
margin_bottom = 1080.0
|
||||
size_flags_stretch_ratio = 0.2
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
margin_left = 350.0
|
||||
margin_right = 446.0
|
||||
margin_bottom = 720.0
|
||||
margin_bottom = 1080.0
|
||||
rect_clip_content = true
|
||||
size_flags_horizontal = 11
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource( 2 )
|
||||
texture = ExtResource( 8 )
|
||||
stretch_mode = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
+52
-1
@@ -6,6 +6,10 @@ const OFFSET_CAMERA_MAX = 0.12
|
||||
const OFFSET_STEP_CHANGE = 0.01
|
||||
const RAY_LENGTH = 1000
|
||||
|
||||
export (PackedScene) var object_first = load("res://scenes/levels/parts/ObjectListFirst.tscn")
|
||||
export (PackedScene) var object_std = load("res://scenes/levels/parts/ObjectListStandard.tscn")
|
||||
export (PackedScene) var object_last = load("res://scenes/levels/parts/ObjectListLast.tscn")
|
||||
|
||||
onready var gyroscope_value_old = Vector3(0, 0, 0)
|
||||
onready var table = Global.database.get_table_by_name("scenes")
|
||||
onready var meshes = {}
|
||||
@@ -15,11 +19,58 @@ onready var mlevel = load("res://db/MLevel.gd")
|
||||
onready var mscene = load("res://db/MScene.gd")
|
||||
onready var victory_condition = 0
|
||||
onready var victory_progress = 0
|
||||
onready var last_btn = null
|
||||
|
||||
func _ready():
|
||||
_load_translations()
|
||||
_load_meshes()
|
||||
_back_button()
|
||||
_prepare_victory_condition()
|
||||
_display_hud_menu()
|
||||
_play_ambient_sound()
|
||||
|
||||
func _back_button():
|
||||
var _back = $Quit/TextureButton.connect("pressed", Event, "_on_main_scene_pressed")
|
||||
|
||||
func _display_hud_menu():
|
||||
var counter = 0
|
||||
var scene = null
|
||||
var label_counter = null
|
||||
|
||||
for key in meshes:
|
||||
scene = meshes[key]
|
||||
_create_button_info(scene, counter, label_counter)
|
||||
label_counter = scene.label_counter()
|
||||
counter = counter + 1
|
||||
|
||||
func _create_button_info(scene, counter, label_counter):
|
||||
var btn = null
|
||||
|
||||
if counter == 0:
|
||||
btn = object_first.instance()
|
||||
elif counter == meshes.size() - 1:
|
||||
btn = object_last.instance()
|
||||
else:
|
||||
btn = object_std.instance()
|
||||
|
||||
if label_counter != null and label_counter == scene.label_counter():
|
||||
last_btn.get_node("Label").set_text(last_btn.get_node("Label").text + " " + String(scene.counter()))
|
||||
last_btn.set_meta("name", scene.label())
|
||||
last_btn.set_meta("counter", scene.counter())
|
||||
last_btn.set_meta("counted", 0)
|
||||
else:
|
||||
$ListObjects/ListContainer.add_child(btn)
|
||||
btn.get_node("Label").set_text(scene.label())
|
||||
btn.set_meta("name", scene.label())
|
||||
btn.set_meta("counter", scene.counter())
|
||||
btn.set_meta("counted", 0)
|
||||
|
||||
last_btn = btn
|
||||
|
||||
func _play_ambient_sound():
|
||||
if Setting.get_setting_ambient_sound():
|
||||
$AmbientSound.play()
|
||||
$AmbientSound.stream_paused = false
|
||||
|
||||
func _prepare_victory_condition():
|
||||
var level = mlevel.new(Global.current_scene_int)
|
||||
@@ -122,7 +173,7 @@ func _start_dissolve(key):
|
||||
func _check_victory_condition():
|
||||
if victory_condition == victory_progress:
|
||||
print("[levels#_check_victory_condition] \\o/")
|
||||
Global.goto_scene("res://scenes/UI/Ending.tscn")
|
||||
Global.goto_scene("res://scenes/UI/ending/Ending.tscn")
|
||||
|
||||
func _node_to_mesh(key):
|
||||
return get_node(meshes[key].mesh())
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/levels/Levels.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/sounds/ambient-sound-level-warcraft.ogg" type="AudioStream" id=2]
|
||||
[ext_resource path="res://scenes/levels/parts/Back.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://scenes/levels/parts/ListObjects.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="Spatial" type="Spatial"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="ListObjects" parent="." instance=ExtResource( 4 )]
|
||||
|
||||
[node name="Quit" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="AmbientSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 2 )
|
||||
volume_db = -15.0
|
||||
stream_paused = true
|
||||
|
||||
[node name="ObjectFind" type="AudioStreamPlayer" parent="."]
|
||||
|
||||
@@ -1,5 +1,39 @@
|
||||
[gd_scene format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[node name="Spatial" type="Spatial"]
|
||||
[ext_resource path="res://scenes/levels/Levels.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://assets/hdri/tx_night_place.hdr" type="Texture" id=2]
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
[sub_resource type="PanoramaSky" id=1]
|
||||
panorama = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="Environment" id=2]
|
||||
background_mode = 3
|
||||
background_sky = SubResource( 1 )
|
||||
background_color = Color( 0.188235, 0.133333, 0.133333, 1 )
|
||||
background_energy = 0.6
|
||||
ambient_light_color = Color( 0.694118, 0.168627, 0.67451, 1 )
|
||||
ambient_light_energy = 1.55
|
||||
ambient_light_sky_contribution = 0.5
|
||||
fog_enabled = true
|
||||
fog_color = Color( 0.562167, 0.29, 1, 0.941176 )
|
||||
fog_depth_begin = 0.0
|
||||
fog_depth_end = 60.0
|
||||
fog_depth_curve = 1.10957
|
||||
fog_height_enabled = true
|
||||
fog_height_min = 2.0
|
||||
fog_height_max = -20.0
|
||||
fog_height_curve = 0.965936
|
||||
tonemap_mode = 2
|
||||
ss_reflections_enabled = true
|
||||
dof_blur_far_distance = 4.0
|
||||
glow_enabled = true
|
||||
|
||||
[node name="Home" instance=ExtResource( 1 )]
|
||||
|
||||
[node name="MainCamera" type="Camera" parent="." index="4"]
|
||||
transform = Transform( 0.160708, -0.25632, 0.953138, 0, 0.96569, 0.259696, -0.987002, -0.0417351, 0.155194, 1.84336, 1.66169, 0.663199 )
|
||||
environment = SubResource( 2 )
|
||||
fov = 38.5632
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://assets/ui/icones/skull.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-first.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-last.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/ui/themes/leather.theme" type="Theme" id=5]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=6]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-first-hover.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/leather.theme" type="Theme" id=2]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://assets/ui/icones/skull.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList.png" type="Texture" id=5]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-last-hover.png" type="Texture" id=6]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-hover.png" type="Texture" id=7]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-first-hover.png" type="Texture" id=8]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-last-hover.png" type="Texture" id=9]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-last.png" type="Texture" id=8]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-first.png" type="Texture" id=9]
|
||||
|
||||
[node name="Control" type="MarginContainer"]
|
||||
anchor_left = 1.0
|
||||
@@ -38,14 +38,14 @@ visible = false
|
||||
margin_right = 196.0
|
||||
margin_bottom = 81.0
|
||||
focus_mode = 0
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 8 )
|
||||
texture_focused = ExtResource( 8 )
|
||||
texture_normal = ExtResource( 9 )
|
||||
texture_hover = ExtResource( 1 )
|
||||
texture_focused = ExtResource( 1 )
|
||||
|
||||
[node name="Label" type="Label" parent="ListContainer/TextureButtonFirst"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = ExtResource( 6 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "First Entry"
|
||||
align = 1
|
||||
valign = 1
|
||||
@@ -55,17 +55,18 @@ __meta__ = {
|
||||
|
||||
[node name="TextureButtonMiddle" type="TextureButton" parent="ListContainer"]
|
||||
visible = false
|
||||
margin_top = 71.0
|
||||
margin_right = 196.0
|
||||
margin_bottom = 81.0
|
||||
margin_bottom = 152.0
|
||||
focus_mode = 0
|
||||
texture_normal = ExtResource( 4 )
|
||||
texture_normal = ExtResource( 5 )
|
||||
texture_hover = ExtResource( 7 )
|
||||
texture_focused = ExtResource( 7 )
|
||||
|
||||
[node name="Label" type="Label" parent="ListContainer/TextureButtonMiddle"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = ExtResource( 6 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Middle"
|
||||
align = 1
|
||||
valign = 1
|
||||
@@ -75,18 +76,19 @@ __meta__ = {
|
||||
|
||||
[node name="TextureButtonLast" type="TextureButton" parent="ListContainer"]
|
||||
visible = false
|
||||
margin_top = 142.0
|
||||
margin_right = 196.0
|
||||
margin_bottom = 81.0
|
||||
margin_bottom = 223.0
|
||||
focus_mode = 0
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 9 )
|
||||
texture_focused = ExtResource( 9 )
|
||||
texture_normal = ExtResource( 8 )
|
||||
texture_hover = ExtResource( 6 )
|
||||
texture_focused = ExtResource( 6 )
|
||||
|
||||
[node name="Label" type="Label" parent="ListContainer/TextureButtonLast"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme = ExtResource( 5 )
|
||||
custom_fonts/font = ExtResource( 6 )
|
||||
theme = ExtResource( 2 )
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Last"
|
||||
align = 1
|
||||
valign = 1
|
||||
@@ -103,4 +105,4 @@ alignment = 1
|
||||
margin_left = 34.0
|
||||
margin_right = 162.0
|
||||
margin_bottom = 128.0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_normal = ExtResource( 4 )
|
||||
@@ -1,13 +1,13 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-first-hover.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-first.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-first.png" type="Texture" id=3]
|
||||
|
||||
[node name="TextureButton" type="TextureButton"]
|
||||
margin_right = 196.0
|
||||
margin_bottom = 81.0
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 1 )
|
||||
texture_focused = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
@@ -18,7 +18,7 @@ __meta__ = {
|
||||
[node name="Label" type="Label" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "First Entry"
|
||||
align = 1
|
||||
valign = 1
|
||||
@@ -1,14 +1,14 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://assets/ui/themes/leather.theme" type="Theme" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-last.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-last-hover.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=4]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-last.png" type="Texture" id=4]
|
||||
|
||||
[node name="TextureButton" type="TextureButton"]
|
||||
margin_right = 196.0
|
||||
margin_bottom = 81.0
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_normal = ExtResource( 4 )
|
||||
texture_hover = ExtResource( 3 )
|
||||
texture_focused = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
@@ -20,7 +20,7 @@ __meta__ = {
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme = ExtResource( 1 )
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Last"
|
||||
align = 1
|
||||
valign = 1
|
||||
@@ -1,15 +1,15 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-hover.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/ui/themes/UI-Button-ItemsList-hover.png" type="Texture" id=3]
|
||||
|
||||
[node name="TextureButton" type="TextureButton"]
|
||||
margin_right = 196.0
|
||||
margin_bottom = 81.0
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 1 )
|
||||
texture_focused = ExtResource( 1 )
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 3 )
|
||||
texture_focused = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false,
|
||||
"_editor_description_": ""
|
||||
@@ -18,7 +18,7 @@ __meta__ = {
|
||||
[node name="Label" type="Label" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Middle"
|
||||
align = 1
|
||||
valign = 1
|
||||
@@ -1,13 +1,13 @@
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-level-btn-shadow.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-Button-Count.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-Button-Reset.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-level-btn-shadow.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-Button-Count.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-Button-Reset-disabled.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-Button-Count-hover.png" type="Texture" id=5]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-Button-Reset-hover.png" type="Texture" id=6]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-level-btn-leather.png" type="Texture" id=7]
|
||||
[ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="DynamicFont" id=8]
|
||||
[ext_resource path="res://assets/ui/themes/tab_select/UI-Button-Reset.png" type="Texture" id=8]
|
||||
|
||||
[node name="TilePuzzle" type="Control"]
|
||||
margin_left = 320.0
|
||||
@@ -25,7 +25,7 @@ anchor_right = 0.5
|
||||
margin_left = -114.0
|
||||
margin_right = 115.0
|
||||
margin_bottom = 456.0
|
||||
texture = ExtResource( 1 )
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@@ -109,7 +109,7 @@ margin_bottom = 57.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_vertical = 0
|
||||
disabled = true
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_normal = ExtResource( 8 )
|
||||
texture_hover = ExtResource( 6 )
|
||||
texture_disabled = ExtResource( 4 )
|
||||
texture_focused = ExtResource( 6 )
|
||||
@@ -120,7 +120,7 @@ margin_right = 207.0
|
||||
margin_bottom = 57.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_vertical = 0
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 5 )
|
||||
texture_focused = ExtResource( 5 )
|
||||
|
||||
@@ -137,7 +137,7 @@ margin_right = 113.0
|
||||
margin_bottom = 47.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 7
|
||||
custom_fonts/font = ExtResource( 8 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "X / 10"
|
||||
align = 1
|
||||
valign = 1
|
||||
Binary file not shown.
@@ -1,55 +0,0 @@
|
||||
extends "res://scenes/levels/Levels.gd"
|
||||
|
||||
export (PackedScene) var object_first = load("res://scenes/UI/list_ho/ObjectListFirst.tscn")
|
||||
export (PackedScene) var object_std = load("res://scenes/UI/list_ho/ObjectListStd.tscn")
|
||||
export (PackedScene) var object_last = load("res://scenes/UI/list_ho/ObjectListLast.tscn")
|
||||
|
||||
onready var last_btn = null
|
||||
|
||||
func _ready():
|
||||
_display_hud_menu()
|
||||
_play_ambient_sound()
|
||||
|
||||
func _display_hud_menu():
|
||||
var counter = 0
|
||||
var scene = null
|
||||
var label_counter = null
|
||||
|
||||
for key in meshes:
|
||||
scene = meshes[key]
|
||||
_create_button_info(scene, counter, label_counter)
|
||||
label_counter = scene.label_counter()
|
||||
counter = counter + 1
|
||||
|
||||
# Back to main scene
|
||||
func _on_TextureButton_pressed():
|
||||
Global.goto_scene("res://scenes/Main.tscn")
|
||||
|
||||
func _create_button_info(scene, counter, label_counter):
|
||||
var btn = null
|
||||
|
||||
if counter == 0:
|
||||
btn = object_first.instance()
|
||||
elif counter == meshes.size() - 1:
|
||||
btn = object_last.instance()
|
||||
else:
|
||||
btn = object_std.instance()
|
||||
|
||||
if label_counter != null and label_counter == scene.label_counter():
|
||||
last_btn.get_node("Label").set_text(last_btn.get_node("Label").text + " " + String(scene.counter()))
|
||||
last_btn.set_meta("name", scene.label())
|
||||
last_btn.set_meta("counter", scene.counter())
|
||||
last_btn.set_meta("counted", 0)
|
||||
else:
|
||||
$ListObjects/ListContainer.add_child(btn)
|
||||
btn.get_node("Label").set_text(scene.label())
|
||||
btn.set_meta("name", scene.label())
|
||||
btn.set_meta("counter", scene.counter())
|
||||
btn.set_meta("counted", 0)
|
||||
|
||||
last_btn = btn
|
||||
|
||||
func _play_ambient_sound():
|
||||
if Setting.get_setting_ambient_sound():
|
||||
$AmbientSound.play()
|
||||
$AmbientSound.stream_paused = false
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
+6
-1
@@ -10,7 +10,7 @@ func _loading_is_finished(_anim_name):
|
||||
print("[Evenst#_loading_is_finished]")
|
||||
Global.loaded = true
|
||||
|
||||
# events for load scene level
|
||||
# Events for load scene level
|
||||
####
|
||||
func _on_warcraft_pressed():
|
||||
Global.current_scene_int = 0
|
||||
@@ -26,3 +26,8 @@ func _on_reset_level(level, node, index, parent):
|
||||
parent.configure_reset(level, node, index)
|
||||
parent.configure_counter(level, node)
|
||||
Global.current_scene_int = null
|
||||
|
||||
# Events for back to main scene
|
||||
####
|
||||
func _on_main_scene_pressed():
|
||||
Global.goto_scene("res://scenes/Main.tscn")
|
||||
|
||||
Reference in New Issue
Block a user