2023-09-21 20:01:14 -04:00
|
|
|
const { Revealer } = ags.Widget;
|
|
|
|
const { closeWindow, openWindow } = ags.App;
|
|
|
|
|
|
|
|
export const PopUp = ({name, child, transition = 'slide_down', ...params}) => Revealer({
|
|
|
|
...params,
|
|
|
|
// FIXME: popups don't work with revealers
|
2023-09-22 01:34:36 -04:00
|
|
|
setup: () => {
|
|
|
|
setTimeout(() => {
|
|
|
|
closeWindow(name);
|
|
|
|
}, 100);
|
|
|
|
|
|
|
|
// my eyes hurt
|
|
|
|
if (name == 'overview') {
|
|
|
|
setTimeout(() => {
|
|
|
|
openWindow(name);
|
|
|
|
closeWindow(name);
|
|
|
|
}, 700);
|
|
|
|
}
|
|
|
|
},
|
2023-09-21 20:01:14 -04:00
|
|
|
transition,
|
|
|
|
transitionDuration: 500,
|
|
|
|
connections: [[ags.App, (revealer, currentName, visible) => {
|
|
|
|
if (currentName === name) {
|
|
|
|
revealer.reveal_child = visible;
|
|
|
|
|
2023-09-22 01:34:36 -04:00
|
|
|
if (visible && name !== 'overview')
|
2023-09-21 20:01:14 -04:00
|
|
|
openWindow('closer');
|
|
|
|
}
|
|
|
|
}]],
|
|
|
|
child: child,
|
|
|
|
});
|