Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekCornerGH committed Oct 8, 2021
2 parents 06108e9 + f9e4fd8 commit 782638f
Show file tree
Hide file tree
Showing 18 changed files with 5,733 additions and 3,477 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build/release

on: push

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- name: Check out Git repository
uses: actions/checkout@v1

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14

- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{ secrets.github_token }}

# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
14
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017-2021 Daniel D. Scalzi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Téléchargez le launcher depuis l'onglet [Releases](https://github.com/GeekCorn
| Platform | File |
| -------- | ---- |
| Windows x64 | `RTMC-launcher-setup-VERSION.exe` |
| macOS | `RTMC-launcher-setup-VERSION.dmg` |
| macOS | `RTMC-launcher-setup-VERSION-ACHITECTURE.dmg` |
| Linux x64 | `RTMC-launcher-linux-VERSION.AppImage` |

---
Expand Down
2 changes: 1 addition & 1 deletion app/assets/js/configmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.e
const dataPath = path.join(sysRoot, '.RTMC')

// Forked processes do not have access to electron, so we have this workaround.
const launcherDir = process.env.CONFIG_DIRECT_PATH || require('electron').remote.app.getPath('userData')
const launcherDir = process.env.CONFIG_DIRECT_PATH || require('@electron/remote').app.getPath('userData')

