Skip to content

Commit

Permalink
Merge pull request #151 from Andy-K-Sparklight/main
Browse files Browse the repository at this point in the history
release(*): bump version 51
  • Loading branch information
skjsjhb authored Jan 4, 2024
2 parents 24077a1 + 43acbdb commit 623c97c
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 95 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

[中文 README](./README_ZH.md)

## IMPORTANT

As I, the developer, decided not to contribute to the Minecraft communities, this project **won't receive major updates** since Core 50 (that's why I call it Sunset).

If servere security vulnerbilities are found in the future, patches might still be available. However, generally, this project is now discontinued.

It doesn't mean you have to switch to another launcher, but if you wish to, we recommand [HMCL](https://github.com/huanghongxun/HMCL), it's a free software (as in freedom) and is still being actively maintained.

---

A third party Minecraft launcher, with high performance and freedom.

![.](https://img.shields.io/badge/Alicorn-is%20cute!-df307f)
Expand Down Expand Up @@ -60,25 +70,25 @@ To build Alicorn, you'll need:
- [Git](https://git-scm.com)

- Clone the repository:

```shell
git clone https://github.com/Andy-K-Sparklight/Alicorn.git --depth=1
```

- Install dependencies:

```shell
yarn
```

- Run build:

```shell
yarn make
```

This will generate binaries and put them under `out`, including Windows x64, Windows ia32, GNU/Linux x64, GNU/Linux arm64 ~~and macOS x64~~. This will also generate corresponding archives.

_The support for macOS has ended and no more platform dependent code will be commited. The modules present are still kept, but might not run correctly._

You also need `wine` to complete the cross build progress on platforms other than Windows. Follow the instructions given by `electron-packager`.
24 changes: 17 additions & 7 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

[English README](./README.md)

## 重要信息

我们并不想让故事就此结束,但是作为开发者,我对 Minecraft 社区已不再抱有太多的信心。因此,Alicorn 在未来将不会接收**主要更新**,也正是因此,核心版本 50 被叫做**落日**

如果将来发现了严重的安全漏洞,Alicorn 依然会得到安全性更新,但是总体上来说,这个项目将不会继续了。

这并不意味着你必须要换一个启动器,在可预见的将来,Alicorn 应当依然能够启动未来的数个版本,但是如果你想要更好,我们推荐 [HMCL](https://github.com/huanghongxun/HMCL),它是自由软件,性能和功能并重,并且现在依然在积极的维护中。

---

高性能并且自由的第三方 Minecraft 启动器。

![.](https://img.shields.io/badge/Alicorn-is%20cute!-df307f)
Expand Down Expand Up @@ -62,27 +72,27 @@
- 一份好用的网络连接

- 首先,克隆本仓库:

```shell
git clone https://github.com/Andy-K-Sparklight/Alicorn.git --depth=1
```

- 安装依赖:

```shell
yarn
```

Alicorn Launcher 有相当多的依赖,包含 Electron 及其构建工具,如果您的网络环境不好,请考虑设置一个镜像或者使用代理服务器,并为 Electron 进行额外的设置。

- 运行构建:

```shell
yarn make
```

该命令构建所有的二进制文件并输出到 `out` 下:Windows x64,Windows ia32,GNU/Linux x64,GNU/Linux arm64 ~~以及 macOS x64~~。该命令同时会生成对应的压缩包。

_macOS 的支持已经正式告终,Alicorn 现在不再为 macOS 编写平台相关代码。已有模块仍然保留,但可能无法正常工作。_

请注意非 Windows 操作系统在构建 Windows 应用时需要 wine 的支持,可参考 electron-packager 的输出信息安装。
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"appVersion": "Sunset",
"version": "1.0.0",
"updatorVersion": 50,
"updatorVersion": 51,
"scripts": {
"lc": "yarn lcd",
"df": "yarn dev-full",
Expand Down
File renamed without changes.
57 changes: 9 additions & 48 deletions resources/shared/defaults/PonyCN.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2385,63 +2385,23 @@ Mojang 版本

# Welcome.Suggest.Part1

['{Config:interactive.i-have-a-crush-on-al}'=='false']今天是 {Date},欢迎你使用 Alicorn Launcher,{UserName}!
这个世界还值得你留念?那我会陪着你的。

[new Date().getHours()>=18]好上晚!哦,我刚刚在练习古小马语……
Alicorn 感谢你的陪伴,至少与你一同见证过斗转星移。

[(()=>{const hours=new Date().getHours();return hours>=23||hours<=6;})()]好困……这个时候叫我……?
[new Date().getHours()>=18]黑夜令群星更闪耀,暮色使落日更辉煌。

[(()=>{const hours=new Date().getHours();return hours>=23||hours<=6;})()]哈……好困,不行,我先去休息了,你自己玩吧(不悦)
[(()=>{const hours=new Date().getHours();return hours>=23||hours<=6;})()]时间若能在此静止,结局倒还不算太坏。

[(()=>{const hours=new Date().getHours();return hours>=23||hours<=6;})()]保证充足睡眠有助于抵御病毒哦!
[(()=>{const hours=new Date().getHours();return hours>=7&&hours<=11;})()]上午好,你依然如此有精神?真意外。

[(()=>{const hours=new Date().getHours();return hours>=7&&hours<=11;})()]上午好!今天的天气真不错……什么?我猜错了?这不能怪我,要不你来预测天气试试
[new Date().getHours()==12]正午,是开始的结束,还是结束的开始

[new Date().getHours()==12]正午到!六分仪已经就绪,出发!

[(()=>{const hours=new Date().getHours();return hours>=7&&hours<=9;})()]早上好!来一杯牛奶……?

无论什么时候你需要我,我都在这里的啦……

嗯呐……什么事?

戴口罩,多通风,少聚集,玩玩 MC 就很好~

['{Config:interactive.i-have-a-crush-on-al}'=='true']你这是什么眼神……唔?唔唔唔!放开我!

['{Config:interactive.i-have-a-crush-on-al}'=='true']这两只小马耳朵?很可爱?想摸摸吗?

['{Config:interactive.i-have-a-crush-on-al}'=='true']我可是会飞的哦~看着!(张开翅膀)

['{Config:updator.use-update}'=='false']不要担心升级!更新后的我就像暮光公主变成坎特拉女孩一样,虽然样子不同,但我不会忘了你的!
能在这里见到你真是太好了。

拒绝 Mod 平台的广告。使用 Modrinth 而拒绝 Curseforge,就是在为大家贡献力量。

['{Config:dev.experimental}'=='true']不要一边驾驶飞机,一边测试飞机的引擎……

['{Config:theme.background}'=='ACG']看多了 ACG 图片,会不会就不喜欢我了呢……

['{Config:updator.url}'!=='']订阅其它源的更新 URL 不一定可信,要小心哦!

['{Config:readyboom}'=='false']没有 ReadyBoom,你都不知道我的速度有多快!

['{Config:dev.experimental}'=='true']听说实验室容易爆炸,实验功能也是一样……

我相信每个人都有一颗小马般的心~

[(()=>{const hours=new Date().getHours();return hours>=18&&hours<=21;})()]虽然我还小,但我觉得在这个浪漫的晚上,似乎也可以小酌一杯苹果酒~

['{Config:interactive.i-have-a-crush-on-al}'=='true']嗯……不行,不能抱我……

['{Config:interactive.i-have-a-crush-on-al}'=='true']来一起跳支舞……?

['{Config:interactive.i-have-a-crush-on-al}'=='true']这不是水,这是苹果酒,提神用的……要来一杯吗?

['{Config:interactive.i-have-a-crush-on-al}'=='true']我可是书虫!不然我怎么对付 Forge 的安装器呢?

['{Config:interactive.i-have-a-crush-on-al}'=='true']在你玩游戏的时候,我可没有偷懒,我在默默地看着你呢~

['{Config:interactive.i-have-a-crush-on-al}'=='false']您还记得我吗?我?我记得每一位用户……
我?我的存储模块还挺可靠,我不会忘记你。

# Welcome.TipName

Expand Down Expand Up @@ -3660,6 +3620,7 @@ MCBBS(Minecraft 中文论坛)……这里是热爱 MC 群体的天堂。\nFr

这是 Alicorn 的前世今生的全部时间线。我知道不会有多少人会想了解我,但这不重要,这相当于我的自传吧……\n\n\
至今 - 你现在看到的 Alicorn。\n\
2022 年 8 月 17 日 - Alicorn 正式停止主要功能更新,ThatRarityEG 表示将离开 Minecraft 社区。
2022 年 1 月 15 日 - 这对于 Alicorn 来说是一个重要的夜晚,继触觉之后,Alicorn 拥有了听觉。\n\
2021 年 8 月 20 日 - Alicorn 在 MCBBS 发布,从此走上新的旅程。\n\
2021 年 8 月 ?? 日 - Alicorn 结束了最后的测试,并发布了第一个核心,从那时至今,几乎每周都会发布一个新版本。\n\
Expand Down
6 changes: 3 additions & 3 deletions src/main/Background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ export function registerBackgroundListeners(): void {
setTimeout(() => {
if (
loginWindow &&
!loginWindow?.isDestroyed() &&
!loginWindow?.isVisible()
!loginWindow.isDestroyed() &&
!loginWindow.isVisible()
) {
loginWindow?.show();
loginWindow.show();
}
}, 5000); // Easy everyone, don't get panic!
await loginWindow.loadURL(LOGIN_START);
Expand Down
43 changes: 41 additions & 2 deletions src/main/Bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, ipcMain, screen, Session } from "electron";
import { app, BrowserWindow, ipcMain, screen, Session, Menu } from "electron";
import { btoa } from "js-base64";
import path from "path";
import { DOH_CONFIGURE } from "../modules/commons/Constants";
Expand All @@ -9,6 +9,7 @@ import {
loadConfigSync,
movOldConfigFolderSync,
} from "../modules/config/ConfigSupport";
import os from "os";
import { setBeacon } from "../modules/selfupdate/Beacon";
import { registerBackgroundListeners } from "./Background";
import { getUsingDM, initDisplayManager } from "./DisplayManager";
Expand Down Expand Up @@ -89,7 +90,45 @@ async function whenAppReady() {
backgroundColor: "#fff",
});
mainWindow.setAspectRatio(1.92);
mainWindow.setMenu(null);
if (getString("frame.drag-impl") === "TitleBar") {
const subMenus = [
"LaunchPad",
"Welcome",
"InstallCore",
"ContainerManager",
"JavaSelector",
"AccountManager",
"Cadance",
"Boticorn",
"UtilitiesIndex",
"Statistics",
"Options",
"DMCenter",
"ServerList",
"Version",
"TheEndingOfTheEnd",
].map((lb) => {
return {
label: lb,
// eslint-disable-next-line require-await
click: async () => {
mainWindow?.webContents.send("menu-click", lb);
},
};
});

if (os.platform() == "darwin") {
const menu = Menu.buildFromTemplate([
{ label: "Alicorn", submenu: [{ role: "quit" }, ...subMenus] },
]);
Menu.setApplicationMenu(menu);
} else {
const menu = Menu.buildFromTemplate(subMenus);
mainWindow.setMenu(menu);
}
} else {
mainWindow.setMenu(null);
}
mainWindow.webContents.on("did-navigate-in-page", () => {
mainWindow?.webContents.setZoomLevel(0);
});
Expand Down
4 changes: 4 additions & 0 deletions src/modules/container/MinecraftContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export class MinecraftContainer {
return path.resolve(this.getModsRoot(), modJar);
}

getNativesLocation(id: string): string {
return path.resolve(this.rootDir, "versions", id, "natives");
}

getVersionBase(): string {
return path.resolve(this.versionsBase);
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launch/ArgsGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function generateVMArgs(
);
}*/
// All natives directories put together
vMap.set("natives_directory", nativesLibs.join(FILE_SEPARATOR));
vMap.set("natives_directory", container.getNativesLocation(profile.id));
// 1.17
vMap.set("library_directory", container.getLibrariesRoot());
// Attention! Use base version!
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launch/Ensurance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function ensureNatives(
for (const s of toEnsureLibraries) {
allPromises.push(
new Promise<void>((resolve) => {
void checkExtractTrimNativeLocal(container, s).then(() => {
void checkExtractTrimNativeLocal(container, profile.id, s).then(() => {
resolve();
});
})
Expand Down
8 changes: 2 additions & 6 deletions src/modules/launch/NativesLint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ const NATIVES_LOCK_FILE = "natives.lock.ald";
// We should validate hash, but it's unnecessary
export async function checkExtractTrimNativeLocal(
container: MinecraftContainer,
id: string,
nativeArtifact: ArtifactMeta
): Promise<void> {
try {
const srcFile = container.getLibraryPath(nativeArtifact.path);
const dest = container.getLibraryPath(
path.join(
path.dirname(nativeArtifact.path),
path.basename(nativeArtifact.path, JAR_SUFFIX)
)
);
const dest = container.getNativesLocation(id);
await fs.ensureDir(dest);
if (await checkLockFile(dest)) {
return;
Expand Down
22 changes: 9 additions & 13 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,9 @@ import {
Alert,
AppBar,
Box,
Button,
Chip,
ClassNameMap,
Container,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
Drawer,
Fab,
IconButton,
Expand All @@ -42,8 +36,6 @@ import {
ListItemIcon,
ListItemText,
Snackbar,
TextField,
ThemeProvider,
Toolbar,
Tooltip,
Typography,
Expand Down Expand Up @@ -88,11 +80,6 @@ import { YNDialog2 } from "./OperatingHint";
import { OptionsPage } from "./Options";
import { PffFront } from "./PffFront";
import { ReadyToLaunch } from "./ReadyToLaunch";
import {
ALICORN_DEFAULT_THEME_DARK,
ALICORN_DEFAULT_THEME_LIGHT,
isBgDark,
} from "./Renderer";
import { ServerList } from "./ServerList";
import { saveStatistics, Statistics } from "./Statistics";
import { AlicornTheme } from "./Stylex";
Expand Down Expand Up @@ -167,6 +154,12 @@ export function App(): JSX.Element {
useEffect(gotoMainIfEmpty, [window.location.hash]);
useEffect(popupInstruction(page), [page]);
useEffect(bindRefreshListener(setRefreshBit), []);
useEffect(() => {
ipcRenderer.addListener("menu-click", (_e, lb) => {
jumpTo("/" + lb);
triggerSetPage(lb);
});
}, []);
useEffect(
bindChangePageWarn(
setOpenChangePageWarn,
Expand Down Expand Up @@ -529,6 +522,9 @@ function AppTopBar(props: {
setOpenDrawer: (o: boolean) => void;
}): JSX.Element {
const classes = props.classes;
if (getString("frame.drag-impl") === "TitleBar") {
return <></>;
}
return (
<AppBar enableColorOnDark>
<Toolbar>
Expand Down
Loading

0 comments on commit 623c97c

Please sign in to comment.