Skip to content

Commit 5c16e49

Browse files
committed
Update a0.6-pre2
1 parent 4df9ed0 commit 5c16e49

File tree

13 files changed

+534
-162
lines changed

13 files changed

+534
-162
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ lib/
2222
\.PyMCL/
2323

2424
stay\.here
25+
26+
pymcl\.spec

changelog.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ key:
55
- ~ Modified feature.
66
- \* Bugfix
77

8-
Version format: (prefix)major.minor.bugfix
8+
Version format: \<prefix\>major.minor.bugfix
99
- Prefix: Annotates if a version is alpha, beta or release. (a, b, r)
1010
- Major: Full rewrite/ui change or something drastic like that.
1111
- Minor: Normal updates. e.g added/remove/modified individual features.
@@ -42,14 +42,14 @@ Prep for a0.4.
4242

4343
~ Per instance java settings.
4444
~ Better instance manager!
45-
~ Optimisation and crash fixes.
4645
~ Rewrite of some functions and general optimisation.
4746
~ Smaller file size! Down to 18mb!
48-
~ Fixed unix compile script!
4947
\- Can no longer display remote (internet) content.
5048
\+ The blog is now themable with a html4 file!
5149
\+ Commented code!
5250
\+ Discord rich presence.
51+
\* Fixed unix compile script!
52+
\* Optimisation and crash fixes.
5353

5454
### a0.6-pre1
5555
The beginning of something awesome.
@@ -58,35 +58,42 @@ The beginning of something awesome.
5858
~ Hopefully fixed random crashes after modpack installation.
5959
~ Partial rewrite of some functions to support threading. (pymcl is now multithreaded! woo!)
6060
~ Now uses "%appdata%/.PyMCL" on windows, "\~/Library/Application Support/PyMCL" on OSX and "\~/.PyMCL" on anything else.
61-
\+ PyMCL is now portable! Create a file named "stay.here" in the same folder pymcl.exe is located to set it to portable mode.
62-
\#\+\+ Online repository of modpacks that can be 1-click-installed. Only one modpack available at the moment.
61+
\#\+\+ Online repository of modpacks that can be 1-click-installed.
62+
\+ PyMCL is now portable! Create a file named "stay.here" in the same folder pymcl.exe is located to set it to portable mode. Only one modpack available at the moment.
6363
\+ Automatic creation of instances from partial jars. Will only initially support b1.7.3 though.
6464
\- Python library "appdirs" no longer used. Shaves about 10kb off the file size. /shrug
6565

6666
### Upcoming a0.6-pre2
6767
ETA unknown. Likely about 1-2 weeks after pre-1.
6868

69-
\+ Command line arguments! Allows exporting of instances and overriding of install directory along with some options coming in the future!
70-
\+ Automatic resource downloads. Will only download missing files. It will not replace modified files.
71-
\+ Support for a1.2.6, b1.6.6.
69+
\#\+ A proper wiki. (WIP)
7270
\#\+\+ Online repo of mods, texturepacks and themes that can be installed.
73-
\+ Automatic "dumb" mod installing. (just copies contents to mc.jar)
74-
\#\+ A proper wiki.
75-
\+ The launcher will have a working "export modpack" button in the instance manager.
76-
\+ A "create instance" button for creating vanilla instances.
71+
\+ Command line arguments! Allows exporting of instances and overriding of install directory along with some more options coming in the future! Use -h to get started.
72+
\+ There is now an instance setting to use a proxy to fix skins, sounds and capes!
73+
\* Techically a modification, but minecraft now launches via MinecraftApplet.
74+
\* Fixed instance settings not loading or saving correctly.
75+
76+
### Upcoming a0.6-pre3
77+
What pre2 was meant to be.
78+
79+
\+ Automatic resource downloads when installing instances/modpacks. Will only download missing files. It will not replace modified files.
80+
\+ Support for a1.2.6, b1.6.6.
81+
\+ Automatic "dumb" mod installing. (just copies contents to mc.jar)
82+
\+ The launcher will have a working modpack exporter window.
83+
\+ A "create instance" button for creating vanilla instances.
7784

