diff --git a/assets/fonts/kirsty/kirsty bd it.otf b/assets/fonts/kirsty/kirsty bd it.otf new file mode 100644 index 0000000..a742033 Binary files /dev/null and b/assets/fonts/kirsty/kirsty bd it.otf differ diff --git a/assets/fonts/kirsty/kirsty bd.otf b/assets/fonts/kirsty/kirsty bd.otf new file mode 100644 index 0000000..ce4eeda Binary files /dev/null and b/assets/fonts/kirsty/kirsty bd.otf differ diff --git a/assets/fonts/kirsty/kirsty rg it.otf b/assets/fonts/kirsty/kirsty rg it.otf new file mode 100644 index 0000000..ddc46bc Binary files /dev/null and b/assets/fonts/kirsty/kirsty rg it.otf differ diff --git a/assets/fonts/kirsty/kirsty rg.otf b/assets/fonts/kirsty/kirsty rg.otf new file mode 100644 index 0000000..a0a644b Binary files /dev/null and b/assets/fonts/kirsty/kirsty rg.otf differ diff --git a/assets/fonts/kirsty/kirsty.tres b/assets/fonts/kirsty/kirsty.tres new file mode 100644 index 0000000..6e83b52 --- /dev/null +++ b/assets/fonts/kirsty/kirsty.tres @@ -0,0 +1,10 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://assets/fonts/kirsty/kirsty rg.otf" type="DynamicFontData" id=1] + +[resource] +size = 38 +outline_color = Color( 0.894118, 0.788235, 0.0901961, 1 ) +use_mipmaps = true +use_filter = true +font_data = ExtResource( 1 ) diff --git a/assets/props/Spyglass/sm_spyglass.mesh b/assets/props/Spyglass/sm_spyglass.mesh new file mode 100644 index 0000000..d0235ee Binary files /dev/null and b/assets/props/Spyglass/sm_spyglass.mesh differ diff --git a/assets/props/column/sm_column.mesh b/assets/props/column/sm_column.mesh index b118927..40bf4d6 100644 Binary files a/assets/props/column/sm_column.mesh and b/assets/props/column/sm_column.mesh differ diff --git a/assets/props/fiole/sm_fiole.mesh b/assets/props/fiole/sm_fiole.mesh index 26b72f1..04c428b 100644 Binary files a/assets/props/fiole/sm_fiole.mesh and b/assets/props/fiole/sm_fiole.mesh differ diff --git a/assets/props/fiole/sm_fiole_socle.mesh b/assets/props/fiole/sm_fiole_socle.mesh index 6fd3414..344aaf8 100644 Binary files a/assets/props/fiole/sm_fiole_socle.mesh and b/assets/props/fiole/sm_fiole_socle.mesh differ diff --git a/assets/props/pinte beer/sm_pinte_beer.mesh b/assets/props/pinte beer/sm_pinte_beer.mesh index 1f67899..9db7638 100644 Binary files a/assets/props/pinte beer/sm_pinte_beer.mesh and b/assets/props/pinte beer/sm_pinte_beer.mesh differ diff --git a/assets/props/spyglass/spyglass.gltf.import b/assets/props/spyglass/spyglass.gltf.import index 94a56e3..03cff2e 100644 --- a/assets/props/spyglass/spyglass.gltf.import +++ b/assets/props/spyglass/spyglass.gltf.import @@ -2,12 +2,12 @@ importer="scene" type="PackedScene" -path="res://.import/spyglass.gltf-f88c2aed065225936fc295c1654b7c4b.scn" +path="res://.import/spyglass.gltf-d150be4703b31b395c1c71afd876d526.scn" [deps] -source_file="res://assets/props/spyglass/spyglass.gltf" -dest_files=[ "res://.import/spyglass.gltf-f88c2aed065225936fc295c1654b7c4b.scn" ] +source_file="res://assets/props/Spyglass/spyglass.gltf" +dest_files=[ "res://.import/spyglass.gltf-d150be4703b31b395c1c71afd876d526.scn" ] [params] diff --git a/assets/props/weapon gun/sm_weapon_gun.mesh b/assets/props/weapon gun/sm_weapon_gun.mesh index 4e8ef05..8826b8d 100644 Binary files a/assets/props/weapon gun/sm_weapon_gun.mesh and b/assets/props/weapon gun/sm_weapon_gun.mesh differ diff --git a/assets/ui/icones/treasure-hover.png b/assets/ui/icones/treasure-hover.png new file mode 100644 index 0000000..d76094d Binary files /dev/null and b/assets/ui/icones/treasure-hover.png differ diff --git a/assets/ui/icones/treasure-hover.png.import b/assets/ui/icones/treasure-hover.png.import new file mode 100644 index 0000000..422bf90 --- /dev/null +++ b/assets/ui/icones/treasure-hover.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/treasure-hover.png-c735f579e93a501fb3627875f2e3f04e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/icones/treasure-hover.png" +dest_files=[ "res://.import/treasure-hover.png-c735f579e93a501fb3627875f2e3f04e.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 diff --git a/assets/ui/icones/treasure.png b/assets/ui/icones/treasure.png index 52598cf..e80d6ff 100644 Binary files a/assets/ui/icones/treasure.png and b/assets/ui/icones/treasure.png differ diff --git a/assets/ui/themes/bck-vert-grd.png b/assets/ui/themes/bck-vert-grd.png new file mode 100644 index 0000000..c7e549d Binary files /dev/null and b/assets/ui/themes/bck-vert-grd.png differ diff --git a/assets/ui/themes/bck-vert-grd.png.import b/assets/ui/themes/bck-vert-grd.png.import new file mode 100644 index 0000000..7552408 --- /dev/null +++ b/assets/ui/themes/bck-vert-grd.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/bck-vert-grd.png-d2083d6bd6456db9a6d0f312e3214ea8.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/bck-vert-grd.png" +dest_files=[ "res://.import/bck-vert-grd.png-d2083d6bd6456db9a6d0f312e3214ea8.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=true +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/ui/themes/bck.jpg b/assets/ui/themes/bck.jpg new file mode 100644 index 0000000..0f6d4f7 Binary files /dev/null and b/assets/ui/themes/bck.jpg differ diff --git a/assets/ui/themes/bck.jpg.import b/assets/ui/themes/bck.jpg.import new file mode 100644 index 0000000..01b7c6a --- /dev/null +++ b/assets/ui/themes/bck.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/bck.jpg-12e6b0ecb958a503e39a462df5c12528.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/bck.jpg" +dest_files=[ "res://.import/bck.jpg-12e6b0ecb958a503e39a462df5c12528.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=true +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 diff --git a/assets/ui/themes/button-summary-hover.jpg b/assets/ui/themes/button-summary-hover.jpg new file mode 100644 index 0000000..74a2ac2 Binary files /dev/null and b/assets/ui/themes/button-summary-hover.jpg differ diff --git a/assets/ui/themes/button-summary-hover.jpg.import b/assets/ui/themes/button-summary-hover.jpg.import new file mode 100644 index 0000000..222c32e --- /dev/null +++ b/assets/ui/themes/button-summary-hover.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/button-summary-hover.jpg-51e102eaa664807a736aa4aff2762f3e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/button-summary-hover.jpg" +dest_files=[ "res://.import/button-summary-hover.jpg-51e102eaa664807a736aa4aff2762f3e.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 diff --git a/assets/ui/themes/button-summary.jpg b/assets/ui/themes/button-summary.jpg new file mode 100644 index 0000000..9bd00b4 Binary files /dev/null and b/assets/ui/themes/button-summary.jpg differ diff --git a/assets/ui/themes/button-summary.jpg.import b/assets/ui/themes/button-summary.jpg.import new file mode 100644 index 0000000..57673d0 --- /dev/null +++ b/assets/ui/themes/button-summary.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/button-summary.jpg-aa86a5d3c97e55e7dd46546765e69753.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/button-summary.jpg" +dest_files=[ "res://.import/button-summary.jpg-aa86a5d3c97e55e7dd46546765e69753.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=1 +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 diff --git a/assets/ui/themes/game-title.png b/assets/ui/themes/game-title.png new file mode 100644 index 0000000..0f90e9e Binary files /dev/null and b/assets/ui/themes/game-title.png differ diff --git a/assets/ui/themes/game-title.png.import b/assets/ui/themes/game-title.png.import new file mode 100644 index 0000000..c35a387 --- /dev/null +++ b/assets/ui/themes/game-title.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/game-title.png-2ddb032c94bf4a6d065bd116579953b1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/game-title.png" +dest_files=[ "res://.import/game-title.png-2ddb032c94bf4a6d065bd116579953b1.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 diff --git a/assets/ui/themes/leather-bck.jpg b/assets/ui/themes/leather-bck.jpg new file mode 100644 index 0000000..7aca26d Binary files /dev/null and b/assets/ui/themes/leather-bck.jpg differ diff --git a/assets/ui/themes/leather-bck.jpg.import b/assets/ui/themes/leather-bck.jpg.import new file mode 100644 index 0000000..6f57ae5 --- /dev/null +++ b/assets/ui/themes/leather-bck.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/leather-bck.jpg-7aafba39292c0e1de112d859a6bad1e2.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/leather-bck.jpg" +dest_files=[ "res://.import/leather-bck.jpg-7aafba39292c0e1de112d859a6bad1e2.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=2 +flags/repeat=1 +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 diff --git a/assets/ui/themes/leather.theme b/assets/ui/themes/leather.theme new file mode 100644 index 0000000..83981d1 Binary files /dev/null and b/assets/ui/themes/leather.theme differ diff --git a/assets/ui/themes/summary-bck.jpg b/assets/ui/themes/summary-bck.jpg new file mode 100644 index 0000000..24c4036 Binary files /dev/null and b/assets/ui/themes/summary-bck.jpg differ diff --git a/assets/ui/themes/summary-bck.jpg.import b/assets/ui/themes/summary-bck.jpg.import new file mode 100644 index 0000000..7fd007a --- /dev/null +++ b/assets/ui/themes/summary-bck.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/summary-bck.jpg-a69db3cfeb0934085d499b17906cd9f7.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/summary-bck.jpg" +dest_files=[ "res://.import/summary-bck.jpg-a69db3cfeb0934085d499b17906cd9f7.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 diff --git a/assets/ui/themes/wood-tile.jpg b/assets/ui/themes/wood-tile.jpg new file mode 100644 index 0000000..1a451db Binary files /dev/null and b/assets/ui/themes/wood-tile.jpg differ diff --git a/assets/ui/themes/wood-tile.jpg.import b/assets/ui/themes/wood-tile.jpg.import new file mode 100644 index 0000000..d5c397d --- /dev/null +++ b/assets/ui/themes/wood-tile.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/wood-tile.jpg-341401d7ff46a44dbbd830e382df4e4d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/themes/wood-tile.jpg" +dest_files=[ "res://.import/wood-tile.jpg-341401d7ff46a44dbbd830e382df4e4d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=1 +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 diff --git a/db/ahog.json b/db/ahog.json index 6b77fbe..2e57850 100644 --- a/db/ahog.json +++ b/db/ahog.json @@ -17,7 +17,7 @@ {"name":"thumb","type":"4","auto_increment":"0"}, {"name":"resource","type":"4","auto_increment":"0"} ], - "data":["WarCraft","res://assets/levels/warcraft.jpg","res://scenes/levels/warcraft/WarCraft.tscn","Develop","res://assets/levels/develop.jpg","res://developers/aurelien/CheckLightmap.tscn"] + "data":["WarCraft","res://assets/levels/warcraft.jpg","res://scenes/levels/warcraft/WarCraft.tscn"] }, { "table_name":"scenes", @@ -33,4 +33,4 @@ "data":["0.0","True","Dagger","0","dagger","0","dagger","0.0","0","Fiole","7788","fiole1","0","fioles/fiole1","1.79","0","Fiole","0","fiole2","0","fioles/fiole2","0.0","0","Fiole","0","fiole3","0","fioles/fiole_socle/fiole3","0.0","0","Spyglass","0","spyglass","0","spyglass","0.0","0","Coins","0","coin1","0","golds/coin1","0.0","0","Coins","0","coin2","0","golds/coin2","0.0","0","Coins","0","coin3","0","golds/coin3","0.0","0","Weapon Gun","0","weapon","0","weapon","0.0","0","Apple","0","apple1","0","apples/apple1","0.0","0","Apple","0","apple2","0","apples/apple2","0.0","0","Apple","0","apple3","0","apples/apple3","0.0","0","Apple","0","apple4","0","apples/apple4","0.0","0","Beer","0","beer","0","beer","0.0","0","SuperDager","0","gadder","1","sm_super_dager"] } ] -} \ No newline at end of file +} diff --git a/locales/fr.po b/locales/fr.po index d3b0752..87544bb 100644 --- a/locales/fr.po +++ b/locales/fr.po @@ -15,16 +15,16 @@ msgid "MAIN_BUTTON_PUZZLES" msgstr "Puzzles" msgid "MAIN_BUTTON_SETTINGS" -msgstr "Parametres" +msgstr "Paramètres" msgid "MAIN_BUTTON_QUIT" -msgstr "Quit" +msgstr "Quitter" msgid "SETTINGS_LABEL_LANGUE" msgstr "Choisir sa language :" msgid "SETTINGS_LABEL_GYROSCOPE" -msgstr "Utiliser le gyroscope :" +msgstr "Activer le gyroscope :" msgid "LOADING" msgstr "Chargement" diff --git a/project.godot b/project.godot index 93217d1..2d2a104 100644 --- a/project.godot +++ b/project.godot @@ -178,7 +178,7 @@ config/quit_on_go_back=false [autoload] Global="*res://scenes/Global.gd" -Loading="*res://scenes/UI/Loading.tscn" +Loading="*res://scenes/UI/loading/Loading.tscn" gddb_constants="*res://addons/godot_db_manager/core/GDDBConstants.gd" gddb_types="*res://addons/godot_db_manager/core/GDDBTypes.gd" gddb_globals="*res://addons/godot_db_manager/core/GDDBGlobals.gd" @@ -189,6 +189,9 @@ settings/stdout/print_fps=true [display] +window/size/width=1440 +window/size/height=900 +window/dpi/allow_hidpi=true window/handheld/orientation="sensor_landscape" window/stretch/mode="2d" diff --git a/scenes/Global.gd b/scenes/Global.gd index c5e7095..5017c7e 100644 --- a/scenes/Global.gd +++ b/scenes/Global.gd @@ -26,7 +26,7 @@ func goto_scene(path): set_process(true) current_scene.queue_free() wait_frames = 1 - Loading.get_node("ColorRect/CenterContainer/VBoxContainer/ProgressBar").set_max(loader.get_stage_count()) + Loading.get_node("VBoxContainer/ProgressBar").set_max(loader.get_stage_count()) func gyroscope_enabled(): if _gyroscope_enabled(): @@ -102,7 +102,7 @@ func _gyroscope_enabled(): func _update_progress(): print("[global#update_progress]") Loading.visible = true - Loading.get_node("ColorRect/CenterContainer/VBoxContainer/ProgressBar").set_value(loader.get_stage()) + Loading.get_node("VBoxContainer/ProgressBar").set_value(loader.get_stage()) func _set_new_scene(): print("[global#set_new_scene]") diff --git a/scenes/UI/ChooseScene.tscn b/scenes/UI/ChooseScene.tscn deleted file mode 100644 index d532ca3..0000000 --- a/scenes/UI/ChooseScene.tscn +++ /dev/null @@ -1,61 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://scenes/UI/ChooseScene.gd" type="Script" id=1] -[ext_resource path="res://assets/levels/warcraft.jpg" type="Texture" id=2] - -[node name="ChooseScene" type="Control"] -anchor_right = 1.0 -anchor_bottom = 1.0 -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="games" type="Control" parent="."] -margin_left = 200.0 -margin_right = 1024.0 -margin_bottom = 600.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="GridContainer" type="GridContainer" parent="games"] -margin_left = 503.586 -margin_top = 300.0 -margin_right = 1302.59 -margin_bottom = 604.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="WarCraft" type="TextureButton" parent="games/GridContainer"] -margin_right = 150.0 -margin_bottom = 150.0 -mouse_default_cursor_shape = 2 -texture_normal = ExtResource( 2 ) - -[node name="Lightmap" type="TextureButton" parent="games/GridContainer"] -margin_top = 154.0 -margin_right = 150.0 -margin_bottom = 304.0 -mouse_default_cursor_shape = 2 -texture_normal = ExtResource( 2 ) - -[node name="Label" type="Label" parent="games/GridContainer/Lightmap"] -margin_right = 40.0 -margin_bottom = 14.0 -text = "Lightmap" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Container" type="Control" parent="games"] -margin_right = 824.0 -margin_bottom = 300.0 - -[node name="HBoxContainer" type="VBoxContainer" parent="games/Container"] -margin_right = 824.0 -margin_bottom = 300.0 - -[connection signal="pressed" from="games/GridContainer/WarCraft" to="." method="_on_WarCraft_pressed"] -[connection signal="pressed" from="games/GridContainer/Lightmap" to="." method="_on_Lightmap_pressed"] diff --git a/scenes/UI/Loading.gd b/scenes/UI/Loading.gd deleted file mode 100644 index ba215df..0000000 --- a/scenes/UI/Loading.gd +++ /dev/null @@ -1,4 +0,0 @@ -extends Control - -func _ready(): - $ColorRect/CenterContainer/VBoxContainer/Label.text = tr("LOADING") diff --git a/scenes/UI/Loading.tscn b/scenes/UI/Loading.tscn deleted file mode 100644 index bd96c26..0000000 --- a/scenes/UI/Loading.tscn +++ /dev/null @@ -1,51 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://scenes/UI/Loading.gd" type="Script" id=1] - -[node name="Control" type="Control"] -anchor_right = 1.0 -anchor_bottom = 1.0 -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="ColorRect" type="ColorRect" parent="."] -margin_right = 1024.0 -margin_bottom = 600.0 -rect_scale = Vector2( 1.00231, 1 ) -color = Color( 0, 0, 0, 1 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="CenterContainer" type="CenterContainer" parent="ColorRect"] -margin_top = 282.0 -margin_right = 1024.0 -margin_bottom = 282.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="VBoxContainer" type="VBoxContainer" parent="ColorRect/CenterContainer"] -margin_left = 479.0 -margin_right = 544.0 -margin_bottom = 32.0 -alignment = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Label" type="Label" parent="ColorRect/CenterContainer/VBoxContainer"] -margin_right = 65.0 -margin_bottom = 14.0 -text = "Loading ..." -align = 1 - -[node name="ProgressBar" type="ProgressBar" parent="ColorRect/CenterContainer/VBoxContainer"] -margin_top = 18.0 -margin_right = 65.0 -margin_bottom = 32.0 -max_value = 1.0 -step = 0.1 -rounded = true diff --git a/scenes/UI/Settings.tscn b/scenes/UI/Settings.tscn deleted file mode 100644 index d656721..0000000 --- a/scenes/UI/Settings.tscn +++ /dev/null @@ -1,70 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://scenes/UI/Settings.gd" type="Script" id=1] - -[node name="Settings" type="Control"] -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="CenterContainer" type="CenterContainer" parent="."] -margin_left = 150.0 -margin_right = 1024.0 -margin_bottom = 600.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] -margin_left = 360.0 -margin_top = 271.0 -margin_right = 513.0 -margin_bottom = 329.0 -alignment = 1 - -[node name="Langue" type="CenterContainer" parent="CenterContainer/VBoxContainer"] -margin_right = 153.0 -margin_bottom = 14.0 - -[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/Langue"] -margin_left = 42.0 -margin_right = 111.0 -margin_bottom = 14.0 - -[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/Langue/HBoxContainer"] -margin_right = 50.0 -margin_bottom = 14.0 -text = "langue :" - -[node name="data" type="Label" parent="CenterContainer/VBoxContainer/Langue/HBoxContainer"] -margin_left = 54.0 -margin_right = 69.0 -margin_bottom = 14.0 -text = "FR" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="gyroscope" type="CenterContainer" parent="CenterContainer/VBoxContainer"] -margin_top = 18.0 -margin_right = 153.0 -margin_bottom = 58.0 - -[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/gyroscope"] -margin_right = 153.0 -margin_bottom = 40.0 - -[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/gyroscope/HBoxContainer"] -margin_top = 13.0 -margin_right = 73.0 -margin_bottom = 27.0 -text = "gyroscope :" - -[node name="data" type="CheckButton" parent="CenterContainer/VBoxContainer/gyroscope/HBoxContainer"] -margin_left = 77.0 -margin_right = 153.0 -margin_bottom = 40.0 -align = 1 - -[connection signal="pressed" from="CenterContainer/VBoxContainer/gyroscope/HBoxContainer/data" to="." method="_on_gyroscope_pressed"] diff --git a/scenes/UI/UI_summary.tscn b/scenes/UI/UI_summary.tscn new file mode 100644 index 0000000..7165306 --- /dev/null +++ b/scenes/UI/UI_summary.tscn @@ -0,0 +1,331 @@ +[gd_scene load_steps=25 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.tres" type="DynamicFont" id=7] + +[sub_resource type="VisualShaderNodeVectorOp" id=1] +operator = 3 + +[sub_resource type="VisualShaderNodeInput" id=2] +input_name = "screen_uv" + +[sub_resource type="VisualShaderNodeVectorDecompose" id=3] +output_port_for_preview = 1 + +[sub_resource type="VisualShaderNodeVectorScalarMix" id=4] + +[sub_resource type="VisualShaderNodeColorConstant" id=5] +constant = Color( 0.2, 0.155, 0.11, 1 ) + +[sub_resource type="VisualShaderNodeColorOp" id=6] + +[sub_resource type="VisualShaderNodeVectorScalarMix" id=7] + +[sub_resource type="VisualShaderNodeScalarOp" id=8] +default_input_values = [ 0, 0.0, 1, 0.2 ] +operator = 2 + +[sub_resource type="VisualShaderNodeScalarOp" id=9] +default_input_values = [ 0, 0.0, 1, -1.0 ] +operator = 2 + +[sub_resource type="VisualShaderNodeInput" id=10] +input_name = "screen_uv" + +[sub_resource type="VisualShaderNodeTexture" id=11] +texture = ExtResource( 4 ) +texture_type = 1 + +[sub_resource type="VisualShaderNodeVectorCompose" id=12] +default_input_values = [ 0, 0.0, 1, 0.0, 2, 1.0 ] + +[sub_resource type="VisualShaderNodeScalarConstant" id=13] +constant = 0.4 + +[sub_resource type="VisualShaderNodeVectorDecompose" id=14] + +[sub_resource type="VisualShaderNodeScalarOp" id=15] +default_input_values = [ 0, 0.0, 1, 1.6 ] +operator = 3 + +[sub_resource type="VisualShader" id=16] +code = "shader_type canvas_item; +uniform sampler2D tex_frg_4 : hint_albedo; + + + +void vertex() { +// Output:0 + +} + +void fragment() { +// Input:3 + vec3 n_out3p0 = vec3(SCREEN_UV, 0.0); + +// Scalar:6 + float n_out6p0 = 0.400000; + +// VectorOp:11 + vec3 n_out11p0 = n_out3p0 / vec3(n_out6p0); + +// VectorDecompose:7 + float n_out7p0 = n_out11p0.x; + float n_out7p1 = n_out11p0.y; + float n_out7p2 = n_out11p0.z; + +// ScalarOp:8 + float n_in8p1 = 1.60000; + float n_out8p0 = n_out7p1 / n_in8p1; + +// VectorCompose:5 + float n_in5p2 = 1.00000; + vec3 n_out5p0 = vec3(n_out7p0, n_out8p0, n_in5p2); + +// Texture:4 + vec4 tex_frg_4_read = texture(tex_frg_4, n_out5p0.xy); + vec3 n_out4p0 = tex_frg_4_read.rgb; + float n_out4p1 = tex_frg_4_read.a; + +// ScalarOp:22 + float n_in22p1 = 0.20000; + float n_out22p0 = dot(n_out4p0, vec3(0.333333, 0.333333, 0.333333)) * n_in22p1; + +// Color:18 + vec3 n_out18p0 = vec3(0.200000, 0.155000, 0.110000); + float n_out18p1 = 1.000000; + +// ColorOp:19 + vec3 n_out19p0 = vec3(1.0) - (vec3(1.0) - n_out18p0) * (vec3(1.0) - n_out4p0); + +// Input:14 + vec3 n_out14p0 = vec3(SCREEN_UV, 0.0); + +// VectorDecompose:15 + float n_out15p0 = n_out14p0.x; + float n_out15p1 = n_out14p0.y; + float n_out15p2 = n_out14p0.z; + +// VectorScalarMix:17 + vec3 n_out17p0 = mix(n_out4p0, n_out19p0, n_out15p1); + +// VectorScalarMix:20 + vec3 n_out20p0 = mix(vec3(n_out22p0), n_out17p0, n_out15p1); + +// Output:0 + COLOR.rgb = n_out20p0; + +} + +void light() { +// Output:0 + +} +" +graph_offset = Vector2( -1049.92, -110.97 ) +mode = 1 +flags/light_only = false +nodes/fragment/0/position = Vector2( 2300, 540 ) +nodes/fragment/3/node = SubResource( 10 ) +nodes/fragment/3/position = Vector2( -2320, 660 ) +nodes/fragment/4/node = SubResource( 11 ) +nodes/fragment/4/position = Vector2( 60, 160 ) +nodes/fragment/5/node = SubResource( 12 ) +nodes/fragment/5/position = Vector2( -580, 720 ) +nodes/fragment/6/node = SubResource( 13 ) +nodes/fragment/6/position = Vector2( -2300, 800 ) +nodes/fragment/7/node = SubResource( 14 ) +nodes/fragment/7/position = Vector2( -1480, 700 ) +nodes/fragment/8/node = SubResource( 15 ) +nodes/fragment/8/position = Vector2( -960, 820 ) +nodes/fragment/11/node = SubResource( 1 ) +nodes/fragment/11/position = Vector2( -1860, 700 ) +nodes/fragment/14/node = SubResource( 2 ) +nodes/fragment/14/position = Vector2( 140, 980 ) +nodes/fragment/15/node = SubResource( 3 ) +nodes/fragment/15/position = Vector2( 580, 960 ) +nodes/fragment/17/node = SubResource( 4 ) +nodes/fragment/17/position = Vector2( 1240, 560 ) +nodes/fragment/18/node = SubResource( 5 ) +nodes/fragment/18/position = Vector2( 520, 620 ) +nodes/fragment/19/node = SubResource( 6 ) +nodes/fragment/19/position = Vector2( 840, 580 ) +nodes/fragment/20/node = SubResource( 7 ) +nodes/fragment/20/position = Vector2( 1780, 660 ) +nodes/fragment/22/node = SubResource( 8 ) +nodes/fragment/22/position = Vector2( 1260, 780 ) +nodes/fragment/23/node = SubResource( 9 ) +nodes/fragment/23/position = Vector2( 1080, 1080 ) +nodes/fragment/connections = PoolIntArray( 8, 0, 5, 1, 7, 1, 8, 0, 7, 0, 5, 0, 5, 0, 4, 0, 3, 0, 11, 0, 6, 0, 11, 1, 11, 0, 7, 0, 14, 0, 15, 0, 4, 0, 17, 0, 15, 1, 17, 2, 4, 0, 19, 1, 18, 0, 19, 0, 19, 0, 17, 1, 4, 0, 22, 0, 20, 0, 0, 0, 15, 1, 23, 0, 22, 0, 20, 0, 15, 1, 20, 2, 17, 0, 20, 1 ) + +[sub_resource type="ShaderMaterial" id=17] +shader = SubResource( 16 ) + +[node name="Summary" type="HBoxContainer"] +anchor_bottom = 1.0 +margin_right = 236.0 +custom_constants/separation = 0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="PanelWood" type="Panel" parent="."] +material = SubResource( 17 ) +margin_right = 350.0 +margin_bottom = 900.0 +rect_min_size = Vector2( 350, 0 ) +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelWood"] +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_clip_content = true +size_flags_horizontal = 8 +size_flags_vertical = 11 +custom_constants/separation = 30 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CenterContainer" type="CenterContainer" parent="PanelWood/VBoxContainer"] +margin_right = 350.0 +margin_bottom = 237.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="TextureRect" type="TextureButton" parent="PanelWood/VBoxContainer/CenterContainer"] +margin_left = 111.0 +margin_top = 54.0 +margin_right = 239.0 +margin_bottom = 182.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 ) +stretch_mode = 3 + +[node name="ButtonPuzzle" type="TextureButton" parent="PanelWood/VBoxContainer"] +margin_top = 267.0 +margin_right = 350.0 +margin_bottom = 344.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 ) +__meta__ = { +"_editor_description_": "" +} + +[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonPuzzle"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 7 +size_flags_vertical = 3 +custom_fonts/font = ExtResource( 7 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) +text = "Puzz" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "" +} + +[node name="ButtonSetting" type="TextureButton" parent="PanelWood/VBoxContainer"] +margin_top = 374.0 +margin_right = 350.0 +margin_bottom = 451.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 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonSetting"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 7 +size_flags_vertical = 3 +custom_fonts/font = ExtResource( 7 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) +text = "Param" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "" +} + +[node name="MarginContainer" type="MarginContainer" parent="PanelWood/VBoxContainer"] +margin_top = 481.0 +margin_right = 350.0 +margin_bottom = 719.0 +size_flags_vertical = 3 + +[node name="ButtonQuit" type="TextureButton" parent="PanelWood/VBoxContainer"] +margin_top = 749.0 +margin_right = 350.0 +margin_bottom = 826.0 +mouse_default_cursor_shape = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +texture_normal = ExtResource( 1 ) +texture_hover = ExtResource( 5 ) +__meta__ = { +"_editor_description_": "" +} + +[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonQuit"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 7 +size_flags_vertical = 3 +custom_fonts/font = ExtResource( 7 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) +text = "Quit" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "" +} + +[node name="LabelVersion" type="Label" parent="PanelWood/VBoxContainer"] +margin_top = 856.0 +margin_right = 350.0 +margin_bottom = 870.0 +size_flags_vertical = 0 +text = "v XX.XX" +align = 2 + +[node name="MarginContainerBottom" type="MarginContainer" parent="PanelWood/VBoxContainer"] +margin_top = 900.0 +margin_right = 350.0 +margin_bottom = 900.0 +size_flags_stretch_ratio = 0.2 + +[node name="TextureRect" type="TextureRect" parent="."] +margin_left = 350.0 +margin_right = 446.0 +margin_bottom = 900.0 +rect_clip_content = true +size_flags_horizontal = 11 +size_flags_vertical = 3 +texture = ExtResource( 2 ) +stretch_mode = 2 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/scenes/UI/ChooseScene.gd b/scenes/UI/choose_scenes/ChooseScene.gd similarity index 58% rename from scenes/UI/ChooseScene.gd rename to scenes/UI/choose_scenes/ChooseScene.gd index 80304f9..8fbcdff 100644 --- a/scenes/UI/ChooseScene.gd +++ b/scenes/UI/choose_scenes/ChooseScene.gd @@ -1,18 +1,13 @@ extends Control +export (PackedScene) var template = load("res://scenes/levels/Template.tscn") + onready var levels = Array() func _ready(): - print("[choose_scene#_ready]") _apply_scenes() # Load scene warcraft -func _on_WarCraft_pressed(): - Global.goto_scene("res://scenes/levels/warcraft/WarCraft.tscn") - -func _on_Lightmap_pressed(): - Global.goto_scene("res://developers/aurelien/CheckLightmap.tscn") - func _on_warcraft_pressed(): Global.current_scene_int = 0 Global.goto_scene("res://scenes/levels/warcraft/WarCraft.tscn") @@ -40,7 +35,10 @@ func _apply_scenes(): if resource == null: resource = _get_resource(index, table, datas) - _apply_scene(name, thumb, resource) + _apply_scene(_load_scene(name), + _load_texture(thumb), + _build_path(name), + _build_method(name)) name = null thumb = null resource = null @@ -57,25 +55,24 @@ func _get_resource(index, table, datas): if table.get_prop_at(index).get_prop_name() == "resource": return datas[index].get_data() -func _apply_scene(name, thumb, resource): - $games/Container/HBoxContainer.add_child(_configure_vbox()) - _configure_button(thumb, resource, name) - $games/Container/HBoxContainer/VBoxContainer.add_child(_configure_label(name)) +func _build_path(name): + return "MarginContainer/HBoxContainer/"+name+"/TextureRect" -func _configure_vbox(): - var vbox = VBoxContainer.new() - vbox.set_name("VBoxContainer") +func _build_method(name): + return "_on_"+name.to_lower()+"_pressed" + +func _load_scene(name): + var template_instance = template.instance() + template_instance.set_name(name) - return vbox + return template_instance -func _configure_label(name): - var label = Label.new() - label.set_text(name) - - return label +func _load_texture(thumbnail): + return load(thumbnail) + +func _apply_scene(instance, thumb, node, method): + $MarginContainer/HBoxContainer.add_child(instance) + var button = get_node(node+"/TextureButton") + button.set_normal_texture(thumb) + button.connect("pressed", self, method) -func _configure_button(thumb, _resource, name): - var thumbnail = TextureButton.new() - $games/Container/HBoxContainer/VBoxContainer.add_child(thumbnail) - thumbnail.set_normal_texture(load(thumb)) - thumbnail.connect("pressed", self, "_on_"+name.to_lower()+"_pressed") diff --git a/scenes/UI/choose_scenes/ChooseScene.tscn b/scenes/UI/choose_scenes/ChooseScene.tscn new file mode 100644 index 0000000..dddb6f4 --- /dev/null +++ b/scenes/UI/choose_scenes/ChooseScene.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://scenes/UI/choose_scenes/ChooseScene.gd" type="Script" id=1] +[ext_resource path="res://scenes/levels/Template.tscn" type="PackedScene" id=2] + +[node name="ChooseScene" type="CenterContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 73.7365 +margin_top = -67.0147 +margin_right = 73.7366 +margin_bottom = -67.0146 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="MarginContainer" type="MarginContainer" parent="."] +margin_left = 705.0 +margin_top = 435.0 +margin_right = 735.0 +margin_bottom = 465.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_constants/margin_right = 15 +custom_constants/margin_top = 15 +custom_constants/margin_left = 15 +custom_constants/margin_bottom = 15 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +margin_left = 15.0 +margin_top = 15.0 +margin_right = 15.0 +margin_bottom = 15.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_constants/separation = 120 + +[node name="example" parent="MarginContainer/HBoxContainer" instance=ExtResource( 2 )] +visible = false + +[editable path="MarginContainer/HBoxContainer/example"] diff --git a/scenes/UI/loading/Loading.gd b/scenes/UI/loading/Loading.gd new file mode 100644 index 0000000..94f02e5 --- /dev/null +++ b/scenes/UI/loading/Loading.gd @@ -0,0 +1,4 @@ +extends Control + +func _ready(): + $VBoxContainer/Label.text = tr("LOADING") diff --git a/scenes/UI/loading/Loading.tscn b/scenes/UI/loading/Loading.tscn new file mode 100644 index 0000000..b3f3417 --- /dev/null +++ b/scenes/UI/loading/Loading.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://scenes/UI/loading/Loading.gd" type="Script" id=1] + +[node name="Control" type="CenterContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_left = 687.0 +margin_top = 432.0 +margin_right = 752.0 +margin_bottom = 468.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +alignment = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="VBoxContainer"] +margin_right = 65.0 +margin_bottom = 14.0 +text = "Loading ..." +align = 1 + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"] +margin_top = 18.0 +margin_right = 65.0 +margin_bottom = 18.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="ProgressBar" type="ProgressBar" parent="VBoxContainer"] +margin_top = 22.0 +margin_right = 65.0 +margin_bottom = 36.0 +max_value = 1.0 +step = 0.1 +rounded = true + +[node name="ColorRect" type="ColorRect" parent="."] +margin_left = 720.0 +margin_top = 450.0 +margin_right = 720.0 +margin_bottom = 450.0 +color = Color( 0, 0, 0, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/scenes/UI/Settings.gd b/scenes/UI/settings/Settings.gd similarity index 76% rename from scenes/UI/Settings.gd rename to scenes/UI/settings/Settings.gd index e20292b..66df407 100644 --- a/scenes/UI/Settings.gd +++ b/scenes/UI/settings/Settings.gd @@ -12,16 +12,16 @@ func _ready(): ## PRIVATE func _translation(): print("[Settings#_translation]") - $CenterContainer/VBoxContainer/Langue/HBoxContainer/Label.text = tr("SETTINGS_LABEL_LANGUE") - $CenterContainer/VBoxContainer/gyroscope/HBoxContainer/Label.text = tr("SETTINGS_LABEL_GYROSCOPE") + $VBoxContainer/Langue/HBoxContainer/Label.text = tr("SETTINGS_LABEL_LANGUE") + $VBoxContainer/gyroscope/HBoxContainer/Label.text = tr("SETTINGS_LABEL_GYROSCOPE") func _apply_settings(): print("[Settings#_apply_settings]") var lang = _get_settings_data("langue", Global.table_settings, Global.data_settings) var gyro = _get_settings_data("gyroscope", Global.table_settings, Global.data_settings) - $CenterContainer/VBoxContainer/Langue/HBoxContainer/data.set_text(lang) - $CenterContainer/VBoxContainer/gyroscope/HBoxContainer/data.set_pressed(int(gyro) as bool) + #$CenterContainer/VBoxContainer/Langue/HBoxContainer/data.set_text(lang) + #$CenterContainer/VBoxContainer/gyroscope/HBoxContainer/data.set_pressed(int(gyro) as bool) func _get_settings_data(name, table, datas): for index in range(0, Global.table_settings.get_props_count()): diff --git a/scenes/UI/settings/Settings.tscn b/scenes/UI/settings/Settings.tscn new file mode 100644 index 0000000..e408589 --- /dev/null +++ b/scenes/UI/settings/Settings.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://scenes/UI/settings/Settings.gd" type="Script" id=1] + +[node name="Settings" type="CenterContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_left = 643.0 +margin_top = 421.0 +margin_right = 796.0 +margin_bottom = 479.0 +alignment = 1 + +[node name="Langue" type="CenterContainer" parent="VBoxContainer"] +margin_right = 153.0 +margin_bottom = 14.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Langue"] +margin_left = 42.0 +margin_right = 111.0 +margin_bottom = 14.0 + +[node name="Label" type="Label" parent="VBoxContainer/Langue/HBoxContainer"] +margin_right = 50.0 +margin_bottom = 14.0 +text = "langue :" + +[node name="data" type="Label" parent="VBoxContainer/Langue/HBoxContainer"] +margin_left = 54.0 +margin_right = 69.0 +margin_bottom = 14.0 +text = "FR" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="gyroscope" type="CenterContainer" parent="VBoxContainer"] +margin_top = 18.0 +margin_right = 153.0 +margin_bottom = 58.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/gyroscope"] +margin_right = 153.0 +margin_bottom = 40.0 + +[node name="Label" type="Label" parent="VBoxContainer/gyroscope/HBoxContainer"] +margin_top = 13.0 +margin_right = 73.0 +margin_bottom = 27.0 +text = "gyroscope :" + +[node name="data" type="CheckButton" parent="VBoxContainer/gyroscope/HBoxContainer"] +margin_left = 77.0 +margin_right = 153.0 +margin_bottom = 40.0 +align = 1 + +[connection signal="pressed" from="VBoxContainer/gyroscope/HBoxContainer/data" to="." method="_on_gyroscope_pressed"] diff --git a/scenes/UI/title/UI_title.tscn b/scenes/UI/title/UI_title.tscn new file mode 100644 index 0000000..cc4551d --- /dev/null +++ b/scenes/UI/title/UI_title.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://assets/ui/themes/game-title.png" type="Texture" id=1] + +[node name="Control" type="CenterContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_pivot_offset = Vector2( -656.735, -331.043 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureRect" type="TextureRect" parent="."] +margin_left = 385.0 +margin_top = 372.0 +margin_right = 1054.0 +margin_bottom = 528.0 +texture = ExtResource( 1 ) diff --git a/scenes/levels/Template.tscn b/scenes/levels/Template.tscn new file mode 100644 index 0000000..0ad350d --- /dev/null +++ b/scenes/levels/Template.tscn @@ -0,0 +1,75 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://assets/levels/warcraft.jpg" type="Texture" id=1] + +[node name="VBoxContainer" type="VBoxContainer"] +margin_right = 150.0 +margin_bottom = 174.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureRect" type="TextureRect" parent="."] +margin_right = 150.0 +margin_bottom = 150.0 +texture = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureButton" type="TextureButton" parent="TextureRect"] +margin_right = 40.0 +margin_bottom = 40.0 +mouse_default_cursor_shape = 2 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="HBoxContainer" parent="."] +margin_top = 154.0 +margin_right = 150.0 +margin_bottom = 174.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_constants/separation = 25 +alignment = 1 + +[node name="ButtonReset" type="Button" parent="VBoxContainer"] +margin_right = 62.0 +margin_bottom = 20.0 +mouse_default_cursor_shape = 2 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer/ButtonReset"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 7 +text = "Reset" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ButtonCount" type="Button" parent="VBoxContainer"] +margin_left = 87.0 +margin_right = 150.0 +margin_bottom = 20.0 +mouse_default_cursor_shape = 2 +size_flags_horizontal = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="VBoxContainer/ButtonCount"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 7 +text = "X / 10" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/scenes/main.gd b/scenes/main.gd index 87e055a..5234596 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -1,39 +1,44 @@ extends Node -export (PackedScene) var settings = load("res://scenes/UI/Settings.tscn") -export (PackedScene) var scenes = load("res://scenes/UI/ChooseScene.tscn") +export (PackedScene) var settings = load("res://scenes/UI/settings/Settings.tscn") +export (PackedScene) var scenes = load("res://scenes/UI/choose_scenes/ChooseScene.tscn") -const max_diff = 0.08 - -var current_scene = null -var value_old = Vector2(0, 0) +onready var current_scene = "title" +onready var scene_instance = $MarginContainer/HBoxContainer/MarginContainer/scene_instance func _ready(): _translation() - -# Quit the game -func _on_Quit_pressed(): - get_tree().quit(0) - -# Load scene settings -func _on_Settings_pressed(): - _prepare_change_scene() - current_scene = settings.instance() - add_child(current_scene) - -# Load scene for select game -func _on_New_pressed(): - _prepare_change_scene() - current_scene = scenes.instance() - add_child(current_scene) + $MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/CenterContainer/TextureRect.grab_focus() + _apply_scene("Title") ## PRIVATE func _translation(): - $Grid/Menu/Action/Puzzles.text = tr("MAIN_BUTTON_PUZZLES") - $Grid/Menu/Action/Settings.text = tr("MAIN_BUTTON_SETTINGS") - $Grid/Menu/Action/Quit.text = tr("MAIN_BUTTON_QUIT") + $MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonPuzzle/Label.text = tr("MAIN_BUTTON_PUZZLES") + $MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonSetting/Label.text = tr("MAIN_BUTTON_SETTINGS") + $MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonQuit/Label.text = tr("MAIN_BUTTON_QUIT") + +func _apply_scene(actual_scene): + var node = "MarginContainer/HBoxContainer/MarginContainer/" -func _prepare_change_scene(): - if (current_scene != null): - remove_child(current_scene) - current_scene.call_deferred("free") + for scene in ["Title", "Settings", "ChooseScene"]: + get_node(node + scene).visible = true + if actual_scene == scene: + get_node(node + scene).visible = true + else: + get_node(node + scene).visible = false + +# Load scene for select game +func _on_ButtonPuzzle_pressed(): + _apply_scene("ChooseScene") + +# Load scene settings +func _on_ButtonSetting_pressed(): + _apply_scene("Settings") + +# Click to icon game +func _on_TextureRect_pressed(): + _apply_scene("Title") + +# Quit the game +func _on_ButtonQuit_pressed(): + get_tree().quit(0) diff --git a/scenes/main.tscn b/scenes/main.tscn index a15d1ab..dbe1a8a 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -1,115 +1,129 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://scenes/main.gd" type="Script" id=1] -[ext_resource path="res://icon.png" type="Texture" id=2] -[ext_resource path="res://assets/fonts/MKXTitle.tres" type="DynamicFont" id=3] +[ext_resource path="res://scenes/UI/title/UI_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://assets/ui/themes/bck.jpg" type="Texture" id=6] +[ext_resource path="res://scenes/UI/UI_summary.tscn" type="PackedScene" id=8] -[sub_resource type="GDScript" id=1] -script/source = "extends LinkButton +[sub_resource type="VisualShaderNodeInput" id=1] +input_name = "screen_uv" -# Quit the game with properly exit code +[sub_resource type="VisualShaderNodeTexture" id=2] +texture = ExtResource( 6 ) +texture_type = 1 + +[sub_resource type="VisualShaderNodeInput" id=3] +input_name = "screen_texture" + +[sub_resource type="VisualShader" id=4] +code = "shader_type canvas_item; +uniform sampler2D tex_frg_4 : hint_albedo; + + + +void vertex() { +// Output:0 + +} + +void fragment() { +// Texture:4 + vec4 tex_frg_4_read = texture(tex_frg_4, UV.xy); + vec3 n_out4p0 = tex_frg_4_read.rgb; + float n_out4p1 = tex_frg_4_read.a; + +// Output:0 + COLOR.rgb = n_out4p0; + +} + +void light() { +// Output:0 + +} " +graph_offset = Vector2( -1049.92, -300 ) +mode = 1 +flags/light_only = false +nodes/fragment/3/node = SubResource( 1 ) +nodes/fragment/3/position = Vector2( -840, 460 ) +nodes/fragment/4/node = SubResource( 2 ) +nodes/fragment/4/position = Vector2( -80, 60 ) +nodes/fragment/5/node = SubResource( 3 ) +nodes/fragment/5/position = Vector2( -1000, 20 ) +nodes/fragment/connections = PoolIntArray( 4, 0, 0, 0 ) -[node name="Main" type="Node"] +[sub_resource type="ShaderMaterial" id=5] +shader = SubResource( 4 ) + +[node name="Main" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 script = ExtResource( 1 ) - -[node name="ColorRect" type="ColorRect" parent="."] -margin_right = 1024.0 -margin_bottom = 600.0 -color = Color( 0.156863, 0.00392157, 0.0156863, 1 ) __meta__ = { "_edit_use_anchors_": false } -[node name="Grid" type="GridContainer" parent="."] -margin_left = -1.33484 -margin_right = 1022.67 -margin_bottom = 600.0 +[node name="BackgroundPicture" type="Panel" parent="."] +material = SubResource( 5 ) +anchor_right = 1.0 +anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } -[node name="Menu" type="Panel" parent="Grid"] - -[node name="Banner" type="Panel" parent="Grid/Menu"] -margin_right = 150.0 -margin_bottom = 150.0 +[node name="MarginContainer" type="MarginContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } -[node name="ColorRect" type="ColorRect" parent="Grid/Menu/Banner"] -margin_right = 150.0 -margin_bottom = 150.0 -color = Color( 0.992157, 0.705882, 0, 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +margin_right = 1440.0 +margin_bottom = 900.0 -[node name="Title" type="Label" parent="Grid/Menu/Banner/ColorRect"] -margin_right = 150.0 -margin_bottom = 150.0 -custom_fonts/font = ExtResource( 3 ) -text = "Loki -" -align = 1 -valign = 2 -__meta__ = { -"_edit_use_anchors_": false -} +[node name="UI_summary" parent="MarginContainer/HBoxContainer" instance=ExtResource( 8 )] +anchor_bottom = 0.0 +margin_right = 446.0 +margin_bottom = 900.0 +size_flags_horizontal = 0 +size_flags_vertical = 3 -[node name="TextureRect" type="TextureRect" parent="Grid/Menu/Banner/ColorRect/Title"] -margin_left = 48.0 -margin_right = 176.0 -margin_bottom = 128.0 -rect_scale = Vector2( 0.5, 0.5 ) -texture = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"] +margin_left = 450.0 +margin_right = 1440.0 +margin_bottom = 900.0 +size_flags_horizontal = 7 +size_flags_vertical = 3 -[node name="Action" type="Panel" parent="Grid/Menu"] -margin_top = 150.0 -margin_right = 150.0 -margin_bottom = 600.0 -__meta__ = { -"_edit_use_anchors_": false -} +[node name="Title" parent="MarginContainer/HBoxContainer/MarginContainer" instance=ExtResource( 2 )] +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 990.0 +margin_bottom = 900.0 -[node name="Puzzles" type="LinkButton" parent="Grid/Menu/Action"] -margin_left = 10.0 -margin_top = 30.0 -margin_right = 130.0 -margin_bottom = 64.0 -custom_fonts/font = ExtResource( 3 ) -text = "Puzzles" -__meta__ = { -"_edit_use_anchors_": false -} +[node name="Settings" parent="MarginContainer/HBoxContainer/MarginContainer" instance=ExtResource( 4 )] +visible = false +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 990.0 +margin_bottom = 900.0 -[node name="Settings" type="LinkButton" parent="Grid/Menu/Action"] -margin_left = 10.0 -margin_top = 130.0 -margin_right = 114.0 -margin_bottom = 164.0 -custom_fonts/font = ExtResource( 3 ) -text = "Settings" -__meta__ = { -"_edit_use_anchors_": false -} +[node name="ChooseScene" parent="MarginContainer/HBoxContainer/MarginContainer" instance=ExtResource( 3 )] +visible = false +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 0.0 +margin_top = 0.0 +margin_right = 990.0 +margin_bottom = 900.0 -[node name="Quit" type="LinkButton" parent="Grid/Menu/Action"] -margin_left = 10.0 -margin_top = 401.059 -margin_right = 161.0 -margin_bottom = 435.059 -custom_fonts/font = ExtResource( 3 ) -text = "Quitter" -script = SubResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +[connection signal="pressed" from="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/CenterContainer/TextureRect" to="." method="_on_TextureRect_pressed"] +[connection signal="pressed" from="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonPuzzle" to="." method="_on_ButtonPuzzle_pressed"] +[connection signal="pressed" from="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonSetting" to="." method="_on_ButtonSetting_pressed"] +[connection signal="pressed" from="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonQuit" to="." method="_on_ButtonQuit_pressed"] -[connection signal="pressed" from="Grid/Menu/Action/Puzzles" to="." method="_on_New_pressed"] -[connection signal="pressed" from="Grid/Menu/Action/Settings" to="." method="_on_Settings_pressed"] -[connection signal="pressed" from="Grid/Menu/Action/Quit" to="." method="_on_Quit_pressed"] +[editable path="MarginContainer/HBoxContainer/UI_summary"]