Skip to content

Commit

Permalink
Added Tray Icon & Fixed Auto Updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Matwix committed Nov 9, 2020
1 parent 3a66688 commit 9768d0f
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/assets/css/launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -3809,7 +3809,7 @@ input:checked + .toggleSwitchSlider:before {
/* Stationary image for the spinner. */
#loadCenterImage {
position: absolute;
width: 277px;
width: 150px;
height: auto;
}

Expand Down
Binary file modified app/assets/images/LoadingSeal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/SealCircle.ico
Binary file not shown.
Binary file modified app/assets/images/SealCircle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/js/isdev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
const getFromEnv = parseInt(process.env.ELECTRON_IS_DEV, 10) === 1
const isEnvSet = 'ELECTRON_IS_DEV' in process.env

module.exports = isEnvSet ? getFromEnv : (process.defaultApp || /node_modules[\\/]electron[\\/]/.test(process.execPath))
module.exports = isEnvSet ? getFromEnv : (process.defaultApp || /node_modules[\\/]electron[\\/]/.test(process.execPath))
8 changes: 7 additions & 1 deletion app/assets/js/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,7 @@ const settingsUpdateChangelogTitle = settingsTabUpdate.getElementsByClassName('s
const settingsUpdateChangelogText = settingsTabUpdate.getElementsByClassName('settingsChangelogText')[0]
const settingsUpdateChangelogCont = settingsTabUpdate.getElementsByClassName('settingsChangelogContainer')[0]
const settingsUpdateActionButton = document.getElementById('settingsUpdateActionButton')
const playButton = document.getElementById('launch_button')

/**
* Update the properties of the update action button.
Expand Down Expand Up @@ -1299,8 +1300,13 @@ function populateSettingsUpdateInformation(data){
shell.openExternal(data.darwindownload)
})
} else {
settingsUpdateButtonStatus('Downloading..', true)
settingsUpdateButtonStatus('Download from GitHub<span style="font-size: 10px;color: gray;text-shadow: none !important;">Close the launcher and run the exe to update.</span>', false, () => {
shell.openExternal(data.windownload)
})
}

playButton.disabled = true

} else {
settingsUpdateTitle.innerHTML = 'You Are Running the Latest Version'
settingsUpdateChangelogCont.style.display = 'none'
Expand Down
16 changes: 9 additions & 7 deletions app/assets/js/scripts/uicore.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ if(!isDev){
break
case 'update-available':
loggerAutoUpdaterSuccess.log('New update available', info.version)

if(process.platform === 'darwin'){
info.darwindownload = `https://github.com/dscalzi/HeliosLauncher/releases/download/v${info.version}/helioslauncher-setup-${info.version}.dmg`
info.darwindownload = `https://github.com/Matwix/ARPGLauncher/releases/download/v${info.version}/AncientRPG.Launcher-setup-${info.version}.dmg`
showUpdateUI(info)
}


info.windownload = `https://github.com/Matwix/ARPGLauncher/releases/download/v${info.version}/AncientRPG.Launcher-setup-${info.version}.exe`

populateSettingsUpdateInformation(info)
break
case 'update-downloaded':
Expand Down Expand Up @@ -97,7 +99,7 @@ if(!isDev){
* allowPrerelease. If we are running a prerelease version, then
* this will always be set to true, regardless of the current value
* of val.
*
*
* @param {boolean} val The new allow prerelease value.
*/
function changeAllowPrerelease(val){
Expand Down Expand Up @@ -187,7 +189,7 @@ document.addEventListener('readystatechange', function () {
document.getElementById('launch_progress').style.width = 170.8
document.getElementById('launch_details_right').style.maxWidth = 170.8
document.getElementById('launch_progress_label').style.width = 53.21

}

}, false)
Expand All @@ -203,11 +205,11 @@ $(document).on('click', 'a[href^="http"]', function(event) {
/**
* Opens DevTools window if you hold (ctrl + shift + i).
* This will crash the program if you are using multiple
* DevTools, for example the chrome debugger in VS Code.
* DevTools, for example the chrome debugger in VS Code.
*/
document.addEventListener('keydown', function (e) {
if((e.key === 'I' || e.key === 'i') && e.ctrlKey && e.shiftKey){
let window = remote.getCurrentWindow()
window.toggleDevTools()
}
})
})
2 changes: 1 addition & 1 deletion app/landing.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</a>
</div>
<div class="mediaContainer" id="settingsMediaContainer">
<a href="https://discord.com/invite/HVmWy3ms" class="mediaURL" id="discordURL">
<a href="https://discord.gg/Hd3ufCDCeg" class="mediaURL" id="discordURL">
<button class="mediaButton" id="discordMediaButton">
<svg id="discordSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
<g>
Expand Down
5 changes: 2 additions & 3 deletions dev-app-update.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
owner: Matwix
repo: ARPGLauncher
provider: github
provider: generic
url: https://arpg.vtc.gg
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ app.on('activate', () => {

let tray = null
app.whenReady().then(() => {
tray = new Tray('app/assets/images/SealCircle.ico')
tray = new Tray(getPlatformIcon('SealCircle'))
const contextMenu = Menu.buildFromTemplate([
{ label: 'Show/Hide Window', click() { if (win.isVisible()) { win.hide() } else { win.show() } } },
{ label: 'Exit Launcher', click() { win.close(); } }
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arpglauncher",
"version": "2.1.1",
"version": "2.1.2",
"productName": "AncientRPG Launcher",
"description": "Modded Minecraft Launcher",
"author": "AncientRPG",
Expand Down Expand Up @@ -38,11 +38,19 @@
"devDependencies": {
"cross-env": "^7.0.2",
"electron": "^10.1.2",
"electron-builder": "^22.8.0",
"electron-builder": "^22.9.1",
"eslint": "^7.9.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dscalzi/HeliosLauncher.git"
"build": {
"publish": [
{
"provider": "generic",
"url": "https://arpg.vtc.gg"
}
],
"appId": "gg.vtc.arpg",
"nsis": {
"perMachine": true
}
}
}

0 comments on commit 9768d0f

Please sign in to comment.