Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
Image fixes, electron integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarwell committed Aug 18, 2018
1 parent dffed95 commit 867a145
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .electron-vue/build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
asar: true,
dir: path.join(__dirname, '../'),
icon: path.join(__dirname, '../build/icons/icon'),
ignore: /(^\/(src|test|\.[a-z]+|README|yarn|dist\/web))|\.gitkeep/,
ignore: /(^\/(src|test|\.[a-z]+|README|yarn|static|dist\/web))|\.gitkeep/,
out: path.join(__dirname, '../build'),
overwrite: true,
platform: process.env.BUILD_TARGET || 'all'
Expand Down
8 changes: 7 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import {app, BrowserWindow} from 'electron';
import {app, BrowserWindow, Menu} from 'electron';

import AppMenu from './menu';


/**
* Set `__static` path to static files in production
Expand Down Expand Up @@ -26,6 +29,9 @@ function createWindow() {
width: 1000,
});

const menu = Menu.buildFromTemplate(AppMenu.mainMenu());
Menu.setApplicationMenu(menu);

mainWindow.loadURL(winURL);

mainWindow.on('closed', () => {
Expand Down
110 changes: 110 additions & 0 deletions src/main/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
const {app} = require('electron');

/** main app menu */
class AppMenu {
/** construct main Menu template.
* @return {Array} the menu template.
*/
static mainMenu() {
const template = [
{
label: 'File',
submenu: [
{label: 'Connect to Twitch…'},
{label: 'Disconnect from Twitch'},
{label: 'Settings'},
{type: 'separator'},
{role: 'quit'},
],
},
{
label: 'Edit',
submenu: [
{role: 'undo'},
{role: 'redo'},
],
},
{
label: 'View',
submenu: [
{role: 'reload'},
{role: 'forcereload'},
{role: 'toggledevtools'},
{type: 'separator'},
{role: 'resetzoom'},
{role: 'zoomin'},
{role: 'zoomout'},
{type: 'separator'},
{role: 'togglefullscreen'},
],
},
{
role: 'window',
submenu: [
{role: 'minimize'},
{role: 'close'},
],
},
{
role: 'help',
submenu: [
{
label: 'SourceCode @ Github',
click() {
require('electron').shell.openExternal('https://github.com/bmhm/alttpr-vue-twitch-chat-tracker');
},
},
{
label: 'ElectronJs',
click() {
require('electron').shell.openExternal('https://electronjs.org');
},
},
],
},
];

if (process.platform === 'darwin') {
template.unshift({
label: app.getName(),
submenu: [
{role: 'about'},
{type: 'separator'},
{role: 'services', submenu: []},
{type: 'separator'},
{role: 'hide'},
{role: 'hideothers'},
{role: 'unhide'},
{type: 'separator'},
{role: 'quit'},
],
});

// Edit menu
template[1].submenu.push(
{type: 'separator'},
{
label: 'Speech',
submenu: [
{role: 'startspeaking'},
{role: 'stopspeaking'},
],
}
);

// Window menu
template[3].submenu = [
{role: 'close'},
{role: 'minimize'},
{role: 'zoom'},
{type: 'separator'},
{role: 'front'},
];
}

return template;
}
}


