Harden home exits and interior presentation
This commit is contained in:
parent
76b4f19e4d
commit
ac82a28f3b
4 changed files with 114 additions and 32 deletions
|
|
@ -5,26 +5,34 @@ signal placement_mode_requested(mode: int)
|
|||
signal rotate_requested
|
||||
signal store_requested
|
||||
signal cancel_requested
|
||||
signal exit_requested
|
||||
|
||||
var _mode_button: Button
|
||||
var _selection_label: Label
|
||||
var _rotate_button: Button
|
||||
var _store_button: Button
|
||||
var _clear_button: Button
|
||||
var _exit_button: Button
|
||||
var _mode: PlayerHomeState.PlacementMode = PlayerHomeState.PlacementMode.GRID
|
||||
var _interactive: bool = true
|
||||
var _selection_active: bool = false
|
||||
var _active: bool = false
|
||||
var _menu_obscured: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_build_ui()
|
||||
hide()
|
||||
_refresh_visibility()
|
||||
|
||||
|
||||
func set_active(active: bool) -> void:
|
||||
if visible == active:
|
||||
return
|
||||
visible = active
|
||||
_active = active
|
||||
_refresh_visibility()
|
||||
|
||||
|
||||
func set_menu_obscured(obscured: bool) -> void:
|
||||
_menu_obscured = obscured
|
||||
_refresh_visibility()
|
||||
|
||||
|
||||
func set_interactive(interactive: bool) -> void:
|
||||
|
|
@ -59,13 +67,17 @@ func report_status(message: String) -> void:
|
|||
_selection_label.text = message
|
||||
|
||||
|
||||
func _refresh_visibility() -> void:
|
||||
visible = _active and not _menu_obscured
|
||||
|
||||
|
||||
func _build_ui() -> void:
|
||||
set_anchors_preset(Control.PRESET_TOP_RIGHT)
|
||||
offset_left = -500.0
|
||||
offset_left = -610.0
|
||||
offset_top = 0.0
|
||||
offset_right = 0.0
|
||||
offset_bottom = 106.0
|
||||
custom_minimum_size = Vector2(500.0, 0.0)
|
||||
custom_minimum_size = Vector2(610.0, 0.0)
|
||||
z_index = 85
|
||||
mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
var panel_style: StyleBoxFlat = UtilityPageStyle.panel_style()
|
||||
|
|
@ -102,6 +114,9 @@ func _build_ui() -> void:
|
|||
_store_button.pressed.connect(store_requested.emit)
|
||||
_clear_button = _add_tool_button(row, "clear", "clear selection", 82.0)
|
||||
_clear_button.pressed.connect(cancel_requested.emit)
|
||||
_exit_button = _add_tool_button(row, "Exit RV", "exit the RV", 100.0)
|
||||
_exit_button.name = "ExitRVButton"
|
||||
_exit_button.pressed.connect(exit_requested.emit)
|
||||
_selection_label = Label.new()
|
||||
_selection_label.text = "use held decor to place; click or drag to edit"
|
||||
_selection_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue