-
Notifications
You must be signed in to change notification settings - Fork 351
Boring window extension
Nako Sung edited this page May 26, 2016
·
2 revisions
extension-boring.js
/// <reference path="typings/ue.d.ts" />
"use strict"
function main() {
const _ = require('lodash')
const UMG = require('UMG')
const I = require('instantiator')
let window
let widget = I(
UMG(JavascriptWindow,
{
SizingRule:'AutoSized',
Title:'Hello JS',
$link:elem => window = elem
},
UMG(Button,
{
OnClicked: finish
},
UMG.text({},"Hello World")
)
)
)
JavascriptSlateWidget.C(widget.TakeWidget()).AddWindow()
function finish() {
if (window) {
window.RequestDestroyWindow()
window = null
}
}
return finish
}
module.exports = function() {
try {
return main()
} catch (e) {
console.error(String(e))
return _ => null
}
}