diff options
| author | dam <dam@gudinoff> | 2022-03-27 16:57:14 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-03-27 16:57:14 +0000 |
| commit | f6369eaee39abe3d360ba42278a5a2a1d166f5af (patch) | |
| tree | 1fec29cbf9de9537efec5a4b7ddd870e4fc2f512 /logic/popup.gd | |
| parent | a6d836d53a09c5b2abedccba51ac428fcfc74379 (diff) | |
| download | surgery-log-f6369eaee39abe3d360ba42278a5a2a1d166f5af.tar.zst surgery-log-f6369eaee39abe3d360ba42278a5a2a1d166f5af.zip | |
Implemented prototype of option set list component.
Diffstat (limited to 'logic/popup.gd')
| -rw-r--r-- | logic/popup.gd | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/logic/popup.gd b/logic/popup.gd new file mode 100644 index 0000000..1b1813a --- /dev/null +++ b/logic/popup.gd @@ -0,0 +1,36 @@ +extends Control +class_name ModalPopup + +var control : Control + + +func _init(): + anchor_right = 1.0 + anchor_bottom = 1.0 + +func popup_control(item: Control): + control = item + control.connect("visibility_changed", self, "closed") + var background = $background + control.anchor_left = background.anchor_left + control.anchor_top = background.anchor_top + control.anchor_right = background.anchor_right + control.anchor_bottom = background.anchor_bottom + control.margin_left = 20 + control.margin_top = 20 + control.margin_right = -20 + control.margin_bottom = -20 + add_child(control) + show() + control.show() +# self.visible = true + + +func closed(): + if control.visible == true: + return + control.disconnect("visibility_changed", self, "closed") + remove_child(control) + self.hide() + + |
