mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-03 19:04:40 +01:00
Refer to child nodes via their path in code directly
This helps making the scene self-contained.
This commit is contained in:
parent
5f375377f7
commit
df0215a8ab
2 changed files with 8 additions and 30 deletions
30
main.gd
30
main.gd
|
@ -6,30 +6,16 @@ var dragged = null
|
|||
var level_set = "bottom-up"
|
||||
var current_level = 0
|
||||
|
||||
export(NodePath) var terminal_path
|
||||
onready var terminal = get_node(terminal_path)
|
||||
onready var terminal = $HBoxContainer/RightSide/Terminal
|
||||
onready var input = terminal.input
|
||||
onready var output = terminal.output
|
||||
|
||||
export(NodePath) var goal_repository_path_2
|
||||
export(NodePath) var active_repository_path_2
|
||||
onready var goal_repository = get_node(goal_repository_path_2)
|
||||
onready var active_repository = get_node(active_repository_path_2)
|
||||
|
||||
export(NodePath) var level_select_path
|
||||
onready var level_select = get_node(level_select_path)
|
||||
|
||||
export(NodePath) var next_level_button_path
|
||||
onready var next_level_button = get_node(next_level_button_path)
|
||||
|
||||
export(NodePath) var level_name_path
|
||||
onready var level_name = get_node(level_name_path)
|
||||
|
||||
export(NodePath) var level_description_path
|
||||
onready var level_description = get_node(level_description_path)
|
||||
|
||||
export(NodePath) var level_congrats_path
|
||||
onready var level_congrats = get_node(level_congrats_path)
|
||||
onready var goal_repository = $HBoxContainer/Repositories/GoalRepository
|
||||
onready var active_repository = $HBoxContainer/Repositories/ActiveRepository
|
||||
onready var level_select = $HBoxContainer/RightSide/TopStuff/Menu/LevelSelect
|
||||
onready var next_level_button = $HBoxContainer/RightSide/TopStuff/Menu/NextLevelButton
|
||||
onready var level_name = $HBoxContainer/RightSide/TopStuff/LevelPanel/LevelName
|
||||
onready var level_description = $HBoxContainer/RightSide/TopStuff/LevelPanel/Text/LevelDescription
|
||||
onready var level_congrats = $HBoxContainer/RightSide/TopStuff/LevelPanel/Text/LevelCongrats
|
||||
|
||||
func _ready():
|
||||
# Initialize level select.
|
||||
|
|
|
@ -29,14 +29,6 @@ script = ExtResource( 2 )
|
|||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
terminal_path = NodePath("HBoxContainer/RightSide/Terminal")
|
||||
goal_repository_path_2 = NodePath("HBoxContainer/Repositories/GoalRepository")
|
||||
active_repository_path_2 = NodePath("HBoxContainer/Repositories/ActiveRepository")
|
||||
level_select_path = NodePath("HBoxContainer/RightSide/TopStuff/Menu/LevelSelect")
|
||||
next_level_button_path = NodePath("HBoxContainer/RightSide/TopStuff/Menu/NextLevelButton")
|
||||
level_name_path = NodePath("HBoxContainer/RightSide/TopStuff/LevelPanel/LevelName")
|
||||
level_description_path = NodePath("HBoxContainer/RightSide/TopStuff/LevelPanel/Text/LevelDescription")
|
||||
level_congrats_path = NodePath("HBoxContainer/RightSide/TopStuff/LevelPanel/Text/LevelCongrats")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
anchor_right = 1.0
|
||||
|
|
Loading…
Reference in a new issue