Skip to content

Commit

Permalink
part 9
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuSai committed Sep 10, 2022
1 parent e107432 commit 5418b2e
Show file tree
Hide file tree
Showing 38 changed files with 350 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .import/character0.png-44bea6e364f4e83634268216d02b7691.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="e76cb679a88e60e83cb2bc1b8fcf172f"
dest_md5="bd1558239daef36856293ec7cd3cf0ab"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/character1.png-bd48f4d72ecdf8b7218be1e3ee3b3161.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="cfa44e898dff62270cb115257892e86d"
dest_md5="5480f6518d5953eed765444512e37d02"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/character2.png-1146c046681af3bc05bef103082e6815.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="efcdc56db0b4eb1d7a50e0fa0bbf5555"
dest_md5="689a05b8feac08b490450a55ffc3cae2"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/character3.png-802fd257d6f399298a8c312db3952692.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="0457a0c791212b89c20ab3e8987b5fe7"
dest_md5="4446e64506cfd205d7298870aef65678"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/tile_0440.png-78cb329c3eb8e9a38f2ecc926158b184.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="0c6794b3051b4ea30826d52de0ed1b59"
dest_md5="85508566cfc1e124bb1bb07863d90611"

3 changes: 3 additions & 0 deletions .import/tile_0440.png-c423ca1f100eb98055cae3b9049d02fb.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="0c6794b3051b4ea30826d52de0ed1b59"
dest_md5="85508566cfc1e124bb1bb07863d90611"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/tile_0507.png-1ace5b73ba99be15e114b194c7bbb403.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="4592cebfbe3348dc5a95b2fb84f6456f"
dest_md5="21225ebe71a40f36cb0cd38f78a0e85a"

3 changes: 3 additions & 0 deletions .import/tile_0507.png-6571e55ec122829424bda38c3d26b433.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="4592cebfbe3348dc5a95b2fb84f6456f"
dest_md5="21225ebe71a40f36cb0cd38f78a0e85a"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/tile_0508.png-cfdfe91c9ce16b96a76023fbeb3a62a7.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="d0ade4baa5f2ef083b8c3588abc9ec0b"
dest_md5="eefe174f8f378d07f38c70dadecdee2c"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/tile_0508.png-d895dfd8314c22b034201e21d743e0dc.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="d0ade4baa5f2ef083b8c3588abc9ec0b"
dest_md5="eefe174f8f378d07f38c70dadecdee2c"

3 changes: 3 additions & 0 deletions .import/tile_0509.png-b2e2689547eda65b2f5aa3620e95f264.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="af33e3b6516dc05fa2ebc5e5ac761a0f"
dest_md5="65c274ac49e3df6dc0d7617aee1d452c"

3 changes: 3 additions & 0 deletions .import/tile_0509.png-f23df3b3f97c973418719bbd0c6c7c2f.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="af33e3b6516dc05fa2ebc5e5ac761a0f"
dest_md5="65c274ac49e3df6dc0d7617aee1d452c"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/tile_0735.png-3640642dd35d2d6a378880dd36604f30.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="51e6835150d8d9e9b7a9b9df030545e3"
dest_md5="63b554de2aa63874d44c1a84b4aca2ac"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/tile_0735.png-58749046a8b2ec57c93badafb723297e.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="51e6835150d8d9e9b7a9b9df030545e3"
dest_md5="63b554de2aa63874d44c1a84b4aca2ac"

Binary file not shown.
36 changes: 36 additions & 0 deletions CharacterSelector.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
extends WindowDialog

const NUM_CHARACTERS: int = 4
var character_index: int = 0 setget set_character_index

onready var character_texture: TextureRect = get_node("VBoxContainer/HBoxContainer/TextureRect")
onready var name_line_edit: LineEdit = get_node("VBoxContainer/LineEdit")


func set_character_index(new_index: int) -> void:
if new_index < 0:
character_index = NUM_CHARACTERS - 1
elif new_index >= NUM_CHARACTERS:
character_index = 0
else:
character_index = new_index

character_texture.texture = load("res://assets/images/GhostShip_Assets/character_icons/character" + str(character_index) + ".png")


func _on_LeftButton_pressed() -> void:
self.character_index -= 1


func _on_RightButton_pressed() -> void:
self.character_index += 1


