From 8886d5111aa4ae75f54f46c93f09fa7548979969 Mon Sep 17 00:00:00 2001 From: Minteck <46352972+Minteck@users.noreply.github.com> Date: Fri, 9 Jul 2021 00:37:48 +0200 Subject: Fixes --- app.js | 138 ++++++++++++++++++++------------------ index.html | 14 ++++ package.json | 2 +- race/_archived/triangle.html | 2 +- race/circuits/furry.html | 2 +- race/circuits/main.html | 2 +- race/circuits/snowy.html | 2 +- race/circuits/water.html | 2 +- sfx/notification.mp3 | Bin 0 -> 41006 bytes views/common/load-new.ttf | Bin 0 -> 50172 bytes views/load.html | 44 +++++------- views/loader.svg | 128 +++++++++++++++++++++++++++++++++++ views/menu.css | 10 ++- views/script/core_notification.js | 13 ++++ views/script/loader_global.js | 2 +- 15 files changed, 255 insertions(+), 106 deletions(-) create mode 100644 sfx/notification.mp3 create mode 100644 views/common/load-new.ttf create mode 100644 views/loader.svg create mode 100644 views/script/core_notification.js diff --git a/app.js b/app.js index 3135b2c..8e4ea52 100644 --- a/app.js +++ b/app.js @@ -302,7 +302,7 @@ const { app, BrowserWindow } = require('electron'); resizable: false, maximizable: false, frame: false, - show: true, + show: false, enableLargerThanScreen: true, icon: "logo/logo.png", backgroundColor: "#4b4e50", @@ -316,82 +316,86 @@ const { app, BrowserWindow } = require('electron'); } }) load.loadFile("./views/load.html"); - setTimeout(() => { - console.log(" * Checking signatures"); - - sigdb = require("./bin/signatures.json"); - total = Object.keys(sigdb["v1"]).length * 3; - processed = 0; - for (file in sigdb["v1"]) { - if (fs.existsSync(file)) { - try { - hash = require('crypto').createHash('sha512').update(fs.readFileSync(file)).digest('base64'); - if (hash !== sigdb["v1"][file]) { - require('electron').dialog.showMessageBoxSync( - { - type: "warning", - title: "Source modification detected", - message: "File " + file + " has been flagged as modified (signing V1). If this is normal, please run the signing process again.\n\nExpected: " + sigdb["v1"][file] + "\nGot: " + hash + "\n\nYou are running a modified version of Kartik, do not expect to get support!" - } - ) + load.webContents.once('dom-ready', () => { + console.log(" * Showing splash screen"); + load.show(); + setTimeout(() => { + console.log(" * Checking signatures"); + + sigdb = require("./bin/signatures.json"); + total = Object.keys(sigdb["v1"]).length * 3; + processed = 0; + for (file in sigdb["v1"]) { + if (fs.existsSync(file)) { + try { + hash = require('crypto').createHash('sha512').update(fs.readFileSync(file)).digest('base64'); + if (hash !== sigdb["v1"][file]) { + require('electron').dialog.showMessageBoxSync( + { + type: "warning", + title: "Source modification detected", + message: "File " + file + " has been flagged as modified (signing V1). If this is normal, please run the signing process again.\n\nExpected: " + sigdb["v1"][file] + "\nGot: " + hash + "\n\nYou are running a modified version of Kartik, do not expect to get support!" + } + ) + } + } catch (e) { + console.warn(" ! Could not V1 compute hash for " + file); } - } catch (e) { - console.warn(" ! Could not V1 compute hash for " + file); } - } - processed++; - load.webContents.send('progress', (processed/total)*100); - } - for (file in sigdb["v2"]) { - if (fs.existsSync(file)) { - try { - hash = require('crypto').createHash('sha1').update(fs.readFileSync(file)).digest('base64'); - if (hash !== sigdb["v2"][file]) { - require('electron').dialog.showMessageBoxSync( - { - type: "warning", - title: "Source modification detected", - message: "File " + file + " has been flagged as modified (signing V2). If this is normal, please run the signing process again.\n\nExpected: " + sigdb["v2"][file] + "\nGot: " + hash + "\n\nYou are running a modified version of Kartik, do not expect to get support!" - } - ) + processed++; + load.webContents.send('progress', (processed/total)*100); + } + for (file in sigdb["v2"]) { + if (fs.existsSync(file)) { + try { + hash = require('crypto').createHash('sha1').update(fs.readFileSync(file)).digest('base64'); + if (hash !== sigdb["v2"][file]) { + require('electron').dialog.showMessageBoxSync( + { + type: "warning", + title: "Source modification detected", + message: "File " + file + " has been flagged as modified (signing V2). If this is normal, please run the signing process again.\n\nExpected: " + sigdb["v2"][file] + "\nGot: " + hash + "\n\nYou are running a modified version of Kartik, do not expect to get support!" + } + ) + } + } catch (e) { + console.warn(" ! Could not compute V2 hash for " + file); } - } catch (e) { - console.warn(" ! Could not compute V2 hash for " + file); } - } - processed++; - load.webContents.send('progress', (processed/total)*100); - } - for (file in sigdb["v3"]) { - if (fs.existsSync(file)) { - try { - hash = require('crypto').createHash('md5').update(fs.readFileSync(file)).digest('base64'); - if (hash !== sigdb["v3"][file]) { - require('electron').dialog.showMessageBoxSync( - { - type: "warning", - title: "Source modification detected", - message: "File " + file + " has been flagged as modified (signing V3). If this is normal, please run the signing process again.\n\nExpected: " + sigdb["v3"][file] + "\nGot: " + hash + "\n\nYou are running a modified version of Kartik, do not expect to get support!" - } - ) + processed++; + load.webContents.send('progress', (processed/total)*100); + } + for (file in sigdb["v3"]) { + if (fs.existsSync(file)) { + try { + hash = require('crypto').createHash('md5').update(fs.readFileSync(file)).digest('base64'); + if (hash !== sigdb["v3"][file]) { + require('electron').dialog.showMessageBoxSync( + { + type: "warning", + title: "Source modification detected", + message: "File " + file + " has been flagged as modified (signing V3). If this is normal, please run the signing process again.\n\nExpected: " + sigdb["v3"][file] + "\nGot: " + hash + "\n\nYou are running a modified version of Kartik, do not expect to get support!" + } + ) + } + } catch (e) { + console.warn(" ! Could not compute V3 hash for " + file); } - } catch (e) { - console.warn(" ! Could not compute V3 hash for " + file); } - } - processed++; - load.webContents.send('progress', (processed/total)*100); - } + processed++; + load.webContents.send('progress', (processed/total)*100); + } - console.log(" * Generating resources pack"); - require('./modding/resources'); - console.log(" * Starting Kartik Modding Platform"); - require('./modding/parser'); - createWindow(); - }, 5000) + console.log(" * Generating resources pack"); + require('./modding/resources'); + console.log(" * Starting Kartik Modding Platform"); + require('./modding/parser'); + createWindow(); + }, 5000) + }) }) app.on('window-all-closed', () => { diff --git a/index.html b/index.html index 6c44948..2262caa 100644 --- a/index.html +++ b/index.html @@ -40,6 +40,19 @@ } } +
+ hello + goodbye +