Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KeimaSenpai authored Mar 31, 2024
1 parent 3e26e4f commit 3d1b627
Show file tree
Hide file tree
Showing 31 changed files with 976 additions and 2 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

59 changes: 57 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# XLauncher-ui
Launcher de Minecraft en el cual pueden jugar de manera segura además de personalizarlo por completo
<div align="center">
<img src="XLauncher LogoX.webp" alt="Launcher de Minecraft" height="250">
</div>

# Minecraft Launcher

![1711569832079](XLauncher-UI.png "Interfaz del XLauncher")

> Launcher de minecraft que hice para un video de YouTube
![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/KeimaSenpai/XLauncher-ui/total?style=for-the-badge&label=Download&color=%23756AB6)

### 🔩Instalacion

- Clonar repositorio

```console
git clone https://github.com/KeimaSenpai/Script-launcher-Minecraft.git
```

- Crear entorno de desarrollo

```console
pip install virtualenv
virtualenv env
```

- Instalar dependencias

```console
pip install -r requirements.txt
```

🔩Instalación para los usuarios de Cuba

> Para que no gasten megas en la instalacion del paquete pueden usar este comando
> Solo funciona para CUBA este comando
```console
python -m pip install -r requirements.txt --index-url http://nexus.prod.uci.cu/repository/pypi-proxy/simple/ --trusted-host nexus.prod.uci.cu
```

### 📦Para empaquetar

```console
pyinstaller main.py --noconfirm --onedir --console --icon icon_windows.ico --name "XLauncher"
```

