new build gui select
This commit is contained in:
22
Scripts/build_manager.gd
Normal file
22
Scripts/build_manager.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends Node
|
||||
|
||||
@onready var DoubleBeds = preload("res://Scenes/Prefabs/DoubleBeds.tscn")
|
||||
@onready var Pot = preload("res://Scenes/Prefabs/Pot.tscn")
|
||||
|
||||
var selected_object_id: int
|
||||
|
||||
|
||||
var global_y = 2.903
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
print(DoubleBeds)
|
||||
|
||||
func get_preview_object():
|
||||
var selected_object
|
||||
match selected_object_id:
|
||||
0:
|
||||
selected_object = DoubleBeds
|
||||
1:
|
||||
selected_object = Pot
|
||||
return selected_object
|
||||
1
Scripts/build_manager.gd.uid
Normal file
1
Scripts/build_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://672n647s560w
|
||||
@@ -31,8 +31,11 @@ func _mouse_exit() -> void:
|
||||
hide_preview()
|
||||
|
||||
func show_preview():
|
||||
previewObject = beds.instantiate()
|
||||
#previewObject = beds.instantiate()
|
||||
previewObject = BuildManager.get_preview_object().instantiate()
|
||||
|
||||
areas[0].add_child(previewObject)
|
||||
#previewObject.global_position.y = BuildManager.global_y
|
||||
buildTransparentPreivew.visible = false
|
||||
Global.preview_created.emit()
|
||||
|
||||
|
||||
10
Scripts/button_select_build.gd
Normal file
10
Scripts/button_select_build.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Button
|
||||
|
||||
|
||||
@export var id: int
|
||||
|
||||
|
||||
func _on_pressed() -> void:
|
||||
BuildManager.selected_object_id = id
|
||||
print(BuildManager.selected_object_id)
|
||||
|
||||
1
Scripts/button_select_build.gd.uid
Normal file
1
Scripts/button_select_build.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://3bsllk6udire
|
||||
15
Scripts/ui/panel_build_select.gd
Normal file
15
Scripts/ui/panel_build_select.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Panel
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
self.visible = false
|
||||
Global.enter_build_mode.connect(_on_enter_build_mode)
|
||||
Global.exit_build_mode.connect(_on_exit_build_mode)
|
||||
|
||||
|
||||
func _on_enter_build_mode():
|
||||
self.visible = true
|
||||
|
||||
|
||||
func _on_exit_build_mode():
|
||||
self.visible = false
|
||||
1
Scripts/ui/panel_build_select.gd.uid
Normal file
1
Scripts/ui/panel_build_select.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bqh6f4f4sc4ba
|
||||
Reference in New Issue
Block a user