7885
### Upcoming a0.6
7986
Woo!!!11 Automate EVERYTHING!
8087

81-
\+ Revamped instance manager.
8288
\#\+\+ Online mod repository with tons of converted mods.
89+
\+ Revamped instance manager.
8390
\+ Automatic "semi-smart" mod installing. Most likely only gonna support optional classes and folders though.
8491
\+ Automatic launcher updates?
8592

8693

8794
### Upcoming b1.0+
8895

89-
~ UI overhaul. Some of the UI isnt fit for use anymore.
96+
~ UI overhaul. Some of the UI isnt fit for purpose anymore.
9097
~ Yet another rewrite. I have learned a lot about how pyqt5 works and I cant bear to look at some of my old code.
9198
~ Launching minecraft via [launchwrapper](https://github.com/Mojang/LegacyLauncher) to allow for mixins.
9299
~ Better theming system.

compile_unix.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
echo Change the 4th line in this batch file to your python install.
2+
23
# CHANGE THIS TO WHAT YOUR PYTHON 3.6+ INSTALL IS (e.g.: C:\Program Files\python\scripts\python.exe
34
export pythonver=python3
45

@@ -18,7 +19,6 @@ echo Adding dependencies.
1819
pip install pyqt5 requests appdirs pyinstaller pypresence
1920

2021
echo Using pyinstaller.
21-
pyinstaller -y -F -w -i "favicon.ico" --add-data "background.png":"." --add-data "logo.png":"." --add-data "favicon.ico":"." --add-data "blogbackground.png":"." --add-data "blog.html":"." --add-data "refresh.png":"." launcher.py
22-
22+
pyinstaller -y -F -i "favicon.ico" --add-data "background.png":"." --add-data "logo.png":"." --add-data "favicon.ico":"." --add-data "blogbackground.png":"." --add-data "blog.html":"." --add-data "refresh.png":"." --add-data "venv/Lib/site-packages/mitmproxy/addons/onboardingapp":"mitmproxy/addons/onboardingapp" pymcl.py
2323
echo Complete!
2424
read -p "Press enter to continue..."

compile_win.bat

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ echo Is "%pythonver%" the correct python 3.6+ directory?
88
echo Close the window if incorrect.
99
PAUSE
1010

11-
echo Creating venv.
12-
%pythonver% -m venv venv
13-
14-
echo Activating venv.
15-
venv\Scripts\activate && echo Adding dependencies. && pip install pyqt5 requests appdirs pypresence && echo Using pyinstaller. && pyinstaller -y -F -i "favicon.ico" --add-data "background.png";"." --add-data "logo.png";"." --add-data "favicon.ico";"." --add-data "blogbackground.png";"." --add-data "blog.html";"." --add-data "refresh.png";"." --hidden-import pypresence launcher.py && echo Complete! & PAUSE
11+
echo Activating venv. && venv\scripts\activate && echo Adding dependencies. && pip install pyqt5 requests appdirs pypresence mitmproxy && echo Using pyinstaller. && pyinstaller -y -F -i "favicon.ico" --add-data "background.png";"." --add-data "logo.png";"." --add-data "favicon.ico";"." --add-data "blogbackground.png";"." --add-data "blog.html";"." --add-data "refresh.png";"." --add-data "venv\Lib\site-packages\mitmproxy\addons\onboardingapp";"mitmproxy\addons\onboardingapp" pymcl.py
12+
echo Complete!
13+
PAUSE

config.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,30 @@
1212
BLOG_BACKGROUND = "blogbackground.png"
1313
BLOG = ""
1414

15+
# THIS IS IN JSON, NOT PYTHON
1516
DEFAULT_LAUNCHER_CONFIG = """
1617
{
1718
"lastusedname": ""
1819
}
1920
"""
2021

22+
# THIS IS IN JSON, NOT PYTHON
2123
DEFAULT_INSTANCE_CONFIG = """
2224
{
2325
"maxram": "512m",
2426
"minram": "256m",
25-
"javaargs": ""
27+
"javaargs": "",
28+
"proxyskin": false,
29+
"proxysound": false,
30+
"proxycape": false
2631
}
2732
"""
2833

29-
VER = "v0.6 Alpha Pre 1"
30-
34+
VER = "v0.6 Alpha Pre 2"
3135

36+
# Sets minecraft install dir. DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING.
37+
# Touching this can cause unintended file deletion/overwrites/etc.
38+
# I have tried to mitigate the risks, but seriously, NO TOUCHIE
3239
if platform.platform().startswith("Windows"):
3340
MC_DIR = os.getenv("APPDATA") + "/.PyMCL"
3441
OS = "windows"

exportlauncher.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import config
2+
import utils
3+
import os
4+
import sys
5+
import requests
6+
7+
from PyQt5.QtGui import QIcon
8+
from PyQt5.QtWidgets import QWidget, QComboBox, QLabel, QPushButton, QCheckBox, QApplication
9+
10+
class exportWindow(QWidget):
11+
currentInstance = ""
12+
13+
# Same drill. Does background things.
14+
def __init__(self, parent=None):
15+
super().__init__(parent)
16+
screen_resolution = app.desktop().screenGeometry()
17+
self.title = config.NAME + " " + config.VER + " Modpack Installer"
18+
config.ICON = utils.loadImage("favicon.ico", self.currentInstance)
19+
self.setWindowIcon(QIcon(config.ICON))
20+
self.left = screen_resolution.width() / 2 - 450
21+
self.top = screen_resolution.height() / 2 - 220
22+
self.initUI()
23+
24+
def initUI(self):
25+
self.setWindowTitle(self.title)
26+
self.setGeometry(self.left, self.top, 450, 220)
27+
self.setFixedSize(self.size())
28+
self.createButtons()
29+
self.createCheckBoxes()
30+
self.show()
31+
32+
def createButtons(self):
33+
self.instanceSelect = QComboBox(self)
34+
item = 0
35+
self.instanceSelect.clear()
36+
for instance in os.listdir(config.MC_DIR + "/instances"): # Instances will be verified before being listed in the future,
37+
self.instanceSelect.addItem(instance)
38+
if os.path.exists(config.MC_DIR + "/instances/" + self.currentInstance):
39+
item = self.instanceSelect.findText(self.currentInstance)
40+
self.instanceSelect.setCurrentIndex(item)
41+
self.currentInstance = self.instanceSelect.currentText()
42+
43+
self.createModpackButton = QPushButton(self)
44+
self.createModpackButton.clicked.connect(self.createModpack)
45+
self.createModpackButton.setText("Export Modpack")
46+
self.createModpackButton.move(50, 50)
47+
48+
def createCheckBoxes(self):
49+
self.doDefaultSoundRemoval = QCheckBox(self)
50+
self.doDefaultSoundRemoval.move(100, 20)
51+
self.doDefaultSoundRemoval.clicked.connect(lambda: print(self.doDefaultSoundRemoval.isChecked()))
52+
53+
def createModpack(self):
54+
soundsMD5 = self.getSoundXML()
55+
print(soundsMD5)
56+
57+
# Screw XML. It's terrible. I chose to use it because I only had to add a single 10 character line to my minecraft resources php file. Fight me.
58+
@staticmethod
59+
def getSoundXML():
60+
md5Array = []
61+
with requests.get("http://resourceproxy.pymcl.net/MinecraftResources") as response:
62+
trip = False
63+
for string in response.text.split("<Key>"):
64+
if trip:
65+
md5Array.append([string.split("</Key>")[0], string.split("<MD5>")[1].split("</MD5>")[0]])
66+
else:
67+
trip = True
68+
69+
return md5Array
70+
71+
def md5Recursive(self, pathininstance):
72+
for root, dirs, files in os.walk(config.MC_DIR + "/" + self.currentInstance + "/" + pathininstance):
73+
for file in files:
74+
utils.md5(root + "/" + file)
75+
76+
77+
app = QApplication([])
78+
exportWin = exportWindow()
79+
80+
sys.exit(app.exec_())

0 commit comments

Comments
 (0)