mirror of
https://github.com/artegoser/pimi-launcher.git
synced 2024-11-22 11:26:22 +03:00
fix: version selection, path to data
This commit is contained in:
parent
63c9bbf2e6
commit
73abb1c352
4 changed files with 12 additions and 9 deletions
|
@ -18,7 +18,7 @@ import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
|||
import react from '@vitejs/plugin-react'
|
||||
import commonjsExternals from 'vite-plugin-commonjs-externals'
|
||||
|
||||
const externals = ['pimi-launcher-core', 'path']
|
||||
const externals = ['pimi-launcher-core', 'path', 'process']
|
||||
|
||||
export default defineConfig({
|
||||
main: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "pimi-launcher",
|
||||
"version": "1.0.0",
|
||||
"description": "An Electron application with React",
|
||||
"version": "1.0.0-alpha",
|
||||
"description": "Modern Minecraft Launcher",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "artegoser",
|
||||
"homepage": "https://github.com/artegoser/pimi-launcher",
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { Client, Authenticator } from 'pimi-launcher-core'
|
||||
|
||||
import path from 'path'
|
||||
import process from 'process'
|
||||
async function launch(version, setProgress, setDownload, setGameStarted, setStarted) {
|
||||
console.log(version)
|
||||
const appdata = process.platform === 'win32' ? process.env.APPDATA : process.env.HOME
|
||||
const launcher = new Client()
|
||||
|
||||
let opts = {
|
||||
|
@ -9,7 +10,7 @@ async function launch(version, setProgress, setDownload, setGameStarted, setStar
|
|||
localStorage.getItem('name') || 'Steve',
|
||||
localStorage.getItem('password') || ''
|
||||
),
|
||||
root: './.pimi',
|
||||
root: path.join(appdata, '.pimi-launcher'),
|
||||
version: {
|
||||
number: version.id,
|
||||
type: version.type
|
||||
|
|
|
@ -49,11 +49,13 @@ function Main() {
|
|||
name="pets"
|
||||
id="pet-select"
|
||||
className="inputs"
|
||||
onChange={(e) => setVersion(e.target.value)}
|
||||
onChange={(e) => {
|
||||
setVersion(versions[e.target.value])
|
||||
}}
|
||||
>
|
||||
{versions.map((version) => {
|
||||
{versions.map((version, index) => {
|
||||
return (
|
||||
<option key={version.id} value={version} className="text-1xl font-bold underline">
|
||||
<option key={index} value={index} className="text-1xl font-bold underline">
|
||||
{version.id}
|
||||
</option>
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue