1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-21 13:03:13 +00:00
Pixelorama/src/UI/PerspectiveEditor/PointCollapseContainer.gd

42 lines
1.1 KiB
GDScript3
Raw Normal View History

Added the Perspective editor (#806) * Added Perspective Editor * removed unintended changes * Removed unintended changes * removed un-intended changes * Delete Axes.tscn * Delete Axis.gd * Removed MouseGuides from editor I will add them separately * Added MouseGuides * Some changes * Fixed some things * added mouse guide * make MouseGuides remember last setting * don't move if dialog is open * Dont move tracker guides if dialog is open * UI improvement to editor * Update VanishingPoint.gd * UI Improvement * Minor Color Improvements * fixed a bug This was causing a crash * Some UI Changes * Improve UI some more * fix typo * Added Undo/Redo and improved UI * Formatting * formatting * formatting * formatting * Fix Definition out of order * Fix Definition out of order * formatting * formatting * fix Duplicate error * Fix some things * Some UI Changes * Some code refinement * Removed un-needed lines * Some code refinement * Some more UI Changes * Changes, Changes and Changes * Delete LineButton.gd * Delete LineButton.tscn * Delete PerspectiveEditor.gd * Delete PerspectiveEditor.tscn * Delete PointCollapseContainer.gd * Delete PerspectiveLine.tscn * Delete PerspectiveLine.gd * Changed boundary separators to ColorRects * make the guide update more frequently * make default color have full alpha * Dim the boundaries based on luminance * typo * Formatting * Formatting * formatting i forgot to do * Delete VanishingPoint.gd * Delete VanishingPoint.tscn * Fixed rouge collapsible container --------- Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-02-12 18:20:53 +05:00
extends Button
# This is NOT related to the CollapsibleContainer class (though it behaves similarly)
# i did it like this because the "Content" is part of a different node
export var point_text := "" setget _set_text
export var visible_content := false setget _set_visible_content
onready var content = $"%Content"
func _ready() -> void:
_set_visible(pressed)
content.connect("visibility_changed", self, "_child_visibility_changed")
func _set_text(value: String) -> void:
$Label.text = value
rect_min_size = $Label.rect_size
func _set_visible_content(value: bool) -> void:
visible_content = value
pressed = value
func _on_Button_toggled(button_pressed: bool) -> void:
_set_visible(button_pressed)
func _set_visible(pressed: bool) -> void:
if pressed:
$TextureRect.rect_rotation = 0
else:
$TextureRect.rect_rotation = -90
content.visible = pressed
# Checks if a child becomes visible from another source and ensures
# it remains invisible if the button is not pressed
func _child_visibility_changed() -> void:
if not pressed:
content.visible = false