lobby.tscn 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. [gd_scene load_steps=2 format=2]
  2. [ext_resource path="res://logic/lobby.gd" type="Script" id=1]
  3. [node name="Lobby" type="Control"]
  4. anchor_left = 0.5
  5. anchor_top = 0.5
  6. anchor_right = 0.5
  7. anchor_bottom = 0.5
  8. margin_left = -320.0
  9. margin_top = -200.0
  10. margin_right = 320.0
  11. margin_bottom = 200.0
  12. size_flags_horizontal = 2
  13. size_flags_vertical = 2
  14. __meta__ = {
  15. "_edit_use_anchors_": false
  16. }
  17. [node name="Title" type="Label" parent="."]
  18. margin_left = 210.0
  19. margin_top = 40.0
  20. margin_right = 430.0
  21. margin_bottom = 80.0
  22. size_flags_horizontal = 2
  23. size_flags_vertical = 0
  24. text = "Multiplayer Pong"
  25. align = 1
  26. valign = 1
  27. [node name="LobbyPanel" type="Panel" parent="."]
  28. margin_left = 210.0
  29. margin_top = 160.0
  30. margin_right = 430.0
  31. margin_bottom = 270.0
  32. size_flags_horizontal = 2
  33. size_flags_vertical = 2
  34. script = ExtResource( 1 )
  35. [node name="AddressLabel" type="Label" parent="LobbyPanel"]
  36. margin_left = 10.0
  37. margin_top = 10.0
  38. margin_right = 62.0
  39. margin_bottom = 24.0
  40. size_flags_horizontal = 2
  41. size_flags_vertical = 0
  42. text = "Address"
  43. [node name="Address" type="LineEdit" parent="LobbyPanel"]
  44. margin_left = 10.0
  45. margin_top = 30.0
  46. margin_right = 210.0
  47. margin_bottom = 54.0
  48. size_flags_horizontal = 2
  49. size_flags_vertical = 2
  50. text = "127.0.0.1"
  51. [node name="HostButton" type="Button" parent="LobbyPanel"]
  52. margin_left = 10.0
  53. margin_top = 60.0
  54. margin_right = 90.0
  55. margin_bottom = 80.0
  56. size_flags_horizontal = 2
  57. size_flags_vertical = 2
  58. text = "Host"
  59. [node name="JoinButton" type="Button" parent="LobbyPanel"]
  60. margin_left = 130.0
  61. margin_top = 60.0
  62. margin_right = 210.0
  63. margin_bottom = 80.0
  64. size_flags_horizontal = 2
  65. size_flags_vertical = 2
  66. text = "Join"
  67. [node name="StatusOk" type="Label" parent="LobbyPanel"]
  68. margin_left = 10.0
  69. margin_top = 90.0
  70. margin_right = 210.0
  71. margin_bottom = 104.0
  72. size_flags_horizontal = 2
  73. size_flags_vertical = 0
  74. custom_colors/font_color = Color( 0, 1, 0.015625, 1 )
  75. align = 1
  76. [node name="StatusFail" type="Label" parent="LobbyPanel"]
  77. margin_left = 10.0
  78. margin_top = 90.0
  79. margin_right = 210.0
  80. margin_bottom = 104.0
  81. size_flags_horizontal = 2
  82. size_flags_vertical = 0
  83. custom_colors/font_color = Color( 1, 0, 0, 1 )
  84. align = 1
  85. [node name="PortForward" type="Label" parent="LobbyPanel"]
  86. visible = false
  87. margin_left = -128.0
  88. margin_top = 136.0
  89. margin_right = 124.0
  90. margin_bottom = 184.0
  91. custom_constants/line_spacing = 6
  92. text = "If you want non-LAN clients to connect,
  93. make sure the port 8910 in UDP
  94. is forwarded on your router."
  95. align = 1
  96. __meta__ = {
  97. "_edit_use_anchors_": false
  98. }
  99. [node name="FindPublicIP" type="LinkButton" parent="LobbyPanel"]
  100. visible = false
  101. margin_left = 155.0
  102. margin_top = 152.0
  103. margin_right = 328.0
  104. margin_bottom = 166.0
  105. text = "Find your public IP address"
  106. __meta__ = {
  107. "_edit_use_anchors_": false
  108. }
  109. [connection signal="pressed" from="LobbyPanel/HostButton" to="LobbyPanel" method="_on_host_pressed"]
  110. [connection signal="pressed" from="LobbyPanel/JoinButton" to="LobbyPanel" method="_on_join_pressed"]
  111. [connection signal="pressed" from="LobbyPanel/FindPublicIP" to="LobbyPanel" method="_on_find_public_ip_pressed"]