Skip to content

Commit

Permalink
Merge branch 'dscalzi-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekCornerGH committed May 22, 2020
2 parents a7e06b7 + 052db24 commit 8265a26
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 228 deletions.
28 changes: 10 additions & 18 deletions app/assets/css/launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -1233,34 +1233,26 @@ input:checked + .toggleSwitchSlider:before {
height: 30px;
}

/* File input for file selection. */
.settingsFileSelSel {
width: 0px;
height: 0px;
opacity: 0;
}
.settingsFileSelSel::-webkit-file-upload-button {
display: none;
}

/* Wrapper label to add a custom style to the file input. */
.settingsFileSelLabel {
border-left: 0px;
/* File selection button. */
.settingsFileSelButton {
border: 0px;
border-radius: 0px 3px 3px 0px;
font-size: 12px;
padding: 0px 5px;
cursor: pointer;
display: flex;
align-items: center;
background: rgba(126, 126, 126, 0.57);
transition: 0.25s ease;
white-space: nowrap;
outline: none;
}
.settingsFileSelLabel:hover,
.settingsFileSelLabel:focus,
.settingsFileSelSel:focus ~ #settingsJavaExecLabel {
.settingsFileSelButton:hover,
.settingsFileSelButton:focus {
text-shadow: 0px 0px 20px white;
}
.settingsFileSelButton:active {
text-shadow: 0px 0px 20px rgba(255, 255, 255, 0.75);
color: rgba(255, 255, 255, 0.75);
}

/* Description for the file selector. */
.settingsFileSelDesc {
Expand Down
39 changes: 29 additions & 10 deletions app/assets/js/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,34 @@ bindSettingsSelect()


function bindFileSelectors(){
for(let ele of document.getElementsByClassName('settingsFileSelSel')){
if(ele.id === 'settingsJavaExecSel'){
ele.onchange = (e) => {
ele.previousElementSibling.value = ele.files[0].path
populateJavaExecDetails(ele.previousElementSibling.value)
for(let ele of document.getElementsByClassName('settingsFileSelButton')){

ele.onclick = async e => {
const isJavaExecSel = ele.id === 'settingsJavaExecSel'
const directoryDialog = ele.hasAttribute('dialogDirectory') && ele.getAttribute('dialogDirectory') == 'true'
const properties = directoryDialog ? ['openDirectory', 'createDirectory'] : ['openFile']

const options = {
properties
}
} else {
ele.onchange = (e) => {
ele.previousElementSibling.value = ele.files[0].path

if(ele.hasAttribute('dialogTitle')) {
options.title = ele.getAttribute('dialogTitle')
}

if(isJavaExecSel && process.platform === 'win32') {
options.filters = [
{ name: 'Executables', extensions: ['exe'] },
{ name: 'All Files', extensions: ['*'] }
]
}

const res = await remote.dialog.showOpenDialog(remote.getCurrentWindow(), options)
if(!res.canceled) {
ele.previousElementSibling.value = res.filePaths[0]
if(isJavaExecSel) {
populateJavaExecDetails(ele.previousElementSibling.value)
}
}
}
}
Expand Down Expand Up @@ -694,7 +713,7 @@ function bindDropinModFileSystemButton(){
const fsBtn = document.getElementById('settingsDropinFileSystemButton')
fsBtn.onclick = () => {
DropinModUtil.validateDir(CACHE_SETTINGS_MODS_DIR)
shell.openItem(CACHE_SETTINGS_MODS_DIR)
shell.openPath(CACHE_SETTINGS_MODS_DIR)
}
fsBtn.ondragenter = e => {
e.dataTransfer.dropEffect = 'move'
Expand Down Expand Up @@ -818,7 +837,7 @@ function bindShaderpackButton() {
spBtn.onclick = () => {
const p = path.join(CACHE_SETTINGS_INSTANCE_DIR, 'shaderpacks')
DropinModUtil.validateDir(p)
shell.openItem(p)
shell.openPath(p)
}
spBtn.ondragenter = e => {
e.dataTransfer.dropEffect = 'move'
Expand Down
4 changes: 4 additions & 0 deletions app/assets/js/scripts/uicore.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ if(!isDev){
loggerAutoUpdaterSuccess.log('New update available', info.version)

if(process.platform === 'darwin'){
<<<<<<< HEAD
info.darwindownload = `https://github.com/GeekCornerGH/RTMC-Launcher/releases/download/v${info.version}/rtmc-launcher-${info.version}.dmg`
=======
info.darwindownload = `https://github.com/dscalzi/HeliosLauncher/releases/download/v${info.version}/helioslauncher-setup-${info.version}.dmg`
>>>>>>> 8726638a235bae927cb150365b72c6ffdd23d854
showUpdateUI(info)
}

Expand Down
4 changes: 4 additions & 0 deletions app/login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
</div>
<div id="loginOptions">
<span class="loginSpanDim">
<<<<<<< HEAD
<a href="https://help.mojang.com/customer/en/portal/articles/329524-change-or-forgot-password">mot de passe oublié?</a>
=======
<a href="https://my.minecraft.net/en-us/password/forgot/">forgot password?</a>
>>>>>>> 8726638a235bae927cb150365b72c6ffdd23d854
</span>
<label id="checkmarkContainer">
<input id="loginRememberOption" type="checkbox" checked>
Expand Down
8 changes: 8 additions & 0 deletions app/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@
</svg>
</div>
<input class="settingsFileSelVal" id="settingsJavaExecVal" type="text" value="null" cValue="JavaExecutable" disabled>
<<<<<<< HEAD
<input class="settingsFileSelSel" id="settingsJavaExecSel" type="file" <%= process.platform === 'win32' ? 'accept=.exe' : '' %>>
<label class="settingsFileSelLabel" for="settingsJavaExecSel">Choisir un exécutable</label>
=======
<button class="settingsFileSelButton" id="settingsJavaExecSel" dialogTitle="Select Java Executable" dialogDirectory="false">Choose File</button>
>>>>>>> 8726638a235bae927cb150365b72c6ffdd23d854
</div>
</div>
<div class="settingsFileSelDesc">L'exécutable de Java est vérifié avant que le jeu ne se lance.. <strong>Requires Java 8 x64.</strong><br>L'emplacement devrait se terminer comme ceci: <strong>bin<%= process.platform === 'win32' ? '\\javaw.exe' : '/java' %></strong>.</div>
Expand Down Expand Up @@ -261,8 +265,12 @@
</svg>
</div>
<input class="settingsFileSelVal" type="text" value="null" cValue="DataDirectory" disabled>
<<<<<<< HEAD
<input class="settingsFileSelSel" id="settingsDataDirSel" type="file" webkitdirectory>
<label class="settingsFileSelLabel" for="settingsDataDirSel">Choisir un dossier</label>
=======
<button class="settingsFileSelButton" dialogTitle="Select Data Directory" dialogDirectory="true">Choose Folder</button>
>>>>>>> 8726638a235bae927cb150365b72c6ffdd23d854
</div>
</div>
<div class="settingsFileSelDesc">Tous les fichiers de jeu et Java seront enregistrés dans ce dossier.</div>
Expand Down
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Requirements
const {app, BrowserWindow, ipcMain} = require('electron')
const Menu = require('electron').Menu
const { app, BrowserWindow, ipcMain, Menu } = require('electron')
const autoUpdater = require('electron-updater').autoUpdater
const ejse = require('ejs-electron')
const fs = require('fs')
Expand Down
Loading

0 comments on commit 8265a26

Please sign in to comment.