| … | … | @@ -2,7 +2,7 @@ extends Node |
| 2 | 2 | |
| 3 | 3 | # TODO : Make Debug UI dynamic and not hardcoded in the core Hyper scripts. |
| 4 | 4 | onready var hyperdebugui : Control = $HyperGodotDebugUI |
| 5 | onready var hyperdebugui_gateway_startstop_button : Button = $HyperGodotDebugUI/HypercoreDebugContainer/GatewayStartStopButton | |
| 5 | onready var hyperdebugui_gateway_startstop_button : Button = $HyperGodotDebugUI/HypercoreDebugPanel/HypercoreDebugContainer/GatewayStartStopButton | |
| 6 | 6 | |
| 7 | 7 | onready var gateway : HyperGateway = $HyperGodot/HyperGateway |
| 8 | 8 | onready var gossip : HyperGossip = $HyperGodot/HyperGossip |
| … | … | @@ -61,6 +61,9 @@ func _on_HyperGateway_started_gateway(_pid : int): |
| 61 | 61 | updateGatewayStatus(_pid) |
| 62 | 62 | _perform_setup() |
| 63 | 63 | |
| 64 | func _on_PlayerLocalNetworkTimer_timeout(): | |
| 65 | _broadcast_player() | |
| 66 | ||
| 64 | 67 | func _on_HyperGateway_stopped_gateway(): |
| 65 | 68 | updateGatewayStatus(0) |
| 66 | 69 | |
| … | … | @@ -104,7 +107,7 @@ func _broadcast_player(): |
| 104 | 107 | "z": velocity_angular.z |
| 105 | 108 | } |
| 106 | 109 | } |
| 107 | print('Broadcasting', data) | |
| 110 | # print('Broadcasting', data) | |
| 108 | 111 | gossip.broadcast_event(EVENT_PLAYER_POSITION, data) |
| 109 | 112 | |
| 110 | 113 | func _on_remote_player_moved(positionData, id): |
| … | … | @@ -122,3 +125,6 @@ func _on_remote_player_moved(positionData, id): |
| 122 | 125 | velocity_linear, |
| 123 | 126 | velocity_angular |
| 124 | 127 | ) |
| 128 | ||
| 129 | func _on_PlayerLocal_moved(): | |
| 130 | _broadcast_player() |
| … | … | @@ -30,6 +30,9 @@ pause_mode = 2 |
| 30 | 30 | script = ExtResource( 8 ) |
| 31 | 31 | player_ball = NodePath("../PlayerLocal") |
| 32 | 32 | |
| 33 | [node name="PlayerLocalNetworkTimer" type="Timer" parent="Players"] | |
| 34 | autostart = true | |
| 35 | ||
| 33 | 36 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] |
| 34 | 37 | environment = ExtResource( 9 ) |
| 35 | 38 | |
| … | … | @@ -65,7 +68,8 @@ autoStart = false |
| 65 | 68 | [node name="HyperGossip" type="Node" parent="HyperGodot"] |
| 66 | 69 | script = ExtResource( 11 ) |
| 67 | 70 | |
| 68 | [connection signal="reset_ball" from="Players/PlayerLocal" to="Players/PlayerLocal" method="_on_PlayerLocal_reset_ball"] | |
| 71 | [connection signal="moved" from="Players/PlayerLocal" to="." method="_on_PlayerLocal_moved"] | |
| 72 | [connection signal="timeout" from="Players/PlayerLocalNetworkTimer" to="." method="_on_PlayerLocalNetworkTimer_timeout"] | |
| 69 | 73 | [connection signal="reset_ball" from="special_input" to="Players/PlayerLocal" method="_on_special_input_reset_ball"] |
| 70 | 74 | [connection signal="toggle_hypergateway_startstop" from="HyperGodotDebugUI" to="HyperGodot/HyperGateway" method="_on_HyperGodotDebugUI_toggle_hypergateway_startstop"] |
| 71 | 75 | [connection signal="started_gateway" from="HyperGodot/HyperGateway" to="." method="_on_HyperGateway_started_gateway"] |
| … | … | @@ -7,7 +7,7 @@ enum BallPhysicsMode { |
| 7 | 7 | PHYSICS_MAX |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | signal reset_ball() | |
| 10 | signal moved | |
| 11 | 11 | |
| 12 | 12 | var rolling_force : float = 10.0 |
| 13 | 13 | var rolling_force_max : float = 50.0 |
| … | … | @@ -145,7 +145,6 @@ func _physics_process(delta: float) -> void: |
| 145 | 145 | lVelocity.text = String(self.linear_velocity) |
| 146 | 146 | lAngularVelocity.text = String(self.angular_velocity) |
| 147 | 147 | |
| 148 | ||
| 149 | 148 | func _on_PlayerLocal_reset_ball() -> void: |
| 150 | 149 | resetBall() |
| 151 | 150 |
| … | … | @@ -1,7 +1,10 @@ |
| 1 | [gd_scene load_steps=2 format=2] | |
| 1 | [gd_scene load_steps=3 format=2] | |
| 2 | 2 | |
| 3 | 3 | [ext_resource path="res://ui/debug/hypercore/ui_debug_hypercore.gd" type="Script" id=1] |
| 4 | 4 | |
| 5 | [sub_resource type="StyleBoxFlat" id=1] | |
| 6 | bg_color = Color( 0, 0, 0, 0.470588 ) | |
| 7 | ||
| 5 | 8 | [node name="Control" type="Control"] |
| 6 | 9 | anchor_right = 1.0 |
| 7 | 10 | anchor_bottom = 1.0 |
| … | … | @@ -10,17 +13,27 @@ __meta__ = { |
| 10 | 13 | "_edit_use_anchors_": false |
| 11 | 14 | } |
| 12 | 15 | |
| 13 | [node name="HypercoreDebugContainer" type="GridContainer" parent="."] | |
| 16 | [node name="HypercoreDebugPanel" type="Panel" parent="."] | |
| 14 | 17 | margin_left = 1052.0 |
| 15 | 18 | margin_top = 62.0 |
| 16 | margin_right = 1591.0 | |
| 17 | margin_bottom = 285.0 | |
| 19 | margin_right = 1584.0 | |
| 20 | margin_bottom = 235.0 | |
| 21 | custom_styles/panel = SubResource( 1 ) | |
| 22 | __meta__ = { | |
| 23 | "_edit_use_anchors_": false | |
| 24 | } | |
| 25 | ||
| 26 | [node name="HypercoreDebugContainer" type="GridContainer" parent="HypercoreDebugPanel"] | |
| 27 | margin_left = 4.0 | |
| 28 | margin_top = 6.0 | |
| 29 | margin_right = 543.0 | |
| 30 | margin_bottom = 229.0 | |
| 18 | 31 | columns = 2 |
| 19 | 32 | __meta__ = { |
| 20 | 33 | "_edit_use_anchors_": false |
| 21 | 34 | } |
| 22 | 35 | |
| 23 | [node name="GatewayStartStopButton" type="Button" parent="HypercoreDebugContainer"] | |
| 36 | [node name="GatewayStartStopButton" type="Button" parent="HypercoreDebugPanel/HypercoreDebugContainer"] | |
| 24 | 37 | margin_right = 105.0 |
| 25 | 38 | margin_bottom = 20.0 |
| 26 | 39 | text = "Start Gateway" |
| … | … | @@ -28,7 +41,7 @@ __meta__ = { |
| 28 | 41 | "_edit_use_anchors_": false |
| 29 | 42 | } |
| 30 | 43 | |
| 31 | [node name="Label" type="Label" parent="HypercoreDebugContainer"] | |
| 44 | [node name="Label" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"] | |
| 32 | 45 | margin_left = 109.0 |
| 33 | 46 | margin_top = 3.0 |
| 34 | 47 | margin_right = 187.0 |
| … | … | @@ -37,7 +50,7 @@ __meta__ = { |
| 37 | 50 | "_edit_use_anchors_": false |
| 38 | 51 | } |
| 39 | 52 | |
| 40 | [node name="GatewayStatus" type="Label" parent="HypercoreDebugContainer"] | |
| 53 | [node name="GatewayStatus" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"] | |
| 41 | 54 | margin_top = 24.0 |
| 42 | 55 | margin_right = 105.0 |
| 43 | 56 | margin_bottom = 38.0 |
| … | … | @@ -47,7 +60,7 @@ __meta__ = { |
| 47 | 60 | "_edit_use_anchors_": false |
| 48 | 61 | } |
| 49 | 62 | |
| 50 | [node name="GatewayStatus_Value" type="Label" parent="HypercoreDebugContainer"] | |
| 63 | [node name="GatewayStatus_Value" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"] | |
| 51 | 64 | margin_left = 109.0 |
| 52 | 65 | margin_top = 24.0 |
| 53 | 66 | margin_right = 187.0 |
| … | … | @@ -57,7 +70,7 @@ __meta__ = { |
| 57 | 70 | "_edit_use_anchors_": false |
| 58 | 71 | } |
| 59 | 72 | |
| 60 | [node name="GossipURL" type="Label" parent="HypercoreDebugContainer"] | |
| 73 | [node name="GossipURL" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"] | |
| 61 | 74 | margin_top = 42.0 |
| 62 | 75 | margin_right = 105.0 |
| 63 | 76 | margin_bottom = 56.0 |
| … | … | @@ -67,11 +80,11 @@ __meta__ = { |
| 67 | 80 | "_edit_use_anchors_": false |
| 68 | 81 | } |
| 69 | 82 | |
| 70 | [node name="GossipURL_Value" type="Label" parent="HypercoreDebugContainer"] | |
| 83 | [node name="GossipURL_Value" type="Label" parent="HypercoreDebugPanel/HypercoreDebugContainer"] | |
| 71 | 84 | margin_left = 109.0 |
| 72 | 85 | margin_top = 42.0 |
| 73 | 86 | margin_right = 187.0 |
| 74 | 87 | margin_bottom = 56.0 |
| 75 | 88 | text = "N/A" |
| 76 | 89 | |
| 77 | [connection signal="button_up" from="HypercoreDebugContainer/GatewayStartStopButton" to="." method="_on_GatewayStartStopButton_button_up"] | |
| 90 | [connection signal="button_up" from="HypercoreDebugPanel/HypercoreDebugContainer/GatewayStartStopButton" to="." method="_on_GatewayStartStopButton_button_up"] |