export default AppMenu;
18 changes: 9 additions & 9 deletions src/renderer/components/TrackerBoss.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ export default {
state: 'deactivated',
index: 0,
rewards: [
'/static/bosses/reward0.svg',
'/static/bosses/reward1.svg',
'/static/bosses/reward2.svg',
'/static/bosses/reward3.png',
'/static/bosses/reward4.png',
'./static/bosses/reward0.svg',
'./static/bosses/reward1.svg',
'./static/bosses/reward2.svg',
'./static/bosses/reward3.png',
'./static/bosses/reward4.png',
],
medallionIndex: 0,
medallions: [
'/static/bosses/medallion0.png',
'/static/items/bombos.svg',
'/static/bosses/medallion2.png',
'/static/bosses/medallion3.png',
'./static/bosses/medallion0.png',
'./static/items/bombos.svg',
'./static/bosses/medallion2.png',
'./static/bosses/medallion3.png',
],
};
},
Expand Down
112 changes: 56 additions & 56 deletions src/renderer/views/Tracker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,88 +66,88 @@ export default {
data() {
return {
items: [
{id: 'bow', title: 'bow', images: ['/static/items/bow0.png'], update: ItemUpdate.bow},
{id: 'silvers', title: 'silver arrows', update: ItemUpdate.arrows, images: ['/static/items/silvers.png']},
{id: 'bow', title: 'bow', images: ['./static/items/bow0.png'], update: ItemUpdate.bow},
{id: 'silvers', title: 'silver arrows', update: ItemUpdate.arrows, images: ['./static/items/silvers.png']},
{id: 'boomerangs', title: 'Boomerangs', update: ItemUpdate.boomerang, images: [
'/static/items/boomerang0.png',
'/static/items/boomerang1.png',
'/static/items/boomerang2.png',
'./static/items/boomerang0.png',
'./static/items/boomerang1.png',
'./static/items/boomerang2.png',
]},
{id: 'hookshot', title: 'Hookshot', images: ['/static/items/hookshot.png']},
{id: 'mushroom', title: 'mushroom', images: ['/static/items/mushroom.png']},
{id: 'powder', title: 'powder', images: ['/static/items/powder.png']},
{id: 'hookshot', title: 'Hookshot', images: ['./static/items/hookshot.png']},
{id: 'mushroom', title: 'mushroom', images: ['./static/items/mushroom.png']},
{id: 'powder', title: 'powder', images: ['./static/items/powder.png']},
{id: 'firerod', title: 'firerod', images: ['/static/items/firerod.png']},
{id: 'icerod', title: 'icerod', images: ['/static/items/icerod.png']},
{id: 'firerod', title: 'firerod', images: ['./static/items/firerod.png']},
{id: 'icerod', title: 'icerod', images: ['./static/items/icerod.png']},
{id: 'bombos', title: 'bombos', images: ['/static/items/bombos.svg']},
{id: 'ether', title: 'ether', images: ['/static/items/ether.png']},
{id: 'quake', title: 'quake', images: ['/static/items/quake.png']},
{id: 'bombos', title: 'bombos', images: ['./static/items/bombos.svg']},
{id: 'ether', title: 'ether', images: ['./static/items/ether.png']},
{id: 'quake', title: 'quake', images: ['./static/items/quake.png']},
{id: 'lantern', title: 'lantern', images: ['/static/items/lantern.png']},
{id: 'lantern', title: 'lantern', images: ['./static/items/lantern.png']},
/* next 12 */
{id: 'hammer', title: 'hammer', images: ['/static/items/hammer.png']},
{id: 'flute', title: 'flute', images: ['/static/items/flute.png']},
{id: 'hammer', title: 'hammer', images: ['./static/items/hammer.png']},
{id: 'flute', title: 'flute', images: ['./static/items/flute.png']},
{id: 'net', title: 'net', images: ['/static/items/net.png']},
{id: 'book', title: 'book', images: ['/static/items/book.png']},
{id: 'shovel', title: 'shovel', images: ['/static/items/shovel.png']},
{id: 'net', title: 'net', images: ['./static/items/net.png']},
{id: 'book', title: 'book', images: ['./static/items/book.png']},
{id: 'shovel', title: 'shovel', images: ['./static/items/shovel.png']},
{id: 'bottle', title: 'bottle', images: [
'/static/items/bottle0.png',
'/static/items/bottle1.png',
'/static/items/bottle2.png',
'/static/items/bottle3.png',
'/static/items/bottle4.png',
'./static/items/bottle0.png',
'./static/items/bottle1.png',
'./static/items/bottle2.png',
'./static/items/bottle3.png',
'./static/items/bottle4.png',
]},
{id: 'byrna', title: 'byrna', images: ['/static/items/byrna.png']},
{id: 'somaria', title: 'somaria', images: ['/static/items/somaria.png']},
{id: 'byrna', title: 'byrna', images: ['./static/items/byrna.png']},
{id: 'somaria', title: 'somaria', images: ['./static/items/somaria.png']},
{id: 'cape', title: 'cape', images: ['/static/items/cape.png']},
{id: 'mirror', title: 'mirror', images: ['/static/items/mirror.png']},
{id: 'moonpearl', title: 'moonpearl', images: ['/static/items/moonpearl.png']},
{id: 'cape', title: 'cape', images: ['./static/items/cape.png']},
{id: 'mirror', title: 'mirror', images: ['./static/items/mirror.png']},
{id: 'moonpearl', title: 'moonpearl', images: ['./static/items/moonpearl.png']},
{id: 'boots', title: 'boots', images: ['/static/items/boots.png']},
{id: 'boots', title: 'boots', images: ['./static/items/boots.png']},
{id: 'gloves', title: 'gloves', images: [
'/static/items/glove1.png',
'/static/items/glove2.png',
'./static/items/glove1.png',
'./static/items/glove2.png',
]},
{id: 'flippers', title: 'flippers', images: ['/static/items/flippers.png']},
{id: 'flippers', title: 'flippers', images: ['./static/items/flippers.png']},
// {id: 'magic', title: 'magic', images: ['/static/items/magic.png']},
// {id: 'magic', title: 'magic', images: ['./static/items/magic.png']},
{id: 'sword', title: 'sword', images: [
'/static/items/sword1.png',
'/static/items/sword2.png',
'/static/items/sword3.png',
'/static/items/sword4.png',
'./static/items/sword1.png',
'./static/items/sword2.png',
'./static/items/sword3.png',
'./static/items/sword4.png',
]},
{id: 'shield', title: 'shield', images: [
'/static/items/shield1.png',
'/static/items/shield2.png',
'/static/items/shield3.png',
'./static/items/shield1.png',
'./static/items/shield2.png',
'./static/items/shield3.png',
]},
{id: 'mail', title: 'mail', images: [
'/static/items/mail0.png',
'/static/items/mail1.png',
'/static/items/mail2.png',
'./static/items/mail0.png',
'./static/items/mail1.png',
'./static/items/mail2.png',
]},
{id: 'aga1', title: 'Agahnim', images: ['/static/items/aga1.png']},
{id: 'aga1', title: 'Agahnim', images: ['./static/items/aga1.png']},
],
bosses: [
{id: 'knights', title: 'Amos Knights', image: '/static/bosses/knights.png'},
{id: 'lanmolas', title: 'lanmolas', image: '/static/bosses/lanmolas.png'},
{id: 'moldorm', title: 'moldorm', image: '/static/bosses/moldorm.png'},
{id: 'knights', title: 'Amos Knights', image: './static/bosses/knights.png'},
{id: 'lanmolas', title: 'lanmolas', image: './static/bosses/lanmolas.png'},
{id: 'moldorm', title: 'moldorm', image: './static/bosses/moldorm.png'},
/* dark world */
{id: 'helmasaur', title: 'helmasaur', image: '/static/bosses/helmasaur.png', hasMedallion: false},
{id: 'arrghus', title: 'arrghus', image: '/static/bosses/arrghus.png', hasMedallion: false},
{id: 'mothula', title: 'mothula', image: '/static/bosses/mothula.png', hasMedallion: false},
{id: 'blind', title: 'blind', image: '/static/bosses/blind.png', hasMedallion: false},
{id: 'kholdstare', title: 'kholdstare', image: '/static/bosses/kholdstare.png', hasMedallion: false},
{id: 'vitreous', title: 'vitreous', image: '/static/bosses/vitreous.png', hasMedallion: true},
{id: 'trinexx', title: 'Trinexx', image: '/static/bosses/trinexx.png', hasMedallion: true},
{id: 'helmasaur', title: 'helmasaur', image: './static/bosses/helmasaur.png', hasMedallion: false},
{id: 'arrghus', title: 'arrghus', image: './static/bosses/arrghus.png', hasMedallion: false},
{id: 'mothula', title: 'mothula', image: './static/bosses/mothula.png', hasMedallion: false},
{id: 'blind', title: 'blind', image: './static/bosses/blind.png', hasMedallion: false},
{id: 'kholdstare', title: 'kholdstare', image: './static/bosses/kholdstare.png', hasMedallion: false},
{id: 'vitreous', title: 'vitreous', image: './static/bosses/vitreous.png', hasMedallion: true},
{id: 'trinexx', title: 'Trinexx', image: './static/bosses/trinexx.png', hasMedallion: true},
],
};
},
Expand Down

0 comments on commit 867a145

Please sign in to comment.