diff --git a/client/.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.md5 b/client/.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.md5 new file mode 100644 index 0000000..89454ad --- /dev/null +++ b/client/.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.md5 @@ -0,0 +1,3 @@ +source_md5="5efb9aac4566cc540675ab7478811cac" +dest_md5="f0bb815a493bfd51d2b236f5f5f2fc8b" + diff --git a/client/.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.stex b/client/.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.stex new file mode 100644 index 0000000..8396959 Binary files /dev/null and b/client/.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.stex differ diff --git a/client/.import/dev_player.png-9e2a7615e3d5f85ba45313d7c0bc6c2a.md5 b/client/.import/dev_player.png-9e2a7615e3d5f85ba45313d7c0bc6c2a.md5 new file mode 100644 index 0000000..3dffaf2 --- /dev/null +++ b/client/.import/dev_player.png-9e2a7615e3d5f85ba45313d7c0bc6c2a.md5 @@ -0,0 +1,3 @@ +source_md5="8aa11b5093dfa6e5ad8586cfd48b6e88" +dest_md5="1922a2eba76828665cd680a720666fe8" + diff --git a/client/.import/dev_player.png-9e2a7615e3d5f85ba45313d7c0bc6c2a.stex b/client/.import/dev_player.png-9e2a7615e3d5f85ba45313d7c0bc6c2a.stex new file mode 100644 index 0000000..70d73cc Binary files /dev/null and b/client/.import/dev_player.png-9e2a7615e3d5f85ba45313d7c0bc6c2a.stex differ diff --git a/client/.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.md5 b/client/.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.md5 new file mode 100644 index 0000000..3dffaf2 --- /dev/null +++ b/client/.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.md5 @@ -0,0 +1,3 @@ +source_md5="8aa11b5093dfa6e5ad8586cfd48b6e88" +dest_md5="1922a2eba76828665cd680a720666fe8" + diff --git a/client/.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.stex b/client/.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.stex new file mode 100644 index 0000000..70d73cc Binary files /dev/null and b/client/.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.stex differ diff --git a/client/.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.md5 b/client/.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.md5 new file mode 100644 index 0000000..7112b8c --- /dev/null +++ b/client/.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.md5 @@ -0,0 +1,3 @@ +source_md5="f5097ca7c211920e40c629bc583248e3" +dest_md5="0b20c79b6ad64f3fbed8b5ab994f4c8c" + diff --git a/client/.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.stex b/client/.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.stex new file mode 100644 index 0000000..366ac01 Binary files /dev/null and b/client/.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.stex differ diff --git a/client/.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.md5 b/client/.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.md5 new file mode 100644 index 0000000..b5e802e --- /dev/null +++ b/client/.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.md5 @@ -0,0 +1,3 @@ +source_md5="57a52ebcb9eefc41ae7c7fe4b17f9929" +dest_md5="d81086922475a0a88eb18c5b63cfadc4" + diff --git a/client/.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.stex b/client/.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.stex new file mode 100644 index 0000000..f7306eb Binary files /dev/null and b/client/.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.stex differ diff --git a/client/.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.md5 b/client/.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.md5 new file mode 100644 index 0000000..dc6e545 --- /dev/null +++ b/client/.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.md5 @@ -0,0 +1,3 @@ +source_md5="6369531b32f45519d9bda64e00cdc847" +dest_md5="d6d9f94b469ca6b1de4c2ad1759450ed" + diff --git a/client/.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.stex b/client/.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.stex new file mode 100644 index 0000000..054b6b9 Binary files /dev/null and b/client/.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.stex differ diff --git a/client/.import/electus.png-a90a07dfed216f4ba27686034df2153e.md5 b/client/.import/electus.png-a90a07dfed216f4ba27686034df2153e.md5 new file mode 100644 index 0000000..1b5ccd1 --- /dev/null +++ b/client/.import/electus.png-a90a07dfed216f4ba27686034df2153e.md5 @@ -0,0 +1,3 @@ +source_md5="91820ac8ea2be3ece9880968e3383d5e" +dest_md5="1708c1f0340ca66cafbe9371c338ab53" + diff --git a/client/.import/electus.png-a90a07dfed216f4ba27686034df2153e.stex b/client/.import/electus.png-a90a07dfed216f4ba27686034df2153e.stex new file mode 100644 index 0000000..837a7b6 Binary files /dev/null and b/client/.import/electus.png-a90a07dfed216f4ba27686034df2153e.stex differ diff --git a/client/.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.md5 b/client/.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.md5 new file mode 100644 index 0000000..8a5244b --- /dev/null +++ b/client/.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.md5 @@ -0,0 +1,3 @@ +source_md5="2986d81638e869b47b08fc6a51e530eb" +dest_md5="fc9df6db0cb50f4e349620f975023c68" + diff --git a/client/.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.stex b/client/.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.stex new file mode 100644 index 0000000..ccf5def Binary files /dev/null and b/client/.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.stex differ diff --git a/client/.import/regium.png-1a0832d2ba20f1f704b0231836336246.md5 b/client/.import/regium.png-1a0832d2ba20f1f704b0231836336246.md5 new file mode 100644 index 0000000..adb588a --- /dev/null +++ b/client/.import/regium.png-1a0832d2ba20f1f704b0231836336246.md5 @@ -0,0 +1,3 @@ +source_md5="f13aaf1926c7461f574eff3379d1227a" +dest_md5="dd9c1dd4ee97dade3f8000d9c2984bd2" + diff --git a/client/.import/regium.png-1a0832d2ba20f1f704b0231836336246.stex b/client/.import/regium.png-1a0832d2ba20f1f704b0231836336246.stex new file mode 100644 index 0000000..9a2b455 Binary files /dev/null and b/client/.import/regium.png-1a0832d2ba20f1f704b0231836336246.stex differ diff --git a/client/art/entities/player/dev_player.aseprite b/client/art/entities/player/dev/dev_player.aseprite similarity index 100% rename from client/art/entities/player/dev_player.aseprite rename to client/art/entities/player/dev/dev_player.aseprite diff --git a/client/art/entities/player/dev_player.png b/client/art/entities/player/dev/dev_player_1.png similarity index 100% rename from client/art/entities/player/dev_player.png rename to client/art/entities/player/dev/dev_player_1.png diff --git a/client/art/entities/player/dev_player.png.import b/client/art/entities/player/dev/dev_player_1.png.import similarity index 67% rename from client/art/entities/player/dev_player.png.import rename to client/art/entities/player/dev/dev_player_1.png.import index 6d18a87..00ac85b 100644 --- a/client/art/entities/player/dev_player.png.import +++ b/client/art/entities/player/dev/dev_player_1.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/dev_player.png-a3e490acef445550df71bca0ea3173dc.stex" +path="res://.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.stex" metadata={ "vram_texture": false } [deps] -source_file="res://art/entities/player/dev_player.png" -dest_files=[ "res://.import/dev_player.png-a3e490acef445550df71bca0ea3173dc.stex" ] +source_file="res://art/entities/player/dev/dev_player_1.png" +dest_files=[ "res://.import/dev_player_1.png-6a7e17e32424a41520db4c795eece2ce.stex" ] [params] diff --git a/client/art/entities/player/dev/dev_player_2.aseprite b/client/art/entities/player/dev/dev_player_2.aseprite new file mode 100644 index 0000000..0790216 Binary files /dev/null and b/client/art/entities/player/dev/dev_player_2.aseprite differ diff --git a/client/art/entities/player/dev/dev_player_2.png b/client/art/entities/player/dev/dev_player_2.png new file mode 100644 index 0000000..ebba5bf Binary files /dev/null and b/client/art/entities/player/dev/dev_player_2.png differ diff --git a/client/art/entities/player/dev/dev_player_2.png.import b/client/art/entities/player/dev/dev_player_2.png.import new file mode 100644 index 0000000..8ea6a40 --- /dev/null +++ b/client/art/entities/player/dev/dev_player_2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/entities/player/dev/dev_player_2.png" +dest_files=[ "res://.import/dev_player_2.png-24cb2fbb0bdff6cc7a030088bf9a60db.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/client/art/entities/player/dev/dev_player_3.aseprite b/client/art/entities/player/dev/dev_player_3.aseprite new file mode 100644 index 0000000..67ba0ae Binary files /dev/null and b/client/art/entities/player/dev/dev_player_3.aseprite differ diff --git a/client/art/entities/player/dev/dev_player_3.png b/client/art/entities/player/dev/dev_player_3.png new file mode 100644 index 0000000..297315e Binary files /dev/null and b/client/art/entities/player/dev/dev_player_3.png differ diff --git a/client/art/entities/player/dev/dev_player_3.png.import b/client/art/entities/player/dev/dev_player_3.png.import new file mode 100644 index 0000000..5d7388a --- /dev/null +++ b/client/art/entities/player/dev/dev_player_3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/entities/player/dev/dev_player_3.png" +dest_files=[ "res://.import/dev_player_3.png-2b614bba7aea33ebd1625829f7dc4dc8.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/client/art/entities/player/dev/dev_player_4.aseprite b/client/art/entities/player/dev/dev_player_4.aseprite new file mode 100644 index 0000000..0ba0948 Binary files /dev/null and b/client/art/entities/player/dev/dev_player_4.aseprite differ diff --git a/client/art/entities/player/dev/dev_player_4.png b/client/art/entities/player/dev/dev_player_4.png new file mode 100644 index 0000000..971715a Binary files /dev/null and b/client/art/entities/player/dev/dev_player_4.png differ diff --git a/client/art/entities/player/dev/dev_player_4.png.import b/client/art/entities/player/dev/dev_player_4.png.import new file mode 100644 index 0000000..c947c9c --- /dev/null +++ b/client/art/entities/player/dev/dev_player_4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/entities/player/dev/dev_player_4.png" +dest_files=[ "res://.import/dev_player_4.png-75d7bdc3c0acf687884cfb7d56448f69.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/client/art/gui/banners/burningwall.aseprite b/client/art/gui/banners/burningwall.aseprite new file mode 100644 index 0000000..a350015 Binary files /dev/null and b/client/art/gui/banners/burningwall.aseprite differ diff --git a/client/art/gui/banners/burningwall.png b/client/art/gui/banners/burningwall.png new file mode 100644 index 0000000..1f48ade Binary files /dev/null and b/client/art/gui/banners/burningwall.png differ diff --git a/client/art/gui/banners/burningwall.png.import b/client/art/gui/banners/burningwall.png.import new file mode 100644 index 0000000..8ec3d2a --- /dev/null +++ b/client/art/gui/banners/burningwall.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/gui/banners/burningwall.png" +dest_files=[ "res://.import/burningwall.png-46bfd2d39d0cac96f39200d4c53851e9.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/client/art/gui/banners/electus.aseprite b/client/art/gui/banners/electus.aseprite new file mode 100644 index 0000000..5b8d4d2 Binary files /dev/null and b/client/art/gui/banners/electus.aseprite differ diff --git a/client/art/gui/banners/electus.png b/client/art/gui/banners/electus.png new file mode 100644 index 0000000..26b103e Binary files /dev/null and b/client/art/gui/banners/electus.png differ diff --git a/client/art/gui/banners/electus.png.import b/client/art/gui/banners/electus.png.import new file mode 100644 index 0000000..9cc14ee --- /dev/null +++ b/client/art/gui/banners/electus.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/electus.png-a90a07dfed216f4ba27686034df2153e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/gui/banners/electus.png" +dest_files=[ "res://.import/electus.png-a90a07dfed216f4ba27686034df2153e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/client/art/gui/banners/lunaki.aseprite b/client/art/gui/banners/lunaki.aseprite new file mode 100644 index 0000000..87de39b Binary files /dev/null and b/client/art/gui/banners/lunaki.aseprite differ diff --git a/client/art/gui/banners/lunaki.png b/client/art/gui/banners/lunaki.png new file mode 100644 index 0000000..f74e482 Binary files /dev/null and b/client/art/gui/banners/lunaki.png differ diff --git a/client/art/gui/banners/lunaki.png.import b/client/art/gui/banners/lunaki.png.import new file mode 100644 index 0000000..a64372e --- /dev/null +++ b/client/art/gui/banners/lunaki.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/gui/banners/lunaki.png" +dest_files=[ "res://.import/lunaki.png-d46c842ee07941bd7d94068ea9489984.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/client/art/gui/banners/regium.aseprite b/client/art/gui/banners/regium.aseprite new file mode 100644 index 0000000..ef7c144 Binary files /dev/null and b/client/art/gui/banners/regium.aseprite differ diff --git a/client/art/gui/banners/regium.png b/client/art/gui/banners/regium.png new file mode 100644 index 0000000..8227238 Binary files /dev/null and b/client/art/gui/banners/regium.png differ diff --git a/client/art/gui/banners/regium.png.import b/client/art/gui/banners/regium.png.import new file mode 100644 index 0000000..8188dfa --- /dev/null +++ b/client/art/gui/banners/regium.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/regium.png-1a0832d2ba20f1f704b0231836336246.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/gui/banners/regium.png" +dest_files=[ "res://.import/regium.png-1a0832d2ba20f1f704b0231836336246.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/client/nodes/entities/Player.tscn b/client/nodes/entities/Player.tscn index 2d47461..459297c 100644 --- a/client/nodes/entities/Player.tscn +++ b/client/nodes/entities/Player.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://art/entities/player/dev_player.png" type="Texture" id=1] +[ext_resource path="res://art/entities/player/dev/dev_player_1.png" type="Texture" id=1] [ext_resource path="res://scripts/entities/Player.gd" type="Script" id=2] [node name="Player" type="KinematicBody2D"] diff --git a/client/nodes/entities/PlayerPuppet.tscn b/client/nodes/entities/PlayerPuppet.tscn index 1a0d40b..7ce382c 100644 --- a/client/nodes/entities/PlayerPuppet.tscn +++ b/client/nodes/entities/PlayerPuppet.tscn @@ -1,6 +1,8 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] -[ext_resource path="res://art/entities/player/dev_player.png" type="Texture" id=1] +[ext_resource path="res://art/entities/player/dev/dev_player_1.png" type="Texture" id=1] +[ext_resource path="res://scripts/entities/PlayerPuppet.gd" type="Script" id=2] [node name="PlayerPuppet" type="Sprite"] texture = ExtResource( 1 ) +script = ExtResource( 2 ) diff --git a/client/project.godot b/client/project.godot index 9620efe..4913dda 100644 --- a/client/project.godot +++ b/client/project.godot @@ -106,6 +106,7 @@ config/icon="res://icon.png" Nakama="*res://addons/com.heroiclabs.nakama/Nakama.gd" ServerConnection="*res://scripts/singletons/ServerConnection.gd" +GameData="*res://scripts/singletons/GameData.gd" [input] diff --git a/client/scenes/CharacterCreation.tscn b/client/scenes/CharacterCreation.tscn new file mode 100644 index 0000000..c517c22 --- /dev/null +++ b/client/scenes/CharacterCreation.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://art/gui/banners/burningwall.png" type="Texture" id=1] +[ext_resource path="res://scripts/menus/character_creation/FactionButtons.gd" type="Script" id=2] +[ext_resource path="res://scripts/menus/character_creation/NameEdit.gd" type="Script" id=3] +[ext_resource path="res://scripts/menus/character_creation/CharacterCreation.gd" type="Script" id=4] + +[node name="CharacterCreation" type="VBoxContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 4 ) +__meta__ = { +"_edit_use_anchors_": false +} +nameTextEdit = NodePath("NameEdit") +factionButtonsNode = NodePath("FactionButtons") + +[node name="NameLabel" type="Label" parent="."] +margin_right = 1024.0 +margin_bottom = 14.0 +text = "The Legacy of" +align = 1 + +[node name="NameEdit" type="LineEdit" parent="."] +margin_top = 18.0 +margin_right = 1024.0 +margin_bottom = 42.0 +align = 1 +placeholder_text = "Character Name" +script = ExtResource( 3 ) + +[node name="FactionLabel" type="Label" parent="."] +margin_top = 46.0 +margin_right = 1024.0 +margin_bottom = 60.0 +text = "Select your family" +align = 1 +uppercase = true + +[node name="FactionButtons" type="HBoxContainer" parent="."] +margin_top = 64.0 +margin_right = 1024.0 +margin_bottom = 198.0 +alignment = 1 +script = ExtResource( 2 ) + +[node name="Button" type="Button" parent="FactionButtons"] +margin_left = 474.0 +margin_right = 550.0 +margin_bottom = 134.0 +icon = ExtResource( 1 ) + +[node name="Button" type="Button" parent="."] +margin_top = 202.0 +margin_right = 1024.0 +margin_bottom = 222.0 +text = "Join World" +[connection signal="button_down" from="Button" to="." method="_on_Button_button_down"] diff --git a/client/scripts/entities/PlayerPuppet.gd b/client/scripts/entities/PlayerPuppet.gd new file mode 100644 index 0000000..dd6a260 --- /dev/null +++ b/client/scripts/entities/PlayerPuppet.gd @@ -0,0 +1,13 @@ +extends Sprite + +export var faction = 1 setget set_faction, get_faction + +func _ready(): + set_faction(faction) + +func set_faction(new_faction): + faction = new_faction + texture = load("res://art/entities/player/dev/dev_player_" + str(faction) + ".png") + +func get_faction(): + return faction diff --git a/client/scripts/menus/character_creation/CharacterCreation.gd b/client/scripts/menus/character_creation/CharacterCreation.gd new file mode 100644 index 0000000..a68fe1f --- /dev/null +++ b/client/scripts/menus/character_creation/CharacterCreation.gd @@ -0,0 +1,16 @@ +extends Node + +export(NodePath) var nameTextEdit +export(NodePath) var factionButtonsNode + +onready var nameEdit : LineEdit = get_node(nameTextEdit) +onready var factionButtons = get_node(factionButtonsNode) + +func _on_Button_button_down(): + if nameEdit.text != "": + if factionButtons.currently_selected: + for i in range(1,len(GameData.factions)): + if GameData.factions[i] == factionButtons.currently_selected: + var created_char = yield(ServerConnection.create_character_async(nameEdit.text, i), "completed") + if created_char: + get_tree().change_scene("res://scenes/World.tscn") diff --git a/client/scripts/menus/character_creation/FactionButtons.gd b/client/scripts/menus/character_creation/FactionButtons.gd new file mode 100644 index 0000000..db2931a --- /dev/null +++ b/client/scripts/menus/character_creation/FactionButtons.gd @@ -0,0 +1,20 @@ +extends Node + +signal selection_updated(faction) + +var currently_selected : String + +func _ready(): + get_child(0).queue_free() + for faction in GameData.factions: + if faction == "Electus": + return + + var faction_button = Button.new() + faction_button.icon = load("res://art/gui/banners/" + faction.to_lower() + ".png") + faction_button.connect("button_down", self, "on_faction_select", [faction]) + add_child(faction_button) + +func on_faction_select(faction): + currently_selected = faction + emit_signal("selection_updated", faction) diff --git a/client/scripts/menus/character_creation/NameEdit.gd b/client/scripts/menus/character_creation/NameEdit.gd new file mode 100644 index 0000000..e241d21 --- /dev/null +++ b/client/scripts/menus/character_creation/NameEdit.gd @@ -0,0 +1,14 @@ +extends LineEdit + +var invalid_chars = " '.,;/\\,[](){}!@#$%^&*-=|_+1234567890\"" + +func _ready(): + connect("text_changed", self, "validate_name") + + +func validate_name(name): + var cursor_pos = caret_position + for character in invalid_chars: + if character in text: + text = text.replace(character, "") + caret_position = cursor_pos diff --git a/client/scripts/singletons/GameData.gd b/client/scripts/singletons/GameData.gd new file mode 100644 index 0000000..59218c7 --- /dev/null +++ b/client/scripts/singletons/GameData.gd @@ -0,0 +1,8 @@ +extends Node + +var factions = [ + "Burningwall", + "Lunaki", + "Regium", + "Electus" +] diff --git a/client/scripts/singletons/ServerConnection.gd b/client/scripts/singletons/ServerConnection.gd index 413923c..725de28 100644 --- a/client/scripts/singletons/ServerConnection.gd +++ b/client/scripts/singletons/ServerConnection.gd @@ -4,19 +4,21 @@ signal tile_update(tile_data) signal player_joined(user_id) signal player_left(user_id) signal player_pos_update(user_id, pos) +signal player_state_update(user_id, user_name, faction) const KEY := "defaultkey" const SERVER_ENDPOINT := "nakama.cloudsumu.com" var _session : NakamaSession -var _client : NakamaClient = Nakama.create_client(KEY, SERVER_ENDPOINT, 7350, "http") +var _client : NakamaClient = Nakama.create_client(KEY, SERVER_ENDPOINT, 7350, "http", Nakama.DEFAULT_TIMEOUT, NakamaLogger.LOG_LEVEL.ERROR) var _socket : NakamaSocket var _precenses : Dictionary = {} var _world_id enum OPCODE { tile_update = 1, - update_position = 2 + update_position = 2, + player_state = 3 } func authenticate_async(email : String, password : String) -> NakamaException: @@ -62,6 +64,11 @@ func join_world_async() -> Dictionary: var match_join_result : NakamaRTAPI.Match = yield(_socket.join_match_async(world.payload), "completed") if match_join_result.is_exception(): print("Join match error: %s - %s" % [match_join_result.exception.status_code, match_join_result.exception.message]) + + # THIS SECTION NEEDS TO BE UPADTED TO BE DECOUPLED + # IT SHOULD ALSO NOT CATCH ALL JOIN ERRORS! + get_tree().change_scene("res://scenes/CharacterCreation.tscn") + return {} _world_id = world.payload @@ -95,7 +102,17 @@ func _on_socket_received_match_state(match_state: NakamaRTAPI.MatchData): OPCODE.update_position: var pos_data = JSON.parse(match_state.data).result emit_signal("player_pos_update", pos_data["player"], Vector2(float(pos_data["x"]), float(pos_data["y"]))) + OPCODE.player_state: + var state_data = JSON.parse(match_state.data).result + emit_signal("player_state_update", state_data["player"], state_data["name"], state_data["faction"]) func send_player_position(position : Vector2) -> void: _socket.send_match_state_async(_world_id, OPCODE.update_position, JSON.print({X = str(position.x), Y = str(position.y)})) +func create_character_async(name : String, faction : int) -> Dictionary: + + var character_response : NakamaAPI.ApiRpc = yield(_client.rpc_async(_session, "create_character", JSON.print({"name":name, "faction" : faction})), "completed") + if character_response.is_exception(): + print("Create character error occured: %s" % character_response.exception.message) + return false + return true diff --git a/client/scripts/systems/PlayerPuppeteer.gd b/client/scripts/systems/PlayerPuppeteer.gd index 96bf07a..b3ef260 100644 --- a/client/scripts/systems/PlayerPuppeteer.gd +++ b/client/scripts/systems/PlayerPuppeteer.gd @@ -11,6 +11,7 @@ func _ready(): ServerConnection.connect("player_joined", self, "on_player_join") ServerConnection.connect("player_left", self, "on_player_leave") ServerConnection.connect("player_pos_update", self, "on_player_pos_update") + ServerConnection.connect("player_state_update", self, "on_player_state_update") func on_player_join(user_id): @@ -29,3 +30,12 @@ func on_player_pos_update(user_id, pos): if user_id != ServerConnection._session.user_id: var player_puppet : Node2D = puppets[user_id] player_puppet.global_position = pos + +func on_player_state_update(user_id, user_name, faction): + if user_id != ServerConnection._session.user_id: + if user_id in puppets: + var player_puppet : Node2D = puppets[user_id] + player_puppet.name = user_name + player_puppet.set_faction(faction) + else: + print("Could not update player state for nonexisting player!")