/**
* Retrieve the absolute path of the launcher directory.
Expand Down
13 changes: 8 additions & 5 deletions app/assets/js/dropinmodutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ exports.addDropinMods = function (files, modsdir) {
* @param {string} modsDir The path to the mods directory.
* @param {string} fullName The fullName of the discovered mod to delete.
*
* @returns {boolean} True if the mod was deleted, otherwise false.
* @returns {Promise.<boolean>} True if the mod was deleted, otherwise false.
*/
exports.deleteDropinMod = function (modsDir, fullName) {
const res = shell.moveItemToTrash(path.join(modsDir, fullName))
if (!res) {
exports.deleteDropinMod = async function(modsDir, fullName){
try {
await shell.trashItem(path.join(modsDir, fullName))
return true
} catch(error) {
shell.beep()
console.error('Error deleting drop-in mod.', error)
return false
}
return res
}

/**
Expand Down
13 changes: 4 additions & 9 deletions app/assets/js/scripts/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ function updateSelectedAccount(authUser) {
if (authUser.displayName != null) {
username = authUser.displayName
}
if (authUser.uuid != null) {
document.getElementById('avatarContainer').style.backgroundImage = `url('https://crafatar.com/renders/body/${authUser.uuid}?scale=3&default=MHF_Steve&overlay')`
if(authUser.uuid != null){
document.getElementById('avatarContainer').style.backgroundImage = `url('https://mc-heads.net/body/${authUser.uuid}/right')`
}
}
user_text.innerHTML = username
Expand Down Expand Up @@ -202,12 +202,7 @@ const refreshMojangStatuses = async function () {
for (let i = 0; i < statuses.length; i++) {
const service = statuses[i]

// Mojang API is broken for sessionserver. https://bugs.mojang.com/browse/WEB-2303
/*if (service.service === 'sessionserver.mojang.com') {
service.status = 'green'
}*/

if (service.essential) {
if(service.essential){
tooltipEssentialHTML += `<div class="mojangStatusContainer">
<span class="mojangStatusIcon" style="color: ${Mojang.statusToHex(service.status)};">&#8226;</span>
<span class="mojangStatusName">${service.name}</span>
Expand Down Expand Up @@ -1261,4 +1256,4 @@ function loadNews() {
})
})
})
}
}
2 changes: 1 addition & 1 deletion app/assets/js/scripts/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function populateAccountListings(){
let htmlString = ''
for(let i=0; i<accounts.length; i++){
htmlString += `<button class="accountListing" uuid="${accounts[i].uuid}" ${i===0 ? 'selected' : ''}>
<img src="https://crafatar.com/renders/head/${accounts[i].uuid}?scale=2&default=MHF_Steve&overlay">
<img src="https://mc-heads.net/head/${accounts[i].uuid}/40">
<div class="accountListingName">${accounts[i].displayName}</div>
</button>`
}
Expand Down
6 changes: 3 additions & 3 deletions app/assets/js/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ function populateAuthAccounts(){
const acc = authAccounts[val]
authAccountStr += `<div class="settingsAuthAccount" uuid="${acc.uuid}">
<div class="settingsAuthAccountLeft">
<img class="settingsAuthAccountImage" alt="${acc.displayName}" src="https://crafatar.com/renders/body/${acc.uuid}?scale=3&default=MHF_Steve&overlay">
<img class="settingsAuthAccountImage" alt="${acc.displayName}" src="https://mc-heads.net/body/${acc.uuid}/60">
</div>
<div class="settingsAuthAccountRight">
<div class="settingsAuthAccountDetails">
Expand Down Expand Up @@ -805,9 +805,9 @@ function resolveServerCodesForUI(){
function bindDropinModsRemoveButton(){
const sEls = settingsModsContainer.querySelectorAll('[remmod]')
Array.from(sEls).map((v, index, arr) => {
v.onclick = () => {
v.onclick = async () => {
const fullName = v.getAttribute('remmod')
const res = DropinModUtil.deleteDropinMod(CACHE_SETTINGS_MODS_DIR, fullName)
const res = await DropinModUtil.deleteDropinMod(CACHE_SETTINGS_MODS_DIR, fullName)
if(res){
document.getElementById(fullName).remove()
} else {
Expand Down
11 changes: 6 additions & 5 deletions app/assets/js/scripts/uicore.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
* modules, excluding dependencies.
*/
// Requirements
const $ = require('jquery')
const {ipcRenderer, remote, shell, webFrame} = require('electron')
const isDev = require('./assets/js/isdev')
const LoggerUtil = require('./assets/js/loggerutil')
const $ = require('jquery')
const {ipcRenderer, shell, webFrame} = require('electron')
const remote = require('@electron/remote')
const isDev = require('./assets/js/isdev')
const LoggerUtil = require('./assets/js/loggerutil')

const loggerUICore = LoggerUtil('%c[UICore]', 'color: #000668; font-weight: bold')
const loggerAutoUpdater = LoggerUtil('%c[AutoUpdater]', 'color: #000668; font-weight: bold')
Expand Down Expand Up @@ -50,7 +51,7 @@ if(!isDev){
loggerAutoUpdaterSuccess.log('Nouvelle version disponible', info.version)

if(process.platform === 'darwin'){
info.darwindownload = `https://github.com/GeekCornerGH/RTMC-launcher/releases/download/v${info.version}/RTMC-launcher-${info.version}.dmg`
info.darwindownload = `https://github.com/GeekCornerGH/RTMC-launcher/releases/download/v${info.version}/RTMC-launcher-${info.version}${process.arch === 'arm64' ? 'arm64' : ''}.dmg`
showUpdateUI(info)
}

Expand Down
4 changes: 2 additions & 2 deletions app/login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<div id="loginOptions">
<span class="loginSpanDim">
<a href="https://help.mojang.com/customer/en/portal/articles/329524-change-or-forgot-password">mot de passe oublié?</a>
<a href="https://minecraft.net/password/forgot/"> mot de passe oublié?</a>
</span>
<label id="checkmarkContainer">
<input id="loginRememberOption" type="checkbox" checked>
Expand All @@ -55,7 +55,7 @@
</button>
<div id="loginDisclaimer">
<span class="loginSpanDim" id="loginRegisterSpan">
<a href="https://minecraft.net/en-us/store/minecraft/">Besoin d'acheter Minecraft?</a>
<a href="https://minecraft.net/store/minecraft-java-edition/">besoin d'acheter Minecraft?</a>
</span>
<p class="loginDisclaimerText">Le mot de passe est transmis de façon crypté chez Mojang et n'est pas stocké chez RTMC.</p>
<p class="loginDisclaimerText">Nous ne sommes pas affilié à Mojang AB.</p>
Expand Down
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function getCurrentPlatform(){
builder.build({
targets: (process.argv[2] != null && Platform[process.argv[2]] != null ? Platform[process.argv[2]] : getCurrentPlatform()).createTarget(),
config: {
appId: '',
appId: 'rtmclauncher',
productName: 'RTMC Launcher',
artifactName: '${productName}-setup-${version}.${ext}',
copyright: 'Copyright © 2018-2020 Daniel Scalzi et GeekCorner',
Expand Down
51 changes: 51 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
appId: 'helioslauncher'
productName: 'Helios Launcher'
artifactName: '${productName}-setup-${version}.${ext}'

copyright: 'Copyright © 2018-2021 Daniel Scalzi'

asar: true
compression: 'maximum'

files:
- '!{dist,.gitignore,.vscode,docs,dev-app-update.yml,.travis.yml,.nvmrc,.eslintrc.json,build.js}'

extraResources:
- 'libraries'

# Windows Configuration
win:
target:
- target: 'nsis'
arch: 'x64'

# Windows Installer Configuration
nsis:
oneClick: false
perMachine: false
allowElevation: true
allowToChangeInstallationDirectory: true

# macOS Configuration
mac:
target:
- target: 'dmg'
arch:
- 'x64'
- 'arm64'
artifactName: '${productName}-setup-${version}-${arch}.${ext}'
category: 'public.app-category.games'

# Linux Configuration
linux:
target: 'AppImage'
maintainer: 'Daniel Scalzi'
vendor: 'Daniel Scalzi'
synopsis: 'Modded Minecraft Launcher'
description: 'Custom launcher which allows users to join modded servers. All mods, configurations, and updates are handled automatically.'
category: 'Game'


directories:
buildResources: 'build'
output: 'dist'
16 changes: 7 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const remoteMain = require('@electron/remote/main')
remoteMain.initialize()

// Requirements
const { app, BrowserWindow, ipcMain, Menu } = require('electron')
const autoUpdater = require('electron-updater').autoUpdater
Expand All @@ -6,7 +9,7 @@ const fs = require('fs')
const isDev = require('./app/assets/js/isdev')
const path = require('path')
const semver = require('semver')
const url = require('url')
const { pathToFileURL } = require('url')

// Setup auto updater.
function initAutoUpdater(event, data) {
Expand Down Expand Up @@ -104,20 +107,15 @@ function createWindow() {
webPreferences: {
preload: path.join(__dirname, 'app', 'assets', 'js', 'preloader.js'),
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
worldSafeExecuteJavaScript: true
contextIsolation: false
},
backgroundColor: '#171614'
})
remoteMain.enable(win.webContents)

ejse.data('bkid', Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)))

win.loadURL(url.format({
pathname: path.join(__dirname, 'app', 'app.ejs'),
protocol: 'file:',
slashes: true
}))
win.loadURL(pathToFileURL(path.join(__dirname, 'app', 'app.ejs')).toString())

/*win.once('ready-to-show', () => {
win.show()
Expand Down
Binary file modified libraries/java/PackXZExtract.jar
Binary file not shown.
Loading

0 comments on commit 782638f

Please sign in to comment.