mirror of
https://github.com/gradenGnostic/LegacyLauncher.git
synced 2026-06-30 18:17:07 +00:00
initial commit
This commit is contained in:
parent
86110f6efb
commit
b7b9c56a83
BIN
256x256.png
Normal file
BIN
256x256.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
BIN
Minecraft.ttf
Normal file
BIN
Minecraft.ttf
Normal file
Binary file not shown.
102
README.md
102
README.md
|
|
@ -1 +1,101 @@
|
|||
# LegacyLauncher
|
||||
# LegacyLauncher
|
||||
|
||||
A custom launcher for Minecraft Legacy Console Edition.
|
||||
|
||||
## Features
|
||||
|
||||
- **Minecraft-style GUI**: Authentic pixelated interface with Minecraft font and styling
|
||||
- **Automatic Updates**: Fetches latest releases from GitHub repositories
|
||||
- **Cross-platform Support**: Works on Windows and Linux
|
||||
- **Profiles**: Save your username and track playtime
|
||||
- **Custom Launch Options**: Configure IP, port, and server mode
|
||||
|
||||
## Installation
|
||||
|
||||
### From Source
|
||||
1. Clone or download this repository
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
3. Run the launcher:
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
|
||||
## Building
|
||||
|
||||
### Linux AppImage
|
||||
```bash
|
||||
npm run dist
|
||||
```
|
||||
|
||||
### Windows Installer
|
||||
```bash
|
||||
npm run dist:win
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Repository Source
|
||||
By default, the launcher fetches releases from `smartcmd/MinecraftConsoles`. You can change this in the Options menu.
|
||||
|
||||
### Launch Options
|
||||
- **GitHub Repository**: Source repository for game releases
|
||||
- **Client Executable**: Name of the executable file (default: `Minecraft.Client.exe`)
|
||||
- **Compatibility Layer**: For Linux users - choose between direct execution, Wine, or Proton
|
||||
- **Connect/Bind IP**: Optional IP address for multiplayer
|
||||
- **Port**: Optional port number
|
||||
- **Server Mode**: Launch as headless server
|
||||
|
||||
### Profile Settings
|
||||
- **Username**: Your in-game player name
|
||||
- **Playtime Tracking**: Automatically tracks total playtime
|
||||
|
||||
## System Requirements
|
||||
|
||||
- **Windows**: Direct execution of Windows executables
|
||||
- **Linux**: Wine or Proton for running Windows executables
|
||||
- **Internet**: Required for downloading game updates
|
||||
|
||||
## Compatibility Layers (Linux)
|
||||
|
||||
The launcher supports several compatibility options for Linux:
|
||||
|
||||
- **Direct**: Run native Linux executables (if available)
|
||||
- **Wine**: Wine compatibility layer
|
||||
- **Proton**: Steam's Proton compatibility layer
|
||||
|
||||
## Dependencies
|
||||
|
||||
- **Electron**: Cross-platform desktop app framework
|
||||
- **discord-rpc**: Discord Rich Presence integration
|
||||
- **extract-zip**: ZIP archive extraction
|
||||
- **Tailwind CSS**: UI styling (via CDN)
|
||||
|
||||
## Development
|
||||
|
||||
The launcher is built with:
|
||||
- **Frontend**: HTML, CSS, JavaScript
|
||||
- **Backend**: Electron with Node.js
|
||||
- **Styling**: Custom CSS with Minecraft theme + Tailwind CSS
|
||||
- **Build**: Electron Builder
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Repository not found**: Check the repository name in Options
|
||||
2. **Executable not found**: Verify the executable name matches the downloaded file
|
||||
3. **Launch failures**: Try different compatibility layers on Linux
|
||||
4. **Discord RPC issues**: Ensure Discord is running and RPC is enabled
|
||||
|
||||
### Linux Specific
|
||||
- Install Wine: `sudo apt install wine` (Ubuntu/Debian)
|
||||
- For Proton: Requires Steam installation
|
||||
- AppImage permissions: `chmod +x LegacyLauncher-*.AppImage`
|
||||
|
||||
## Contributing
|
||||
|
||||
Feel free to submit issues and pull requests for improvements.</content>
|
||||
|
|
|
|||
1181
index.html
Normal file
1181
index.html
Normal file
File diff suppressed because it is too large
Load diff
120
main.js
Normal file
120
main.js
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
const { app, BrowserWindow, shell, ipcMain } = require('electron');
|
||||
const path = require('path');
|
||||
const DiscordRPC = require('discord-rpc');
|
||||
|
||||
const clientId = '1346541144141103114';
|
||||
let rpc;
|
||||
|
||||
function initRPC() {
|
||||
rpc = new DiscordRPC.Client({ transport: 'ipc' });
|
||||
|
||||
rpc.on('ready', () => {
|
||||
console.log('Discord RPC ready');
|
||||
setActivity();
|
||||
});
|
||||
|
||||
rpc.on('error', (err) => {
|
||||
console.error('Discord RPC Error:', err);
|
||||
});
|
||||
|
||||
rpc.on('disconnected', () => {
|
||||
console.log('Discord RPC disconnected, retrying...');
|
||||
setTimeout(connectRPC, 15000);
|
||||
});
|
||||
|
||||
connectRPC();
|
||||
}
|
||||
|
||||
function connectRPC() {
|
||||
rpc.login({ clientId }).catch(err => {
|
||||
|
||||
console.log('Discord RPC connection failed, retrying in 20s...');
|
||||
setTimeout(connectRPC, 20000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
initRPC();
|
||||
|
||||
function setActivity(details = 'In Menus', state = 'Ready to Play', startTime = null) {
|
||||
if (!rpc || !rpc.user) return;
|
||||
|
||||
const activity = {
|
||||
details: details,
|
||||
state: state,
|
||||
largeImageKey: 'logo',
|
||||
largeImageText: 'LegacyLauncher',
|
||||
instance: false,
|
||||
};
|
||||
|
||||
if (startTime) {
|
||||
activity.startTimestamp = startTime;
|
||||
}
|
||||
|
||||
rpc.setActivity(activity).catch(() => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 1280,
|
||||
height: 720,
|
||||
minWidth: 1024,
|
||||
minHeight: 600,
|
||||
resizable: true,
|
||||
frame: false,
|
||||
icon: path.join(__dirname, '256x256.png'),
|
||||
transparent: true,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
enableRemoteModule: true
|
||||
}
|
||||
});
|
||||
|
||||
win.maximize();
|
||||
win.loadFile('index.html');
|
||||
|
||||
// Handle window controls
|
||||
ipcMain.on('window-minimize', () => win.minimize());
|
||||
ipcMain.on('window-maximize', () => {
|
||||
if (win.isMaximized()) {
|
||||
win.unmaximize();
|
||||
} else {
|
||||
win.maximize();
|
||||
}
|
||||
});
|
||||
ipcMain.on('window-close', () => win.close());
|
||||
|
||||
|
||||
ipcMain.on('update-rpc', (event, data) => {
|
||||
setActivity(data.details, data.state, data.startTime);
|
||||
});
|
||||
|
||||
win.on('maximize', () => win.webContents.send('window-is-maximized', true));
|
||||
win.on('unmaximize', () => win.webContents.send('window-is-maximized', false));
|
||||
|
||||
|
||||
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||
shell.openExternal(url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
BIN
minecraft.jpg
Normal file
BIN
minecraft.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 300 KiB |
BIN
minecraftlogo.png
Normal file
BIN
minecraftlogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 320 KiB |
4989
package-lock.json
generated
Normal file
4989
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
48
package.json
Normal file
48
package.json
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "legacylauncher",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "electron .",
|
||||
"dist": "electron-builder --linux AppImage",
|
||||
"dist:win": "electron-builder --win nsis"
|
||||
},
|
||||
"build": {
|
||||
"appId": "com.legacylauncher.app",
|
||||
"productName": "LegacyLauncher",
|
||||
"win": {
|
||||
"target": [
|
||||
"nsis"
|
||||
],
|
||||
"icon": "256x256.png"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"allowToChangeInstallationDirectory": true
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
"AppImage"
|
||||
],
|
||||
"category": "Game",
|
||||
"icon": "256x256.png"
|
||||
},
|
||||
"files": [
|
||||
"**/*",
|
||||
"!dist/*"
|
||||
]
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"discord-rpc": "^4.0.1",
|
||||
"extract-zip": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^40.7.0",
|
||||
"electron-builder": "^26.8.1"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue