Compare commits

...

6 Commits
v0.3 ... master

Author SHA1 Message Date
Damillora 2dba9271a9 fix icon on non-Mac 2017-07-07 14:57:43 +07:00
Damillora 73608d17e1 tweak menu behavior on non-Mac 2017-07-07 14:53:35 +07:00
Damillora 718bae29ab add checks for macOS 2017-07-07 14:44:26 +07:00
Damillora ef12775d84 add million live help 2017-07-04 02:32:21 +07:00
Damillora 18878a20d6 more fix on menus 2017-07-04 02:02:17 +07:00
Damillora 766edbc6c4 fix menu 2017-07-04 01:59:09 +07:00
5 changed files with 24 additions and 14 deletions

View File

@ -182,5 +182,5 @@ module.exports.navitemplate = function(win){
module.exports.setdock = function(win) {
const dockMenu = Menu.buildFromTemplate(module.exports.navitemplate(win))
app.dock.setMenu(dockMenu);
if(process.platform == 'darwin' ) app.dock.setMenu(dockMenu);
}

View File

@ -13,9 +13,11 @@ const options = {userAgent: 'Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6
function createWindow () {
// Create the browser window.
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'ic_launcher.png')})
win = new BrowserWindow({width: 480, height: 600,icon: path.join(__dirname, 'icon.png')})
setdock.setdock(win)
Menu.setApplicationMenu(themenu(win));
if(process.platform == 'darwin') { Menu.setApplicationMenu(themenu(win)); }
else { win.setMenu(themenu(win));
}
// and load the index.html of the app.
win.loadURL('http://pf.gree.net/58737',options);
// Open the DevTools.

27
menu.js
View File

@ -7,13 +7,6 @@ const options = {userAgent: 'Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6
module.exports = function(win){
const template = [
{
label: "File",
submenu: [
{label: 'Preferences',click(){prefman.showPreferences()}},
],
visible: process.platform !== 'darwin'
},
{
label: 'Edit',
submenu: [
@ -57,12 +50,16 @@ module.exports = function(win){
label: 'Help',
role: 'help',
submenu: [
{
label: "Million Live! Help",
click() { win.loadURL("http://imas.gree-apps.net/app/index.php/help",options)}
},
{
label: "Project Homepage",
click(){shell.openExternal("https://github.com/Damillora/MillionHopes")}
},
{
label: 'About SoundCleod',
label: 'About Million Hopes',
click() {
prefman.showAbout();
},
@ -72,7 +69,6 @@ module.exports = function(win){
]
}
]
if (process.platform === 'darwin') {
template.unshift({
label: app.getName(),
@ -92,7 +88,7 @@ module.exports = function(win){
})
// Edit menu
template[1].submenu.push(
template[2].submenu.push(
{type: 'separator'},
{
label: 'Speech',
@ -111,6 +107,17 @@ module.exports = function(win){
{type: 'separator'},
{role: 'front'}
]
} else
{
template.unshift({
label: "File",
submenu: [
{label: 'Preferences',click(){prefman.showPreferences()}},
{type: 'separator'},
{label: 'Exit', click(){ app.quit() }},
],
visible: process.platform !== 'darwin'
})
}
const themenu = Menu.buildFromTemplate(template);

View File

@ -1,7 +1,7 @@
{
"name": "MillionHopes",
"productName": "Million Hopes",
"version": "0.3.0",
"version": "0.3.1",
"description": "A thin wrapper for the game THE IDOLM@STER: Million Live!, using Electron.",
"main": "main.js",
"devDependencies": {

View File

@ -10,6 +10,7 @@ require('electron-debug')();
function showPreferences_int(){
if(!preferencesWindow){
preferencesWindow = new BrowserWindow({width: 800, height: 600})
if (process.platform !== 'darwin') preferencesWindow.setMenu(null);
preferencesWindow.loadURL(url.format({
pathname: path.join(__dirname, 'preferences.html'),
protocol: 'file:',