func _on_CharacterSelector_about_to_show() -> void:
self.character_index = Client.my_info.character_index
name_line_edit.text = Client.my_info.name


func _on_CharacterSelector_popup_hide() -> void:
Client.my_info.character_index = character_index
Client.my_info.name = name_line_edit.text
6 changes: 6 additions & 0 deletions Menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ onready var join_dialog: WindowDialog = get_node("JoinDialog")
onready var join_room_label: Label = join_dialog.get_node("WaitScrollContainer/VBoxContainer/Label")
onready var join_player_list: VBoxContainer = join_dialog.get_node("WaitScrollContainer/VBoxContainer/PlayerList")

onready var character_selector: WindowDialog = get_node("CharacterSelector")


func update_room(room_id: int) -> void:
if Client.is_creator:
Expand Down Expand Up @@ -59,3 +61,7 @@ func remove_all_players() -> void:

func _on_CreateDialog_confirmed() -> void:
Client.start_game()


func _on_CharacterSelectorButton_pressed() -> void:
character_selector.popup_centered()
101 changes: 88 additions & 13 deletions Menu.tscn
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=10 format=2]

[ext_resource path="res://Menu.gd" type="Script" id=1]
[ext_resource path="res://JoinDialog.gd" type="Script" id=2]
[ext_resource path="res://PlayerList.gd" type="Script" id=3]
[ext_resource path="res://assets/images/GhostShip_Assets/character_icons/character0.png" type="Texture" id=4]
[ext_resource path="res://assets/images/kenney_input/tile_0735.png" type="Texture" id=5]
[ext_resource path="res://CharacterSelector.gd" type="Script" id=6]
[ext_resource path="res://assets/fonts/kenney_fontpackage/Kenney Mini.ttf" type="DynamicFontData" id=7]

[sub_resource type="DynamicFont" id=1]
font_data = ExtResource( 7 )

[sub_resource type="Theme" id=2]
default_font = SubResource( 1 )

