Browse Source

Only allow player switch with 100% charge

master
Luna 7 years ago
parent
commit
f1afc61275
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      scripts/player.gd

+ 11
- 7
scripts/player.gd View File

@ -162,14 +162,18 @@ func _process(delta):
spawn()
switch_hero_interface()
if "record" in player_info:
recording.time += delta
func switch_hero_interface():
# Interface needs the mouse!
toggle_mouse_capture()
# Pause so if we have walls and such nothing funny happens
get_tree().set_pause(true)
var interface = preload("res://scenes/HeroSelect.tscn").instance()
add_child(interface)
interface.get_node("Confirm").connect("pressed", self, "switch_hero_master")
if switch_charge >= 100:
# Interface needs the mouse!
toggle_mouse_capture()
# Pause so if we have walls and such nothing funny happens
get_tree().set_pause(true)
var interface = preload("res://scenes/HeroSelect.tscn").instance()
add_child(interface)
interface.get_node("Confirm").connect("pressed", self, "switch_hero_master")
func switch_hero_master():
rpc("switch_hero", get_node("HeroSelect/Hero").get_selected_id())


Loading…
Cancel
Save