Repository navigation
Expand file tree
/
Copy pathstart.html
More file actions
82 lines (72 loc) · 1.58 KB
/
Copy pathstart.html
File metadata and controls
82 lines (72 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<html>
<head>
<meta charset="UTF-8">
<title>mirigation</title>
</head>
<body>
<script>
var gui = require('nw.gui')
, win = gui.Window.get()
// , config = require('config/config')
, config = {}
// console.log(config)
, port = config.port || 3001
gui.App.setProxyConfig('localhost:5050')
// gui.App.clearCache()
var os = require('os')
, systemInfo = '(' + os.hostname() + ')'
+ '(' + os.type() + ')'
+ '(' + os.arch() + ')'
+ '(' + os.release() + ')'
var tray = new gui.Tray({ title: 'Tray', icon: 'public/img/idol.png' })
, menu = new gui.Menu()
, item = {}
function startGame () {
gui.Window.open(
'http://127.0.0.1:'+port+'/standalone'
, { frame: false
, toolbar: false
, width: 800
, height: 510
, min_width: 800
, min_height: 510
}
)
}
function startInfo (gameWin) {
var infoWin = gui.Window.open(
'http://127.0.0.1:'+port+'/backboned'
, { frame: false
, toolbar: false
, width: 400
, height: 600
}
)
if (gameWin) {
var x = gameWin.x + gameWin.width
, y = gameWin.y + gameWin.height
infoWin.moveTo(x, y)
}
}
item.quit = new gui.MenuItem(
{ label: 'quit'
, click: function () {
gui.App.quit()
}
}
)
item.start = new gui.MenuItem(
{ label: 'start'
, click: function () {
startGame()
startInfo()
}
}
)
for (var i in item) {
menu.append(item[i])
}
tray.menu = menu
</script>
</body>
</html>