[node name="Menu" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = SubResource( 2 )
script = ExtResource( 1 )

[node name="VBoxContainer" type="VBoxContainer" parent="."]
Expand All @@ -15,17 +26,23 @@ anchor_bottom = 1.0
alignment = 2

[node name="CreateButton" type="Button" parent="VBoxContainer"]
margin_top = 100.0
margin_top = 58.0
margin_right = 256.0
margin_bottom = 120.0
margin_bottom = 84.0
text = "Create"

[node name="JoinButton" type="Button" parent="VBoxContainer"]
margin_top = 124.0
margin_top = 88.0
margin_right = 256.0
margin_bottom = 144.0
margin_bottom = 114.0
text = "Join"

[node name="CharacterSelectorButton" type="Button" parent="VBoxContainer"]
margin_top = 118.0
margin_right = 256.0
margin_bottom = 144.0
text = "character Selector"

[node name="CreateDialog" type="AcceptDialog" parent="."]
margin_left = 20.0
margin_top = 37.0
Expand All @@ -43,8 +60,8 @@ margin_bottom = 52.0
scroll_horizontal_enabled = false

[node name="VBoxContainer" type="VBoxContainer" parent="CreateDialog/ScrollContainer"]
margin_right = 61.0
margin_bottom = 18.0
margin_right = 74.0
margin_bottom = 24.0

[node name="Label" type="Label" parent="CreateDialog/ScrollContainer/VBoxContainer"]
margin_right = 61.0
Expand Down Expand Up @@ -74,14 +91,14 @@ margin_right = 179.0
margin_bottom = 14.0

[node name="SpinBox" type="SpinBox" parent="JoinDialog/ConnectVBoxContainer"]
margin_right = 179.0
margin_bottom = 24.0
margin_right = 220.0
margin_bottom = 30.0
align = 1

[node name="ConnectButton" type="Button" parent="JoinDialog/ConnectVBoxContainer"]
margin_top = 28.0
margin_right = 179.0
margin_bottom = 48.0
margin_top = 34.0
margin_right = 220.0
margin_bottom = 60.0
text = "Connect"

[node name="WaitScrollContainer" type="ScrollContainer" parent="JoinDialog"]
Expand All @@ -91,7 +108,7 @@ anchor_bottom = 1.0
scroll_horizontal_enabled = false

[node name="VBoxContainer" type="VBoxContainer" parent="JoinDialog/WaitScrollContainer"]
margin_bottom = 18.0
margin_bottom = 24.0

[node name="Label" type="Label" parent="JoinDialog/WaitScrollContainer/VBoxContainer"]
margin_bottom = 14.0
Expand All @@ -101,10 +118,68 @@ margin_top = 18.0
margin_bottom = 18.0
script = ExtResource( 3 )

[node name="CharacterSelector" type="WindowDialog" parent="."]
visible = true
margin_left = 42.0
margin_top = 34.0
margin_right = 205.0
margin_bottom = 124.0
window_title = "Character selector"
script = ExtResource( 6 )

[node name="VBoxContainer" type="VBoxContainer" parent="CharacterSelector"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 4.0
margin_right = -4.0
margin_bottom = -4.0

[node name="HBoxContainer" type="HBoxContainer" parent="CharacterSelector/VBoxContainer"]
margin_right = 206.0
margin_bottom = 32.0
alignment = 1

[node name="LeftButton" type="TextureButton" parent="CharacterSelector/VBoxContainer/HBoxContainer"]
margin_left = 67.0
margin_right = 83.0
margin_bottom = 32.0
rect_min_size = Vector2( 16, 0 )
texture_normal = ExtResource( 5 )
expand = true
stretch_mode = 3
flip_h = true

[node name="TextureRect" type="TextureRect" parent="CharacterSelector/VBoxContainer/HBoxContainer"]
margin_left = 87.0
margin_right = 119.0
margin_bottom = 32.0
texture = ExtResource( 4 )

[node name="RightButton" type="TextureButton" parent="CharacterSelector/VBoxContainer/HBoxContainer"]
margin_left = 123.0
margin_right = 139.0
margin_bottom = 32.0
rect_min_size = Vector2( 16, 0 )
texture_normal = ExtResource( 5 )
expand = true
stretch_mode = 3

[node name="LineEdit" type="LineEdit" parent="CharacterSelector/VBoxContainer"]
margin_top = 36.0
margin_right = 206.0
margin_bottom = 66.0
max_length = 12

[connection signal="pressed" from="VBoxContainer/CreateButton" to="." method="_on_CreateButton_pressed"]
[connection signal="pressed" from="VBoxContainer/JoinButton" to="." method="_on_JoinButton_pressed"]
[connection signal="pressed" from="VBoxContainer/CharacterSelectorButton" to="." method="_on_CharacterSelectorButton_pressed"]
[connection signal="confirmed" from="CreateDialog" to="." method="_on_CreateDialog_confirmed"]
[connection signal="popup_hide" from="CreateDialog" to="." method="_on_popup_hide"]
[connection signal="popup_hide" from="JoinDialog" to="." method="_on_popup_hide"]
[connection signal="popup_hide" from="JoinDialog" to="JoinDialog" method="_on_JoinDialog_popup_hide"]
[connection signal="pressed" from="JoinDialog/ConnectVBoxContainer/ConnectButton" to="JoinDialog" method="_on_ConnectButton_pressed"]
[connection signal="about_to_show" from="CharacterSelector" to="CharacterSelector" method="_on_CharacterSelector_about_to_show"]
[connection signal="popup_hide" from="CharacterSelector" to="CharacterSelector" method="_on_CharacterSelector_popup_hide"]
[connection signal="pressed" from="CharacterSelector/VBoxContainer/HBoxContainer/LeftButton" to="CharacterSelector" method="_on_LeftButton_pressed"]
[connection signal="pressed" from="CharacterSelector/VBoxContainer/HBoxContainer/RightButton" to="CharacterSelector" method="_on_RightButton_pressed"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/character0.png-c9f6aac0b9a54779db8cbe8aa10cc8d4.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/GhostShip_Assets/character_icons/character0.png"
dest_files=[ "res://.import/character0.png-c9f6aac0b9a54779db8cbe8aa10cc8d4.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/character1.png-b74eead93aea4e0d852e6b2b1be29775.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/GhostShip_Assets/character_icons/character1.png"
dest_files=[ "res://.import/character1.png-b74eead93aea4e0d852e6b2b1be29775.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/character2.png-2c238128df36e61f9b35e25bacd2b831.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/GhostShip_Assets/character_icons/character2.png"
dest_files=[ "res://.import/character2.png-2c238128df36e61f9b35e25bacd2b831.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5418b2e

Please sign in to comment.