diff --git a/assets/background.png b/assets/background.png
index a01e03c..5d7a852 100644
Binary files a/assets/background.png and b/assets/background.png differ
diff --git a/assets/styles/minecraft.qss b/assets/styles/minecraft.qss
index 97e0ddc..34f2731 100644
--- a/assets/styles/minecraft.qss
+++ b/assets/styles/minecraft.qss
@@ -1,5 +1,6 @@
* {
font-family : "Monocraft";
+ background-image : ":/assets/background.png"
}
QPushButton {
@@ -17,7 +18,7 @@ QPushButton::pressed {
QPushButton::hover {
border-image : url(":/assets/button-pressed.png");
- color : white;
+ color : yellow;
text-decoration : underline;
border : none;
}
@@ -32,11 +33,20 @@ QMainWindow QLabel {
color : white;
}
+QMenu::item:selected {
+ color: yellow;
+ text-decoration: underline;
+}
+
QStatusBar {
color : white;
background-color : black;
}
-QWidget {
+QMenu {
+ background-color : black;
+}
+
+QMenuBar {
background-color : black;
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 27f550a..f0cdc1a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,7 +9,7 @@ description = "This is a custom Free/Libre Minecraft LCE Launcher written in Pyt
requires-python = "==3.12.*"
license = "GPL-3.0-or-later"
readme = "readme.md"
-lisence-files = "license.md"
+license-files = "license.md"
dependencies = [
"pyside6",
@@ -17,7 +17,8 @@ dependencies = [
"rich",
"term-image",
"pillow",
- "pip"
+ "pip",
+ "hatch"
]
[project.urls]
@@ -64,6 +65,8 @@ files = [
"src/json_trans.py",
"src/main.py",
"src/cli.py",
+ "src/term_service.py",
+ "src/features.py",
"src/browser_dialog.py",
"pkg/LCE-Qt-Launcher.desktop",
"license.md",
diff --git a/readme.md b/readme.md
index 4cce825..563715f 100644
--- a/readme.md
+++ b/readme.md
@@ -8,13 +8,25 @@
## About
-This is a custom MCLCE Launcher written in python and Qt with Freedom and GNU/Linux support in mind.
+This is a custom Minecraft LCE Launcher written in Python and Qt with Freedom and GNU/Linux support in mind.
## Features
-- cli.y : simple way to install and launch the game
-- launcher.py
-
+- Command Line interface
+- Qt 6 GUI (Native like Interface)
+- Written in Python (No Electron or Rust)
+- Customisable
+- Free Software (GPLv3)
+- Multiple Instance (Work in progress)
+
+- GNU/Linux compatibility first (with secondary Windows and FreeBSD support)
+- Focus on being the main hub for Minecraft LCE on GNU/Linux
+- Minecraft Theme pre-configured
+
## Software Requirement
- [Python 3.12.x](https://www.python.org/downloads/latest/python3.12/)
diff --git a/res.qrc b/res.qrc
index bc57bcb..85be65c 100644
--- a/res.qrc
+++ b/res.qrc
@@ -5,7 +5,7 @@
assets/Launcher_medium.png
assets/Launcher.png
assets/minecraft.png
- assets/minecraft-lce-title.png
+ assets/minecraft-lce-title.png
assets/button.png
assets/button-pressed.png
assets/app.ico
diff --git a/src/build_info.py b/src/build_info.py
index 9cce50e..2c34cf2 100644
--- a/src/build_info.py
+++ b/src/build_info.py
@@ -2,6 +2,8 @@ from PySide6.QtCore import qVersion
from system_manager import SystemManager
+import term_service
+
from pathlib import Path
import os
@@ -71,12 +73,10 @@ try:
_LICENSE_LINK = license_url_metadata
if license_metadata is not "" or None:
_LICENSE = license_metadata
-
except importlib.metadata.PackageNotFoundError:
pass
-
except RuntimeError:
- print(f"Error : Metadata not found! More info : {RuntimeError.with_traceback}")
+ term_service.print_error(f"Metadata not found! More info : {RuntimeError.with_traceback}")
class BuildInfo:
def __init__(self):
diff --git a/src/cli.py b/src/cli.py
old mode 100755
new mode 100644
index dfcde46..15679a2
--- a/src/cli.py
+++ b/src/cli.py
@@ -1,10 +1,6 @@
-#!/usr/bin/env python3
-
-from term_image.image import from_file
-from rich import print
-
from instance_manager import InstanceManager, Instance
+import term_service
import build_info
import os
@@ -16,14 +12,19 @@ MENU_STR = """
"""
def launch_cli():
-
- ascii_art = os.path.join(build_info.get_assets_dir(), "ascii-art-text.png")
-
- image = from_file(ascii_art)
-
- image.draw()
-
- print(MENU_STR)
+ try:
+ ascii_art = os.path.join(build_info.get_assets_dir(), "ascii-art-text.png")
+ term_service.show_image(ascii_art)
+ except FileNotFoundError:
+ term_service.print_error("Image cannot be found.")
+ print("LCE Qt Launcher")
+ except PermissionError:
+ term_service.print_error("File Permission error on the file")
+ print("LCE Qt Launcher")
+ except:
+ term_service.print_error("An unkown error occurred")
+ print("LCE Qt Launcher")
+ term_service.print_pretty(MENU_STR)
user_output = input()
@@ -35,4 +36,4 @@ def launch_cli():
if user_output == "2":
instanceManager.install_instance()
else:
- print("not implemented yet")
+ term_service.print_information("Not implemented Yet!")
diff --git a/src/downloader.py b/src/downloader.py
index 9ad5c42..00f7fd6 100644
--- a/src/downloader.py
+++ b/src/downloader.py
@@ -1,6 +1,8 @@
from __future__ import annotations
from typing import TYPE_CHECKING
+import term_service
+
if TYPE_CHECKING:
from instance_manager import Instance
from build_info import BuildInfo
@@ -18,15 +20,17 @@ class Downloader:
self._build_info = build_info
def download_instance(self, instance : Instance):
+ print("Go to installation")
response = requests.get(instance.get_download_url())
+ response.raise_for_status()
if response.status_code == SUCCESS_STATUS_CODE:
- print(f"Download of {instance.name} from {instance.get_download_url} was a success")
+ term_service.print_success(f"Download of {instance.name} from {instance.get_download_url} was a success")
try:
archive : ZipFile = self.extract_instance(response, instance)
except BadZipFile as err:
- print(f"Error : {err} while extracting {archive.filename}")
+ term_service.print_error(f"{err} while extracting {archive.filename}")
except LargeZipFile as err:
- print(f"Error : {archive.filename} was too big.")
+ term_service.print_error(f"{archive.filename} was too big.")
else:
if os.name == "posix":
exe_abs_path = os.path.join(instance.installation_path, instance.exe_name)
diff --git a/src/features.py b/src/features.py
new file mode 100644
index 0000000..c340f75
--- /dev/null
+++ b/src/features.py
@@ -0,0 +1,67 @@
+from PySide6.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QDialog, QMessageBox, QFileDialog, QInputDialog
+from PySide6.QtGui import QPalette, QPixmap, QBrush
+from PySide6.QtCore import qVersion
+from user_pref import UserPref
+from build_info import BuildInfo
+from instance_manager import InstanceManager, Instance
+from cmd_arg import CmdArgAction, parse_args, argsDetected
+
+import term_service
+
+from browser_dialog import BrowserDialog
+from setting_dialog import SettingDialog
+from cli import launch_cli
+
+import sys
+import os
+import platform
+
+def confirm_changes(parent):
+ pass
+
+def launch_game(parent):
+ pass
+
+def launch_game(parent):
+ pass
+
+def launch_setting(parent):
+ pass
+
+def load_instance(parent):
+ pass
+
+def new_instance_from_form(mainWindow : QMainWindow):
+ form = mainWindow.ui
+
+ username_str = form.usernameInputBox.text()
+ path_str = form.pathInputBox.text()
+ server_ip_str = form.serverIPInputBox.text()
+ server_name_str = form.serverNameInputBox.text()
+ repo_url_str = form.repoURLInputBox.text()
+
+ instance_name = QInputDialog.getText(mainWindow, "Name your instance", "Set the name of the instance")
+
+ newInstance = Instance()
+
+ if instance_name:
+ newInstance.name = instance_name
+ if username_str:
+ newInstance.username = username_str
+ if path_str:
+ newInstance.installation_path = path_str
+ if server_ip_str and server_name_str:
+ newInstance.servers = {f"ip : {server_ip_str}, name : {server_name_str}" }
+ if repo_url_str:
+ newInstance.repo_url = repo_url_str
+
+ return newInstance;
+
+def setup_update(parent):
+ pass
+
+def hide_options(parent):
+ pass
+
+def show_webpage(parent):
+ pass
\ No newline at end of file
diff --git a/src/form.ui b/src/form.ui
index 762a3e5..cbb5e10 100644
--- a/src/form.ui
+++ b/src/form.ui
@@ -10,11 +10,6 @@
600
-
-
- Adwaita Sans
-
-
Minecraft LCE QT Launcher
@@ -26,11 +21,6 @@
false
-
-
- Adwaita Sans
-
-
false
@@ -148,17 +138,11 @@
50
-
-
- Adwaita Sans
- 31
-
-
- :/assets/minecraft_lce_titl;e.png
+ :/assets/minecraft_lce_title.png
@@ -186,7 +170,7 @@
0
0
800
- 27
+ 29