Skip to content

Commit

Permalink
map buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcastrocouto committed Aug 17, 2022
1 parent 06c420e commit 4fc961c
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 21 deletions.
23 changes: 19 additions & 4 deletions prototype/ui/button/menu_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ export var value:String

var blue_team_button:Node
var red_team_button:Node
var small_map_button:Node
var large_map_button:Node
var play_button:Node


func _ready():
game = get_tree().get_current_scene()
yield(get_tree(), "idle_frame")

var buttons = game.ui.main_menu.get_node("container/menu_team_buttons")
blue_team_button = buttons.get_node("blue_team_button")
red_team_button = buttons.get_node("red_team_button")
var menu_buttons = game.ui.main_menu.get_node("container/menu_team_buttons")
blue_team_button = menu_buttons.get_node("blue_team_button")
red_team_button = menu_buttons.get_node("red_team_button")
var map_buttons = game.ui.main_menu.get_node("container/menu_map_buttons")
small_map_button = map_buttons.get_node("small_map_button")
large_map_button = map_buttons.get_node("large_map_button")
play_button = game.ui.main_menu.get_node("container/play_button")




func button_down():
match self.value:

Expand Down Expand Up @@ -58,6 +62,17 @@ func button_down():
blue_team_button.disabled = false
red_team_button.disabled = true

"small":
game.maps.current_map = "1lane_map"
large_map_button.pressed = false
large_map_button.disabled = false
small_map_button.disabled = true

"large":
game.maps.current_map = "3lane_map"
small_map_button.pressed = false
small_map_button.disabled = false
large_map_button.disabled = true

"menu":
game.paused = true
Expand Down
100 changes: 83 additions & 17 deletions prototype/ui/ui.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -336,20 +336,17 @@ anchor_bottom = 0.5
[node name="main_menu" type="ItemList" parent="mid"]
pause_mode = 2
margin_left = -200.0
margin_top = -140.0
margin_top = -180.0
margin_right = 200.0
margin_bottom = 140.0
margin_bottom = 180.0
custom_styles/bg = SubResource( 15 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="container" type="VBoxContainer" parent="mid/main_menu"]
margin_left = 16.0
margin_top = 16.0
margin_right = 384.0
margin_bottom = 264.0
custom_constants/separation = 8
custom_constants/separation = 3

[node name="menu_title" type="Label" parent="mid/main_menu/container"]
margin_right = 368.0
Expand All @@ -362,29 +359,29 @@ __meta__ = {
}

[node name="separator" type="HSeparator" parent="mid/main_menu/container"]
margin_top = 26.0
margin_top = 21.0
margin_right = 368.0
margin_bottom = 50.0
margin_bottom = 45.0
custom_constants/separation = 24
__meta__ = {
"_edit_use_anchors_": false
}

[node name="team_choose" type="Label" parent="mid/main_menu/container"]
margin_top = 58.0
margin_top = 48.0
margin_right = 368.0
margin_bottom = 74.0
margin_bottom = 64.0
custom_fonts/font = SubResource( 7 )
text = "choose your team"
text = "choose team"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="menu_team_buttons" type="HBoxContainer" parent="mid/main_menu/container"]
margin_top = 82.0
margin_top = 67.0
margin_right = 368.0
margin_bottom = 142.0
margin_bottom = 127.0
custom_constants/separation = 20
alignment = 1
__meta__ = {
Expand Down Expand Up @@ -430,18 +427,85 @@ visible = false
text = "2"

[node name="separator2" type="HSeparator" parent="mid/main_menu/container"]
margin_top = 150.0
margin_top = 130.0
margin_right = 368.0
margin_bottom = 174.0
margin_bottom = 154.0
custom_constants/separation = 24
__meta__ = {
"_edit_use_anchors_": false
}

[node name="map_choose" type="Label" parent="mid/main_menu/container"]
margin_top = 157.0
margin_right = 368.0
margin_bottom = 173.0
custom_fonts/font = SubResource( 7 )
text = "choose map"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="menu_map_buttons" type="HBoxContainer" parent="mid/main_menu/container"]
margin_top = 176.0
margin_right = 368.0
margin_bottom = 236.0
custom_constants/separation = 20
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="small_map_button" parent="mid/main_menu/container/menu_map_buttons" instance=ExtResource( 15 )]
margin_left = 14.0
margin_right = 174.0
rect_min_size = Vector2( 160, 60 )
custom_styles/focus = SubResource( 41 )
disabled = true
pressed = true
text = "small"
icon = null
value = "small"

[node name="name" parent="mid/main_menu/container/menu_map_buttons/small_map_button" index="0"]
visible = false
text = "blue"

[node name="hint" parent="mid/main_menu/container/menu_map_buttons/small_map_button" index="2"]
visible = false
text = "1"

[node name="large_map_button" parent="mid/main_menu/container/menu_map_buttons" instance=ExtResource( 15 )]
margin_left = 194.0
margin_right = 354.0
rect_min_size = Vector2( 160, 60 )
focus_mode = 2
custom_styles/focus = SubResource( 42 )
text = "large"
icon = null
value = "large"

[node name="name" parent="mid/main_menu/container/menu_map_buttons/large_map_button" index="0"]
visible = false
text = "red"

[node name="hint" parent="mid/main_menu/container/menu_map_buttons/large_map_button" index="2"]
visible = false
text = "2"

[node name="separator3" type="HSeparator" parent="mid/main_menu/container"]
margin_top = 239.0
margin_right = 368.0
margin_bottom = 263.0
custom_constants/separation = 24
__meta__ = {
"_edit_use_anchors_": false
}

[node name="play_button" parent="mid/main_menu/container" instance=ExtResource( 15 )]
margin_top = 182.0
margin_top = 266.0
margin_right = 368.0
margin_bottom = 242.0
margin_bottom = 326.0
rect_min_size = Vector2( 360, 60 )
custom_styles/pressed = SubResource( 26 )
custom_styles/focus = SubResource( 49 )
Expand Down Expand Up @@ -1000,6 +1064,8 @@ text = "y"
[editable path="top_right/shop/scroll_container/container/consumable_items/item_button3"]
[editable path="mid/main_menu/container/menu_team_buttons/blue_team_button"]
[editable path="mid/main_menu/container/menu_team_buttons/red_team_button"]
[editable path="mid/main_menu/container/menu_map_buttons/small_map_button"]
[editable path="mid/main_menu/container/menu_map_buttons/large_map_button"]
[editable path="mid/main_menu/container/play_button"]
[editable path="bot_right/controls/scroll_container/container/controls_buttons/teleport_button"]
[editable path="bot_right/controls/scroll_container/container/controls_buttons/lane_button"]
Expand Down

0 comments on commit 4fc961c

Please sign in to comment.