lobby.tscn 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. [gd_scene load_steps=2 format=3 uid="uid://f85s2avde6r4"]
  2. [ext_resource type="Script" path="res://logic/lobby.gd" id="1"]
  3. [node name="Lobby" type="Control"]
  4. layout_mode = 3
  5. anchors_preset = 8
  6. anchor_left = 0.5
  7. anchor_top = 0.5
  8. anchor_right = 0.5
  9. anchor_bottom = 0.5
  10. offset_left = -320.0
  11. offset_top = -200.0
  12. offset_right = 320.0
  13. offset_bottom = 200.0
  14. grow_horizontal = 2
  15. grow_vertical = 2
  16. size_flags_horizontal = 2
  17. size_flags_vertical = 2
  18. [node name="Title" type="Label" parent="."]
  19. layout_mode = 1
  20. anchors_preset = 8
  21. anchor_left = 0.5
  22. anchor_top = 0.5
  23. anchor_right = 0.5
  24. anchor_bottom = 0.5
  25. offset_left = -110.0
  26. offset_top = -156.0
  27. offset_right = 110.0
  28. offset_bottom = -116.0
  29. grow_horizontal = 2
  30. grow_vertical = 2
  31. size_flags_horizontal = 2
  32. size_flags_vertical = 0
  33. theme_override_font_sizes/font_size = 32
  34. text = "Multiplayer Pong"
  35. horizontal_alignment = 1
  36. vertical_alignment = 1
  37. [node name="LobbyPanel" type="Panel" parent="."]
  38. layout_mode = 1
  39. anchors_preset = 8
  40. anchor_left = 0.5
  41. anchor_top = 0.5
  42. anchor_right = 0.5
  43. anchor_bottom = 0.5
  44. offset_left = -110.0
  45. offset_top = -73.0
  46. offset_right = 110.0
  47. offset_bottom = 73.0
  48. grow_horizontal = 2
  49. grow_vertical = 2
  50. size_flags_horizontal = 2
  51. size_flags_vertical = 2
  52. script = ExtResource("1")
  53. [node name="AddressLabel" type="Label" parent="LobbyPanel"]
  54. layout_mode = 0
  55. offset_left = 10.0
  56. offset_top = 6.0
  57. offset_right = 77.0
  58. offset_bottom = 29.0
  59. size_flags_horizontal = 2
  60. size_flags_vertical = 0
  61. text = "Address:"
  62. [node name="Address" type="LineEdit" parent="LobbyPanel"]
  63. layout_mode = 0
  64. offset_left = 10.0
  65. offset_top = 37.0
  66. offset_right = 210.0
  67. offset_bottom = 68.0
  68. size_flags_horizontal = 2
  69. size_flags_vertical = 2
  70. text = "127.0.0.1"
  71. [node name="HostButton" type="Button" parent="LobbyPanel"]
  72. layout_mode = 0
  73. offset_left = 10.0
  74. offset_top = 76.0
  75. offset_right = 90.0
  76. offset_bottom = 107.0
  77. size_flags_horizontal = 2
  78. size_flags_vertical = 2
  79. text = "Host"
  80. [node name="JoinButton" type="Button" parent="LobbyPanel"]
  81. layout_mode = 0
  82. offset_left = 130.0
  83. offset_top = 76.0
  84. offset_right = 210.0
  85. offset_bottom = 107.0
  86. size_flags_horizontal = 2
  87. size_flags_vertical = 2
  88. text = "Join"
  89. [node name="StatusOk" type="Label" parent="LobbyPanel"]
  90. layout_mode = 0
  91. offset_left = 10.0
  92. offset_top = 114.0
  93. offset_right = 210.0
  94. offset_bottom = 137.0
  95. size_flags_horizontal = 2
  96. size_flags_vertical = 0
  97. horizontal_alignment = 1
  98. [node name="StatusFail" type="Label" parent="LobbyPanel"]
  99. modulate = Color(1, 0.427451, 0.345098, 1)
  100. layout_mode = 0
  101. offset_left = 10.0
  102. offset_top = 114.0
  103. offset_right = 210.0
  104. offset_bottom = 137.0
  105. size_flags_horizontal = 2
  106. size_flags_vertical = 0
  107. horizontal_alignment = 1
  108. [node name="PortForward" type="Label" parent="LobbyPanel"]
  109. visible = false
  110. layout_mode = 1
  111. anchors_preset = 8
  112. anchor_left = 0.5
  113. anchor_top = 0.5
  114. anchor_right = 0.5
  115. anchor_bottom = 0.5
  116. offset_left = -278.0
  117. offset_top = 91.0
  118. offset_right = 25.0
  119. offset_bottom = 166.0
  120. grow_horizontal = 2
  121. grow_vertical = 2
  122. text = "If you want non-LAN clients to connect,
  123. make sure the port 8910 in UDP
  124. is forwarded on your router."
  125. [node name="FindPublicIP" type="LinkButton" parent="LobbyPanel"]
  126. visible = false
  127. layout_mode = 1
  128. anchors_preset = 8
  129. anchor_left = 0.5
  130. anchor_top = 0.5
  131. anchor_right = 0.5
  132. anchor_bottom = 0.5
  133. offset_left = 61.0
  134. offset_top = 118.0
  135. offset_right = 269.0
  136. offset_bottom = 141.0
  137. grow_horizontal = 2
  138. grow_vertical = 2
  139. text = "Find your public IP address"
  140. [connection signal="pressed" from="LobbyPanel/HostButton" to="LobbyPanel" method="_on_host_pressed"]
  141. [connection signal="pressed" from="LobbyPanel/JoinButton" to="LobbyPanel" method="_on_join_pressed"]
  142. [connection signal="pressed" from="LobbyPanel/FindPublicIP" to="LobbyPanel" method="_on_find_public_ip_pressed"]