v0.1.0 - Test

This commit is contained in:
Cyanoure
2023-07-20 04:05:31 +02:00
parent d89b270c20
commit e553ff87d0
36 changed files with 5490 additions and 5143 deletions

View File

@@ -377,7 +377,7 @@ body, button {
}
/* Main login container. */
#loginContainer {
.loginContainer {
position: relative;
display: flex;
justify-content: center;
@@ -389,50 +389,50 @@ body, button {
}
/* Login cancel button styles. */
#loginCancelContainer {
.loginCancelContainer {
position: absolute;
top: 5%;
right: 5%;
}
/* Login cancel button styles. */
#loginCancelButton {
.loginCancelButton {
background: none;
border: none;
outline: none;
cursor: pointer;
transition: 0.25s ease;
}
#loginCancelButton:hover #loginCancelIcon,
#loginCancelButton:hover #loginCancelText,
#loginCancelButton:focus #loginCancelIcon,
#loginCancelButton:focus #loginCancelText {
.loginCancelButton:hover .loginCancelIcon,
.loginCancelButton:hover .loginCancelText,
.loginCancelButton:focus .loginCancelIcon,
.loginCancelButton:focus .loginCancelText {
text-shadow: 0px 0px 20px white;
}
#loginCancelButton:hover #loginCancelIcon,
#loginCancelButton:focus #loginCancelIcon {
.loginCancelButton:hover .loginCancelIcon,
.loginCancelButton:focus .loginCancelIcon {
box-shadow: 0px 0px 20px white;
}
#loginCancelButton:active #loginCancelIcon,
#loginCancelButton:active #loginCancelText {
.loginCancelButton:active .loginCancelIcon,
.loginCancelButton:active .loginCancelText {
text-shadow: 0px 0px 20px rgba(255, 255, 255, 0.75);
color: rgba(255, 255, 255, 0.75);
border-color: rgba(255, 255, 255, 0.75);
}
#loginCancelButton:active #loginCancelIcon {
.loginCancelButton:active .loginCancelIcon {
box-shadow: 0px 0px 20px rgba(255, 255, 255, 0.75);
}
#loginCancelButton:disabled {
.loginCancelButton:disabled {
pointer-events: none;
}
#loginCancelButton:disabled #loginCancelIcon,
#loginCancelButton:disabled #loginCancelText {
.loginCancelButton:disabled .loginCancelIcon,
.loginCancelButton:disabled .loginCancelText {
color: rgba(255, 255, 255, 0.75);
border-color: rgba(255, 255, 255, 0.75);
}
/* The X in a circle icon for the cancel button. */
#loginCancelIcon {
.loginCancelIcon {
border-radius: 50%;
border: 1px solid white;
box-sizing: border-box;
@@ -445,13 +445,13 @@ body, button {
transition: 0.25s ease;
}
/* Text for the login cancel button. */
#loginCancelText {
.loginCancelText {
font-size: 15px;
transition: 0.25s ease;
}
/* Login content wrapper. */
#loginContent {
.loginContent {
display: flex;
justify-content: center;
align-items: center;
@@ -460,7 +460,7 @@ body, button {
}
/* Login form. */
#loginForm {
.loginForm {
display: flex;
flex-direction: column;
justify-content: center;
@@ -468,35 +468,31 @@ body, button {
}
/* Login form anchor styles. */
#loginForm a {
.loginForm a {
font-size: 12px;
color: #848484;
font-weight: bold;
text-decoration: none;
transition: 0.25s ease;
}
#loginForm a:hover,
#loginForm a:focus {
.loginForm a:hover,
.loginForm a:focus {
color: #a2a2a2;
outline: none;
}
#loginForm a:active {
.loginForm a:active {
color: #8b8b8b;
}
/* Logo on login form. */
#loginImageSeal {
border-radius: 50%;
border: 2px solid #cad7e1;
background: rgba(1, 2, 1, 0.5);
.loginImageSeal {
height: 125px;
width: 125px;
box-shadow: 0px 0px 10px 0px rgb(0, 0, 0);
margin-bottom: 20px;
}
/* Header on login view. */
#loginSubheader {
.loginSubheader {
font-family: 'Avenir Medium';
margin-bottom: 25px;
font-size: 12px;
@@ -518,6 +514,7 @@ body, button {
fill: #fff;
height: 20px;
width: 20px;
margin-bottom: 5px;
}
/* Span which displays errors related to login field content. */
@@ -603,13 +600,13 @@ body, button {
}
/* Remember option text. */
#loginRememberText {
.loginRememberText {
padding-right: 10px;
transition: 0.25s ease;
}
/* Login button styles. */
#loginButton {
.loginButton {
background: none;
font-weight: bold;
letter-spacing: 2px;
@@ -621,23 +618,23 @@ body, button {
right: -20px;
transition: 0.5s ease;
}
#loginButton:disabled {
.loginButton:disabled {
color: rgba(255, 255, 255, 0.75);
pointer-events: none;
}
#loginButton[loading] {
.loginButton[loading] {
color: #fff;
}
#loginButton:hover,
#loginButton:focus {
.loginButton:hover,
.loginButton:focus {
text-shadow: 0px 0px 20px #fff;
outline: none;
}
#loginButton:active {
.loginButton:active {
color: #c7c7c7;
text-shadow: 0px 0px 20px #c7c7c7;
}
#loginSVG {
.loginButtonSVG {
-webkit-transform: translate3d(0, 0, 0);
overflow: visible;
transform: rotate(90deg);
@@ -646,31 +643,31 @@ body, button {
width: 20px;
height: 20px;
}
#loginButton:hover #loginSVG,
#loginButton:focus #loginSVG {
.loginButton:hover .loginButtonSVG,
.loginButton:focus .loginButtonSVG {
-webkit-filter: drop-shadow(0px 0px 2px #fff);
}
#loginButton:active #loginSVG .arrowLine {
.loginButton:active .loginButtonSVG .arrowLine {
stroke: #c7c7c7;
}
#loginButton:active #loginSVG {
.loginButton:active .loginButtonSVG {
-webkit-filter: drop-shadow(0px 0px 2px #c7c7c7);
}
#loginButton:disabled #loginSVG .arrowLine {
.loginButton:disabled .loginButtonSVG .arrowLine {
stroke: rgba(255, 255, 255, 0.75);
}
#loginButtonContent {
.loginButtonContent {
display: flex;
align-items: center;
}
#loginButton .circle-loader,
#loginButton[loading] #loginSVG {
.loginButton .circle-loader,
.loginButton[loading] .loginButtonSVG {
display: none;
}
#loginButton[loading] .circle-loader,
#loginButton #loginSVG {
.loginButton[loading] .circle-loader,
.loginButton .loginButtonSVG {
display: initial;
}
@@ -772,7 +769,7 @@ body, button {
}*/
/* Disclaimer container. */
#loginDisclaimer {
.loginDisclaimer {
display: flex;
flex-direction: column;
justify-content: center;
@@ -780,7 +777,7 @@ body, button {
}
/* Add spacing between register anchor and disclaimer. */
#loginRegisterSpan {
.loginRegisterSpan {
margin-bottom: 5px;
}
@@ -831,7 +828,7 @@ body, button {
border-color: #a2a2a2;
}
/* On keydown, darken the checkbox a bit. */
#checkmarkContainer input:active ~ *:not(#loginRememberText) {
#checkmarkContainer input:active ~ *:not(.loginRememberText) {
color: #8d8d8d;
border-color: #8d8d8d;
}
@@ -861,7 +858,7 @@ body, button {
}
/*
#login_filter {
.login_filter {
height: calc(100% - 22px);
width: 100%;
z-index: 9000;
@@ -994,7 +991,7 @@ body, button {
.loginOptionButton {
background: rgba(0, 0, 0, 0.25);
border: 1px solid rgba(126, 126, 126, 0.57);
border-radius: 3px;
border-radius: 15px;
height: 50px;
width: 100%;
text-align: left;
@@ -1012,12 +1009,12 @@ body, button {
text-shadow: 0px 0px 20px white;
}
#loginOptionCancelContainer {
.loginOptionCancelContainer {
position: absolute;
bottom: -100px;
}
#loginOptionCancelButton {
.loginOptionCancelButton {
background: none;
border: none;
padding: 2px 0px;
@@ -1028,15 +1025,15 @@ body, button {
outline: none;
transition: 0.25s ease;
}
#loginOptionCancelButton:hover,
#loginOptionCancelButton:focus {
.loginOptionCancelButton:hover,
.loginOptionCancelButton:focus {
text-shadow: 0px 0px 20px lightgrey;
}
#loginOptionCancelButton:active {
.loginOptionCancelButton:active {
text-shadow: 0px 0px 20px rgba(211, 211, 211, 0.75);
color: rgba(211, 211, 211, 0.75);
}
#loginOptionCancelButton:disabled {
.loginOptionCancelButton:disabled {
color: rgba(211, 211, 211, 0.75);
pointer-events: none;
}
@@ -2456,7 +2453,7 @@ input:checked + .toggleSwitchSlider:before {
/* Upper content container. */
#landingContainer > #upper {
position: relative;
transition: top 2s ease;
transition: top 0.5s ease;
top: 0px;
height: 77%;
display: flex;
@@ -2486,7 +2483,7 @@ input:checked + .toggleSwitchSlider:before {
}
#landingContainer > #lower > #left {
position: relative;
transition: top 2s ease;
transition: top 0.5s ease;
top: 0px;
height: 100%;
width: 33%;
@@ -2502,7 +2499,7 @@ input:checked + .toggleSwitchSlider:before {
}
#landingContainer > #lower > #center {
position: relative;
transition: top 2s ease;
transition: top 0.5s ease;
top: 0px;
height: 100%;
width: 34%;
@@ -2512,12 +2509,12 @@ input:checked + .toggleSwitchSlider:before {
#landingContainer > #lower > #center #content {
position: relative;
z-index: 500;
transition: top 2s ease;
transition: top 0.5s ease;
top: 10px;
}
#landingContainer > #lower > #right {
position: relative;
transition: top 2s ease;
transition: top 0.5s ease;
top: 0px;
height: 100%;
width: 33%;
@@ -2536,7 +2533,7 @@ input:checked + .toggleSwitchSlider:before {
top: 100%;
height: 100%;
width: 100%;
transition: top 2s ease;
transition: top 0.5s ease;
display: flex;
align-items: flex-end;
justify-content: center;
@@ -2858,7 +2855,6 @@ input:checked + .toggleSwitchSlider:before {
height: 70px;
width: auto;
position: relative;
border: 2px solid white;
box-sizing: border-box;
border-radius: 50%;
}
@@ -2979,6 +2975,14 @@ input:checked + .toggleSwitchSlider:before {
box-shadow: 0px 0px 10px 0px rgb(0, 0, 0);
overflow: hidden;
position: relative;
}
/* User profile avatar image */
#avatarImage {
width: 50px;
height: 50px;
margin: 8px;
margin-bottom: -58px;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
@@ -3181,7 +3185,7 @@ input:checked + .toggleSwitchSlider:before {
/* Style for a general label on the bottom of the landing view. */
.bot_label {
font-size: 9px;
font-size: 10px;
letter-spacing: 1px;
font-weight: bold;
text-shadow: 0px 0px 0px #bebcbb;
@@ -3209,7 +3213,7 @@ input:checked + .toggleSwitchSlider:before {
/* Span which displays the player count of the selected server. */
#player_count {
color: #949494;
font-size: 8px;
font-size: 11px;
font-weight: 900;
text-shadow: 0px 0px 20px #949494;
margin-left: 10px;
@@ -3687,6 +3691,7 @@ input:checked + .toggleSwitchSlider:before {
cursor: pointer;
position: relative;
background: rgba(131, 131, 131, 0.25);
border-radius: 15px;
}
.serverListing[selected] {
cursor: default;
@@ -3747,7 +3752,6 @@ input:checked + .toggleSwitchSlider:before {
/* Server listing image. */
.serverListingImg {
margin: 0px 10px 0px 5px;
border: 1px solid #fff;
height: 50px;
width: 50px;
}
@@ -3791,9 +3795,9 @@ input:checked + .toggleSwitchSlider:before {
align-items: center;
line-height: 12px;
height: 12px;
border-radius: 2px;
border-radius: 6px;
background: rgba(31, 140, 11, 0.8);
padding: 0px 2px;
padding: 0px 5px;
}
/* The revision version of the server's manifest. */
@@ -3930,14 +3934,6 @@ input:checked + .toggleSwitchSlider:before {
justify-content: center;
}
/* Spinner container. */
#loadSpinnerContainer {
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
/* Stationary image for the spinner. */
#loadCenterImage {
position: absolute;
@@ -3945,13 +3941,6 @@ input:checked + .toggleSwitchSlider:before {
height: auto;
}
/* Rotating image for the spinner. */
#loadSpinnerImage {
width: 280px;
height: auto;
z-index: 400;
}
/* Rotating animation for the spinner. */
@keyframes rotating {
from {
@@ -3965,4 +3954,9 @@ input:checked + .toggleSwitchSlider:before {
/* Class which is applied when the spinner image is spinning. */
.rotating {
animation: rotating 10s linear infinite;
}
/* Extra by Chronika */
#landingPlayerLabel {
margin-left: -30px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 KiB

View File

@@ -308,8 +308,55 @@ exports.validateSelected = async function(){
if(current.type === 'microsoft') {
return await validateSelectedMicrosoftAccount()
} else if(current.type === 'offline') {
return true
} else {
return await validateSelectedMojangAccount()
}
}
/**
* Generate Offline UUID
* @param {string} username
* @returns {string} UUID of offline player
*/
exports.generateOfflineUUID = function(username) {
const uuidNamespace = 'OfflinePlayer:'
// Create a SHA-1 hash of the UUID namespace concatenated with the username
const md5 = require('crypto').createHash('md5')
md5.update(uuidNamespace + username)
const hash = md5.digest('hex')
// Insert dashes to form the UUID format
const uuid = hash.substring(0, 8) + '-' +
hash.substring(8, 12) + '-' +
hash.substring(12, 16) + '-' +
hash.substring(16, 20) + '-' +
hash.substring(20)
return uuid
}
/**
* Add an offline account.
*
* @param {string} username The account username.
* @returns {<Object>} Promise which resolves the resolved authenticated account object.
*/
exports.addOfflineAccount = function(username) {
const uuid = exports.generateOfflineUUID(username)
const ret = ConfigManager.addOfflineAuthAccount(uuid, username)
ConfigManager.save()
return ret
}
/**
* Remove offline account
* @param {string} uuid
*/
exports.removeOfflineAccount = function(uuid) {
ConfigManager.removeAuthAccount(uuid)
ConfigManager.save()
}

View File

@@ -7,7 +7,7 @@ const logger = LoggerUtil.getLogger('ConfigManager')
const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME)
const dataPath = path.join(sysRoot, '.helioslauncher')
const dataPath = path.join(sysRoot, '.chronikamc')
const launcherDir = require('@electron/remote').app.getPath('userData')
@@ -78,10 +78,10 @@ function resolveSelectedRAM(ram) {
const DEFAULT_CONFIG = {
settings: {
game: {
resWidth: 1280,
resHeight: 720,
resWidth: 856,
resHeight: 482,
fullscreen: false,
autoConnect: true,
autoConnect: false,
launchDetached: true
},
launcher: {
@@ -349,6 +349,26 @@ exports.addMojangAuthAccount = function(uuid, accessToken, username, displayName
return config.authenticationDatabase[uuid]
}
/**
* Adds an offline account to the database to be stored.
*
* @param {string} uuid The uuid of the account.
* @param {string} username The username of the account.
*
* @returns {Object} The authenticated account object created by this action.
*/
exports.addOfflineAuthAccount = function(uuid, username){
config.selectedAccount = uuid
config.authenticationDatabase[uuid] = {
type: 'offline',
accessToken: '',
username: username.trim(),
uuid: uuid.trim(),
displayName: username.trim()
}
return config.authenticationDatabase[uuid]
}
/**
* Update the tokens of an authenticated microsoft account.
*

View File

@@ -8,12 +8,12 @@ const { Client } = require('discord-rpc-patch')
let client
let activity
exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting for Client..'){
exports.initRPC = function(genSettings, servSettings, initialDetails = 'Várakozás a kliensre..'){
client = new Client({ transport: 'ipc' })
activity = {
details: initialDetails,
state: 'Server: ' + servSettings.shortId,
state: 'Szerver: ' + servSettings.shortId,
largeImageKey: servSettings.largeImageKey,
largeImageText: servSettings.largeImageText,
smallImageKey: genSettings.smallImageKey,
@@ -23,7 +23,7 @@ exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting
}
client.on('ready', () => {
logger.info('Discord RPC Connected')
logger.info('Discord RPC Kapcsolódva')
client.setActivity(activity)
})

View File

@@ -4,7 +4,8 @@ const ConfigManager = require('./configmanager')
// Old WesterosCraft url.
// exports.REMOTE_DISTRO_URL = 'http://mc.westeroscraft.com/WesterosCraftLauncher/distribution.json'
exports.REMOTE_DISTRO_URL = 'https://helios-files.geekcorner.eu.org/distribution.json'
// exports.REMOTE_DISTRO_URL = 'https://helios-files.geekcorner.eu.org/distribution.json'
exports.REMOTE_DISTRO_URL = 'https://files.chronika.hu/distribution.json'
const api = new DistributionAPI(
ConfigManager.getLauncherDirectory(),

View File

@@ -156,7 +156,7 @@ exports.scanForShaderpacks = function(instanceDir){
const shaderDir = path.join(instanceDir, SHADER_DIR)
const packsDiscovered = [{
fullName: 'OFF',
name: 'Off (Default)'
name: 'Kikapcsolva (Alapértelmezett)'
}]
if(fs.existsSync(shaderDir)){
let modCandidates = fs.readdirSync(shaderDir)
@@ -191,7 +191,7 @@ exports.getEnabledShaderpack = function(instanceDir){
if(match != null){
return match[1]
} else {
console.warn('WARNING: Shaderpack regex failed.')
console.warn('FIGYELEM: Shaderpack regex hiba.')
}
}
return 'OFF'

View File

@@ -1,7 +1,7 @@
// NOTE FOR THIRD-PARTY
// REPLACE THIS CLIENT ID WITH YOUR APPLICATION ID.
// SEE https://github.com/dscalzi/HeliosLauncher/blob/master/docs/MicrosoftAuth.md
exports.AZURE_CLIENT_ID = '1ce6e35a-126f-48fd-97fb-54d143ac6d45'
exports.AZURE_CLIENT_ID = '58b013f6-0ad6-46f8-939a-b8e157af42f6'
// SEE NOTE ABOVE.

View File

@@ -12,7 +12,7 @@ const { HeliosDistribution } = require('helios-core/common')
const logger = LoggerUtil.getLogger('Preloader')
logger.info('Loading..')
logger.info('Betöltés..')
// Load ConfigManager
ConfigManager.load()
@@ -23,7 +23,7 @@ DistroAPI['commonDir'] = ConfigManager.getCommonDirectory()
DistroAPI['instanceDir'] = ConfigManager.getInstanceDirectory()
// Load Strings
LangLoader.loadLanguage('en_US')
LangLoader.loadLanguage('hu_HU')
/**
*

File diff suppressed because it is too large Load Diff

View File

@@ -124,8 +124,8 @@ document.getElementById('launch_button').addEventListener('click', async e => {
}
}
} catch(err) {
loggerLanding.error('Unhandled error in during launch process.', err)
showLaunchFailure('Error During Launch', 'See console (CTRL + Shift + i) for more details.')
loggerLanding.error('Kezeletlen hiba az indítási folyamat közben.', err)
showLaunchFailure('Hiba Indítás Közben', 'Lásd a konzolban (CTRL + Shift + i) a további részleteket.')
}
})
@@ -145,14 +145,15 @@ document.getElementById('avatarOverlay').onclick = async e => {
// Bind selected account
function updateSelectedAccount(authUser){
let username = 'No Account Selected'
let username = 'Nincs fiók kiválasztva'
if(authUser != null){
if(authUser.displayName != null){
username = authUser.displayName
document.getElementById('avatarImage').style.backgroundImage = `url('https://portal.chronika.hu/api/skinrender.php?username=${authUser.displayName}')`
}
if(authUser.uuid != null){
/*if(authUser.uuid != null){
document.getElementById('avatarContainer').style.backgroundImage = `url('https://mc-heads.net/body/${authUser.uuid}/right')`
}
}*/
}
user_text.innerHTML = username
}
@@ -165,14 +166,14 @@ function updateSelectedServer(serv){
}
ConfigManager.setSelectedServer(serv != null ? serv.rawServer.id : null)
ConfigManager.save()
server_selection_button.innerHTML = '\u2022 ' + (serv != null ? serv.rawServer.name : 'No Server Selected')
server_selection_button.innerHTML = '\u2022 ' + (serv != null ? serv.rawServer.name : 'Nincs szerver kiválasztva')
if(getCurrentView() === VIEWS.settings){
animateSettingsTabRefresh()
}
setLaunchEnabled(serv != null)
}
// Real text is set in uibinder.js on distributionIndexDone.
server_selection_button.innerHTML = '\u2022 Loading..'
server_selection_button.innerHTML = '\u2022 Betöltés..'
server_selection_button.onclick = async e => {
e.target.blur()
await toggleServerSelection(true)
@@ -180,7 +181,7 @@ server_selection_button.onclick = async e => {
// Update Mojang Status Color
const refreshMojangStatuses = async function(){
loggerLanding.info('Refreshing Mojang Statuses..')
loggerLanding.info('Mojang Információ Frissítése..')
let status = 'grey'
let tooltipEssentialHTML = ''
@@ -191,7 +192,7 @@ const refreshMojangStatuses = async function(){
if(response.responseStatus === RestResponseStatus.SUCCESS) {
statuses = response.data
} else {
loggerLanding.warn('Unable to refresh Mojang service status.')
loggerLanding.warn('Nem sikerült lekérni a Mojang szervereinek állapotát.')
statuses = MojangRestAPI.getDefaultStatuses()
}
@@ -240,21 +241,21 @@ const refreshMojangStatuses = async function(){
}
const refreshServerStatus = async (fade = false) => {
loggerLanding.info('Refreshing Server Status')
loggerLanding.info('Szerver állapotának frissítése')
const serv = (await DistroAPI.getDistribution()).getServerById(ConfigManager.getSelectedServer())
let pLabel = 'SERVER'
let pLabel = 'SZERVER'
let pVal = 'OFFLINE'
try {
const servStat = await getServerStatus(47, serv.hostname, serv.port)
console.log(servStat)
pLabel = 'PLAYERS'
pLabel = 'JÁTÉKOSOK'
pVal = servStat.players.online + '/' + servStat.players.max
} catch (err) {
loggerLanding.warn('Unable to refresh server status, assuming offline.')
loggerLanding.warn('Nem sikerült lekérni a szerver állapotát, feltehetőleg offline.')
loggerLanding.debug(err)
}
if(fade){
@@ -304,7 +305,7 @@ function showLaunchFailure(title, desc){
*/
async function asyncSystemScan(effectiveJavaOptions, launchAfter = true){
setLaunchDetails('Checking system info..')
setLaunchDetails('Rendszerinformáció ellenőrzése..')
toggleLaunchArea(true)
setLaunchPercentage(0, 100)
@@ -317,30 +318,30 @@ async function asyncSystemScan(effectiveJavaOptions, launchAfter = true){
// If the result is null, no valid Java installation was found.
// Show this information to the user.
setOverlayContent(
'No Compatible<br>Java Installation Found',
`In order to join WesterosCraft, you need a 64-bit installation of Java ${effectiveJavaOptions.suggestedMajor}. Would you like us to install a copy?`,
'Install Java',
'Install Manually'
'Nem található<br>Kompatibilis Java telepítés',
`Ahhoz hogy elindítsd a játékot, 64 bites Java ${effectiveJavaOptions.suggestedMajor} szükséges. Feltelepítsük neked?`,
'Java Telepítése',
'Manuális Telepítés'
)
setOverlayHandler(() => {
setLaunchDetails('Preparing Java Download..')
setLaunchDetails('Java letöltés előkészítése..')
toggleOverlay(false)
try {
downloadJava(effectiveJavaOptions, launchAfter)
} catch(err) {
loggerLanding.error('Unhandled error in Java Download', err)
showLaunchFailure('Error During Java Download', 'See console (CTRL + Shift + i) for more details.')
loggerLanding.error('Kezeletlen hiba Java letöltés közben', err)
showLaunchFailure('Hiba történt java letöltés közben', 'Lásd a konzolban (CTRL + Shift + i) a további részleteket.')
}
})
setDismissHandler(() => {
$('#overlayContent').fadeOut(250, () => {
//$('#overlayDismiss').toggle(false)
setOverlayContent(
'Java is Required<br>to Launch',
`A valid x64 installation of Java ${effectiveJavaOptions.suggestedMajor} is required to launch.<br><br>Please refer to our <a href="https://github.com/dscalzi/HeliosLauncher/wiki/Java-Management#manually-installing-a-valid-version-of-java">Java Management Guide</a> for instructions on how to manually install Java.`,
'I Understand',
'Go Back'
'Java szükséges<br>az indításhoz',
`Egy érvényes x64-es Java ${effectiveJavaOptions.suggestedMajor} szükséges az indításhoz.<br><br>Részleteket a <a href="https://github.com/ChronikaMC/Launcher/wiki/Java-Management#manually-installing-a-valid-version-of-java">Dokumentációnkban</a> találod a Java manuális telepítéséhez.`,
'Értem',
'Vissza'
)
setOverlayHandler(() => {
toggleLaunchArea(false)
@@ -385,7 +386,7 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) {
effectiveJavaOptions.distribution)
if(asset == null) {
throw new Error('Failed to find OpenJDK distribution.')
throw new Error('Nem sikerült lekérni a legfrisebb OpenJDK letöltést.')
}
let received = 0
@@ -396,11 +397,11 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) {
setDownloadPercentage(100)
if(received != asset.size) {
loggerLanding.warn(`Java Download: Expected ${asset.size} bytes but received ${received}`)
loggerLanding.warn(`Java Letöltés: Várt ${asset.size} byte helyett ${received} byte érkezett.`)
if(!await validateLocalFile(asset.path, asset.algo, asset.hash)) {
log.error(`Hashes do not match, ${asset.id} may be corrupted.`)
log.error(`Hashek nem egyeznek, ${asset.id} sérült lehet.`)
// Don't know how this could happen, but report it.
throw new Error('Downloaded JDK has bad hash, file may be corrupted.')
throw new Error('Letöltött JDK nem jó hash-t adott eredményül, valószínűleg hibás a fájl.')
}
}
@@ -409,7 +410,7 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) {
remote.getCurrentWindow().setProgressBar(2)
// Wait for extration to complete.
const eLStr = 'Extracting Java'
const eLStr = 'Java Kicsomagolása'
let dotStr = ''
setLaunchDetails(eLStr)
const extractListener = setInterval(() => {
@@ -431,7 +432,7 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) {
ConfigManager.save()
clearInterval(extractListener)
setLaunchDetails('Java Installed!')
setLaunchDetails('Java Telepítve!')
// TODO Callback hell
// Refactor the launch functions
@@ -456,7 +457,7 @@ async function dlAsync(login = true) {
const loggerLaunchSuite = LoggerUtil.getLogger('LaunchSuite')
setLaunchDetails('Loading server information..')
setLaunchDetails('Szerver információk betöltése..')
let distro
@@ -473,12 +474,12 @@ async function dlAsync(login = true) {
if(login) {
if(ConfigManager.getSelectedAccount() == null){
loggerLanding.error('You must be logged into an account.')
loggerLanding.error('Jelentkezz be egy fiókba.')
return
}
}
setLaunchDetails('Please wait..')
setLaunchDetails('Kérlek várj..')
toggleLaunchArea(true)
setLaunchPercentage(0, 100)
@@ -493,18 +494,18 @@ async function dlAsync(login = true) {
fullRepairModule.spawnReceiver()
fullRepairModule.childProcess.on('error', (err) => {
loggerLaunchSuite.error('Error during launch', err)
showLaunchFailure('Error During Launch', err.message || 'See console (CTRL + Shift + i) for more details.')
loggerLaunchSuite.error('Hiba indítás közben', err)
showLaunchFailure('Hiba indítás közben', err.message || 'Lásd a konzolt (CTRL + Shift + i) a további részletekért.')
})
fullRepairModule.childProcess.on('close', (code, _signal) => {
if(code !== 0){
loggerLaunchSuite.error(`Full Repair Module exited with code ${code}, assuming error.`)
showLaunchFailure('Error During Launch', 'See console (CTRL + Shift + i) for more details.')
loggerLaunchSuite.error(`Teljes Javító Modul kilépett a(z) ${code} kóddal, valószínűleg hiba.`)
showLaunchFailure('Hiba indítás közben', 'Lásd a konzolt (CTRL + Shift + i) a további részletekért.')
}
})
loggerLaunchSuite.info('Validating files.')
setLaunchDetails('Validating file integrity..')
loggerLaunchSuite.info('Fájlok ellenőrzése.')
setLaunchDetails('Fájl integritás ellenőrzése..')
let invalidFileCount = 0
try {
invalidFileCount = await fullRepairModule.verifyFiles(percent => {
@@ -512,15 +513,15 @@ async function dlAsync(login = true) {
})
setLaunchPercentage(100)
} catch (err) {
loggerLaunchSuite.error('Error during file validation.')
showLaunchFailure('Error During File Verification', err.displayable || 'See console (CTRL + Shift + i) for more details.')
loggerLaunchSuite.error('Hiba fájl ellenőrzés közben.')
showLaunchFailure('Hiba fájl ellenőrzés közben', err.displayable || 'Lásd a konzolt (CTRL + Shift + i) a további részletekért.')
return
}
if(invalidFileCount > 0) {
loggerLaunchSuite.info('Downloading files.')
setLaunchDetails('Downloading files..')
loggerLaunchSuite.info('Fájlok letöltése.')
setLaunchDetails('Fájlok letöltése..')
setLaunchPercentage(0)
try {
await fullRepairModule.download(percent => {
@@ -528,12 +529,12 @@ async function dlAsync(login = true) {
})
setDownloadPercentage(100)
} catch(err) {
loggerLaunchSuite.error('Error during file download.')
showLaunchFailure('Error During File Download', err.displayable || 'See console (CTRL + Shift + i) for more details.')
loggerLaunchSuite.error('Hiba fájl letöltés közben.')
showLaunchFailure('Hiba fájl letöltés közben', err.displayable || 'Lásd a konzolt (CTRL + Shift + i) a további részletekért.')
return
}
} else {
loggerLaunchSuite.info('No invalid files, skipping download.')
loggerLaunchSuite.info('Fájlok rendben vannak, letöltés kihagyása.')
}
// Remove download bar.
@@ -541,7 +542,7 @@ async function dlAsync(login = true) {
fullRepairModule.destroyReceiver()
setLaunchDetails('Preparing to launch..')
setLaunchDetails('Indítás előkészítése..')
const mojangIndexProcessor = new MojangIndexProcessor(
ConfigManager.getCommonDirectory(),
@@ -557,17 +558,18 @@ async function dlAsync(login = true) {
if(login) {
const authUser = ConfigManager.getSelectedAccount()
loggerLaunchSuite.info(`Sending selected account (${authUser.displayName}) to ProcessBuilder.`)
loggerLaunchSuite.info(`Kiválasztott fiók elküldése (${authUser.displayName}) a ProcessBuilder-nek.`)
let pb = new ProcessBuilder(serv, versionData, forgeData, authUser, remote.app.getVersion())
setLaunchDetails('Launching game..')
setLaunchDetails('Játék indítása..')
// const SERVER_JOINED_REGEX = /\[.+\]: \[CHAT\] [a-zA-Z0-9_]{1,16} joined the game/
const SERVER_JOINED_REGEX = new RegExp(`\\[.+\\]: \\[CHAT\\] ${authUser.displayName} joined the game`)
// const SERVER_JOINED_REGEX = new RegExp(`\\[.+\\]: \\[CHAT\\] ${authUser.displayName} joined the game`)
const SERVER_JOINED_REGEX = new RegExp('Sikeresen bejelentkeztél.')
const onLoadComplete = () => {
toggleLaunchArea(false)
if(hasRPC){
DiscordWrapper.updateDetails('Loading game..')
DiscordWrapper.updateDetails('Játék betöltése..')
proc.stdout.on('data', gameStateChange)
}
proc.stdout.removeListener('data', tempListener)
@@ -594,17 +596,17 @@ async function dlAsync(login = true) {
const gameStateChange = function(data){
data = data.trim()
if(SERVER_JOINED_REGEX.test(data)){
DiscordWrapper.updateDetails('Exploring the Realm!')
DiscordWrapper.updateDetails('Chronika szerverein lazul.')
} else if(GAME_JOINED_REGEX.test(data)){
DiscordWrapper.updateDetails('Sailing to Westeros!')
DiscordWrapper.updateDetails('Főmenü')
}
}
const gameErrorListener = function(data){
data = data.trim()
if(data.indexOf('Could not find or load main class net.minecraft.launchwrapper.Launch') > -1){
loggerLaunchSuite.error('Game launch failed, LaunchWrapper was not downloaded properly.')
showLaunchFailure('Error During Launch', 'The main file, LaunchWrapper, failed to download properly. As a result, the game cannot launch.<br><br>To fix this issue, temporarily turn off your antivirus software and launch the game again.<br><br>If you have time, please <a href="https://github.com/dscalzi/HeliosLauncher/issues">submit an issue</a> and let us know what antivirus software you use. We\'ll contact them and try to straighten things out.')
if(data.indexOf('Nem sikerült betölteni a fő osztályt net.minecraft.launchwrapper.Launch') > -1){
loggerLaunchSuite.error('Játékindítás meghiúsult, LaunchWrapper nem töltődött le megfelelően.')
showLaunchFailure('Hiba indítás közben', 'A fő fájl, LaunchWrapper, nem töltődött le megfelelően. Ennek eredményeképp a játék nem tudott elindulni.<br><br>Próbáld meg kikapcsolni a vírusírtót ideiglenesen és próbáld meg újra elindítani a játékot.<br><br>Ha van egy kis időd, kérlek <a href="https://github.com/ChronikaMC/ChronikaLauncher/issues">jelezd a hibát</a> és tudasd velünk milyen vírusirtót használsz. Megpróbáljuk megoldani a problémát.')
}
}
@@ -616,10 +618,11 @@ async function dlAsync(login = true) {
proc.stdout.on('data', tempListener)
proc.stderr.on('data', gameErrorListener)
setLaunchDetails('Done. Enjoy the server!')
setLaunchDetails('Kész. Élvezd a szervert!')
// Init Discord Hook
if(distro.rawDistribution.discord != null && serv.rawServerdiscord != null){
console.log('DISCORD:', serv.rawServer.discord)
if(distro.rawDistribution.discord != null && serv.rawServer.discord != null){
DiscordWrapper.initRPC(distro.rawDistribution.discord, serv.rawServer.discord)
hasRPC = true
proc.on('close', (code, signal) => {
@@ -632,8 +635,8 @@ async function dlAsync(login = true) {
} catch(err) {
loggerLaunchSuite.error('Error during launch', err)
showLaunchFailure('Error During Launch', 'Please check the console (CTRL + Shift + i) for more details.')
loggerLaunchSuite.error('Hiba indítás közben', err)
showLaunchFailure('Hiba indítás közben', 'Lásd a konzolt (CTRL + Shift + i) a további részletekért.')
}
}
@@ -740,7 +743,7 @@ let newsLoadingListener = null
*/
function setNewsLoading(val){
if(val){
const nLStr = 'Checking for News'
const nLStr = 'Hírek Betöltése'
let dotStr = '..'
nELoadSpan.innerHTML = nLStr + dotStr
newsLoadingListener = setInterval(() => {
@@ -967,7 +970,7 @@ async function loadNews(){
const distroData = await DistroAPI.getDistribution()
if(!distroData.rawDistribution.rss) {
loggerLanding.debug('No RSS feed provided.')
loggerLanding.debug('Nincs RSS hírfolyam.')
return null
}
@@ -986,14 +989,14 @@ async function loadNews(){
const el = $(items[i])
// Resolve date.
const date = new Date(el.find('pubDate').text()).toLocaleDateString('en-US', {month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric'})
const date = new Date(el.find('pubDate').text()).toLocaleDateString('hu-HU', {month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric'})
// Resolve comments.
let comments = el.find('slash\\:comments').text() || '0'
comments = comments + ' Comment' + (comments === '1' ? '' : 's')
let comments = el.find('comments').text() || '0'
comments = comments + ' Komment'
// Fix relative links in content.
let content = el.find('content\\:encoded').text()
let content = el.find('content').text()
let regex = /src="(?!http:\/\/|https:\/\/)(.+?)"/g
let matches
while((matches = regex.exec(content))){
@@ -1002,7 +1005,7 @@ async function loadNews(){
let link = el.find('link').text()
let title = el.find('title').text()
let author = el.find('dc\\:creator').text()
let author = el.find('author').text()
// Generate article.
articles.push(

View File

@@ -215,14 +215,14 @@ loginButton.addEventListener('click', () => {
let actualDisplayableError
if(isDisplayableError(displayableError)) {
msftLoginLogger.error('Error while logging in.', displayableError)
msftLoginLogger.error('Hiba belépés közben.', displayableError)
actualDisplayableError = displayableError
} else {
// Uh oh.
msftLoginLogger.error('Unhandled error during login.', displayableError)
msftLoginLogger.error('Kezeletlen hiba belépés közben.', displayableError)
actualDisplayableError = {
title: 'Unknown Error During Login',
desc: 'An unknown error has occurred. Please see the console for details.'
title: 'Ismeretlen hiba belépés közben',
desc: 'Egy ismeretlen hiba történt. Lásd a konzolt a részletekért.'
}
}

View File

@@ -47,4 +47,12 @@ loginOptionsCancelButton.onclick = (e) => {
loginOptionsViewCancelHandler = null
}
})
}
loginOptionOffline.onclick = (e) => {
switchView(getCurrentView(), VIEWS.offline, 500, 500, () => {
offlineLoginViewOnSuccess = loginOptionsViewOnLoginSuccess
offlineLoginViewOnCancel = loginOptionsViewOnLoginCancel
offlineLoginCancelEnabled(true)
})
}

View File

@@ -0,0 +1,178 @@
/**
* Script for offlineLogin.ejs
*/
// Login Elements
const offlineLoginCancelContainer = document.getElementById('offlineLoginCancelContainer')
const offlineLoginCancelButton = document.getElementById('offlineLoginCancelButton')
const offlineLoginEmailError = document.getElementById('offlineLoginEmailError')
const offlineLoginUsername = document.getElementById('offlineLoginUsername')
const offlineCheckmarkContainer = document.getElementById('offlineCheckmarkContainer')
const offlineLoginRememberOption = document.getElementById('offlineLoginRememberOption')
const offlineLoginButton = document.getElementById('offlineLoginButton')
const offlineLoginForm = document.getElementById('offlineLoginForm')
// Control variables.
let olu = false
/**
* Show a offlineLogin error.
*
* @param {HTMLElement} element The element on which to display the error.
* @param {string} value The error text.
*/
function showError(element, value){
element.innerHTML = value
element.style.opacity = 1
}
/**
* Shake a offlineLogin error to add emphasis.
*
* @param {HTMLElement} element The element to shake.
*/
function shakeError(element){
if(element.style.opacity == 1){
element.classList.remove('shake')
void element.offsetWidth
element.classList.add('shake')
}
}
/**
* Validate that an email field is neither empty nor invalid.
*
* @param {string} value The email value.
*/
function validateOfflineUsername(value){
if(value){
if(!validUsername.test(value)){
showError(offlineLoginEmailError, Lang.queryJS('login.error.invalidValue'))
offlineLoginDisabled(true)
olu = false
} else {
offlineLoginEmailError.style.opacity = 0
olu = true
offlineLoginDisabled(false)
}
} else {
olu = false
showError(offlineLoginEmailError, Lang.queryJS('login.error.requiredValue'))
offlineLoginDisabled(true)
}
}
// Emphasize errors with shake when focus is lost.
offlineLoginUsername.addEventListener('focusout', (e) => {
validateOfflineUsername(e.target.value)
shakeError(offlineLoginEmailError)
})
// Validate input for each field.
offlineLoginUsername.addEventListener('input', (e) => {
validateOfflineUsername(e.target.value)
})
/**
* Enable or disable the offlineLogin button.
*
* @param {boolean} v True to enable, false to disable.
*/
function offlineLoginDisabled(v){
if(offlineLoginButton.disabled !== v){
offlineLoginButton.disabled = v
}
}
/**
* Enable or disable loading elements.
*
* @param {boolean} v True to enable, false to disable.
*/
function offlineLoginLoading(v){
if(v){
offlineLoginButton.setAttribute('loading', v)
offlineLoginButton.innerHTML = offlineLoginButton.innerHTML.replace(Lang.queryJS('login.login'), Lang.queryJS('login.loggingIn'))
} else {
offlineLoginButton.removeAttribute('loading')
offlineLoginButton.innerHTML = offlineLoginButton.innerHTML.replace(Lang.queryJS('login.loggingIn'), Lang.queryJS('login.login'))
}
}
/**
* Enable or disable offlineLogin form.
*
* @param {boolean} v True to enable, false to disable.
*/
function offlineFormDisabled(v){
offlineLoginDisabled(v)
offlineLoginCancelButton.disabled = v
offlineLoginUsername.disabled = v
if(v){
offlineCheckmarkContainer.setAttribute('disabled', v)
} else {
offlineCheckmarkContainer.removeAttribute('disabled')
}
offlineLoginRememberOption.disabled = v
}
let offlineLoginViewOnSuccess = VIEWS.landing
let offlineLoginViewOnCancel = VIEWS.settings
let offlineLoginViewCancelHandler
function offlineLoginCancelEnabled(val){
if(val){
$(offlineLoginCancelContainer).show()
} else {
$(offlineLoginCancelContainer).hide()
}
}
offlineLoginCancelButton.onclick = (e) => {
switchView(getCurrentView(), offlineLoginViewOnCancel, 500, 500, () => {
offlineLoginUsername.value = ''
offlineLoginCancelEnabled(false)
if(offlineLoginViewCancelHandler != null){
offlineLoginViewCancelHandler()
offlineLoginViewCancelHandler = null
}
})
}
// Disable default form behavior.
offlineLoginForm.onsubmit = () => { return false }
// Bind offlineLogin button behavior.
offlineLoginButton.addEventListener('click', () => {
// Disable form.
offlineFormDisabled(true)
// Show loading stuff.
offlineLoginLoading(true)
const username = offlineLoginUsername.value
const value = AuthManager.addOfflineAccount(username)
$('.circle-loader').toggleClass('load-complete')
$('.offlineCheckmark').toggle()
updateSelectedAccount(value)
setTimeout(() => {
switchView(VIEWS.offline, offlineLoginViewOnSuccess, 500, 500, async () => {
// Temporary workaround
if(offlineLoginViewOnSuccess === VIEWS.settings){
await prepareSettings()
}
offlineLoginViewOnSuccess = VIEWS.landing // Reset this for good measure.
offlineLoginCancelEnabled(false) // Reset this for good measure.
offlineLoginViewCancelHandler = null // Reset this for good measure.
offlineLoginUsername.value = ''
$('.circle-loader').toggleClass('load-complete')
$('.offlineCheckmark').toggle()
offlineLoginLoading(false)
loginButton.innerHTML = loginButton.innerHTML.replace(Lang.queryJS('login.success'), Lang.queryJS('login.login'))
offlineFormDisabled(false)
})
}, 1000)
})

View File

@@ -289,7 +289,7 @@ async function populateServerListings(){
<path class="cls-1" d="M100.93,65.54C89,62,68.18,55.65,63.54,52.13c2.7-5.23,18.8-19.2,28-27.55C81.36,31.74,63.74,43.87,58.09,45.3c-2.41-5.37-3.61-26.52-4.37-39-.77,12.46-2,33.64-4.36,39-5.7-1.46-23.3-13.57-33.49-20.72,9.26,8.37,25.39,22.36,28,27.55C39.21,55.68,18.47,62,6.52,65.55c12.32-2,33.63-6.06,39.34-4.9-.16,5.87-8.41,26.16-13.11,37.69,6.1-10.89,16.52-30.16,21-33.9,4.5,3.79,14.93,23.09,21,34C70,86.84,61.73,66.48,61.59,60.65,67.36,59.49,88.64,63.52,100.93,65.54Z"/>
<circle class="cls-2" cx="53.73" cy="53.9" r="38"/>
</svg>
<span class="serverListingStarTooltip">Main Server</span>
<span class="serverListingStarTooltip"> Server</span>
</div>` : ''}
</div>
</div>

View File

@@ -342,6 +342,15 @@ settingsNavDone.onclick = () => {
const msftLoginLogger = LoggerUtil.getLogger('Microsoft Login')
const msftLogoutLogger = LoggerUtil.getLogger('Microsoft Logout')
// Bind the add offline account button.
document.getElementById('settingsAddOfflineAccount').onclick = (e) => {
switchView(getCurrentView(), VIEWS.offline, 500, 500, () => {
offlineLoginViewOnCancel = VIEWS.settings
offlineLoginViewOnSuccess = VIEWS.settings
offlineLoginCancelEnabled(true)
})
}
// Bind the add mojang account button.
document.getElementById('settingsAddMojangAccount').onclick = (e) => {
switchView(getCurrentView(), VIEWS.login, 500, 500, () => {
@@ -374,8 +383,8 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGIN, (_, ...arguments_) => {
// Unexpected error.
setOverlayContent(
'Something Went Wrong',
'Microsoft authentication failed. Please try again.',
'Valami nem sikerült',
'Microsoft hitelesítés meghiúsult. Kérlek próbáld újra.',
'OK'
)
setOverlayHandler(() => {
@@ -430,8 +439,8 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGIN, (_, ...arguments_) => {
// Uh oh.
msftLoginLogger.error('Unhandled error during login.', displayableError)
actualDisplayableError = {
title: 'Unknown Error During Login',
desc: 'An unknown error has occurred. Please see the console for details.'
title: 'Ismeretlen Hiba Belépés Közben',
desc: 'Egy ismeretlen hiba történt. Lásd a konzolt a további részletekért.'
}
}
@@ -461,11 +470,11 @@ function bindAuthAccountSelect(){
for(let i=0; i<selectBtns.length; i++){
if(selectBtns[i].hasAttribute('selected')){
selectBtns[i].removeAttribute('selected')
selectBtns[i].innerHTML = 'Select Account'
selectBtns[i].innerHTML = 'Kiválaszt'
}
}
val.setAttribute('selected', '')
val.innerHTML = 'Selected Account &#10004;'
val.innerHTML = 'Kiválasztott Fiók &#10004;'
setSelectedAccount(val.closest('.settingsAuthAccount').getAttribute('uuid'))
}
})
@@ -483,10 +492,10 @@ function bindAuthAccountLogOut(){
if(Object.keys(ConfigManager.getAuthAccounts()).length === 1){
isLastAccount = true
setOverlayContent(
'Warning<br>This is Your Last Account',
'In order to use the launcher you must be logged into at least one account. You will need to login again after.<br><br>Are you sure you want to log out?',
'I\'m Sure',
'Cancel'
'Figyelem<br>Ez az utolsó fiókod',
'A launcher használatához legalább egy fiókkal be kell lépj. Ki leszel jelentkeztetve ezután.<br><br>Biztos ki szeretnél jelentkezni?',
'Igen',
'Vissza'
)
setOverlayHandler(() => {
processLogOut(val, isLastAccount)
@@ -521,6 +530,23 @@ function processLogOut(val, isLastAccount){
switchView(getCurrentView(), VIEWS.waiting, 500, 500, () => {
ipcRenderer.send(MSFT_OPCODE.OPEN_LOGOUT, uuid, isLastAccount)
})
} else if(targetAcc.type === 'offline') {
AuthManager.removeOfflineAccount(uuid)
if(!isLastAccount && uuid === prevSelAcc.uuid){
const selAcc = ConfigManager.getSelectedAccount()
refreshAuthAccountSelected(selAcc.uuid)
updateSelectedAccount(selAcc)
validateSelectedAccount()
}
if(isLastAccount) {
loginOptionsCancelEnabled(false)
loginOptionsViewOnLoginSuccess = VIEWS.settings
loginOptionsViewOnLoginCancel = VIEWS.loginOptions
switchView(getCurrentView(), VIEWS.loginOptions)
}
$(parent).fadeOut(250, () => {
parent.remove()
})
} else {
AuthManager.removeMojangAccount(uuid).then(() => {
if(!isLastAccount && uuid === prevSelAcc.uuid){
@@ -611,18 +637,19 @@ function refreshAuthAccountSelected(uuid){
const selBtn = val.getElementsByClassName('settingsAuthAccountSelect')[0]
if(uuid === val.getAttribute('uuid')){
selBtn.setAttribute('selected', '')
selBtn.innerHTML = 'Selected Account &#10004;'
selBtn.innerHTML = 'Kiválasztott Fiók &#10004;'
} else {
if(selBtn.hasAttribute('selected')){
selBtn.removeAttribute('selected')
}
selBtn.innerHTML = 'Select Account'
selBtn.innerHTML = 'Kiválaszt'
}
})
}
const settingsCurrentMicrosoftAccounts = document.getElementById('settingsCurrentMicrosoftAccounts')
const settingsCurrentMojangAccounts = document.getElementById('settingsCurrentMojangAccounts')
const settingsCurrentOfflineAccounts = document.getElementById('settingsCurrentOfflineAccounts')
/**
* Add auth account elements for each one stored in the authentication database.
@@ -637,18 +664,19 @@ function populateAuthAccounts(){
let microsoftAuthAccountStr = ''
let mojangAuthAccountStr = ''
let offlineAuthAccountStr = ''
authKeys.forEach((val) => {
const acc = authAccounts[val]
const accHtml = `<div class="settingsAuthAccount" uuid="${acc.uuid}">
<div class="settingsAuthAccountLeft">
<img class="settingsAuthAccountImage" alt="${acc.displayName}" src="https://mc-heads.net/body/${acc.uuid}/60">
<img class="settingsAuthAccountImage" alt="${acc.displayName}" src="https://portal.chronika.hu/api/skinrender.php?username=${acc.displayName}">
</div>
<div class="settingsAuthAccountRight">
<div class="settingsAuthAccountDetails">
<div class="settingsAuthAccountDetailPane">
<div class="settingsAuthAccountDetailTitle">Username</div>
<div class="settingsAuthAccountDetailTitle">Felhasználónév</div>
<div class="settingsAuthAccountDetailValue">${acc.displayName}</div>
</div>
<div class="settingsAuthAccountDetailPane">
@@ -657,9 +685,9 @@ function populateAuthAccounts(){
</div>
</div>
<div class="settingsAuthAccountActions">
<button class="settingsAuthAccountSelect" ${selectedUUID === acc.uuid ? 'selected>Selected Account &#10004;' : '>Select Account'}</button>
<button class="settingsAuthAccountSelect" ${selectedUUID === acc.uuid ? 'selected>Kiválasztott Fiók &#10004;' : '>Kiválaszt'}</button>
<div class="settingsAuthAccountWrapper">
<button class="settingsAuthAccountLogOut">Log Out</button>
<button class="settingsAuthAccountLogOut">Kijelentkezés</button>
</div>
</div>
</div>
@@ -667,6 +695,8 @@ function populateAuthAccounts(){
if(acc.type === 'microsoft') {
microsoftAuthAccountStr += accHtml
} else if(acc.type === 'offline') {
offlineAuthAccountStr += accHtml
} else {
mojangAuthAccountStr += accHtml
}
@@ -675,6 +705,7 @@ function populateAuthAccounts(){
settingsCurrentMicrosoftAccounts.innerHTML = microsoftAuthAccountStr
settingsCurrentMojangAccounts.innerHTML = mojangAuthAccountStr
settingsCurrentOfflineAccounts.innerHTML = offlineAuthAccountStr
}
/**
@@ -1093,7 +1124,7 @@ async function loadSelectedServerOnModsTab(){
<path class="cls-1" d="M100.93,65.54C89,62,68.18,55.65,63.54,52.13c2.7-5.23,18.8-19.2,28-27.55C81.36,31.74,63.74,43.87,58.09,45.3c-2.41-5.37-3.61-26.52-4.37-39-.77,12.46-2,33.64-4.36,39-5.7-1.46-23.3-13.57-33.49-20.72,9.26,8.37,25.39,22.36,28,27.55C39.21,55.68,18.47,62,6.52,65.55c12.32-2,33.63-6.06,39.34-4.9-.16,5.87-8.41,26.16-13.11,37.69,6.1-10.89,16.52-30.16,21-33.9,4.5,3.79,14.93,23.09,21,34C70,86.84,61.73,66.48,61.59,60.65,67.36,59.49,88.64,63.52,100.93,65.54Z"/>
<circle class="cls-2" cx="53.73" cy="53.9" r="38"/>
</svg>
<span class="serverListingStarTooltip">Main Server</span>
<span class="serverListingStarTooltip"> Server</span>
</div>` : ''}
</div>
</div>
@@ -1433,11 +1464,11 @@ function isPrerelease(version){
function populateVersionInformation(version, valueElement, titleElement, checkElement){
valueElement.innerHTML = version
if(isPrerelease(version)){
titleElement.innerHTML = 'Pre-release'
titleElement.innerHTML = 'Teszt Kiadás'
titleElement.style.color = '#ff886d'
checkElement.style.background = '#ff886d'
} else {
titleElement.innerHTML = 'Stable Release'
titleElement.innerHTML = 'Stabil Kiadás'
titleElement.style.color = null
checkElement.style.background = null
}
@@ -1456,7 +1487,7 @@ function populateAboutVersionInformation(){
*/
function populateReleaseNotes(){
$.ajax({
url: 'https://github.com/dscalzi/HeliosLauncher/releases.atom',
url: 'https://github.com/ChronikaMC/Launcher/releases.atom',
success: (data) => {
const version = 'v' + remote.app.getVersion()
const entries = $(data).find('entry')
@@ -1476,7 +1507,7 @@ function populateReleaseNotes(){
},
timeout: 2500
}).catch(err => {
settingsAboutChangelogText.innerHTML = 'Failed to load release notes.'
settingsAboutChangelogText.innerHTML = 'Nem sikerült betölteni a frissítésekre vonatkozó információkat.'
})
}
@@ -1524,27 +1555,27 @@ function settingsUpdateButtonStatus(text, disabled = false, handler = null){
*/
function populateSettingsUpdateInformation(data){
if(data != null){
settingsUpdateTitle.innerHTML = `New ${isPrerelease(data.version) ? 'Pre-release' : 'Release'} Available`
settingsUpdateTitle.innerHTML = `Új ${isPrerelease(data.version) ? 'Teszt' : 'Stabil'} verzió elérhető`
settingsUpdateChangelogCont.style.display = null
settingsUpdateChangelogTitle.innerHTML = data.releaseName
settingsUpdateChangelogText.innerHTML = data.releaseNotes
populateVersionInformation(data.version, settingsUpdateVersionValue, settingsUpdateVersionTitle, settingsUpdateVersionCheck)
if(process.platform === 'darwin'){
settingsUpdateButtonStatus('Download from GitHub<span style="font-size: 10px;color: gray;text-shadow: none !important;">Close the launcher and run the dmg to update.</span>', false, () => {
settingsUpdateButtonStatus('Töltsd le GitHubról<span style="font-size: 10px;color: gray;text-shadow: none !important;">Zárd be a launchert és futtasd a dmg-t a frissítéshez.</span>', false, () => {
shell.openExternal(data.darwindownload)
})
} else {
settingsUpdateButtonStatus('Downloading..', true)
settingsUpdateButtonStatus('Letöltés..', true)
}
} else {
settingsUpdateTitle.innerHTML = 'You Are Running the Latest Version'
settingsUpdateTitle.innerHTML = 'A legfrisebb verziót használod'
settingsUpdateChangelogCont.style.display = 'none'
populateVersionInformation(remote.app.getVersion(), settingsUpdateVersionValue, settingsUpdateVersionTitle, settingsUpdateVersionCheck)
settingsUpdateButtonStatus('Check for Updates', false, () => {
settingsUpdateButtonStatus('Frissítések keresése', false, () => {
if(!isDev){
ipcRenderer.send('autoUpdateAction', 'checkForUpdate')
settingsUpdateButtonStatus('Checking for Updates..', true)
settingsUpdateButtonStatus('Frissítések keresése..', true)
}
})
}

View File

@@ -21,7 +21,8 @@ const VIEWS = {
login: '#loginContainer',
settings: '#settingsContainer',
welcome: '#welcomeContainer',
waiting: '#waitingContainer'
waiting: '#waitingContainer',
offline: '#offlineLoginContainer'
}
// The currently shown view container.

View File

@@ -26,9 +26,9 @@ window.eval = global.eval = function () {
// Display warning when devtools window is opened.
remote.getCurrentWebContents().on('devtools-opened', () => {
console.log('%cThe console is dark and full of terrors.', 'color: white; -webkit-text-stroke: 4px #a02d2a; font-size: 60px; font-weight: bold')
console.log('%cIf you\'ve been told to paste something here, you\'re being scammed.', 'font-size: 16px')
console.log('%cUnless you know exactly what you\'re doing, close this window.', 'font-size: 16px')
console.log('%cA konzol sötét és tele van terrorral.', 'color: white; -webkit-text-stroke: 4px #a02d2a; font-size: 60px; font-weight: bold')
console.log('%cHa azt mondták, hogy illessz be ide valamit, valószínűleg átverés.', 'font-size: 16px')
console.log('%cHacsak nem tudod pontosan mit csinálsz, zárd be ezt az ablakot.', 'font-size: 16px')
})
// Disable zoom, needed for darwin.
@@ -41,22 +41,22 @@ if(!isDev){
ipcRenderer.on('autoUpdateNotification', (event, arg, info) => {
switch(arg){
case 'checking-for-update':
loggerAutoUpdater.info('Checking for update..')
settingsUpdateButtonStatus('Checking for Updates..', true)
loggerAutoUpdater.info('Frissítés keresése..')
settingsUpdateButtonStatus('Frissítés keresése..', true)
break
case 'update-available':
loggerAutoUpdater.info('New update available', info.version)
loggerAutoUpdater.info('Új frissítés elérhető', info.version)
if(process.platform === 'darwin'){
info.darwindownload = `https://github.com/dscalzi/HeliosLauncher/releases/download/v${info.version}/Helios-Launcher-setup-${info.version}${process.arch === 'arm64' ? '-arm64' : '-x64'}.dmg`
info.darwindownload = `https://github.com/ChronikaMC/Launcher/releases/download/v${info.version}/Chronika-Launcher-setup-${info.version}${process.arch === 'arm64' ? '-arm64' : '-x64'}.dmg`
showUpdateUI(info)
}
populateSettingsUpdateInformation(info)
break
case 'update-downloaded':
loggerAutoUpdater.info('Update ' + info.version + ' ready to be installed.')
settingsUpdateButtonStatus('Install Now', false, () => {
loggerAutoUpdater.info('Frissítés ' + info.version + ' készen áll a telepítésre.')
settingsUpdateButtonStatus('Telepítés Most', false, () => {
if(!isDev){
ipcRenderer.send('autoUpdateAction', 'installUpdateNow')
}
@@ -64,8 +64,8 @@ if(!isDev){
showUpdateUI(info)
break
case 'update-not-available':
loggerAutoUpdater.info('No new update found.')
settingsUpdateButtonStatus('Check for Updates')
loggerAutoUpdater.info('Nem található frissítés.')
settingsUpdateButtonStatus('Frissítés keresése')
break
case 'ready':
updateCheckListener = setInterval(() => {
@@ -76,12 +76,12 @@ if(!isDev){
case 'realerror':
if(info != null && info.code != null){
if(info.code === 'ERR_UPDATER_INVALID_RELEASE_FEED'){
loggerAutoUpdater.info('No suitable releases found.')
loggerAutoUpdater.info('Nem található megfelelő kiadás.')
} else if(info.code === 'ERR_XML_MISSED_ELEMENT'){
loggerAutoUpdater.info('No releases found.')
loggerAutoUpdater.info('Nem találhatóak kiadások.')
} else {
loggerAutoUpdater.error('Error during update check..', info)
loggerAutoUpdater.debug('Error Code:', info.code)
loggerAutoUpdater.error('Hiba történt a frissítések keresése közben..', info)
loggerAutoUpdater.debug('Hibakód:', info.code)
}
}
break

View File

@@ -1,48 +1,48 @@
{
"html": {
"avatarOverlay": "Edit"
"avatarOverlay": "Fiók"
},
"js": {
"login": {
"error": {
"invalidValue": "* Invalid Value",
"requiredValue": "* Required",
"invalidValue": "* Érvénytelen Érték",
"requiredValue": "* Kötelező",
"userMigrated": {
"title": "Error During Login:<br>Invalid Credentials",
"title": "Hiba bejelentkezés közben:<br>Érvénytelen adatok",
"desc": "You've attempted to login with a migrated account. Try again using the account email as the username."
},
"invalidCredentials": {
"title": "Error During Login:<br>Invalid Credentials",
"desc": "The email or password you've entered is incorrect. Please try again."
"title": "Hiba bejelentkezés közben:<br>Érvénytelen adatok",
"desc": "Érvénytelen felhasználó vagy jelszó. Próbáld újra."
},
"rateLimit": {
"title": "Error During Login:<br>Too Many Attempts",
"title": "Hiba bejelentkezés közben:<br>Túl sok próbálkozás",
"desc": "There have been too many login attempts with this account recently. Please try again later."
},
"noInternet": {
"title": "Error During Login:<br>No Internet Connection",
"title": "Hiba bejelentkezés közben:<br>Nincs internet",
"desc": "You must be connected to the internet in order to login. Please connect and try again."
},
"authDown": {
"title": "Error During Login:<br>Authentication Server Offline",
"title": "Hiba bejelentkezés közben:<br>Hitelesítő szerver offline",
"desc": "Mojang's authentication server is currently offline or unreachable. Please wait a bit and try again. You can check the status of the server on <a href=\"https://help.mojang.com/\">Mojang's help portal</a>."
},
"notPaid": {
"title": "Error During Login:<br>Game Not Purchased",
"title": "Hiba bejelentkezés közben:<br>Nem vetted meg a játékot",
"desc": "The account you are trying to login with has not purchased a copy of Minecraft.<br>You may purchase a copy on <a href=\"https://minecraft.net/\">Minecraft.net</a>"
},
"unknown": {
"title": "Error During Login:<br>Unknown Error"
"title": "Hiba bejelentkezés közben:<br>Ismeretlen Hiba"
}
},
"login": "LOGIN",
"loggingIn": "LOGGING IN",
"success": "SUCCESS",
"tryAgain": "Try Again"
"login": "BELÉPÉS",
"loggingIn": "BEJELENTKEZÉS",
"success": "SIKER",
"tryAgain": "Próbáld Újra"
},
"landing": {
"launch": {
"pleaseWait": "Please wait.."
"pleaseWait": "Kérlek Várj.."
}
}
}