> Link de la documentacion [LINK](https://minecraft-launcher-lib.readthedocs.io/en/stable/)
## 📺Video de YouTube

> Recuerda dejar Like y no dejes de suscribirte al canal 👍
> [CREA TU PROPIO LAUNCHER de MINECRAFT](https://youtu.be/5FmjSubDRyw?si=9brYY9OnENftZgft)
## Personas que hicieron este proyecto posible
[![Contribuidores](https://contrib.rocks/image?repo=KeimaSenpai/XLauncher-ui)](https://github.com/KeimaSenpai/XLauncher-ui/graphs/contributors)
Binary file added XLauncher LogoX.webp
Binary file not shown.
Binary file added XLauncher-UI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fonts/minecraft-dungeons.ttf
Binary file not shown.
Binary file added assets/fonts/minecraft.ttf
Binary file not shown.
Binary file added assets/img/Rectángulo.webp
Binary file not shown.
Binary file added assets/img/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/downloads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/logo.webp
Binary file not shown.
Binary file added assets/img/minecraft_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/news.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/open parcel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/youtube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon_windows.ico
Binary file not shown.
29 changes: 29 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import flet as ft


from vews.home import *
from vews.navegacion import *

def main(page: ft.Page):
page.title = "XLauncher"
page.window_width = 760
page.window_height = 478
page.window_resizable = False
page.padding = 0
page.fonts = {
"mine":"fonts/minecraft.ttf",
"mine_dun":"fonts/minecraft-dungeons.ttf"
}

#Se agrupan todas las paginas
page.add(
ft.Row(
spacing=0,
controls=[
nab,
conte
],
)
)

ft.app(target=main, assets_dir='assets')
3 changes: 3 additions & 0 deletions minecraft_launcher/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Minecraft Libreria para ejecutar Minecraft
"""
2 changes: 2 additions & 0 deletions minecraft_launcher/componentes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import flet as ft

71 changes: 71 additions & 0 deletions minecraft_launcher/minecraft.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import os
import json
import subprocess
import minecraft_launcher_lib

user_windows = os.environ['USERNAME']
minecraft_directory = f"C://Users//{user_windows}//AppData//Roaming//.xlauncher"
ruta_json = f"{minecraft_directory}//configuracion.json"

async def prueba(e):
print(e)

async def play_mine():
global options
with open(ruta_json, 'r') as file:
data = json.load(file)

if 'Nombre' in data and 'RAM' in data:
mine_user = data['Nombre']
ram = data['RAM']
java_ruta = data.get('Java', None)

forts = minecraft_launcher_lib.utils.get_installed_versions(minecraft_directory)
for fort in forts:
print(fort['id'])
version = input('» ')

options = {
'username': mine_user,
'uuid': '',
'token': '',
'executablePath':f'{java_ruta}',
'defaultExecutablePath':f'{java_ruta}',

"jvmArguments": [
f"-Xmx{ram}G",
f"-Xms{ram}G",
"-Xmn668m",
"-XX:+DisableExplicitGC",
"-XX:+UseConcMarkSweepGC",
"-XX:+UseParNewGC",
"-XX:+UseNUMA",
"-XX:+CMSParallelRemarkEnabled",
"-XX:MaxTenuringThreshold=15",
"-XX:MaxGCPauseMillis=30",
"-XX:GCPauseIntervalMillis=150",
"-XX:+UseAdaptiveGCBoundary",
"-XX:-UseGCOverheadLimit",
"-XX:+UseBiasedLocking",
"-XX:SurvivorRatio=8",
"-XX:TargetSurvivorRatio=90",
"-XX:MaxTenuringThreshold=15",
"-Dfml.ignorePatchDiscrepancies=true",
"-Dfml.ignoreInvalidMinecraftCertificates=true",
"-XX:+UseFastAccessorMethods",
"-XX:+UseCompressedOops",
"-XX:+OptimizeStringConcat",
"-XX:+AggressiveOpts",
"-XX:ReservedCodeCacheSize=2048m",
"-XX:+UseCodeCacheFlushing",
"-XX:SoftRefLRUPolicyMSPerMB=10000",
"-XX:ParallelGCThreads=10"
], # The jvmArguments
"launcherVersion": "1.0.2",
}

# Ejecutar Minecraft
minecraft_command = minecraft_launcher_lib.command.get_minecraft_command(
version, minecraft_directory, options) # type: ignore
subprocess.run(minecraft_command)
await play_mine()
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flet
minecraft-launcher-lib
pyinstaller
flet_route
58 changes: 58 additions & 0 deletions vews/home.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import flet as ft
from flet_route import Params,Basket

from minecraft_launcher.minecraft import prueba


class Home(ft.UserControl):
def __init__(self):
super().__init__()

def view(self,page:ft.Page,params:Params,basket:Basket):
return ft.View(
controls=[
ft.Text('Hola',size=30)
]
)



minecraft_title = ft.Image(
src='img/minecraft_title.png',
height=170,
)
play = ft.ElevatedButton(
"PLAY",
style=ft.ButtonStyle(
color='#191919',
bgcolor='#68C90E',
overlay_color='#447A12',
shape=ft.RoundedRectangleBorder(radius=5)
),
on_click=prueba
)

conte = ft.Stack(
[
ft.Image(
src='img/Rectángulo.webp',
height=478,
width=681,
fit=ft.ImageFit.COVER,
),
ft.Container(
content=ft.Column(
controls=[
minecraft_title,
play
],
alignment=ft.MainAxisAlignment.CENTER,
horizontal_alignment=ft.CrossAxisAlignment.CENTER
),
alignment=ft.alignment.center
)

],
width=681,
height=478
)
77 changes: 77 additions & 0 deletions vews/navegacion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import flet as ft


logo = ft.Container(
content=ft.Image(src='img/logo.webp', height=45, width=45),
alignment=ft.alignment.center,
height=47,
margin=10,
)

a = ft.IconButton(
icon=ft.icons.PLAY_CIRCLE_FILL_OUTLINED,
style=ft.ButtonStyle(
color='#5B0098',
bgcolor='#0C0C0C',
shape=ft.RoundedRectangleBorder(radius=5)
)
)
b = ft.IconButton(
icon=ft.icons.ACCOUNT_CIRCLE,
style=ft.ButtonStyle(
color='#5B0098',
bgcolor='#0C0C0C',
shape=ft.RoundedRectangleBorder(radius=5)
)
)
c = ft.IconButton(
icon=ft.icons.NEWSPAPER_OUTLINED,
style=ft.ButtonStyle(
color='#5B0098',
bgcolor='#0C0C0C',
shape=ft.RoundedRectangleBorder(radius=5)
)
)
d = ft.IconButton(
icon=ft.icons.DOWNLOAD,
style=ft.ButtonStyle(
color='#5B0098',
bgcolor='#0C0C0C',
shape=ft.RoundedRectangleBorder(radius=5)
)
)
e = ft.IconButton(
icon=ft.icons.SETTINGS,
style=ft.ButtonStyle(
color='#5B0098',
bgcolor='#0C0C0C',
shape=ft.RoundedRectangleBorder(radius=5)
)
)
iconos = ft.Column(
controls=[
a,
b,
c,
d,
e
]
)

#Navegacion principal de la app
nab = ft.Container(
content=ft.Column(
spacing=100,
controls=[
logo,
iconos
],
alignment=ft.MainAxisAlignment.START,
horizontal_alignment=ft.CrossAxisAlignment.CENTER,

),
height= 478,
width= 70,
bgcolor='#131313',
alignment=ft.alignment.center
)
1 change: 1 addition & 0 deletions vews/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import flet as ft
Empty file added vews/user.py
Empty file.

0 comments on commit 3d1b627

Please sign in to comment.