From 8e5fad8d89aaa1c90114792f969b55e88e337fa1 Mon Sep 17 00:00:00 2001 From: AleaJactaEst Date: Tue, 22 Jun 2021 18:22:58 +0200 Subject: [PATCH] adding icon jukebox --- NEWS_fr | 5 + README.md | 15 + addons/kh_window/kh_window_plugin.gd | 2 +- .../Login-Khanat-jukebox-button-hover.png | Bin 0 -> 16157 bytes .../Login-Khanat-jukebox-button.png | Bin 0 -> 1977 bytes assets/interfaces/options.png | Bin 545 -> 10868 bytes project.godot | 7 + ressources/scripts/datas/data.gd | 534 ++++++------- scenes/characters/character.gd | 438 +++++----- scenes/characters/character.tscn | 1 + scenes/creatures/creature.gd | 745 +++++++++--------- scenes/creatures/creature_creation_menu.gd | 3 +- scenes/creatures/creatures_creation.tscn | 38 +- scenes/creatures/human/human_female.tscn | 1 + scenes/creatures/human/mh_human_female.tscn | 19 +- scenes/interfaces/focus_reticle.gd | 4 +- .../interfaces/music_manager/music_manager.gd | 28 + scenes/interfaces/options/options.gd | 4 + scenes/interfaces/options/options.tscn | 41 +- scenes/main/main.gd | 7 +- scenes/main/main.tscn | 8 +- scenes/player/player.tscn | 1 + 22 files changed, 1010 insertions(+), 891 deletions(-) create mode 100644 assets/interfaces/Login-Khanat-jukebox-button-hover.png create mode 100644 assets/interfaces/Login-Khanat-jukebox-button.png diff --git a/NEWS_fr b/NEWS_fr index 8a27fbc..7eb0854 100644 --- a/NEWS_fr +++ b/NEWS_fr @@ -29,3 +29,8 @@ 6) Correction du menu de selection de la langue 7) Activer la sortie audio en fonction de la selection dans le menu option + +8) Ajouter un icon JukeBox dans la page de démarrage + +9) A l'ouverture du JukeBox, il retaille la fenetre afin de ne pas avoir du scrolling (si possible) + diff --git a/README.md b/README.md index e69de29..3fbc921 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,15 @@ +1/ To check error on + Impossible de charger le script de l’extension depuis le chemin : « res://addons/kh_window/kh_window_plugin.gd ». Cela peut être dû à une erreur de programmation dans ce script. + + +2/ +‎17/06/2021 | 21:49:01 ‎Zatalyz‎: pour les nouveautés : il faudrait que le texte ne demande pas de scroll horizontal, qu'il s'adapte à la largeur de cette fenêtre. 80 caractères si tu cherche la meilleure taille pour ce morceau :) + + dépend de la taille du texte, si trop grand ..., mais bonne remarque je note + + +‎17/06/2021 | 21:52:17 ‎Zatalyz‎: ha, un détail : quand on choisit "tête", c'est pas mal de zoomer sur la tête +‎17/06/2021 | 21:52:47 ‎Zatalyz‎: Ha oui, le nom commence par M, donc ça l'a fait apparaitre... je dirais : pas de raccourci sur cet écran :D +‎17/06/2021 | 21:53:07 ‎Zatalyz‎: (zoomer automatiquement... j'ai trouvé le zoom sinon) + +3/ je note ajouter un icon pour juke box diff --git a/addons/kh_window/kh_window_plugin.gd b/addons/kh_window/kh_window_plugin.gd index d6d2535..af8aeb4 100644 --- a/addons/kh_window/kh_window_plugin.gd +++ b/addons/kh_window/kh_window_plugin.gd @@ -4,7 +4,7 @@ extends EditorPlugin func _enter_tree(): # Initialization of the plugin goes here # Add the new type with a name, a parent type, a script and an icon - add_custom_type("kh_window", "MarginContainer", preload("kh_window.gd"), preload("icon.png")) + add_custom_type("kh_window", "MarginContainer", preload("res://addons/kh_window/kh_window.gd"), preload("res://addons/kh_window/icon.png")) func _exit_tree(): # Clean-up of the plugin goes here diff --git a/assets/interfaces/Login-Khanat-jukebox-button-hover.png b/assets/interfaces/Login-Khanat-jukebox-button-hover.png new file mode 100644 index 0000000000000000000000000000000000000000..ad26341b298b6ae8c4c6e8253060f0aa22f009d9 GIT binary patch literal 16157 zcmeHtWmKHa(k<@p&fo-RV6fn>!QEwW3+}-^Xdt+|y9b95oZwDym*9TMd*nN3-S5v? z>)wB7);!i-wX14(bSXuIj)V&7%R$m$V+H4M=Rghs zF5(;=CKr(7MwtOQdP&hzG6#(i>R;DCkzJC%UXYI`rzpr5?k3mobS;=%X0n#~zFt2T z*I&GNz9QdWa@-!>DrjYsdvxMn4c|^Ycm_Q_bUt==KbBvrKOBg<`uVZ>J&QzTAI-0` z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P^T>Yy1UqcH4a#BrKcaiT)?uT1IV` zF2yJn*d8z*@G01Z(UC4oCa2AVSvHDe_M&c|KxDVq&=U*hJJrfr@IPJTO)8s3mwc78WVW0ZFKvvSHvd=Re^ HH46Mczj@6Y literal 0 HcmV?d00001 diff --git a/assets/interfaces/Login-Khanat-jukebox-button.png b/assets/interfaces/Login-Khanat-jukebox-button.png new file mode 100644 index 0000000000000000000000000000000000000000..673786ac06be065b52e0df4301fe07d05a75445e GIT binary patch literal 1977 zcmZux4OERu7@m8}RbA<4%aNt1uWc{dQYy4XyKb7|YI9u*?d?bYc1oL&+b^<|(`IC& zjaEOagrrQWt!{*f9EEe&=;zc@NPgDtlC|GXIcJZwbI#1X^PTsd=Xsy^oo|n?Y=OSs z1U&$NKJ=RJ$988n-E>53eXu>t8~`ogyHGA=M}BDXLmSUd{NSLJ5<)P>2q6d|$8i(@ z0ssa80RREuSk#D5lmbEk#sDDzA>jVci2_Oh!2lzGAb=dZX++pac%Bf7F+m7Jh&YbN zm?A_V#LPyBLP(eaA!RG0%2PrKCKzD^5#%68c!DWL1VIcr#9MwGJqnE@$f zE60yu&l8?vN)W*iBgPl=6j1^RW_ciZ=i_Bv}5hf5}4kEzO53~l1=zDSlMCb<*5EC9@3K6RT1{@lm?qH8# zo*;@LVU>dbu{?)&0|dkC!$<;(0YQMd^MFu*2|$>&E#U#Ci~?XlL*vF&p*8^8o8Wv8 z`P%j;S^m2xNlkX~RgNKHxt^a)`>fv3y581%o<&!xSL2QpyRIENDdKQ#597QT-<2Qv z`pQi_zVh%e$}{Ln?%b|pX_PsmFx@D3XJoGK`i#)r?rX8N+0)#dYUCvbcSq}mZ^@a% zzkV#wnX@#mKoPL6;D93FwT0eBt&KY4N8M4Z{VTrHpfgG-ZOwlmSWxu!5!**03H9+y zaGLjo^2f0HQh=FR+TZT?HZ>@O3Bp$OXUav%Bx3ZX>A?{$@T#C>!ZRPIpy|SR$Gxdp zmYdz}wI&K=$BlYqR)0!5vnKzUByjh2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At^QrgQApf9;cqXKlpCPcB^0TIC008?G zc*|YY(W!`h>J=;4V4_1VyC1?c`9 zXm@m^gxgK%`MmxOzp)1gS!8@gN3?V8-cCjGj>mFm0JF>1Spe|kJClm;S>Lr821YDz z#EKLCJy`qkvW$#3i#X47f+b)7%$xI58}O{`D)$TIEWl+b`mxVjCctYX6~*Y^AiU$7O|>h`KQ=4JhycI7_8-L;XZ4QJ776N5CW!g3MiC$@r6gG^ZWQ=` Dy9K{1 literal 545 zcmeAS@N?(olHy`uVBq!ia0y~yV4MeJyK=Ar$*NBc;XsPBz$3C4NLhg}|C)4Z8lh3@)7f41tH39j1I>5Ky(Dj9a?RZlSLJQr-US$IZ`jUvFl-VQIQ^ z&2`ytvt1=s%b7lGugGF1&7WDn?<>_DPX9Z@-ym Nz|+;wWt~$(697`Jz=Hq) diff --git a/project.godot b/project.godot index c1a22db..4d21734 100644 --- a/project.godot +++ b/project.godot @@ -65,6 +65,7 @@ _global_script_class_icons={ config/name="Khanat" run/main_scene="res://scenes/main/main.tscn" boot_splash/image="res://assets/interfaces/new_launcher_bg_0-1.png" +boot_splash/bg_color=Color( 0.12549, 0.145098, 0.192157, 1 ) config/icon="res://icon.png" [audio] @@ -79,12 +80,18 @@ MusicManager="*res://scenes/interfaces/music_manager/music_manager.tscn" Connection="*res://scenes/connection/connection.tscn" Globals="*res://ressources/scripts/global.gd" Datas="*res://ressources/scripts/datas/data.gd" +GeneratorMap="*res://scenes/game/generate_map.gd" [debug] +settings/stdout/verbose_stdout=true gdscript/completion/autocomplete_setters_and_getters=true gdscript/warnings/unused_class_variable=true gdscript/warnings/return_value_discarded=false +gdscript/warnings/unsafe_property_access=true +gdscript/warnings/unsafe_method_access=true +gdscript/warnings/unsafe_cast=true +gdscript/warnings/unsafe_call_argument=true [display] diff --git a/ressources/scripts/datas/data.gd b/ressources/scripts/datas/data.gd index 85315a4..d0031f9 100644 --- a/ressources/scripts/datas/data.gd +++ b/ressources/scripts/datas/data.gd @@ -4,301 +4,301 @@ extends Node var JSONBeautifier = preload( "res://ressources/scripts/json_beautifier/json_beautifier.gd" ) class Data: - var datas = {} - - func _init( p_name = null ): - self.set_data( "name", p_name ) - - func get_data( p_key, p_default_value = null ): - return self.datas.get( p_key, p_default_value ) - - func set_data( p_key, p_value ): - self.datas[ p_key ] = p_value - - func get_filename(): - if not self.get_data( "name", null ): - return "unknow.data" - if self.get_data( "name" ).get_extension(): - return self.get_data( "name" ) - return self.get_data( "name" ) + ".data" - - func save( p_emplacement = "res"): - var filename = self.get_filename() - var ext = filename.get_extension() - var file = File.new() - - if p_emplacement == "res": - if file.open("res://ressources/files/"+ext+"s/"+filename, File.WRITE) == OK: - file.store_line( JSONBeautifier.beautify_json( to_json(self.datas), 4 ) ) - file.close() - elif p_emplacement == "user": - var dir = Directory.new() - if not dir.dir_exists( "user://saves/save_temp/ressources/files/"+ext+"s/" ): - dir .make_dir_recursive( "user://saves/save_temp/ressources/files/"+ext+"s/" ) - - if file.open("user://saves/save_temp/ressources/files/"+ext+"s/"+filename, File.WRITE) == OK: - file.store_line( JSONBeautifier.beautify_json( to_json(self.datas), 4 ) ) - file.close() - elif p_emplacement == "pc": - var dir = Directory.new() - if not dir.dir_exists( "user://saves/save_temp/ressources/files/"+ext+"s/pc/" ): - dir .make_dir_recursive( "user://saves/save_temp/ressources/files/"+ext+"s/pc/" ) - - if file.open("user://saves/save_temp/ressources/files/"+ext+"s/pc/"+filename, File.WRITE) == OK: - file.store_line( JSONBeautifier.beautify_json( to_json(self.datas), 4 ) ) - file.close() - - - func load( p_path = null, p_emplacement = null ): - - var dict = null - - if not p_path: - var filename = self.get_filename() - var ext = filename.get_extension() - var file = File.new() - if not p_emplacement: - if file.open("user://saves/save_temp/ressources/files/"+ext+"s/"+filename, File.READ) == OK or file.open("res://ressources/files/"+ext+"s/"+filename, File.READ) == OK: - dict = JSON.parse(file.get_as_text()).get_result() - else: - var path = "res://ressources/files/"+ext+"s/"+filename - if p_emplacement == "usr": - path = "user://saves/save_temp/ressources/files/"+ext+"s/"+filename - elif p_emplacement == "pc": - path = "user://saves/save_temp/ressources/files/"+ext+"s/pc/"+filename - - if file.open(path, File.READ) == OK: - dict = JSON.parse(file.get_as_text()).get_result() - file.close() - - else: - var file = File.new() - if file.open(p_path, File.READ) == OK: - dict = JSON.parse(file.get_as_text()).get_result() - file.close() - - if dict: - for key in dict.keys(): - self.set_data( key, dict[key] ) - + var datas = {} + + func _init( p_name = null ): + self.set_data( "name", p_name ) + + func get_data( p_key, p_default_value = null ): + return self.datas.get( p_key, p_default_value ) + + func set_data( p_key, p_value ): + self.datas[ p_key ] = p_value + + func get_filename(): + if not self.get_data( "name", null ): + return "unknow.data" + if self.get_data( "name" ).get_extension(): + return self.get_data( "name" ) + return self.get_data( "name" ) + ".data" + + func save( p_emplacement = "res"): + var filename = self.get_filename() + var ext = filename.get_extension() + var file = File.new() + + if p_emplacement == "res": + if file.open("res://ressources/files/"+ext+"s/"+filename, File.WRITE) == OK: + file.store_line( JSONBeautifier.beautify_json( to_json(self.datas), 4 ) ) + file.close() + elif p_emplacement == "user": + var dir = Directory.new() + if not dir.dir_exists( "user://saves/save_temp/ressources/files/"+ext+"s/" ): + dir .make_dir_recursive( "user://saves/save_temp/ressources/files/"+ext+"s/" ) + + if file.open("user://saves/save_temp/ressources/files/"+ext+"s/"+filename, File.WRITE) == OK: + file.store_line( JSONBeautifier.beautify_json( to_json(self.datas), 4 ) ) + file.close() + elif p_emplacement == "pc": + var dir = Directory.new() + if not dir.dir_exists( "user://saves/save_temp/ressources/files/"+ext+"s/pc/" ): + dir .make_dir_recursive( "user://saves/save_temp/ressources/files/"+ext+"s/pc/" ) + + if file.open("user://saves/save_temp/ressources/files/"+ext+"s/pc/"+filename, File.WRITE) == OK: + file.store_line( JSONBeautifier.beautify_json( to_json(self.datas), 4 ) ) + file.close() + + + func load( p_path = null, p_emplacement = null ): + + var dict = null + + if not p_path: + var filename = self.get_filename() + var ext = filename.get_extension() + var file = File.new() + if not p_emplacement: + if file.open("user://saves/save_temp/ressources/files/"+ext+"s/"+filename, File.READ) == OK or file.open("res://ressources/files/"+ext+"s/"+filename, File.READ) == OK: + dict = JSON.parse(file.get_as_text()).get_result() + else: + var path = "res://ressources/files/"+ext+"s/"+filename + if p_emplacement == "usr": + path = "user://saves/save_temp/ressources/files/"+ext+"s/"+filename + elif p_emplacement == "pc": + path = "user://saves/save_temp/ressources/files/"+ext+"s/pc/"+filename + + if file.open(path, File.READ) == OK: + dict = JSON.parse(file.get_as_text()).get_result() + file.close() + + else: + var file = File.new() + if file.open(p_path, File.READ) == OK: + dict = JSON.parse(file.get_as_text()).get_result() + file.close() + + if dict: + for key in dict.keys(): + self.set_data( key, dict[key] ) + class ProxyData extends Data: - - var data = null - - func _init( p_data_filename, p_data = null ): - .set_data( "item_filename", p_data_filename ) - .set_data( "modified_values", {} ) + + var data = null + + func _init( p_data_filename, p_data = null ): + .set_data( "item_filename", p_data_filename ) + .set_data( "modified_values", {} ) - var ref_data = Data.new() - ref_data.set_data( "name", .get_data( "item_filename" ) ) - ref_data.load() - if ref_data and ref_data is Data: - self.data = ref_data - var modified_values = {} - for data_name in self.data.datas.keys(): - if self.data and p_data and not self.data.get_data( data_name ) == p_data.get_data( data_name ): - modified_values[ data_name ] = p_data.get_data( data_name ) - .set_data( "modified_values", modified_values ) + var ref_data = Data.new() + ref_data.set_data( "name", .get_data( "item_filename" ) ) + ref_data.load() + if ref_data and ref_data is Data: + self.data = ref_data + var modified_values = {} + for data_name in self.data.datas.keys(): + if self.data and p_data and not self.data.get_data( data_name ) == p_data.get_data( data_name ): + modified_values[ data_name ] = p_data.get_data( data_name ) + .set_data( "modified_values", modified_values ) - func set_data( p_data_name, p_value ): - if not .get_data( "modified_values" ): - .set_data( "modified_values", {} ) - - var new_modified_value = .get_data( "modified_values" ) - new_modified_value[ p_data_name ] = p_value - .set_data( "modified_values", new_modified_value ) + func set_data( p_data_name, p_value ): + if not .get_data( "modified_values" ): + .set_data( "modified_values", {} ) + + var new_modified_value = .get_data( "modified_values" ) + new_modified_value[ p_data_name ] = p_value + .set_data( "modified_values", new_modified_value ) - func get_data( p_key, p_default_value = null ): - if .get_data( "modified_values" ) and p_key in .get_data( "modified_values" ): - return .get_data( "modified_values" )[ p_key ] - elif self.data: - return self.data.get_data( p_key, p_default_value ) - return p_default_value + func get_data( p_key, p_default_value = null ): + if .get_data( "modified_values" ) and p_key in .get_data( "modified_values" ): + return .get_data( "modified_values" )[ p_key ] + elif self.data: + return self.data.get_data( p_key, p_default_value ) + return p_default_value - func save( p_emplacement = "usr"): - .save( p_emplacement ) + func save( p_emplacement = "usr"): + .save( p_emplacement ) - func load( p_path = null, p_emplacement = "usr" ): - .load( p_path, p_emplacement ) - + func load( p_path = null, p_emplacement = "usr" ): + .load( p_path, p_emplacement ) + class Creature extends Data: - func _init( p_name = null ).( p_name ): - self.set_data( "race", null ) - # Caracteristiques. - self.set_data( "strength", 5 ) - self.set_data( "perception", 5 ) - self.set_data( "endurance", 5 ) - self.set_data( "constitution", 5 ) - self.set_data( "agility", 5 ) - self.set_data( "current_life", self.get_max_life() ) - self.set_data( "current_stamina", self.get_max_stamina() ) - # inventaire. - self.set_data( "inventory", [] ) - - func get_filename(): - if not self.get_data( "name", null ): - return "unknow.creature" - return self.get_data( "name" )+".creature" - - func get_max_life(): - return self.get_data( "constitution", 5 ) * 1000 - func get_max_stamina(): - return self.get_data( "endurance", 5 ) * 1000 - + func _init( p_name = null ).( p_name ): + self.set_data( "race", null ) + # Caracteristiques. + self.set_data( "strength", 5 ) + self.set_data( "perception", 5 ) + self.set_data( "endurance", 5 ) + self.set_data( "constitution", 5 ) + self.set_data( "agility", 5 ) + self.set_data( "current_life", self.get_max_life() ) + self.set_data( "current_stamina", self.get_max_stamina() ) + # inventaire. + self.set_data( "inventory", [] ) + + func get_filename(): + if not self.get_data( "name", null ): + return "unknow.creature" + return self.get_data( "name" )+".creature" + + func get_max_life(): + return self.get_data( "constitution", 5 ) * 1000 + func get_max_stamina(): + return self.get_data( "endurance", 5 ) * 1000 + class Human extends Creature: - func _init( p_name = null ).( p_name ): - self.set_data( "first_name", null ) - self.set_data( "last_name", null ) - # Aspect. - self.set_data( "caucasian", 0.0 ) - self.set_data( "african", 0.0 ) - self.set_data( "asian", 0.0 ) - self.set_data( "size", 1.0 ) - self.set_data( "fat", 0.0 ) - self.set_data( "muscles", 0.0 ) - self.set_data( "proportion", 0.0 ) - self.set_data( "breast", 0.0 ) - self.set_data( "pregnancy", 0.0 ) - self.set_data( "skin_tone", 0.0 ) - self.set_data( "hair", 0 ) - self.set_data( "hair_color", Color.white ) - self.set_data( "cleft_chin", 0.0 ) - self.set_data( "chin_angle", 0.0 ) - self.set_data( "mouth_horiz", 0.0 ) - self.set_data( "mouth_vert", 0.0 ) - self.set_data( "nose_galbe", 0.0 ) - self.set_data( "nose_grec", 0.0 ) - self.set_data( "nose_horiz", 0.0 ) - self.set_data( "nose_depth", 0.0 ) - self.set_data( "eyes_vert", 0.0 ) - self.set_data( "eyes_gap", 0.0 ) - self.set_data( "earlobes", 0.0 ) - self.set_data( "ears_wing", 0.0 ) - self.set_data( "lips_up_shape", 0.0 ) - self.set_data( "lips_up_shape_2", 0.0 ) + func _init( p_name = null ).( p_name ): + self.set_data( "first_name", null ) + self.set_data( "last_name", null ) + # Aspect. + self.set_data( "caucasian", 0.0 ) + self.set_data( "african", 0.0 ) + self.set_data( "asian", 0.0 ) + self.set_data( "size", 1.0 ) + self.set_data( "fat", 0.0 ) + self.set_data( "muscles", 0.0 ) + self.set_data( "proportion", 0.0 ) + self.set_data( "breast", 0.0 ) + self.set_data( "pregnancy", 0.0 ) + self.set_data( "skin_tone", 0.0 ) + self.set_data( "hair", 0 ) + self.set_data( "hair_color", Color.white ) + self.set_data( "cleft_chin", 0.0 ) + self.set_data( "chin_angle", 0.0 ) + self.set_data( "mouth_horiz", 0.0 ) + self.set_data( "mouth_vert", 0.0 ) + self.set_data( "nose_galbe", 0.0 ) + self.set_data( "nose_grec", 0.0 ) + self.set_data( "nose_horiz", 0.0 ) + self.set_data( "nose_depth", 0.0 ) + self.set_data( "eyes_vert", 0.0 ) + self.set_data( "eyes_gap", 0.0 ) + self.set_data( "earlobes", 0.0 ) + self.set_data( "ears_wing", 0.0 ) + self.set_data( "lips_up_shape", 0.0 ) + self.set_data( "lips_up_shape_2", 0.0 ) - func get_filename(): - if not self.get_data( "first_name" ) and not self.get_data( "last_name" ): - return "unknow.creature" - elif not self.get_data( "last_name" ): - return self.get_data( "first_name" ) + ".creature" - elif not self.get_data( "first_name" ): - return self.get_data( "last_name" ) + ".creature" - return self.get_data( "first_name" ) + "_" + self.get_data( "last_name" ) + ".creature" + func get_filename(): + if not self.get_data( "first_name" ) and not self.get_data( "last_name" ): + return "unknow.creature" + elif not self.get_data( "last_name" ): + return self.get_data( "first_name" ) + ".creature" + elif not self.get_data( "first_name" ): + return self.get_data( "last_name" ) + ".creature" + return self.get_data( "first_name" ) + "_" + self.get_data( "last_name" ) + ".creature" class Item extends Data: - func _init( p_name = null ).( p_name ): - self.set_data( "model", null ) - self.set_data( "label", "" ) - self.set_data( "description", "" ) - self.set_data( "icon", null ) - self.set_data( "stack", 1 ) - self.set_data( "default_num_given", 1 ) - self.set_data( "pickable", true ) - self.set_data( "dropable", true ) - self.set_data( "hit_points", -1 ) - - func get_filename(): - if not self.get_data( "name", null ): - return "unknow.item" - return self.get_data( "name" )+".item" + func _init( p_name = null ).( p_name ): + self.set_data( "model", null ) + self.set_data( "label", "" ) + self.set_data( "description", "" ) + self.set_data( "icon", null ) + self.set_data( "stack", 1 ) + self.set_data( "default_num_given", 1 ) + self.set_data( "pickable", true ) + self.set_data( "dropable", true ) + self.set_data( "hit_points", -1 ) + + func get_filename(): + if not self.get_data( "name", null ): + return "unknow.item" + return self.get_data( "name" )+".item" class Equipment extends Item: - - enum SLOT { - cloth_hand, - cloth_face, - cloth_head, - cloth_torso, - cloth_legs, - cloth_feet, - cloth_back, - weapon_hand_right, - weapon_hand_left, - weapon_hands, - weapon_hip_right, - weapon_hip_left, - weapon_back_right, - weapon_back_left, - weapon_holster_right, - weapon_holster_left - } - - func _init( p_name = null ).( p_name ): - self.set_data( "slots", [SLOT.weapon_hand_right] ) - self.set_data( "default_slot", SLOT.weapon_hand_right ) - self.set_data( "model_equiped", null ) - self.set_data( "attachment", "attachment_hand_R" ) - self.set_data( "attachment_equiped", "attachment_hand_R" ) + + enum SLOT { + cloth_hand, + cloth_face, + cloth_head, + cloth_torso, + cloth_legs, + cloth_feet, + cloth_back, + weapon_hand_right, + weapon_hand_left, + weapon_hands, + weapon_hip_right, + weapon_hip_left, + weapon_back_right, + weapon_back_left, + weapon_holster_right, + weapon_holster_left + } + + func _init( p_name = null ).( p_name ): + self.set_data( "slots", [SLOT.weapon_hand_right] ) + self.set_data( "default_slot", SLOT.weapon_hand_right ) + self.set_data( "model_equiped", null ) + self.set_data( "attachment", "attachment_hand_R" ) + self.set_data( "attachment_equiped", "attachment_hand_R" ) - func get_filename(): - if not self.get_data( "name", null ): - return "unknow.equipment" - return self.get_data( "name" )+".equipment" - + func get_filename(): + if not self.get_data( "name", null ): + return "unknow.equipment" + return self.get_data( "name" )+".equipment" + class Cloth extends Equipment: - - enum LIMB { - head, - torso, - left_upper_arm, - right_upper_arm, - left_lower_arm, - right_lower_arm, - left_hand, - right_hand, - left_upper_leg, - right_upper_leg, - left_lower_leg, - right_lower_leg, - left_feet, - right_feet - } - - func _init( p_name = null ).( p_name ): - self.set_data( "protection", 0 ) - self.set_data( "protected_limbs", [] ) - self.set_data( "texture", null ) + + enum LIMB { + head, + torso, + left_upper_arm, + right_upper_arm, + left_lower_arm, + right_lower_arm, + left_hand, + right_hand, + left_upper_leg, + right_upper_leg, + left_lower_leg, + right_lower_leg, + left_feet, + right_feet + } + + func _init( p_name = null ).( p_name ): + self.set_data( "protection", 0 ) + self.set_data( "protected_limbs", [] ) + self.set_data( "texture", null ) - func get_filename(): - if not self.get_data( "name", null ): - return "unknow.cloth" - return self.get_data( "name" )+".cloth" + func get_filename(): + if not self.get_data( "name", null ): + return "unknow.cloth" + return self.get_data( "name" )+".cloth" class Weapon extends Equipment: - - enum TYPE { - melee, - ranged, - throwed - } - - func _init( p_name = null ).( p_name ): - self.set_data( "damage", 0.0 ) - self.set_data( "reload_needed", 0 ) - self.set_data( "range", 1.0 ) - self.set_data( "type", TYPE.melee ) - self.set_data( "attack_delay", 1.0 ) - - func get_filename(): - if not self.get_data( "name", null ): - return "unknow.weapon" - return self.get_data( "name" )+".weapon" + + enum TYPE { + melee, + ranged, + throwed + } + + func _init( p_name = null ).( p_name ): + self.set_data( "damage", 0.0 ) + self.set_data( "reload_needed", 0 ) + self.set_data( "range", 1.0 ) + self.set_data( "type", TYPE.melee ) + self.set_data( "attack_delay", 1.0 ) + + func get_filename(): + if not self.get_data( "name", null ): + return "unknow.weapon" + return self.get_data( "name" )+".weapon" class InventoryItem extends ProxyData: - func _init( p_item_filename, p_number = 1, p_item = null ).( p_item_filename, p_item ): - self.set_data( "number", p_number ) + func _init( p_item_filename, p_number = 1, p_item = null ).( p_item_filename, p_item ): + self.set_data( "number", p_number ) class PickupItem extends ProxyData: - - func _init( p_item_filename, p_global_transform, p_item = null ).( p_item_filename, p_item ): - self.set_data( "global_transform", p_global_transform ) + + func _init( p_item_filename, p_global_transform, p_item = null ).( p_item_filename, p_item ): + self.set_data( "global_transform", p_global_transform ) # #class Character extends ProxyData: diff --git a/scenes/characters/character.gd b/scenes/characters/character.gd index 5e861e8..0b743a3 100644 --- a/scenes/characters/character.gd +++ b/scenes/characters/character.gd @@ -35,268 +35,268 @@ var direction = Vector3.ZERO var orientation = 0.0 enum PLAYER_RELATION { - neutre, - friend, - ennemy + neutre, + friend, + ennemy } export( PLAYER_RELATION ) var player_relation = PLAYER_RELATION.neutre export( String ) var creature_filename = null setget set_creature_filename func set_creature_filename( p_filename ): - creature_filename = p_filename - self.load_from_name( p_filename ) + creature_filename = p_filename + self.load_from_name( p_filename ) func _process( delta ): - # Calculate a move direction vector relative to the camera - # The basis stores the (right, up, -forwards) vectors of our camera. - var forwards: Vector3 = $look_at.global_transform.basis.z * direction.z - var right: Vector3 = $look_at.global_transform.basis.x * direction.x - if forwards: - right = Vector3.ZERO - var move_direction: = forwards + right - if move_direction.length() > 1.0: - move_direction = move_direction.normalized() - move_direction.y = 0 - - # Rotation. - if (self.has_node( "creature" ) and $creature.can_turn()) or self.is_readying_weapon or self.is_weapon_ready: - self.rotate_y( rotation_speed_factor * orientation ) + # Calculate a move direction vector relative to the camera + # The basis stores the (right, up, -forwards) vectors of our camera. + var forwards: Vector3 = $look_at.global_transform.basis.z * direction.z + var right: Vector3 = $look_at.global_transform.basis.x * direction.x + if forwards: + right = Vector3.ZERO + var move_direction: = forwards + right + if move_direction.length() > 1.0: + move_direction = move_direction.normalized() + move_direction.y = 0 + + # Rotation. + if (self.has_node( "creature" ) and $creature.can_turn()) or self.is_readying_weapon or self.is_weapon_ready: + self.rotate_y( rotation_speed_factor * orientation ) - # Movement. - velocity = self.calculate_velocity(velocity, move_direction, delta) - if not self.is_readying_weapon and not self.is_weapon_ready: - if not self.is_jumping and not self.is_jump_started and not self.is_falling: - velocity = self.move_and_slide_with_snap(velocity, Vector3.DOWN, Vector3.UP, true) - else: - velocity = self.move_and_slide(velocity, Vector3.UP, true) - # Animation. - if self.has_node( "creature" ): - if self.is_dead: - $creature.play( "dead_loop" ) - elif self.is_dying: - $creature.play( "dying", 2.0 ) - elif self.is_readying_weapon: - $creature.play( "1h_pistol_ready_start" ) - elif self.is_weapon_ready: - $creature.play( "1h_pistol_ready_loop" ) - elif direction and not self.is_jump_started and not self.is_jumping and not self.is_falling: - if direction.z < 0.0: - if self.is_running: - $creature.play( "run" , 2.0 ) - else: - $creature.play( "walk" ) - elif direction.z > 0.0: - if self.is_running: - $creature.play_backwards( "run", 2.0 ) - else: - $creature.play_backwards( "walk" ) - elif direction.x > 0.0: - $creature.play( "strafe_right" ) - elif direction.x < 0.0: - $creature.play( "strafe_left" ) - elif self.is_jump_started and not self.is_jumping: - $creature.play( "jump_start" ) - elif self.is_jumping or self.is_falling: - if not self.is_on_ground: - $creature.play( "jump_loop" ) - else: - $creature.play( "jump_end", 2 ) - elif not self.orientation == 0.0: - if self.orientation < 0.0: - $creature.play( "turn_right", 2.0 ) - elif self.orientation > 0.0: - $creature.play( "turn_left", 2.0 ) - else: - $creature.play( "idle" ) - - + # Movement. + velocity = self.calculate_velocity(velocity, move_direction, delta) + if not self.is_readying_weapon and not self.is_weapon_ready: + if not self.is_jumping and not self.is_jump_started and not self.is_falling: + velocity = self.move_and_slide_with_snap(velocity, Vector3.DOWN, Vector3.UP, true) + else: + velocity = self.move_and_slide(velocity, Vector3.UP, true) + # Animation. + if self.has_node( "creature" ): + if self.is_dead: + $creature.play( "dead_loop" ) + elif self.is_dying: + $creature.play( "dying", 2.0 ) + elif self.is_readying_weapon: + $creature.play( "1h_pistol_ready_start" ) + elif self.is_weapon_ready: + $creature.play( "1h_pistol_ready_loop" ) + elif direction and not self.is_jump_started and not self.is_jumping and not self.is_falling: + if direction.z < 0.0: + if self.is_running: + $creature.play( "run" , 2.0 ) + else: + $creature.play( "walk" ) + elif direction.z > 0.0: + if self.is_running: + $creature.play_backwards( "run", 2.0 ) + else: + $creature.play_backwards( "walk" ) + elif direction.x > 0.0: + $creature.play( "strafe_right" ) + elif direction.x < 0.0: + $creature.play( "strafe_left" ) + elif self.is_jump_started and not self.is_jumping: + $creature.play( "jump_start" ) + elif self.is_jumping or self.is_falling: + if not self.is_on_ground: + $creature.play( "jump_loop" ) + else: + $creature.play( "jump_end", 2 ) + elif not self.orientation == 0.0: + if self.orientation < 0.0: + $creature.play( "turn_right", 2.0 ) + elif self.orientation > 0.0: + $creature.play( "turn_left", 2.0 ) + else: + $creature.play( "idle" ) + + func calculate_velocity( - velocity_current: Vector3, - move_direction: Vector3, - delta: float - ) -> Vector3: - + velocity_current: Vector3, + move_direction: Vector3, + delta: float + ) -> Vector3: + # var velocity_new := move_direction - var velocity_new = Vector3.ZERO - if not self.is_jump_started: - velocity_new = move_direction - - if self.is_running: - velocity_new *= run_speed - else: - velocity_new *= move_speed - if velocity_new.length() > max_speed: - velocity_new = velocity_new.normalized() * max_speed - velocity_new.y = velocity_current.y + gravity * delta - if self.is_jumping: - velocity_new.y += self.jump_strength * delta - self.is_jumping = false - self.is_falling = true - if self.is_falling: - velocity_new.x *= 2.0 - velocity_new.z *= 2.0 - - - return velocity_new - + var velocity_new = Vector3.ZERO + if not self.is_jump_started: + velocity_new = move_direction + + if self.is_running: + velocity_new *= run_speed + else: + velocity_new *= move_speed + if velocity_new.length() > max_speed: + velocity_new = velocity_new.normalized() * max_speed + velocity_new.y = velocity_current.y + gravity * delta + if self.is_jumping: + velocity_new.y += self.jump_strength * delta + self.is_jumping = false + self.is_falling = true + if self.is_falling: + velocity_new.x *= 2.0 + velocity_new.z *= 2.0 + + + return velocity_new + func load_from_name( p_name, p_emplacement = null ): - var creature = Datas.Creature.new() - creature.set_data( "name", p_name ) - creature.load( null, p_emplacement ) - if creature.get_data( "race" ) == Globals.RACE.human: - if creature.get_data( "sex" ) == Globals.SEX.female: - self.change_creature( "res://scenes/creatures/human/human_female.tscn" ) - elif creature.get_data( "sex" ) == Globals.SEX.male: - self.change_creature( "res://scenes/creatures/human/human_male.tscn" ) - if $creature: - $creature.load_from_name( p_name, p_emplacement ) - + var creature = Datas.Creature.new() + creature.set_data( "name", p_name ) + creature.load( null, p_emplacement ) + if creature.get_data( "race" ) == Globals.RACE.human: + if creature.get_data( "sex" ) == Globals.SEX.female: + self.change_creature( "res://scenes/creatures/human/human_female.tscn" ) + elif creature.get_data( "sex" ) == Globals.SEX.male: + self.change_creature( "res://scenes/creatures/human/human_male.tscn" ) + if $creature: + $creature.load_from_name( p_name, p_emplacement ) + func change_creature( new_model_path ): - if $creature: - var old_model = $creature - self.remove_child( old_model ) - old_model.queue_free() - var new_model = load( new_model_path ) - if new_model: - new_model = new_model.instance() - new_model.name = "creature" - self.add_child( new_model ) - new_model.connect( "animation_finished", self, "_on_creature_animation_finished" ) - new_model.duplicate_meshes() + if $creature: + var old_model = $creature + self.remove_child( old_model ) + old_model.queue_free() + var new_model = load( new_model_path ) + if new_model: + new_model = new_model.instance() + new_model.name = "creature" + self.add_child( new_model ) + new_model.connect( "animation_finished", self, "_on_creature_animation_finished" ) + new_model.duplicate_meshes() func set_blend_shape( p_blend_shape_name, p_value ): - $creature.set_blend_shape( p_blend_shape_name, p_value ) - + $creature.set_blend_shape( p_blend_shape_name, p_value ) + func _on_ground_area_body_entered(body): - if not body == self: - self.ground_contacts += 1 - if self.ground_contacts > 0: + if not body == self: + self.ground_contacts += 1 + if self.ground_contacts > 0: # self.is_falling = false - self.is_on_ground = true + self.is_on_ground = true func _on_ground_area_body_exited(body): - if not body == self: - self.ground_contacts -= 1 - if self.ground_contacts <= 0: - self.is_falling = true - self.is_on_ground = false + if not body == self: + self.ground_contacts -= 1 + if self.ground_contacts <= 0: + self.is_falling = true + self.is_on_ground = false func _on_creature_animation_finished(anim_name): - if anim_name == "jump_start": - self.is_jump_started = false - self.is_jumping = true - elif anim_name == "jump_end": - self.is_falling = false - elif anim_name == "turn_right": - self.can_turn = false - elif anim_name == "turn_left": - self.can_turn = false - elif anim_name == "1h_pistol_ready_start": - self.is_readying_weapon = false - self.is_weapon_ready = true - elif anim_name == "dying": - self.is_dying = false - self.is_dead = true + if anim_name == "jump_start": + self.is_jump_started = false + self.is_jumping = true + elif anim_name == "jump_end": + self.is_falling = false + elif anim_name == "turn_right": + self.can_turn = false + elif anim_name == "turn_left": + self.can_turn = false + elif anim_name == "1h_pistol_ready_start": + self.is_readying_weapon = false + self.is_weapon_ready = true + elif anim_name == "dying": + self.is_dying = false + self.is_dead = true func set_focus( p_focus = true ): - if p_focus: - $focus.show() - if self.player_relation == PLAYER_RELATION.neutre: - $focus.get_surface_material( 0 ).albedo_color = Color.white - elif self.player_relation == PLAYER_RELATION.friend: - $focus.get_surface_material( 0 ).albedo_color = Color.green - elif self.player_relation == PLAYER_RELATION.ennemy: - $focus.get_surface_material( 0 ).albedo_color = Color.red - else: - $focus.hide() + if p_focus: + $focus.show() + if self.player_relation == PLAYER_RELATION.neutre: + $focus.get_surface_material( 0 ).albedo_color = Color.white + elif self.player_relation == PLAYER_RELATION.friend: + $focus.get_surface_material( 0 ).albedo_color = Color.green + elif self.player_relation == PLAYER_RELATION.ennemy: + $focus.get_surface_material( 0 ).albedo_color = Color.red + else: + $focus.hide() func get_weapons(): - var weapons = [] - if Datas.Equipment.SLOT.weapon_hands in $creature.slots: - if $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item: - weapons.push_back( $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item ) + var weapons = [] + if Datas.Equipment.SLOT.weapon_hands in $creature.slots: + if $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item: + weapons.push_back( $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item ) - if not weapons.size() > 0: - if Datas.Equipment.SLOT.weapon_hand_right in $creature.slots: - if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item: - weapons.push_back( $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item ) - if Datas.Equipment.SLOT.weapon_hand_left in $creature.slots: - if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item: - weapons.push_back( $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item ) - return weapons - + if not weapons.size() > 0: + if Datas.Equipment.SLOT.weapon_hand_right in $creature.slots: + if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item: + weapons.push_back( $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item ) + if Datas.Equipment.SLOT.weapon_hand_left in $creature.slots: + if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item: + weapons.push_back( $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item ) + return weapons + func get_main_weapon_node(): - var weapon = null - if Datas.Equipment.SLOT.weapon_hands in $creature.slots: - if $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item: - if $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children().size() > 0: - weapon = $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children()[0] - if not weapon and Datas.Equipment.SLOT.weapon_hand_right in $creature.slots: - if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item: - if $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children().size() > 0: - weapon = $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children()[0] - if not weapon and Datas.Equipment.SLOT.weapon_hand_left in $creature.slots: - if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item: - if $creature/body_parts/body/skeleton/attachment_hand_L/handle.get_children().size() > 0: - weapon = $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children()[0] - return weapon - + var weapon = null + if Datas.Equipment.SLOT.weapon_hands in $creature.slots: + if $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item: + if $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children().size() > 0: + weapon = $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children()[0] + if not weapon and Datas.Equipment.SLOT.weapon_hand_right in $creature.slots: + if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item: + if $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children().size() > 0: + weapon = $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children()[0] + if not weapon and Datas.Equipment.SLOT.weapon_hand_left in $creature.slots: + if $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item: + if $creature/body_parts/body/skeleton/attachment_hand_L/handle.get_children().size() > 0: + weapon = $creature/body_parts/body/skeleton/attachment_hand_R/handle.get_children()[0] + return weapon + func attack(): - if self.can_attack: - var weapon = null - var attachment = null - weapon = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item - attachment = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].attachment - if not weapon: - weapon = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item - attachment = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].attachment - if not weapon: - weapon = $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item - attachment = $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].attachment - - if weapon: - print( "pan " + str(weapon.get_data( "damage" )) ) + if self.can_attack: + var weapon = null + var attachment = null + weapon = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].item + attachment = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_right ].attachment + if not weapon: + weapon = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].item + attachment = $creature.slots[ Datas.Equipment.SLOT.weapon_hand_left ].attachment + if not weapon: + weapon = $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].item + attachment = $creature.slots[ Datas.Equipment.SLOT.weapon_hands ].attachment + + if weapon: + print( "pan " + str(weapon.get_data( "damage" )) ) - var weapon_node = $creature/body_parts/body/skeleton.get_node( attachment ) - if weapon_node: - weapon_node = weapon_node.get_node( "handle" ).get_children()[0] + var weapon_node = $creature/body_parts/body/skeleton.get_node( attachment ) + if weapon_node: + weapon_node = weapon_node.get_node( "handle" ).get_children()[0] # if weapon_node is preload( "res://scenes/items/equipments/weapons/firearm.gd" ): # weapon_node.fire( self, [self] ) # - self.can_attack = false - $attack_delay.start() - + self.can_attack = false + $attack_delay.start() + func hit( p_damage, p_from = null ): - $creature.creature.set_data( "current_life", $creature.creature.get_data( "current_life" )-p_damage ) - $head_infos_viewport/head_infos/bars/life.max_value = $creature.creature.get_max_life() - $head_infos_viewport/head_infos/bars/life.value = $creature.creature.get_data( "current_life", 0 ) - + $creature.creature.set_data( "current_life", $creature.creature.get_data( "current_life" )-p_damage ) + $head_infos_viewport/head_infos/bars/life.max_value = $creature.creature.get_max_life() + $head_infos_viewport/head_infos/bars/life.value = $creature.creature.get_data( "current_life", 0 ) + func die(): - self.is_dying = true - + self.is_dying = true + func _on_creature_equip(p_slot, p_item): - var weapons = self.get_weapons() - if weapons.size() > 0: - var max_delay = null - for weapon in weapons: - if not max_delay: - max_delay = weapon.get_data( "attack_delay" ) - else: - max_delay = max( max_delay, weapon.get_data( "attack_delay" ) ) - $attack_delay.wait_time = max_delay - emit_signal( "equip", p_slot, p_item ) + var weapons = self.get_weapons() + if weapons.size() > 0: + var max_delay = null + for weapon in weapons: + if not max_delay: + max_delay = weapon.get_data( "attack_delay" ) + else: + max_delay = max( max_delay, weapon.get_data( "attack_delay" ) ) + $attack_delay.wait_time = max_delay + emit_signal( "equip", p_slot, p_item ) func _on_creature_unequip(p_slot): - emit_signal( "unequip", p_slot ) + emit_signal( "unequip", p_slot ) func _on_attack_delay_timeout(): - self.can_attack = true + self.can_attack = true func _on_creature_is_dead(): - self.die() + self.die() diff --git a/scenes/characters/character.tscn b/scenes/characters/character.tscn index 5af2450..a12ae03 100644 --- a/scenes/characters/character.tscn +++ b/scenes/characters/character.tscn @@ -85,6 +85,7 @@ size = Vector2( 1, 1.5 ) [node name="attack_delay" type="Timer" parent="."] one_shot = true + [connection signal="animation_finished" from="creature" to="." method="_on_creature_animation_finished"] [connection signal="equip" from="creature" to="." method="_on_creature_equip"] [connection signal="is_dead" from="creature" to="." method="_on_creature_is_dead"] diff --git a/scenes/creatures/creature.gd b/scenes/creatures/creature.gd index 8eccea3..500b53b 100644 --- a/scenes/creatures/creature.gd +++ b/scenes/creatures/creature.gd @@ -11,407 +11,412 @@ var eye_color_list = [ "blue_eye", "bluegreen_eye","brown_eye","deepblue_eye","g class Slot: - var item = null - var attachment = null - func _init( p_attachment = null ): - self.attachment = p_attachment + var item = null + var attachment = null + func _init( p_attachment = null ): + self.attachment = p_attachment var slots = { Datas.Equipment.SLOT.cloth_hand: Slot.new( "cloths" )\ - , Datas.Equipment.SLOT.cloth_face: Slot.new( "cloths" )\ - , Datas.Equipment.SLOT.cloth_head: Slot.new( "cloths" )\ - , Datas.Equipment.SLOT.cloth_torso: Slot.new( "cloths" )\ - , Datas.Equipment.SLOT.cloth_legs: Slot.new( "cloths" )\ - , Datas.Equipment.SLOT.cloth_feet: Slot.new( "cloths" )\ - , Datas.Equipment.SLOT.cloth_back: Slot.new( "cloths" )\ - , Datas.Equipment.SLOT.weapon_hand_right: Slot.new( "attachment_hand_R" )\ - , Datas.Equipment.SLOT.weapon_hand_left: Slot.new( "attachment_hand_L" )\ - , Datas.Equipment.SLOT.weapon_hands: Slot.new( "attachment_hand_R" )\ - , Datas.Equipment.SLOT.weapon_hip_right: Slot.new( "attachment_hips_R" )\ - , Datas.Equipment.SLOT.weapon_hip_left: Slot.new( "attachment_hips_L" )\ - , Datas.Equipment.SLOT.weapon_back_right: Slot.new()\ - , Datas.Equipment.SLOT.weapon_back_left: Slot.new()\ - , Datas.Equipment.SLOT.weapon_holster_right: Slot.new()\ - , Datas.Equipment.SLOT.weapon_holster_left: Slot.new() } + , Datas.Equipment.SLOT.cloth_face: Slot.new( "cloths" )\ + , Datas.Equipment.SLOT.cloth_head: Slot.new( "cloths" )\ + , Datas.Equipment.SLOT.cloth_torso: Slot.new( "cloths" )\ + , Datas.Equipment.SLOT.cloth_legs: Slot.new( "cloths" )\ + , Datas.Equipment.SLOT.cloth_feet: Slot.new( "cloths" )\ + , Datas.Equipment.SLOT.cloth_back: Slot.new( "cloths" )\ + , Datas.Equipment.SLOT.weapon_hand_right: Slot.new( "attachment_hand_R" )\ + , Datas.Equipment.SLOT.weapon_hand_left: Slot.new( "attachment_hand_L" )\ + , Datas.Equipment.SLOT.weapon_hands: Slot.new( "attachment_hand_R" )\ + , Datas.Equipment.SLOT.weapon_hip_right: Slot.new( "attachment_hips_R" )\ + , Datas.Equipment.SLOT.weapon_hip_left: Slot.new( "attachment_hips_L" )\ + , Datas.Equipment.SLOT.weapon_back_right: Slot.new()\ + , Datas.Equipment.SLOT.weapon_back_left: Slot.new()\ + , Datas.Equipment.SLOT.weapon_holster_right: Slot.new()\ + , Datas.Equipment.SLOT.weapon_holster_left: Slot.new() } func _ready(): - self.duplicate_meshes() + self.duplicate_meshes() func duplicate_meshes(): - for body in $body_parts.get_children(): - for mesh in body.get_node( "skeleton" ).get_children(): - if mesh is MeshInstance: - var new_mat = mesh.get( "material/0" ).duplicate() - var new_mesh = mesh.mesh.duplicate() - mesh.mesh = new_mesh - mesh.set( "material/0", new_mat ) - for body in $hair_parts.get_children(): - for mesh in body.get_node( "skeleton" ).get_children(): - if mesh is MeshInstance: - var new_mat = mesh.get( "material/0" ).duplicate() - var new_mesh = mesh.mesh.duplicate() - mesh.mesh = new_mesh - mesh.set( "material/0", new_mat ) - for body in $cloths.get_children(): - for mesh in body.get_node( "skeleton" ).get_children(): - if mesh is MeshInstance: - var new_mat = mesh.get( "material/0" ).duplicate() - var new_mesh = mesh.mesh.duplicate() - mesh.mesh = new_mesh - mesh.set( "material/0", new_mat ) - self.update() + for body in $body_parts.get_children(): + for mesh in body.get_node( "skeleton" ).get_children(): + if mesh is MeshInstance: + var new_mat = mesh.get( "material/0" ).duplicate() + var new_mesh = mesh.mesh.duplicate() + mesh.mesh = new_mesh + mesh.set( "material/0", new_mat ) + for body in $hair_parts.get_children(): + for mesh in body.get_node( "skeleton" ).get_children(): + if mesh is MeshInstance: + var new_mat = mesh.get( "material/0" ).duplicate() + var new_mesh = mesh.mesh.duplicate() + mesh.mesh = new_mesh + mesh.set( "material/0", new_mat ) + for body in $cloths.get_children(): + for mesh in body.get_node( "skeleton" ).get_children(): + if mesh is MeshInstance: + var new_mat = mesh.get( "material/0" ).duplicate() + var new_mesh = mesh.mesh.duplicate() + mesh.mesh = new_mesh + mesh.set( "material/0", new_mat ) + self.update() func set_blend_shape( p_blend_shape_name, p_value ): - for child in $body_parts.get_children(): - var skeleton = child.get_node( "skeleton" ) - for node in skeleton.get_children(): - if node is MeshInstance: - node.set( "blend_shapes/"+p_blend_shape_name, p_value ) - for child in $hair_parts.get_children(): - var skeleton = child.get_node( "skeleton" ) - for node in skeleton.get_children(): - if node is MeshInstance: - node.set( "blend_shapes/"+p_blend_shape_name, p_value ) - for child in $cloths.get_children(): - var skeleton = child.get_node( "skeleton" ) - for node in skeleton.get_children(): - if node is MeshInstance: - node.set( "blend_shapes/"+p_blend_shape_name, p_value ) + for child in $body_parts.get_children(): + var skeleton = child.get_node( "skeleton" ) + for node in skeleton.get_children(): + if node is MeshInstance: + node.set( "blend_shapes/"+p_blend_shape_name, p_value ) + for child in $hair_parts.get_children(): + var skeleton = child.get_node( "skeleton" ) + for node in skeleton.get_children(): + if node is MeshInstance: + node.set( "blend_shapes/"+p_blend_shape_name, p_value ) + for child in $cloths.get_children(): + var skeleton = child.get_node( "skeleton" ) + for node in skeleton.get_children(): + if node is MeshInstance: + node.set( "blend_shapes/"+p_blend_shape_name, p_value ) func load_from_name( p_name, p_emplacement = "usr" ): - var new_creature = Datas.Human.new() - var name_split = p_name.split( "_" ) - new_creature.set_data( "first_name", name_split[0] ) - new_creature.set_data( "last_name", name_split[1] ) - new_creature.load( null, p_emplacement ) - self.creature = new_creature - self.update() - + var new_creature = Datas.Human.new() + var name_split = p_name.split( "_" ) + new_creature.set_data( "first_name", name_split[0] ) + new_creature.set_data( "last_name", name_split[1] ) + new_creature.load( null, p_emplacement ) + self.creature = new_creature + self.update() + func update(): - - if self.creature: - - self.scale = Vector3( self.creature.get_data( "size" ), self.creature.get_data( "size" ), self.creature.get_data( "size" ) ) - - self.set_blend_shape( "caucasian", self.creature.get_data( "caucasian" ) ) - self.set_blend_shape( "african", self.creature.get_data( "african" ) ) - self.set_blend_shape( "asian", self.creature.get_data( "asian" ) ) - - if self.creature.get_data( "sex" ) == Globals.SEX.female: - if self.creature.get_data( "skin" ) == 0: - self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_female_diffuse.png" ) ) - elif self.creature.get_data( "skin" ) == 1: - self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_female_diffuse3.png" ) ) - elif self.creature.get_data( "skin" ) == 2: - self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_darkskinned_female_diffuse.png" ) ) - elif self.creature.get_data( "sex" ) == Globals.SEX.male: - if self.creature.get_data( "skin" ) == 0: - self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_male_diffuse2.png" ) ) - elif self.creature.get_data( "skin" ) == 1: - self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_male_diffuse3.png" ) ) - elif self.creature.get_data( "skin" ) == 2: - self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_darkskinned_male_diffuse.png" ) ) + Config.msg_debug("Update") + if self.creature: + Config.msg_debug("scale:" + str(self.scale) + " y:" + str(self.translation.y)) + if self.scale.y != self.creature.get_data( "size" ): + var delta_y = self.translation.y - self.scale.y + Config.msg_debug("scale:" + str(self.scale) + " y:" + str(self.translation.y) + " deltaY:" + str(delta_y)) + self.scale = Vector3( self.creature.get_data( "size" ), self.creature.get_data( "size" ), self.creature.get_data( "size" ) ) + self.translation.y = self.scale.y + delta_y + Config.msg_debug("scale:" + str(self.scale) + " y:" + str(self.translation.y) + " deltaY:" + str(self.translation.y - self.scale.y)) + + self.set_blend_shape( "caucasian", self.creature.get_data( "caucasian" ) ) + self.set_blend_shape( "african", self.creature.get_data( "african" ) ) + self.set_blend_shape( "asian", self.creature.get_data( "asian" ) ) + + if self.creature.get_data( "sex" ) == Globals.SEX.female: + if self.creature.get_data( "skin" ) == 0: + self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_female_diffuse.png" ) ) + elif self.creature.get_data( "skin" ) == 1: + self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_female_diffuse3.png" ) ) + elif self.creature.get_data( "skin" ) == 2: + self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_darkskinned_female_diffuse.png" ) ) + elif self.creature.get_data( "sex" ) == Globals.SEX.male: + if self.creature.get_data( "skin" ) == 0: + self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_male_diffuse2.png" ) ) + elif self.creature.get_data( "skin" ) == 1: + self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_lightskinned_male_diffuse3.png" ) ) + elif self.creature.get_data( "skin" ) == 2: + self.get_node( "body_parts/body/skeleton/body" ).get_surface_material( 0 ).set_shader_param( "texture_albedo", preload( "res://assets/creatures/human/textures/young_darkskinned_male_diffuse.png" ) ) - if self.creature.get_data( "sex" ) == Globals.SEX.female: - if self.creature.get_data( "hair" ) == 0: - self.get_node( "hair_parts/mh_human_female_hair" ).hide() - elif self.creature.get_data( "hair" ) == 1: - self.get_node( "hair_parts/mh_human_female_hair" ).show() - self.get_node( "hair_parts/mh_human_female_hair/skeleton/hair" ).get_surface_material( 0 ).albedo_texture = preload( "res://assets/creatures/human/textures/human_female_hair_001.png" ) - elif self.creature.get_data( "hair" ) == 2: - self.get_node( "hair_parts/mh_human_female_hair" ).show() - self.get_node( "hair_parts/mh_human_female_hair/skeleton/hair" ).get_surface_material( 0 ).albedo_texture = preload( "res://assets/creatures/human/textures/human_female_hair_002.png" ) - elif self.creature.get_data( "sex" ) == Globals.SEX.male: - if self.creature.get_data( "hair" ) == 0: - self.get_node( "hair_parts/mh_human_male_hair" ).hide() - elif self.creature.get_data( "hair" ) == 1: - self.get_node( "hair_parts/mh_human_male_hair" ).show() - self.get_node( "hair_parts/mh_human_male_hair/skeleton/hair" ).get_surface_material( 0 ).albedo_texture = preload( "res://assets/creatures/human/textures/human_male_hair.png" ) - - - for hair in $hair_parts.get_children(): - if hair.has_node( "skeleton/hair" ) and hair.get_node( "skeleton/hair" ).get_surface_material( 0 ): - hair.get_node( "skeleton/hair" ).get_surface_material( 0 ).albedo_color = self.creature.get_data( "hair_color" ) + if self.creature.get_data( "sex" ) == Globals.SEX.female: + if self.creature.get_data( "hair" ) == 0: + self.get_node( "hair_parts/mh_human_female_hair" ).hide() + elif self.creature.get_data( "hair" ) == 1: + self.get_node( "hair_parts/mh_human_female_hair" ).show() + self.get_node( "hair_parts/mh_human_female_hair/skeleton/hair" ).get_surface_material( 0 ).albedo_texture = preload( "res://assets/creatures/human/textures/human_female_hair_001.png" ) + elif self.creature.get_data( "hair" ) == 2: + self.get_node( "hair_parts/mh_human_female_hair" ).show() + self.get_node( "hair_parts/mh_human_female_hair/skeleton/hair" ).get_surface_material( 0 ).albedo_texture = preload( "res://assets/creatures/human/textures/human_female_hair_002.png" ) + elif self.creature.get_data( "sex" ) == Globals.SEX.male: + if self.creature.get_data( "hair" ) == 0: + self.get_node( "hair_parts/mh_human_male_hair" ).hide() + elif self.creature.get_data( "hair" ) == 1: + self.get_node( "hair_parts/mh_human_male_hair" ).show() + self.get_node( "hair_parts/mh_human_male_hair/skeleton/hair" ).get_surface_material( 0 ).albedo_texture = preload( "res://assets/creatures/human/textures/human_male_hair.png" ) + + + for hair in $hair_parts.get_children(): + if hair.has_node( "skeleton/hair" ) and hair.get_node( "skeleton/hair" ).get_surface_material( 0 ): + hair.get_node( "skeleton/hair" ).get_surface_material( 0 ).albedo_color = self.creature.get_data( "hair_color" ) - - if self.creature.get_data( "muscles" ) > 0.0: - self.set_blend_shape( "muscles_min", 0.0 ) - self.set_blend_shape( "muscles_max", self.creature.get_data( "muscles" ) ) - elif self.creature.get_data( "muscles" ) < 0.0: - self.set_blend_shape( "muscles_min", -self.creature.get_data( "muscles" ) ) - self.set_blend_shape( "muscles_max", 0.0 ) - else: - self.set_blend_shape( "muscles_min", 0.0 ) - self.set_blend_shape( "muscles_max", 0.0 ) - - if self.creature.get_data( "fat" ) > 0.0: - self.set_blend_shape( "fat_min", 0.0 ) - self.set_blend_shape( "fat_max", self.creature.get_data( "fat" ) ) - elif self.creature.get_data( "fat" ) < 0.0: - self.set_blend_shape( "fat_min", -self.creature.get_data( "fat" ) ) - self.set_blend_shape( "fat_max", 0.0 ) - else: - self.set_blend_shape( "fat_min", 0.0 ) - self.set_blend_shape( "fat_max", 0.0 ) - - if self.creature.get_data( "proportion" ) > 0.0: - self.set_blend_shape( "proportion_min", 0.0 ) - self.set_blend_shape( "proportion_max", self.creature.get_data( "proportion" ) ) - elif self.creature.get_data( "proportion" ) < 0.0: - self.set_blend_shape( "proportion_min", -self.creature.get_data( "proportion" ) ) - self.set_blend_shape( "proportion_max", 0.0 ) - else: - self.set_blend_shape( "proportion_min", 0.0 ) - self.set_blend_shape( "proportion_max", 0.0 ) - - if self.creature.get_data( "breast" ) > 0.0: - self.set_blend_shape( "breast_min", 0.0 ) - self.set_blend_shape( "breast_max", self.creature.get_data( "breast" ) ) - elif self.creature.get_data( "breast" ) < 0.0: - self.set_blend_shape( "breast_min", -self.creature.get_data( "breast" ) ) - self.set_blend_shape( "breast_max", 0.0 ) - else: - self.set_blend_shape( "breast_min", 0.0 ) - self.set_blend_shape( "breast_max", 0.0 ) + + if self.creature.get_data( "muscles" ) > 0.0: + self.set_blend_shape( "muscles_min", 0.0 ) + self.set_blend_shape( "muscles_max", self.creature.get_data( "muscles" ) ) + elif self.creature.get_data( "muscles" ) < 0.0: + self.set_blend_shape( "muscles_min", -self.creature.get_data( "muscles" ) ) + self.set_blend_shape( "muscles_max", 0.0 ) + else: + self.set_blend_shape( "muscles_min", 0.0 ) + self.set_blend_shape( "muscles_max", 0.0 ) + + if self.creature.get_data( "fat" ) > 0.0: + self.set_blend_shape( "fat_min", 0.0 ) + self.set_blend_shape( "fat_max", self.creature.get_data( "fat" ) ) + elif self.creature.get_data( "fat" ) < 0.0: + self.set_blend_shape( "fat_min", -self.creature.get_data( "fat" ) ) + self.set_blend_shape( "fat_max", 0.0 ) + else: + self.set_blend_shape( "fat_min", 0.0 ) + self.set_blend_shape( "fat_max", 0.0 ) + + if self.creature.get_data( "proportion" ) > 0.0: + self.set_blend_shape( "proportion_min", 0.0 ) + self.set_blend_shape( "proportion_max", self.creature.get_data( "proportion" ) ) + elif self.creature.get_data( "proportion" ) < 0.0: + self.set_blend_shape( "proportion_min", -self.creature.get_data( "proportion" ) ) + self.set_blend_shape( "proportion_max", 0.0 ) + else: + self.set_blend_shape( "proportion_min", 0.0 ) + self.set_blend_shape( "proportion_max", 0.0 ) + + if self.creature.get_data( "breast" ) > 0.0: + self.set_blend_shape( "breast_min", 0.0 ) + self.set_blend_shape( "breast_max", self.creature.get_data( "breast" ) ) + elif self.creature.get_data( "breast" ) < 0.0: + self.set_blend_shape( "breast_min", -self.creature.get_data( "breast" ) ) + self.set_blend_shape( "breast_max", 0.0 ) + else: + self.set_blend_shape( "breast_min", 0.0 ) + self.set_blend_shape( "breast_max", 0.0 ) - if self.creature.get_data( "sex" ) == Globals.SEX.female: - self.set_blend_shape( "pregnancy", self.creature.get_data( "pregnancy" ) ) - - # Skin tone. - if self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ) and self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ) is ShaderMaterial: - var color = self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ).get_shader_param( "albedo" ) - color.v = 1.0 - self.creature.get_data( "skin_tone" ) - self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ).set_shader_param( "albedo", color ) + if self.creature.get_data( "sex" ) == Globals.SEX.female: + self.set_blend_shape( "pregnancy", self.creature.get_data( "pregnancy" ) ) + + # Skin tone. + if self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ) and self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ) is ShaderMaterial: + var color = self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ).get_shader_param( "albedo" ) + color.v = 1.0 - self.creature.get_data( "skin_tone" ) + self.get_node( "body_parts/body/skeleton/body" ).get( "material/0" ).set_shader_param( "albedo", color ) - self.set_blend_shape( "cleft_chin", self.creature.get_data( "cleft_chin" ) ) - self.set_blend_shape( "chin_angle", self.creature.get_data( "chin_angle" ) ) - - if self.creature.get_data( "mouth_horiz" ) > 0.0: - self.set_blend_shape( "mouth_horiz_min", 0.0 ) - self.set_blend_shape( "mouth_horiz_max", self.creature.get_data( "mouth_horiz" ) ) - elif self.creature.get_data( "mouth_horiz" ) < 0.0: - self.set_blend_shape( "mouth_horiz_min", -self.creature.get_data( "mouth_horiz" ) ) - self.set_blend_shape( "mouth_horiz_max", 0.0 ) - else: - self.set_blend_shape( "mouth_horiz_min", 0.0 ) - self.set_blend_shape( "mouth_horiz_max", 0.0 ) - - if self.creature.get_data( "mouth_vert" ) > 0.0: - self.set_blend_shape( "mouth_vert_min", 0.0 ) - self.set_blend_shape( "mouth_vert_max", self.creature.get_data( "mouth_vert" ) ) - elif self.creature.get_data( "mouth_vert" ) < 0.0: - self.set_blend_shape( "mouth_vert_min", -self.creature.get_data( "mouth_vert" ) ) - self.set_blend_shape( "mouth_vert_max", 0.0 ) - else: - self.set_blend_shape( "mouth_vert_min", 0.0 ) - self.set_blend_shape( "mouth_vert_max", 0.0 ) - - if self.creature.get_data( "nose_galbe" ) > 0.0: - self.set_blend_shape( "nose_galbe_min", 0.0 ) - self.set_blend_shape( "nose_galbe_max", self.creature.get_data( "nose_galbe" ) ) - elif self.creature.get_data( "nose_galbe" ) < 0.0: - self.set_blend_shape( "nose_galbe_min", -self.creature.get_data( "nose_galbe" ) ) - self.set_blend_shape( "nose_galbe_max", 0.0 ) - else: - self.set_blend_shape( "nose_galbe_min", 0.0 ) - self.set_blend_shape( "nose_galbe_max", 0.0 ) - - if self.creature.get_data( "nose_grec" ) > 0.0: - self.set_blend_shape( "nose_grec_min", 0.0 ) - self.set_blend_shape( "nose_grec_max", self.creature.get_data( "nose_grec" ) ) - elif self.creature.get_data( "nose_grec" ) < 0.0: - self.set_blend_shape( "nose_grec_min", -self.creature.get_data( "nose_grec" ) ) - self.set_blend_shape( "nose_grec_max", 0.0 ) - else: - self.set_blend_shape( "nose_grec_min", 0.0 ) - self.set_blend_shape( "nose_grec_max", 0.0 ) - - if self.creature.get_data( "nose_horiz" ) > 0.0: - self.set_blend_shape( "nose_horiz_min", 0.0 ) - self.set_blend_shape( "nose_horiz_max", self.creature.get_data( "nose_horiz" ) ) - elif self.creature.get_data( "nose_horiz" ) < 0.0: - self.set_blend_shape( "nose_horiz_min", -self.creature.get_data( "nose_horiz" ) ) - self.set_blend_shape( "nose_horiz_max", 0.0 ) - else: - self.set_blend_shape( "nose_horiz_min", 0.0 ) - self.set_blend_shape( "nose_horiz_max", 0.0 ) - - if self.creature.get_data( "nose_depth" ) > 0.0: - self.set_blend_shape( "nose_depth_min", 0.0 ) - self.set_blend_shape( "nose_depth_max", self.creature.get_data( "nose_depth" ) ) - elif self.creature.get_data( "nose_depth" ) < 0.0: - self.set_blend_shape( "nose_depth_min", -self.creature.get_data( "nose_depth" ) ) - self.set_blend_shape( "nose_depth_max", 0.0 ) - else: - self.set_blend_shape( "nose_depth_min", 0.0 ) - self.set_blend_shape( "nose_depth_max", 0.0 ) - - - self.get_node( "body_parts/body/skeleton/eyes" ).get_surface_material( 0 ).albedo_texture = load( "res://assets/creatures/human/textures/"+self.eye_color_list[ self.creature.get_data( "eyes_color", 0 ) ]+".png" ) - - if self.creature.get_data( "eyes_vert" ) > 0.0: - self.set_blend_shape( "eyes_vert_min", 0.0 ) - self.set_blend_shape( "eyes_vert_max", self.creature.get_data( "eyes_vert" ) ) - elif self.creature.get_data( "eyes_vert" ) < 0.0: - self.set_blend_shape( "eyes_vert_min", -self.creature.get_data( "eyes_vert" ) ) - self.set_blend_shape( "eyes_vert_max", 0.0 ) - else: - self.set_blend_shape( "eyes_vert_min", 0.0 ) - self.set_blend_shape( "eyes_vert_max", 0.0 ) - - if self.creature.get_data( "eyes_gap" ) > 0.0: - self.set_blend_shape( "eyes_gap_min", 0.0 ) - self.set_blend_shape( "eyes_gap_max", self.creature.get_data( "eyes_gap" ) ) - elif self.creature.get_data( "eyes_gap" ) < 0.0: - self.set_blend_shape( "eyes_gap_min", -self.creature.get_data( "eyes_gap" ) ) - self.set_blend_shape( "eyes_gap_max", 0.0 ) - else: - self.set_blend_shape( "eyes_gap_min", 0.0 ) - self.set_blend_shape( "eyes_gap_max", 0.0 ) - - self.set_blend_shape( "earlobes", self.creature.get_data( "earlobes" ) ) - self.set_blend_shape( "ears_wing", self.creature.get_data( "ears_wing" ) ) - - if self.creature.get_data( "lips_up_shape" ) > 0.0: - self.set_blend_shape( "lips_up_shape_min", 0.0 ) - self.set_blend_shape( "lips_up_shape_max", self.creature.get_data( "lips_up_shape" ) ) - elif self.creature.get_data( "lips_up_shape" ) < 0.0: - self.set_blend_shape( "lips_up_shape_min", -self.creature.get_data( "lips_up_shape" ) ) - self.set_blend_shape( "lips_up_shape_max", 0.0 ) - else: - self.set_blend_shape( "lips_up_shape_min", 0.0 ) - self.set_blend_shape( "lips_up_shape_max", 0.0 ) - - if self.creature.get_data( "lips_up_shape_2" ) > 0.0: - self.set_blend_shape( "lips_up_shape_2_min", 0.0 ) - self.set_blend_shape( "lips_up_shape_2_max", self.creature.get_data( "lips_up_shape_2" ) ) - elif self.creature.get_data( "lips_up_shape_2" ) < 0.0: - self.set_blend_shape( "lips_up_shape_2_min", -self.creature.get_data( "lips_up_shape_2" ) ) - self.set_blend_shape( "lips_up_shape_2_max", 0.0 ) - else: - self.set_blend_shape( "lips_up_shape_2_min", 0.0 ) - self.set_blend_shape( "lips_up_shape_2_max", 0.0 ) - - self.set_blend_shape( "nipple_flat", 1.0 ) - - - + self.set_blend_shape( "cleft_chin", self.creature.get_data( "cleft_chin" ) ) + self.set_blend_shape( "chin_angle", self.creature.get_data( "chin_angle" ) ) + + if self.creature.get_data( "mouth_horiz" ) > 0.0: + self.set_blend_shape( "mouth_horiz_min", 0.0 ) + self.set_blend_shape( "mouth_horiz_max", self.creature.get_data( "mouth_horiz" ) ) + elif self.creature.get_data( "mouth_horiz" ) < 0.0: + self.set_blend_shape( "mouth_horiz_min", -self.creature.get_data( "mouth_horiz" ) ) + self.set_blend_shape( "mouth_horiz_max", 0.0 ) + else: + self.set_blend_shape( "mouth_horiz_min", 0.0 ) + self.set_blend_shape( "mouth_horiz_max", 0.0 ) + + if self.creature.get_data( "mouth_vert" ) > 0.0: + self.set_blend_shape( "mouth_vert_min", 0.0 ) + self.set_blend_shape( "mouth_vert_max", self.creature.get_data( "mouth_vert" ) ) + elif self.creature.get_data( "mouth_vert" ) < 0.0: + self.set_blend_shape( "mouth_vert_min", -self.creature.get_data( "mouth_vert" ) ) + self.set_blend_shape( "mouth_vert_max", 0.0 ) + else: + self.set_blend_shape( "mouth_vert_min", 0.0 ) + self.set_blend_shape( "mouth_vert_max", 0.0 ) + + if self.creature.get_data( "nose_galbe" ) > 0.0: + self.set_blend_shape( "nose_galbe_min", 0.0 ) + self.set_blend_shape( "nose_galbe_max", self.creature.get_data( "nose_galbe" ) ) + elif self.creature.get_data( "nose_galbe" ) < 0.0: + self.set_blend_shape( "nose_galbe_min", -self.creature.get_data( "nose_galbe" ) ) + self.set_blend_shape( "nose_galbe_max", 0.0 ) + else: + self.set_blend_shape( "nose_galbe_min", 0.0 ) + self.set_blend_shape( "nose_galbe_max", 0.0 ) + + if self.creature.get_data( "nose_grec" ) > 0.0: + self.set_blend_shape( "nose_grec_min", 0.0 ) + self.set_blend_shape( "nose_grec_max", self.creature.get_data( "nose_grec" ) ) + elif self.creature.get_data( "nose_grec" ) < 0.0: + self.set_blend_shape( "nose_grec_min", -self.creature.get_data( "nose_grec" ) ) + self.set_blend_shape( "nose_grec_max", 0.0 ) + else: + self.set_blend_shape( "nose_grec_min", 0.0 ) + self.set_blend_shape( "nose_grec_max", 0.0 ) + + if self.creature.get_data( "nose_horiz" ) > 0.0: + self.set_blend_shape( "nose_horiz_min", 0.0 ) + self.set_blend_shape( "nose_horiz_max", self.creature.get_data( "nose_horiz" ) ) + elif self.creature.get_data( "nose_horiz" ) < 0.0: + self.set_blend_shape( "nose_horiz_min", -self.creature.get_data( "nose_horiz" ) ) + self.set_blend_shape( "nose_horiz_max", 0.0 ) + else: + self.set_blend_shape( "nose_horiz_min", 0.0 ) + self.set_blend_shape( "nose_horiz_max", 0.0 ) + + if self.creature.get_data( "nose_depth" ) > 0.0: + self.set_blend_shape( "nose_depth_min", 0.0 ) + self.set_blend_shape( "nose_depth_max", self.creature.get_data( "nose_depth" ) ) + elif self.creature.get_data( "nose_depth" ) < 0.0: + self.set_blend_shape( "nose_depth_min", -self.creature.get_data( "nose_depth" ) ) + self.set_blend_shape( "nose_depth_max", 0.0 ) + else: + self.set_blend_shape( "nose_depth_min", 0.0 ) + self.set_blend_shape( "nose_depth_max", 0.0 ) + + + self.get_node( "body_parts/body/skeleton/eyes" ).get_surface_material( 0 ).albedo_texture = load( "res://assets/creatures/human/textures/"+self.eye_color_list[ self.creature.get_data( "eyes_color", 0 ) ]+".png" ) + + if self.creature.get_data( "eyes_vert" ) > 0.0: + self.set_blend_shape( "eyes_vert_min", 0.0 ) + self.set_blend_shape( "eyes_vert_max", self.creature.get_data( "eyes_vert" ) ) + elif self.creature.get_data( "eyes_vert" ) < 0.0: + self.set_blend_shape( "eyes_vert_min", -self.creature.get_data( "eyes_vert" ) ) + self.set_blend_shape( "eyes_vert_max", 0.0 ) + else: + self.set_blend_shape( "eyes_vert_min", 0.0 ) + self.set_blend_shape( "eyes_vert_max", 0.0 ) + + if self.creature.get_data( "eyes_gap" ) > 0.0: + self.set_blend_shape( "eyes_gap_min", 0.0 ) + self.set_blend_shape( "eyes_gap_max", self.creature.get_data( "eyes_gap" ) ) + elif self.creature.get_data( "eyes_gap" ) < 0.0: + self.set_blend_shape( "eyes_gap_min", -self.creature.get_data( "eyes_gap" ) ) + self.set_blend_shape( "eyes_gap_max", 0.0 ) + else: + self.set_blend_shape( "eyes_gap_min", 0.0 ) + self.set_blend_shape( "eyes_gap_max", 0.0 ) + + self.set_blend_shape( "earlobes", self.creature.get_data( "earlobes" ) ) + self.set_blend_shape( "ears_wing", self.creature.get_data( "ears_wing" ) ) + + if self.creature.get_data( "lips_up_shape" ) > 0.0: + self.set_blend_shape( "lips_up_shape_min", 0.0 ) + self.set_blend_shape( "lips_up_shape_max", self.creature.get_data( "lips_up_shape" ) ) + elif self.creature.get_data( "lips_up_shape" ) < 0.0: + self.set_blend_shape( "lips_up_shape_min", -self.creature.get_data( "lips_up_shape" ) ) + self.set_blend_shape( "lips_up_shape_max", 0.0 ) + else: + self.set_blend_shape( "lips_up_shape_min", 0.0 ) + self.set_blend_shape( "lips_up_shape_max", 0.0 ) + + if self.creature.get_data( "lips_up_shape_2" ) > 0.0: + self.set_blend_shape( "lips_up_shape_2_min", 0.0 ) + self.set_blend_shape( "lips_up_shape_2_max", self.creature.get_data( "lips_up_shape_2" ) ) + elif self.creature.get_data( "lips_up_shape_2" ) < 0.0: + self.set_blend_shape( "lips_up_shape_2_min", -self.creature.get_data( "lips_up_shape_2" ) ) + self.set_blend_shape( "lips_up_shape_2_max", 0.0 ) + else: + self.set_blend_shape( "lips_up_shape_2_min", 0.0 ) + self.set_blend_shape( "lips_up_shape_2_max", 0.0 ) + + self.set_blend_shape( "nipple_flat", 1.0 ) + + + func play( anim_name, speed = 1.0 ): - for child in $body_parts.get_children(): - child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed - if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): - child.get_node( "skeleton/AnimationPlayer" ).play( anim_name ) - for child in $hair_parts.get_children(): - child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed - if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): - child.get_node( "skeleton/AnimationPlayer" ).play( anim_name ) - for child in $cloths.get_children(): - child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed - if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): - child.get_node( "skeleton/AnimationPlayer" ).play( anim_name ) - + for child in $body_parts.get_children(): + child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed + if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): + child.get_node( "skeleton/AnimationPlayer" ).play( anim_name ) + for child in $hair_parts.get_children(): + child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed + if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): + child.get_node( "skeleton/AnimationPlayer" ).play( anim_name ) + for child in $cloths.get_children(): + child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed + if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): + child.get_node( "skeleton/AnimationPlayer" ).play( anim_name ) + func play_backwards( anim_name, speed = 1.0 ): - for child in $body_parts.get_children(): - child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed - if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): - child.get_node( "skeleton/AnimationPlayer" ).play_backwards( anim_name ) - for child in $hair_parts.get_children(): - child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed - if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): - child.get_node( "skeleton/AnimationPlayer" ).play_backwards( anim_name ) - for child in $cloths.get_children(): - child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed - if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): - child.get_node( "skeleton/AnimationPlayer" ).play_backwards( anim_name ) + for child in $body_parts.get_children(): + child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed + if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): + child.get_node( "skeleton/AnimationPlayer" ).play_backwards( anim_name ) + for child in $hair_parts.get_children(): + child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed + if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): + child.get_node( "skeleton/AnimationPlayer" ).play_backwards( anim_name ) + for child in $cloths.get_children(): + child.get_node( "skeleton/AnimationPlayer" ).playback_speed = speed + if child.get_node( "skeleton/AnimationPlayer" ).has_animation( anim_name ): + child.get_node( "skeleton/AnimationPlayer" ).play_backwards( anim_name ) func can_turn(): - var animation_player = $body_parts/body/skeleton/AnimationPlayer - return (animation_player.current_animation.begins_with( "turn_") and animation_player.current_animation_position >= 1.2) or (not animation_player.current_animation.begins_with( "turn_") and not animation_player.current_animation.begins_with( "idle")) + var animation_player = $body_parts/body/skeleton/AnimationPlayer + return (animation_player.current_animation.begins_with( "turn_") and animation_player.current_animation_position >= 1.2) or (not animation_player.current_animation.begins_with( "turn_") and not animation_player.current_animation.begins_with( "idle")) func equip( p_item, p_slot = null ): - var model = load( p_item.get_data( "model_equiped", "") ) - if not model: - model = load( p_item.get_data( "model", "") ) - if model: - model = model.instance() - var attachment = null - if not p_slot: - p_slot = p_item.get_data( "default_slot" ) - if p_slot and int(p_slot) in self.slots: - self.unequip( p_slot ) - attachment = self.slots[ int(p_slot) ].attachment - self.slots[ int(p_slot) ].item = p_item - if attachment: - if attachment == "cloths": - model.name = str(int(p_slot)) - $cloths.add_child( model ) - var animation = $body_parts/body/skeleton/AnimationPlayer.current_animation - var animation_position = $body_parts/body/skeleton/AnimationPlayer.current_animation_position - var animation_speed = $body_parts/body/skeleton/AnimationPlayer.playback_speed - model.get_node( "skeleton/AnimationPlayer" ).stop() - model.get_node( "skeleton/AnimationPlayer" ).set( "playback_speed", animation_speed ) - model.get_node( "skeleton/AnimationPlayer" ).play( animation ) - model.get_node( "skeleton/AnimationPlayer" ).advance( animation_position ) - else: - if $body_parts/body/skeleton.has_node( attachment ): - $body_parts/body/skeleton.get_node( attachment ).get_node( "handle" ).add_child( model ) - - emit_signal( "equip", int(p_slot), p_item ) + var model = load( p_item.get_data( "model_equiped", "") ) + if not model: + model = load( p_item.get_data( "model", "") ) + if model: + model = model.instance() + var attachment = null + if not p_slot: + p_slot = p_item.get_data( "default_slot" ) + if p_slot and int(p_slot) in self.slots: + self.unequip( p_slot ) + attachment = self.slots[ int(p_slot) ].attachment + self.slots[ int(p_slot) ].item = p_item + if attachment: + if attachment == "cloths": + model.name = str(int(p_slot)) + $cloths.add_child( model ) + var animation = $body_parts/body/skeleton/AnimationPlayer.current_animation + var animation_position = $body_parts/body/skeleton/AnimationPlayer.current_animation_position + var animation_speed = $body_parts/body/skeleton/AnimationPlayer.playback_speed + model.get_node( "skeleton/AnimationPlayer" ).stop() + model.get_node( "skeleton/AnimationPlayer" ).set( "playback_speed", animation_speed ) + model.get_node( "skeleton/AnimationPlayer" ).play( animation ) + model.get_node( "skeleton/AnimationPlayer" ).advance( animation_position ) + else: + if $body_parts/body/skeleton.has_node( attachment ): + $body_parts/body/skeleton.get_node( attachment ).get_node( "handle" ).add_child( model ) + + emit_signal( "equip", int(p_slot), p_item ) func unequip( p_slot ): - if p_slot and int(p_slot) in self.slots: - if self.slots[ int(p_slot) ].item: - var attachment = self.slots[ int(p_slot) ].attachment - self.slots[ int(p_slot) ].item = null - if attachment: - if attachment == "cloths": - var node = $cloths.get_node( str(p_slot) ) - if node: - $cloths.remove_child( node ) - node.queue_free() - else: - for child in $body_parts/body/skeleton.get_node( attachment ).get_node( "handle" ).get_children(): - $body_parts/body/skeleton.get_node( attachment ).get_node( "handle" ).remove_child( child ) - child.queue_free() - emit_signal( "unequip", int(p_slot) ) - - + if p_slot and int(p_slot) in self.slots: + if self.slots[ int(p_slot) ].item: + var attachment = self.slots[ int(p_slot) ].attachment + self.slots[ int(p_slot) ].item = null + if attachment: + if attachment == "cloths": + var node = $cloths.get_node( str(p_slot) ) + if node: + $cloths.remove_child( node ) + node.queue_free() + else: + for child in $body_parts/body/skeleton.get_node( attachment ).get_node( "handle" ).get_children(): + $body_parts/body/skeleton.get_node( attachment ).get_node( "handle" ).remove_child( child ) + child.queue_free() + emit_signal( "unequip", int(p_slot) ) + + func drop_item( p_item ): - var new_inventory = self.creature.get_data( "inventory" ) - var item_index = new_inventory.find( p_item ) - if item_index != -1: - if new_inventory[ item_index ].get_data( "dropable", true ): - new_inventory[ item_index ].set_data( "number", new_inventory[ item_index ].get_data( "number" )-1 ) + var new_inventory = self.creature.get_data( "inventory" ) + var item_index = new_inventory.find( p_item ) + if item_index != -1: + if new_inventory[ item_index ].get_data( "dropable", true ): + new_inventory[ item_index ].set_data( "number", new_inventory[ item_index ].get_data( "number" )-1 ) - if new_inventory[ item_index ].get_data( "number" ) <= 0: - new_inventory.remove( item_index ) + if new_inventory[ item_index ].get_data( "number" ) <= 0: + new_inventory.remove( item_index ) - var pickup_item_node = preload( "res://scenes/items/pickup_item.tscn" ).instance() - pickup_item_node.item_filename = p_item.get_filename() - pickup_item_node.global_transform = $drop_point.global_transform + var pickup_item_node = preload( "res://scenes/items/pickup_item.tscn" ).instance() + pickup_item_node.item_filename = p_item.get_filename() + pickup_item_node.global_transform = $drop_point.global_transform - var pickup_item = Datas.PickupItem.new( p_item.get_filename(), $drop_point.global_transform, p_item ) - pickup_item_node.item = pickup_item - - if self.get_tree().get_root().has_node( "main/scene/game" ): - self.get_tree().get_root().get_node( "main/scene/game" ).get_node( "pickups" ).add_child( pickup_item_node ) - - + var pickup_item = Datas.PickupItem.new( p_item.get_filename(), $drop_point.global_transform, p_item ) + pickup_item_node.item = pickup_item + + if self.get_tree().get_root().has_node( "main/scene/game" ): + self.get_tree().get_root().get_node( "main/scene/game" ).get_node( "pickups" ).add_child( pickup_item_node ) + + func _on_body_animation_finished( anim_name ): - emit_signal( "animation_finished", anim_name ) + emit_signal( "animation_finished", anim_name ) func _on_body_limb_body_entered(limb, body): - if body.is_in_group( "bullet" ): - if limb == Datas.Cloth.LIMB.head: - var blood_particle = preload( "res://scenes/fx/blood_particles.tscn" ).instance() - $body_parts/body/skeleton/limb_head.add_child( blood_particle ) - blood_particle.emit() - emit_signal( "is_dead" ) - self.creature.set_data( "current_life", 0.0 ) - else: - var blood_particle = preload( "res://scenes/fx/blood_particles.tscn" ).instance() - $body_parts/body/skeleton/limb_torso_1.add_child( blood_particle ) - blood_particle.emit() + if body.is_in_group( "bullet" ): + if limb == Datas.Cloth.LIMB.head: + var blood_particle = preload( "res://scenes/fx/blood_particles.tscn" ).instance() + $body_parts/body/skeleton/limb_head.add_child( blood_particle ) + blood_particle.emit() + emit_signal( "is_dead" ) + self.creature.set_data( "current_life", 0.0 ) + else: + var blood_particle = preload( "res://scenes/fx/blood_particles.tscn" ).instance() + $body_parts/body/skeleton/limb_torso_1.add_child( blood_particle ) + blood_particle.emit() diff --git a/scenes/creatures/creature_creation_menu.gd b/scenes/creatures/creature_creation_menu.gd index 04a3423..4985b74 100644 --- a/scenes/creatures/creature_creation_menu.gd +++ b/scenes/creatures/creature_creation_menu.gd @@ -229,7 +229,6 @@ func _on_underwear_button_toggled(button_pressed): else: $margin_box/window_box/content_box/preview_box/v_box_container/underwear_button.modulate.a = 0.5 + func _on_zoom_head_button_toggled(button_pressed): emit_signal( "zoom_head_button_toggled", button_pressed ) - - diff --git a/scenes/creatures/creatures_creation.tscn b/scenes/creatures/creatures_creation.tscn index bd70fd3..2033817 100644 --- a/scenes/creatures/creatures_creation.tscn +++ b/scenes/creatures/creatures_creation.tscn @@ -1,8 +1,27 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://scenes/characters/character.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/creatures/creature_creation_menu.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/creatures/creatures_creation.gd" type="Script" id=3] +[ext_resource path="res://assets/interfaces/creatures_creation/Material.material" type="Material" id=4] + +[sub_resource type="ArrayMesh" id=1] +resource_name = "Cube" +surfaces/0 = { +"aabb": AABB( -4, -1, -4, 8.00001, 1.00001, 8 ), +"array_data": PoolByteArray( 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 128, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 57, 0, 56, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 128, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 57, 0, 56, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 128, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 56, 0, 0, 128, 64, 0, 0, 128, 191, 0, 0, 128, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 54, 0, 56, 0, 0, 128, 64, 0, 0, 128, 191, 0, 0, 128, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 54, 0, 56, 0, 0, 128, 64, 0, 0, 128, 191, 0, 0, 128, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 56, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 128, 64, 0, 0, 127, 0, 0, 127, 0, 127, 0, 57, 0, 52, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 128, 64, 0, 127, 0, 0, 129, 0, 0, 127, 0, 57, 0, 52, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 128, 64, 127, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 52, 0, 0, 128, 64, 0, 0, 128, 191, 0, 0, 128, 64, 0, 129, 0, 0, 127, 0, 0, 127, 0, 54, 0, 52, 0, 0, 128, 64, 0, 0, 128, 191, 0, 0, 128, 64, 0, 0, 127, 0, 0, 127, 0, 127, 0, 54, 0, 52, 0, 0, 128, 64, 0, 0, 128, 191, 0, 0, 128, 64, 127, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 52, 0, 0, 128, 192, 0, 0, 0, 0, 0, 0, 128, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 58, 0, 0, 128, 192, 0, 0, 0, 0, 0, 0, 128, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 57, 0, 58, 0, 0, 128, 192, 0, 0, 0, 0, 0, 0, 128, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 59, 0, 56, 0, 0, 128, 192, 0, 0, 128, 191, 0, 0, 128, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 58, 0, 0, 128, 192, 0, 0, 128, 191, 0, 0, 128, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 48, 0, 56, 0, 0, 128, 192, 0, 0, 128, 191, 0, 0, 128, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 54, 0, 58, 0, 0, 128, 192, 0, 0, 0, 0, 0, 0, 128, 64, 129, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 60, 0, 0, 128, 192, 0, 0, 0, 0, 0, 0, 128, 64, 0, 0, 127, 0, 0, 127, 0, 127, 0, 57, 0, 0, 0, 0, 128, 192, 0, 0, 0, 0, 0, 0, 128, 64, 0, 127, 0, 0, 129, 0, 0, 127, 0, 59, 0, 52, 0, 0, 128, 192, 0, 0, 128, 191, 0, 0, 128, 64, 129, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 60, 0, 0, 128, 192, 0, 0, 128, 191, 0, 0, 128, 64, 0, 129, 0, 0, 127, 0, 0, 127, 0, 48, 0, 52, 0, 0, 128, 192, 0, 0, 128, 191, 0, 0, 128, 64, 0, 0, 127, 0, 0, 127, 0, 127, 0, 54, 0, 0 ), +"array_index_data": PoolByteArray( 1, 0, 20, 0, 14, 0, 1, 0, 7, 0, 20, 0, 10, 0, 19, 0, 6, 0, 10, 0, 23, 0, 19, 0, 21, 0, 12, 0, 18, 0, 21, 0, 15, 0, 12, 0, 16, 0, 9, 0, 3, 0, 16, 0, 22, 0, 9, 0, 5, 0, 8, 0, 2, 0, 5, 0, 11, 0, 8, 0, 17, 0, 0, 0, 13, 0, 17, 0, 4, 0, 0, 0 ), +"blend_shape_data": [ ], +"format": 97559, +"index_count": 36, +"material": ExtResource( 4 ), +"primitive": 4, +"skeleton_aabb": [ ], +"vertex_count": 24 +} + +[sub_resource type="ConcavePolygonShape" id=2] +data = PoolVector3Array( 4, 0, -4, -4, 0, 4, -4, 0, -4, 4, 0, -4, 4, 0, 4, -4, 0, 4, 4, -1, 4, -4, 0, 4, 4, 0, 4, 4, -1, 4, -4, -1, 4, -4, 0, 4, -4, -1, 4, -4, 0, -4, -4, 0, 4, -4, -1, 4, -4, -1, -4, -4, 0, -4, -4, -1, -4, 4, -1, 4, 4, -1, -4, -4, -1, -4, -4, -1, 4, 4, -1, 4, 4, -1, -4, 4, 0, 4, 4, 0, -4, 4, -1, -4, 4, -1, 4, 4, 0, 4, -4, -1, -4, 4, 0, -4, -4, 0, -4, -4, -1, -4, 4, -1, -4, 4, 0, -4 ) [node name="creatures_creation" type="Spatial"] script = ExtResource( 3 ) @@ -27,6 +46,23 @@ gravity = 0.0 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.98872, 2.59328 ) light_specular = 0.1 +[node name="root" type="Spatial" parent="."] + +[node name="Cube" type="MeshInstance" parent="root"] +mesh = SubResource( 1 ) +material/0 = null + +[node name="static_body" type="StaticBody" parent="root/Cube"] + +[node name="collision_shape" type="CollisionShape" parent="root/Cube/static_body"] +shape = SubResource( 2 ) + +[node name="Light" type="Spatial" parent="root"] +transform = Transform( -0.290865, 0.566393, 0.771101, -0.0551891, 0.794672, -0.604525, -0.955171, -0.218391, -0.199883, 4.07625, 5.90386, -1.00545 ) + +[node name="Camera" type="Spatial" parent="root"] +transform = Transform( 0.685921, 0.651558, 0.324014, 0, 0.445271, -0.895396, -0.727676, 0.61417, 0.305421, 7.35889, 4.95831, 6.92579 ) + [connection signal="choose_pressed" from="creature_creation_menu" to="." method="_on_creature_creation_menu_choose_pressed"] [connection signal="cloths_button_toggled" from="creature_creation_menu" to="." method="_on_creature_creation_menu_cloths_button_toggled"] [connection signal="load_pressed" from="creature_creation_menu" to="." method="_on_creature_creation_menu_load_pressed"] diff --git a/scenes/creatures/human/human_female.tscn b/scenes/creatures/human/human_female.tscn index f9530f3..ed2668a 100644 --- a/scenes/creatures/human/human_female.tscn +++ b/scenes/creatures/human/human_female.tscn @@ -30,5 +30,6 @@ transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0, 0 [node name="drop_point" type="Spatial" parent="."] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.332089, -0.157172 ) + [connection signal="animation_finished" from="body_parts/body" to="." method="_on_body_animation_finished"] [connection signal="limb_body_entered" from="body_parts/body" to="." method="_on_body_limb_body_entered"] diff --git a/scenes/creatures/human/mh_human_female.tscn b/scenes/creatures/human/mh_human_female.tscn index daa62e3..5982533 100644 --- a/scenes/creatures/human/mh_human_female.tscn +++ b/scenes/creatures/human/mh_human_female.tscn @@ -15,31 +15,31 @@ signal animation_finished( anim_name ) signal limb_body_entered( limb, body ) func _on_AnimationPlayer_animation_finished(anim_name): - emit_signal( \"animation_finished\", anim_name ) + emit_signal( \"animation_finished\", anim_name ) func _on_limb_head_area_body_entered(body): - emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.head, body ) + emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.head, body ) func _on_limb_tosro_1_body_entered(body): - emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) - + emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) + func _on_limb_torso_2_body_entered(body): - emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) + emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) func _on_limb_torso_3_body_entered(body): - emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) + emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) func _on_limb_torso_4_body_entered(body): - emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) + emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) func _on_limb_torso_5_body_entered(body): - emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) + emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.torso, body ) func _on_limb_upper_arm_left_body_entered(body): - emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.left_upper_arm, body ) + emit_signal( \"limb_body_entered\", Datas.Cloth.LIMB.left_upper_arm, body ) " @@ -179,6 +179,7 @@ bone_name = "pelvis.R" [node name="handle" type="Spatial" parent="skeleton/attachment_hips_R" index="0"] transform = Transform( -0.142459, -0.381941, -0.913079, -0.617878, -0.686553, 0.383382, -0.773427, 0.618672, -0.138049, 0.0391004, 0.0367368, 0.013404 ) + [connection signal="animation_finished" from="skeleton/AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"] [connection signal="body_entered" from="skeleton/limb_head/area" to="." method="_on_limb_head_area_body_entered"] [connection signal="body_entered" from="skeleton/limb_torso_1/area" to="." method="_on_limb_tosro_1_body_entered"] diff --git a/scenes/interfaces/focus_reticle.gd b/scenes/interfaces/focus_reticle.gd index 1d79f92..0f9ec20 100644 --- a/scenes/interfaces/focus_reticle.gd +++ b/scenes/interfaces/focus_reticle.gd @@ -5,5 +5,5 @@ class_name focus_reticle export( Vector2 ) var size = Vector2( 1.0, 1.0 ) setget set_size func set_size( p_value ): - size = p_value - self.mesh.size = p_value + size = p_value + self.mesh.size = p_value diff --git a/scenes/interfaces/music_manager/music_manager.gd b/scenes/interfaces/music_manager/music_manager.gd index 0ec0b34..20c4e6c 100644 --- a/scenes/interfaces/music_manager/music_manager.gd +++ b/scenes/interfaces/music_manager/music_manager.gd @@ -249,6 +249,7 @@ func add_music(file: String): self.next_id += 1 playlist_music['player'] = $window_box/scroll_box/musics_box.get_children() load_music_to_config() + auto_sizing_windows() func _on_music_box_delete_pressed( id ): @@ -256,6 +257,7 @@ func _on_music_box_delete_pressed( id ): for child in $window_box/scroll_box/musics_box.get_children(): if child.id == id: child.queue_free() + auto_sizing_windows() func _on_music_box_down_pressed( id ): @@ -307,9 +309,35 @@ func move_child_id(id, pos): load_music_to_config() +func auto_sizing_windows(): + Config.msg_debug("Auto sizing Jukebox") + var max_x = 0 + var max_y = $window_box/controls_box.rect_size.y + for child in $window_box/scroll_box/musics_box.get_children(): + var x = 0 + for child2 in child.get_children(): + x += child2.rect_size.x + if max_x < x: + max_x += x + max_y += 24 + var tx = int( (get_viewport().size.x - max_x) / 2 ) + var ty = int( (get_viewport().size.y - max_y) / 2 ) + if tx <= 20: + max_x = get_viewport().size.x - 20 + tx = 10 + if ty <= 20: + max_y = get_viewport().size.y - 20 + ty = 10 + self.rect_size.x = max_x + self.rect_position.x = tx + self.rect_size.y = max_y + self.rect_position.y = ty + + func open(): Config.msg_debug("Open") update_playermusic() + # auto_sizing_windows() self.popup() diff --git a/scenes/interfaces/options/options.gd b/scenes/interfaces/options/options.gd index b1c3109..a8342e2 100644 --- a/scenes/interfaces/options/options.gd +++ b/scenes/interfaces/options/options.gd @@ -74,3 +74,7 @@ func _on_sound_button_pressed(): func _on_control_mute_pressed(): Config.msg_debug("