Skip to content

Commit f5ec869

Browse files
committed
feat: ✨ v4.3.2
1 parent 4b6492e commit f5ec869

File tree

9 files changed

+113
-76
lines changed

9 files changed

+113
-76
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solartweaks",
3-
"version": "4.3.1",
3+
"version": "4.3.2",
44
"author": "SolarTweaks",
55
"contributors": [
66
"RichardDorian",

src/assets/global.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,17 @@ body[data-theme='light'] {
257257
}
258258
}
259259

260+
@keyframes fade_down {
261+
from {
262+
transform: translateY(-15px);
263+
opacity: 0;
264+
}
265+
to {
266+
transform: translateY(0);
267+
opacity: 1;
268+
}
269+
}
270+
260271
@keyframes scale_down {
261272
from {
262273
transform: scale(1.6);
@@ -275,4 +286,4 @@ body[data-theme='light'] {
275286
to {
276287
transform: scale(0.95);
277288
}
278-
}
289+
}

src/components/Content/Engine.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div id="options-title-container">
99
<div class="options-title-section">
1010
<img
11-
:src="`https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/8baaf723c0c991b4feaa2963c55794fffb98eaaa/${menu.module.name}.png`"
11+
:src="`https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/main/${menu.module.name}.png`"
1212
id="options-icon"
1313
:alt="`${menu.module.name} Image`"
1414
/>
@@ -65,7 +65,7 @@
6565
<div id="options-title-container">
6666
<div class="options-title-section">
6767
<img
68-
src="https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/8baaf723c0c991b4feaa2963c55794fffb98eaaa/customCommands.png"
68+
src="https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/main/customCommands.png"
6969
id="options-icon-custom-commands"
7070
alt="Command Aliases Image"
7171
/>
@@ -141,7 +141,7 @@
141141
>
142142
<div class="customization-icon-container">
143143
<img
144-
:src="`https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/8baaf723c0c991b4feaa2963c55794fffb98eaaa/${item.name}.png`"
144+
:src="`https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/main/${item.name}.png`"
145145
class="customization-icon"
146146
:alt="`${item.name} Image`"
147147
/>
@@ -171,7 +171,7 @@
171171
>
172172
<div class="customization-icon-container">
173173
<img
174-
src="https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/8baaf723c0c991b4feaa2963c55794fffb98eaaa/customCommands.png"
174+
src="https://raw.githubusercontent.com/Solar-Tweaks/Engine-Icons/main/customCommands.png"
175175
class="customization-icon"
176176
alt="Command Aliases Image"
177177
/>

src/components/Content/Home.vue

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div id="home-container">
3-
<div id="quick-play-container">
3+
<div id="quick-play-container" v-if="starredServers.length">
44
<div class="quick-play-content">
55
<div class="quick-play-servers">
66
<div
@@ -15,7 +15,15 @@
1515
</div>
1616
</div>
1717
<div id="posts-container">
18-
<div v-for="post in posts" v-bind:key="post.url" class="post-container">
18+
<div
19+
v-for="post in posts"
20+
v-bind:key="post.url"
21+
class="post-container"
22+
:class="{
23+
'post-container-normal': starredServers.length,
24+
'post-container-large': !starredServers.length,
25+
}"
26+
>
1927
<div class="post-image-container">
2028
<img
2129
:src="post.imageUrl"
@@ -26,7 +34,15 @@
2634
alt="Post Image"
2735
/>
2836
</div>
29-
<p class="post-description">{{ post.description }}</p>
37+
<p
38+
class="post-description"
39+
:class="{
40+
'post-description-normal': starredServers.length,
41+
'post-description-large': !starredServers.length,
42+
}"
43+
>
44+
{{ post.description }}
45+
</p>
3046
<div id="post-bottom-container">
3147
<div class="post-author-container">
3248
<p class="post-author">
@@ -257,13 +273,18 @@ export default {
257273
}
258274
.post-container {
259275
width: 400px;
260-
height: 285px;
261276
border-radius: 0.5rem;
262277
margin: 0 5px;
263278
background: var(--card-background);
264279
box-shadow: rgb(0 0 0 / 13%) 0px 1px 5px 0px;
265280
transition: transform 0.4s ease;
266281
}
282+
.post-container-normal {
283+
height: 285px;
284+
}
285+
.post-container-large {
286+
height: 355px;
287+
}
267288
.post-image-container {
268289
width: 400px;
269290
height: 170px;
@@ -288,7 +309,6 @@ export default {
288309
letter-spacing: 0.35px;
289310
line-height: 20px;
290311
margin: 0 5px;
291-
height: 45px;
292312
overflow: hidden;
293313
text-overflow: ellipsis;
294314
display: -webkit-box;
@@ -299,6 +319,12 @@ export default {
299319
overflow-y: scroll;
300320
margin-top: 5px;
301321
}
322+
.post-description-normal {
323+
height: 45px;
324+
}
325+
.post-description-large {
326+
height: 115px;
327+
}
302328
303329
#post-bottom-container {
304330
display: flex;

src/components/Content/Play.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
<div>
33
<div
44
id="play-container"
5-
:style="
6-
'height: ' +
7-
$store.getters.getPlayContainerHeight +
8-
'px;'
9-
"
5+
:style="'height: ' + $store.getters.getPlayContainerHeight + 'px;'"
6+
@keydown="closeVersionSelection"
107
>
118
<div id="buttons" :class="{ disabled: $store.state.isLaunching }">
129
<button
@@ -260,7 +257,7 @@ export default {
260257
*/
261258
262259
async closeVersionSelection(event) {
263-
if (event.key === 'Escape' && this.isSelectingVersion) {
260+
if (event.key === 'Escape') {
264261
await settings.set('version', this.selectedSubversion.id);
265262
await settings.set('module', this.selectedModule);
266263
await this.updateLaunchButton();

src/components/TitleBar.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@
3535
<i class="fa-solid fa-brush titlebar-button-icon"></i>
3636
</button>
3737
</div>
38-
<button
39-
class="titlebar-button"
40-
id="shortcut-btn"
41-
@click="showTutorial()"
42-
>
38+
<button class="titlebar-button" @click="showTutorial()">
4339
<i class="fa-solid fa-book titlebar-button-icon"></i>
4440
</button>
4541
<button class="titlebar-button" id="close-btn" @click="closeWindow()">
@@ -130,7 +126,7 @@ export default {
130126
131127
async registerClick() {
132128
this.clickCount++;
133-
if (this.clickCount == 10) {
129+
if (this.clickCount >= 10) {
134130
await settings.set('themeSwapperEnabled', true);
135131
if (this.theme === 'dark') this.toggleTheme();
136132
}
@@ -147,7 +143,8 @@ export default {
147143
keysDone += event.key;
148144
else keysDone = '';
149145
if (keysDone.length == keysAll.length) {
150-
this.links.push({ name: 'Debug', active: false });
146+
if (!this.links.find((link) => link.name == 'Debug'))
147+
this.links.push({ name: 'Debug', active: false });
151148
await settings.set('DeveloperMode', true);
152149
document.removeEventListener('keydown', listener);
153150
}

src/javascript/minecraft.js

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ export async function checkNatives(metadata) {
406406
icon: 'fa-solid fa-file',
407407
});
408408

409+
await rm(join(constants.DOTLUNARCLIENT, 'offline', 'multiver', 'natives'))
410+
.then(() => logger.log('Deleted Natives Directory'))
411+
.catch(() => logger.log('Natives Directory does not Exist'));
412+
409413
const artifact = metadata.launchTypeData.artifacts.find(
410414
(artifact) => artifact.type === 'NATIVES'
411415
);
@@ -414,26 +418,18 @@ export async function checkNatives(metadata) {
414418
join(constants.DOTLUNARCLIENT, 'offline', 'multiver', artifact.name)
415419
)
416420
) {
417-
if (
418-
!existsSync(
419-
join(constants.DOTLUNARCLIENT, 'offline', 'multiver', 'natives')
420-
)
421-
) {
422-
await extractZip(
423-
join(constants.DOTLUNARCLIENT, 'offline', 'multiver', artifact.name),
424-
{
425-
dir: join(constants.DOTLUNARCLIENT, 'offline', 'multiver', 'natives'),
426-
}
427-
)
428-
.then(() => {
429-
logger.debug('Extracted natives');
430-
})
431-
.catch((error) => {
432-
logger.throw('Failed to extract natives', error);
433-
});
434-
} else {
435-
logger.debug('Natives already extracted');
436-
}
421+
await extractZip(
422+
join(constants.DOTLUNARCLIENT, 'offline', 'multiver', artifact.name),
423+
{
424+
dir: join(constants.DOTLUNARCLIENT, 'offline', 'multiver', 'natives'),
425+
}
426+
)
427+
.then(() => {
428+
logger.debug('Extracted natives');
429+
})
430+
.catch((error) => {
431+
logger.throw('Failed to extract natives', error);
432+
});
437433
} else {
438434
logger.error('Natives not found, this should not happen');
439435
}
@@ -763,19 +759,15 @@ export async function checkAndLaunch(serverIp = null) {
763759
store.commit('setLaunching', true);
764760
updateActivity('In the launcher', 'Launching game');
765761

762+
const version = await settings.get('version');
763+
const skipChecks = await settings.get('skipChecks');
764+
766765
let success = true;
767766

768767
function error(action, err) {
769-
console.error(action, err);
770-
store.commit('setLaunchingState', {
771-
title: `LAUNCH ${version}`,
772-
message: 'READY TO LAUNCH',
773-
icon: 'fa-solid fa-gamepad',
774-
});
775-
store.commit('setLaunching', false);
768+
success = false;
776769
store.commit('setErrorMessage', `${action} Error: ` + (err.stack ?? err));
777770
store.commit('setErrorModal', true);
778-
success = false;
779771
logger.throw(`Failed to ${action}`, err);
780772
}
781773

@@ -786,7 +778,7 @@ export async function checkAndLaunch(serverIp = null) {
786778

787779
if (!metadata) return logger.error('No Metadata for Launch');
788780

789-
if (!(await settings.get('skipChecks'))) {
781+
if (!skipChecks) {
790782
// Check JRE
791783
if (!(await checkJRE(metadata).catch((err) => error('Check JRE', err))))
792784
return;
@@ -819,15 +811,22 @@ export async function checkAndLaunch(serverIp = null) {
819811
await checkEngine().catch((err) => error('Check Engine', err));
820812
}
821813

822-
if (!success) return;
814+
if (!success) {
815+
remote.getCurrentWindow().setProgressBar(-1);
816+
store.commit('setLaunching', false);
817+
return store.commit('setLaunchingState', {
818+
title: `LAUNCH ${version}`,
819+
message: 'READY TO LAUNCH',
820+
icon: 'fa-solid fa-gamepad',
821+
});
822+
}
823823

824824
// Launch game
825825
await launchGame(metadata, serverIp, await settings.get('debugMode')).catch(
826826
(err) => error('Launch Game', err)
827827
);
828828

829829
// Trackers
830-
const version = await settings.get('version');
831830
await axios
832831
.post(`${constants.API_URL}${constants.ENDPOINTS.LAUNCH}`, {
833832
item: 'launcher',

src/javascript/updater.js

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,37 @@ export async function checkForUpdates() {
5151
'Downloading update in the background. Please wait.\n\nThis may take a while depending on your internet speed. You can close this window and use the launcher, we will notify you when the update is ready.',
5252
});
5353

54-
const filename = `launcher-${release.data.index.stable.launcher}-update-temp.exe`;
55-
const filePath = join(constants.SOLARTWEAKS_DIR, filename);
54+
const updateReady = async () => {
55+
const choice2 = await remote.dialog.showMessageBox({
56+
type: 'question',
57+
title: 'Update ready',
58+
message: `The update is ready to be installed.`,
59+
buttons: ['Cancel update', 'Install update'],
60+
});
5661

57-
await downloadAndSaveFile(
58-
`${constants.API_URL}${constants.UPDATERS.LAUNCHER.replace(
59-
'{version}',
60-
release.data.index.stable.launcher
61-
)}`,
62-
filePath,
63-
'blob'
64-
);
62+
if (choice2.response === 1) return true;
63+
else return false; // Cancel update or closed
64+
};
6565

66-
const choice2 = await remote.dialog.showMessageBox({
67-
type: 'question',
68-
title: 'Update ready',
69-
message: `The update is ready to be installed.`,
70-
buttons: ['Cancel update', 'Install update'],
71-
});
66+
if (platform === 'win32') {
67+
const filename = `launcher-${release.data.index.stable.launcher}-update-temp.exe`;
68+
const filePath = join(constants.SOLARTWEAKS_DIR, filename);
69+
70+
await downloadAndSaveFile(
71+
`${constants.API_URL}${constants.UPDATERS.LAUNCHER.replace(
72+
'{version}',
73+
release.data.index.stable.launcher
74+
)}`,
75+
filePath,
76+
'blob'
77+
);
7278

73-
if (choice2.response !== 1) return; // Cancel update or closed
79+
if (!(await updateReady())) return;
7480

75-
execSync(filePath);
81+
execSync(filePath);
7682

77-
await unlink(filePath);
83+
await unlink(filePath);
84+
}
7885

7986
remote.app.quit();
8087
} else logger.info('Launcher up to date');

0 commit comments

Comments
 (0)