diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2021-12-24 21:11:39 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2021-12-24 21:11:39 +0100 |
commit | 7cb4290601010459b09376396c7833ec391c25bf (patch) | |
tree | be6243e49ad764f90418e6d41641f99209da2b29 /scripts/gui_bottom_bar.gd | |
parent | e9598b88841374301646a7115253ab38ac904e4c (diff) |
working on it
Diffstat (limited to 'scripts/gui_bottom_bar.gd')
-rw-r--r-- | scripts/gui_bottom_bar.gd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/gui_bottom_bar.gd b/scripts/gui_bottom_bar.gd new file mode 100644 index 0000000..0a7b7b8 --- /dev/null +++ b/scripts/gui_bottom_bar.gd @@ -0,0 +1,41 @@ +extends Control + +var _in_editor : bool +var voxel_picker : Control +var map_tool_picker : Control +var turret_picker : Control + +var _load_turrets : Node + +var gui : Control + +func _fetch (): + if gui == null: gui = get_parent() + if voxel_picker == null: voxel_picker = $voxels + if map_tool_picker == null: map_tool_picker = $map_tools + if turret_picker == null: turret_picker = $turrets + + var root = get_tree().root.get_child(0) + if _load_turrets == null: + _load_turrets = root.get_node("saveload").get_node("load_turrets") + +func build (): + _fetch() + turret_picker.build(_load_turrets.get_base_turrets()) + voxel_picker.build() + map_tool_picker.build() + +func refresh (in_editor : bool): + _fetch() + _in_editor = in_editor + + if _in_editor: + voxel_picker.visible = true + map_tool_picker.visible = true + else: + voxel_picker.visible = false + map_tool_picker.visible = false + + turret_picker.refresh(gui.player.sel) + voxel_picker.refresh(gui.player.sel) + map_tool_picker.refresh(gui.player.sel) |