From c3b756f987ffd8ca981c1e6f23435c74aad36aea Mon Sep 17 00:00:00 2001 From: Minteck <46352972+Minteck@users.noreply.github.com> Date: Sat, 10 Jul 2021 16:03:26 +0200 Subject: Fixes --- app.js | 24 +++-- lang/en.json | 27 +++++ online/levels.txt | 200 +++++++++++++++++++++++++++++++++++++ package.json | 2 +- race/cars/car1ai.js | 2 +- sfx/click.mp3 | Bin 4461 -> 8641 bytes sfx/crash.mp3 | Bin 9453 -> 13194 bytes sfx/intro.mp3 | Bin 9026 -> 0 bytes sfx/last.mp3 | Bin 8168 -> 26670 bytes sfx/menu.mp3 | Bin 5037 -> 7561 bytes sfx/notification.mp3 | Bin 41006 -> 11425 bytes sfx/pass.mp3 | Bin 10884 -> 22309 bytes sfx/pause.mp3 | Bin 11565 -> 14353 bytes sfx/win.mp3 | Bin 3361 -> 24337 bytes signing/sign.js | 4 +- views/loader.svg | 4 +- views/loader/back.png | Bin 0 -> 67643 bytes views/loader/logo.png | Bin 0 -> 165369 bytes views/menu.css | 70 +++++++++++++ views/menu.html | 34 ++++++- views/script/core_compatlayer.js | 4 +- views/script/global_compatlayer.js | 4 +- views/script/global_levelsapi.js | 47 +++++++++ views/script/loader_global.js | 7 +- views/script/menu_global.js | 2 + views/script/menu_login.js | 155 ++++++++++++++++++++++++++++ views/stats.html | 2 +- 27 files changed, 564 insertions(+), 24 deletions(-) create mode 100644 online/levels.txt delete mode 100644 sfx/intro.mp3 create mode 100644 views/loader/back.png create mode 100644 views/loader/logo.png create mode 100644 views/script/global_levelsapi.js create mode 100644 views/script/menu_login.js diff --git a/app.js b/app.js index 8e4ea52..30b2439 100644 --- a/app.js +++ b/app.js @@ -269,17 +269,29 @@ const { app, BrowserWindow } = require('electron'); win.webContents.send('setmusic', value); } }) - musicIpc.on('prefademusic', (event, value) => { - win.webContents.send('fademusic', value); - }) - musicIpc.on('preunfademusic', (event, value) => { - win.webContents.send('unfademusic', value); - }) + + const LevelsAPI = require('./views/script/global_levelsapi'); + const lvl = new LevelsAPI(); stats = require(homedir + "/.kartik/stats.json"); musicIpc.on('addstats', (event, value) => { stats[value.catalog][value.key] = stats[value.catalog][value.key] + value.add; fs.writeFile(homedir + "/.kartik/stats.json", JSON.stringify(stats), () => {}); + + if (value.key === "laps" && fs.existsSync(homedir + "/.kartik/authentication.json")) { + auth = JSON.parse(fs.readFileSync(homedir + "/.kartik/authentication.json").toString()); + level = lvl.correspond(stats["ingame"]["laps"], "256") - 1 + 1; + + if (level !== auth.level) { + auth.level = level + fs.writeFileSync(homedir + "/.kartik/authentication.json", JSON.stringify(auth)); + if (level < 200) { + win.webContents.send("notification", {title: lang.polymer.levelup[0], message: lang.polymer.levelup[1] + " " + level + " " + lang.polymer.levelup[2]}); + } else { + win.webContents.send("notification", {title: lang.polymer.finished[0], message: lang.polymer.finished[1]}); + } + } + } }) musicIpc.on('addstatsandclose', (event, value) => { stats[value.catalog][value.key] = stats[value.catalog][value.key] + value.add; diff --git a/lang/en.json b/lang/en.json index 6f75c3d..19372a4 100644 --- a/lang/en.json +++ b/lang/en.json @@ -200,5 +200,32 @@ "ingame.laps": "Number of laps you made", "ingame.turns": "Number of rotations you made" } + }, + "polymer": { + "gpu": "GPU Support Status", + "logging": "We are logging you in ; check for your Web browser window and accept the login.", + "loginClose": "You can now close this tab/window and go back to Kartik.", + "gatheringLogin": "We are checking your account ; this may take a while.", + "loginIntro": "Press L to login", + "ktoLevel": "Level", + "ktoMaxLevel": "God", + "error": [ + "Unable to communicate with servers", + "You won't be able to use Kartik Online until we can connect to the servers.", + "Go online to log in" + ], + "updateError": [ + "Unable to check for updates", + "We cannot check for new updates right now, please try again later." + ], + "levelup": [ + "Level up!", + "You have reached level", + "and you're gaining power! Continue and try to reach the maximum level." + ], + "finished": [ + "You've beaten the game!", + "Finished Kartik?! Yes. You've reached the god level!" + ] } } diff --git a/online/levels.txt b/online/levels.txt new file mode 100644 index 0000000..6566fea --- /dev/null +++ b/online/levels.txt @@ -0,0 +1,200 @@ +1:1 +2:2 +3:3 +4:4 +5:5 +6:7 +7:9 +8:11 +9:13 +10:16 +11:19 +12:22 +13:25 +14:29 +15:33 +16:37 +17:41 +18:46 +19:51 +20:56 +21:61 +22:67 +23:73 +24:79 +25:85 +26:92 +27:99 +28:106 +29:113 +30:121 +31:129 +32:137 +33:145 +34:154 +35:163 +36:172 +37:181 +38:191 +39:201 +40:211 +41:221 +42:232 +43:243 +44:254 +45:265 +46:277 +47:289 +48:301 +49:313 +50:326 +51:339 +52:352 +53:365 +54:379 +55:393 +56:407 +57:421 +58:436 +59:451 +60:466 +61:481 +62:497 +63:513 +64:529 +65:545 +66:562 +67:579 +68:596 +69:613 +70:631 +71:649 +72:667 +73:685 +74:704 +75:723 +76:742 +77:761 +78:781 +79:801 +80:821 +81:841 +82:862 +83:883 +84:904 +85:925 +86:947 +87:969 +88:991 +89:1013 +90:1036 +91:1059 +92:1082 +93:1105 +94:1129 +95:1153 +96:1177 +97:1201 +98:1226 +99:1251 +100:1276 +101:1301 +102:1327 +103:1353 +104:1379 +105:1405 +106:1432 +107:1459 +108:1486 +109:1513 +110:1541 +111:1569 +112:1597 +113:1625 +114:1654 +115:1683 +116:1712 +117:1741 +118:1771 +119:1801 +120:1831 +121:1861 +122:1892 +123:1923 +124:1954 +125:1985 +126:2017 +127:2049 +128:2081 +129:2113 +130:2146 +131:2179 +132:2212 +133:2245 +134:2279 +135:2313 +136:2347 +137:2381 +138:2416 +139:2451 +140:2486 +141:2521 +142:2557 +143:2593 +144:2629 +145:2665 +146:2702 +147:2739 +148:2776 +149:2813 +150:2851 +151:2889 +152:2927 +153:2965 +154:3004 +155:3043 +156:3082 +157:3121 +158:3161 +159:3201 +160:3241 +161:3281 +162:3322 +163:3363 +164:3404 +165:3445 +166:3487 +167:3529 +168:3571 +169:3613 +170:3656 +171:3699 +172:3742 +173:3785 +174:3829 +175:3873 +176:3917 +177:3961 +178:4006 +179:4051 +180:4096 +181:4141 +182:4187 +183:4233 +184:4279 +185:4325 +186:4372 +187:4419 +188:4466 +189:4513 +190:4561 +191:4609 +192:4657 +193:4705 +194:4754 +195:4803 +196:4852 +197:4901 +198:4951 +199:5001 +200:5051 \ No newline at end of file diff --git a/package.json b/package.json index 11e0311..93490a9 100644 --- a/package.json +++ b/package.json @@ -1 +1 @@ -{"name":"kartik","version":"a69a90e","channel":"git","description":"A multiplatform 2D karting game","main":"app.js","dependencies":{"@electron/remote":"^1.0.4","discord-rpc":"^3.2.0","electron":"^12.0.1","ini":"^1.3.8","jquery":"^3.6.0","os-locale":"^5.0.0","systeminformation":"^5.7.7","uuid":"^8.3.2","yaml":"^1.10.2"},"scripts":{"test":"node_modules\\electron\\dist\\electron.exe app.js"},"author":"Minteck Projects","license":"GPL-3.0-or-later","serial":"XXX99999999999"} \ No newline at end of file +{"name":"kartik","version":"83fb25f","channel":"git","description":"A multiplatform 2D karting game","main":"app.js","dependencies":{"@electron/remote":"^1.0.4","discord-rpc":"^3.2.0","electron":"^12.0.1","ini":"^1.3.8","jquery":"^3.6.0","open":"^8.2.1","os-locale":"^5.0.0","systeminformation":"^5.7.7","uuid":"^8.3.2","yaml":"^1.10.2"},"scripts":{"test":"node_modules\\electron\\dist\\electron.exe app.js"},"author":"Minteck Projects","license":"GPL-3.0-or-later","serial":"XXX99999999999"} \ No newline at end of file diff --git a/race/cars/car1ai.js b/race/cars/car1ai.js index 25e1819..87e5920 100644 --- a/race/cars/car1ai.js +++ b/race/cars/car1ai.js @@ -53,7 +53,7 @@ function enableAI() { } else if (overlap) { car1speed = 9; } else { - car1speed = 10; + car1speed = 16; } carshb = document.getElementById("aibox-far").getBoundingClientRect(); diff --git a/sfx/click.mp3 b/sfx/click.mp3 index 710c85b..20feda0 100644 Binary files a/sfx/click.mp3 and b/sfx/click.mp3 differ diff --git a/sfx/crash.mp3 b/sfx/crash.mp3 index 1ce02e9..c68bb1f 100644 Binary files a/sfx/crash.mp3 and b/sfx/crash.mp3 differ diff --git a/sfx/intro.mp3 b/sfx/intro.mp3 deleted file mode 100644 index 5d90f31..0000000 Binary files a/sfx/intro.mp3 and /dev/null differ diff --git a/sfx/last.mp3 b/sfx/last.mp3 index 2595f73..ff00ddf 100644 Binary files a/sfx/last.mp3 and b/sfx/last.mp3 differ diff --git a/sfx/menu.mp3 b/sfx/menu.mp3 index f48daa8..626a82e 100644 Binary files a/sfx/menu.mp3 and b/sfx/menu.mp3 differ diff --git a/sfx/notification.mp3 b/sfx/notification.mp3 index c3dc438..09f548a 100644 Binary files a/sfx/notification.mp3 and b/sfx/notification.mp3 differ diff --git a/sfx/pass.mp3 b/sfx/pass.mp3 index 04caca0..e4fc004 100644 Binary files a/sfx/pass.mp3 and b/sfx/pass.mp3 differ diff --git a/sfx/pause.mp3 b/sfx/pause.mp3 index aedcd13..76d0634 100644 Binary files a/sfx/pause.mp3 and b/sfx/pause.mp3 differ diff --git a/sfx/win.mp3 b/sfx/win.mp3 index 9a7ae56..d3c3b89 100644 Binary files a/sfx/win.mp3 and b/sfx/win.mp3 differ diff --git a/signing/sign.js b/signing/sign.js index 2e1c23d..bb8d534 100644 --- a/signing/sign.js +++ b/signing/sign.js @@ -9,7 +9,7 @@ global.sdb = { function scan(start) { rt = fs.readdirSync(start); for (file of rt) { - if (file !== ".git" && file !== "build" && file !== "signatures.json" && file !== "staging" && file !== "node_modules" && !file.endsWith(".staging") && !file.endsWith(".old") && file !== "_translate") { + if (file !== ".git" && file !== "build" && file !== "signatures.json" && file !== "staging" && file !== "node_modules" && !file.endsWith(".staging") && !file.endsWith(".old") && file !== "_translate" && file !== "macos") { if (fs.lstatSync(start + "/" + file).isDirectory()) { scan(start + "/" + file); } else { @@ -30,4 +30,4 @@ function scan(start) { } scan(".."); -fs.writeFileSync("../bin/signatures.json", JSON.stringify(sdb)); \ No newline at end of file +fs.writeFileSync("../bin/signatures.json", JSON.stringify(sdb)); diff --git a/views/loader.svg b/views/loader.svg index 77a496e..042b338 100644 --- a/views/loader.svg +++ b/views/loader.svg @@ -115,7 +115,7 @@ - + Kartik %version% @@ -123,6 +123,6 @@ - + diff --git a/views/loader/back.png b/views/loader/back.png new file mode 100644 index 0000000..4d268cc Binary files /dev/null and b/views/loader/back.png differ diff --git a/views/loader/logo.png b/views/loader/logo.png new file mode 100644 index 0000000..09112ca Binary files /dev/null and b/views/loader/logo.png differ diff --git a/views/menu.css b/views/menu.css index 2c2b94f..ca90e93 100644 --- a/views/menu.css +++ b/views/menu.css @@ -151,4 +151,74 @@ .item-icon { filter: invert(1); vertical-align: middle; +} + +div.services.home { + top: 115px; + padding: 0; + display: flex; + align-items: center; + bottom: 70px; + z-index: 9999; +} + +div.services.home > div.items > ul > li > span.item { + width: 216px; + border-radius: 0; +} + +div.services.home > div.items > ul > li > span.item > a { + margin-left: 10px; + margin-right: 10px; + width: 100%; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +div.services.home > div.items { + width: 256px; +} + +div.services.home > div.items > ul { + padding: 0; +} + +div.services.home > div.items > ul > li { + list-style: none; +} + +div.services.home > div.items > ul > li > span.item { + margin-left: 10vw; + transition: none; +} + +img[alt="full-logo"] { + margin-left: calc(10vw + 37.5px) !important; + margin-top: 55px !important; + height: 56px !important; + z-index: 99999; + position: fixed; +} + +span#copyright { + bottom: 46px; + left: 10vw; + z-index: 9999; + color: rgba(255, 255, 255, 0.75); + right: unset; + width: 227px; + text-align: center; +} + +#services-background { + position: fixed; + top: 0; + bottom: 0; + width: 227px; + z-index: 9; + backdrop-filter: blur(10px); + background: rgba(0, 0, 0, 0.5); + left: 10vw; } \ No newline at end of file diff --git a/views/menu.html b/views/menu.html index d00107c..26e79db 100644 --- a/views/menu.html +++ b/views/menu.html @@ -11,6 +11,7 @@ Kartik +