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 react from '@vitejs/plugin-react'
|
||||||
import commonjsExternals from 'vite-plugin-commonjs-externals'
|
import commonjsExternals from 'vite-plugin-commonjs-externals'
|
||||||
|
|
||||||
const externals = ['pimi-launcher-core', 'path']
|
const externals = ['pimi-launcher-core', 'path', 'process']
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
main: {
|
main: {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "pimi-launcher",
|
"name": "pimi-launcher",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0-alpha",
|
||||||
"description": "An Electron application with React",
|
"description": "Modern Minecraft Launcher",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "artegoser",
|
"author": "artegoser",
|
||||||
"homepage": "https://github.com/artegoser/pimi-launcher",
|
"homepage": "https://github.com/artegoser/pimi-launcher",
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { Client, Authenticator } from 'pimi-launcher-core'
|
import { Client, Authenticator } from 'pimi-launcher-core'
|
||||||
|
import path from 'path'
|
||||||
|
import process from 'process'
|
||||||
async function launch(version, setProgress, setDownload, setGameStarted, setStarted) {
|
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()
|
const launcher = new Client()
|
||||||
|
|
||||||
let opts = {
|
let opts = {
|
||||||
|
@ -9,7 +10,7 @@ async function launch(version, setProgress, setDownload, setGameStarted, setStar
|
||||||
localStorage.getItem('name') || 'Steve',
|
localStorage.getItem('name') || 'Steve',
|
||||||
localStorage.getItem('password') || ''
|
localStorage.getItem('password') || ''
|
||||||
),
|
),
|
||||||
root: './.pimi',
|
root: path.join(appdata, '.pimi-launcher'),
|
||||||
version: {
|
version: {
|
||||||
number: version.id,
|
number: version.id,
|
||||||
type: version.type
|
type: version.type
|
||||||
|
|
|
@ -49,11 +49,13 @@ function Main() {
|
||||||
name="pets"
|
name="pets"
|
||||||
id="pet-select"
|
id="pet-select"
|
||||||
className="inputs"
|
className="inputs"
|
||||||
onChange={(e) => setVersion(e.target.value)}
|
onChange={(e) => {
|
||||||
|
setVersion(versions[e.target.value])
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{versions.map((version) => {
|
{versions.map((version, index) => {
|
||||||
return (
|
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}
|
{version.id}
|
||||||
</option>
|
</option>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue