Kaynağa Gözat

work done on browse menu

galo 1 yıl önce
ebeveyn
işleme
cf9e5edf1c
4 değiştirilmiş dosya ile 48 ekleme ve 35 silme
  1. 3 4
      BrowseColumn.gd
  2. 43 29
      BrowseColumn.tscn
  3. 1 1
      BrowserListClient.gd
  4. 1 1
      main.tscn

+ 3 - 4
BrowseColumn.gd

@@ -1,15 +1,14 @@
-extends HBoxContainer
+extends Control
 
 export var clickable = true
 
 func _ready():
-	for i in get_children():
-		i.connect('button_down',self,'_on_Button_button_down')
+	$Button.connect('button_down',self,'_on_Button_button_down')
 
 func _on_Button_button_down():
 	if clickable:
 		var dict = {}
-		for x in get_children():
+		for x in $HBoxContainer.get_children():
 			dict[x.name] = x.text
 		print(dict)
 	pass # Replace with function body.

+ 43 - 29
BrowseColumn.tscn

@@ -2,54 +2,68 @@
 
 [ext_resource path="res://BrowseColumn.gd" type="Script" id=1]
 
-[node name="BrowseColumn" type="HBoxContainer"]
+[node name="BrowseColumn" type="PanelContainer"]
 anchor_right = 1.0
 margin_bottom = 14.0
 script = ExtResource( 1 )
 
-[node name="Name" type="Button" parent="."]
-margin_right = 103.0
-margin_bottom = 20.0
+[node name="HBoxContainer" type="HBoxContainer" parent="."]
+margin_left = 7.0
+margin_top = 7.0
+margin_right = 633.0
+margin_bottom = 27.0
+size_flags_horizontal = 3
+
+[node name="Name" type="Label" parent="HBoxContainer"]
+margin_top = 3.0
+margin_right = 101.0
+margin_bottom = 17.0
 size_flags_horizontal = 3
 text = "Name"
-flat = true
 
-[node name="IP" type="Button" parent="."]
-margin_left = 107.0
-margin_right = 210.0
-margin_bottom = 20.0
+[node name="IP" type="Label" parent="HBoxContainer"]
+margin_left = 105.0
+margin_top = 3.0
+margin_right = 206.0
+margin_bottom = 17.0
 size_flags_horizontal = 3
 text = "IP"
-flat = true
 
-[node name="Port" type="Button" parent="."]
-margin_left = 214.0
-margin_right = 318.0
-margin_bottom = 20.0
+[node name="Port" type="Label" parent="HBoxContainer"]
+margin_left = 210.0
+margin_top = 3.0
+margin_right = 311.0
+margin_bottom = 17.0
 size_flags_horizontal = 3
 text = "Port"
-flat = true
 
-[node name="Gamemode" type="Button" parent="."]
-margin_left = 322.0
-margin_right = 425.0
-margin_bottom = 20.0
+[node name="Gamemode" type="Label" parent="HBoxContainer"]
+margin_left = 315.0
+margin_top = 3.0
+margin_right = 416.0
+margin_bottom = 17.0
 size_flags_horizontal = 3
 text = "Gamemode"
-flat = true
 
-[node name="Map" type="Button" parent="."]
-margin_left = 429.0
-margin_right = 532.0
-margin_bottom = 20.0
+[node name="Map" type="Label" parent="HBoxContainer"]
+margin_left = 420.0
+margin_top = 3.0
+margin_right = 521.0
+margin_bottom = 17.0
 size_flags_horizontal = 3
 text = "Map"
-flat = true
 
-[node name="Ping" type="Button" parent="."]
-margin_left = 536.0
-margin_right = 640.0
-margin_bottom = 20.0
+[node name="Ping" type="Label" parent="HBoxContainer"]
+margin_left = 525.0
+margin_top = 3.0
+margin_right = 626.0
+margin_bottom = 17.0
 size_flags_horizontal = 3
 text = "Ping"
+
+[node name="Button" type="Button" parent="."]
+margin_left = 7.0
+margin_top = 7.0
+margin_right = 633.0
+margin_bottom = 27.0
 flat = true

+ 1 - 1
BrowserListClient.gd

@@ -17,6 +17,6 @@ func _ready():
 		var newone = browsecolumn.instance()
 		for z in dict[x].keys():
 			print(z)
-			newone.get_node(z).text = str(dict[x][z])
+			newone.get_node('HBoxContainer').get_node(z).text = str(dict[x][z])
 		$PanelContainer/Table.add_child(newone)
 	pass # Replace with function body.

+ 1 - 1
main.tscn

@@ -74,7 +74,7 @@ render_target_v_flip = true
 [node name="Goblin" type="AnimatedSprite" parent="Textures/Goblin3"]
 modulate = Color( 1, 0, 0, 1 )
 frames = SubResource( 5 )
-frame = 1
+frame = 3
 speed_scale = 1.2
 playing = true
 offset = Vector2( 32, 32 )