Update flie on 2024/2/19

This commit is contained in:
dengrb1 2024-02-19 22:30:12 +08:00 committed by GitHub
parent 2647109751
commit 0ab5d99011
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 939 additions and 115 deletions

View File

@ -1,24 +1,25 @@
# Pmcl:Python minecraft launcher
-------------------------
#### 介绍
## 介绍
用python制作的我的世界1.8.9启动器
可以把我的世界1.8.9forge版启动!
支持vape一键注入
### Gitee库
此项目在Github上面也已开源主要更新在Gitee所以GitHub更新会慢一些
项目地址:[https://github.com/dengrb1/pmcl](https://)
此项目在Gitee上面也已开源主要更新在Gitee所以GitHub更新会慢一些
项目地址:[https://gitee.com/dengrb1/pmcl](https://)
#### 安装教程
1. 从[https://gitee.com/dengrb1/pmcl/releases](http://)里下载最新版本 _**文件开头是“Pmcl”全都要下载**_
2. 打开**pmcl_setup.7z.001** 文件并解压
3. 打开安装包安装完成即可使用
3. 打开安装包安装完成即可使用
**因为gitee的总附件只有1GB的存储空间所以现在无法发送安装包问题以后可能会修复**
#### 更新日志
更新日志可能不是最新,请到[https://gitee.com/dengrb1/pmcl/releases](http://)里查看最新版本的更新日志!!
1.0.0 没什么好说的,自己看
1.0.1 加入游戏启动检测,并增加程序自由性
1.0.1 加入游戏启动检测,并增加程序自由性
1.0.2 加入检测vape是否启动加入保存配置功能测试修复无法启动vape lite的BUG

47
jc.py
View File

@ -4,16 +4,41 @@ from time import sleep
import shelve
print('版本:V1.0.1')
def run():
try:
os.startfile('pmcl_main.exe')
except:
error()
print('初始化已完成!')
sleep(1.2)
sys.exit()
def error():
print('==================================')
print('启动失败!')
print('请检查文件是否完整再重启!')
sleep(1)
sys.exit()
print('版本:V1.1')
print('正在初始化...')
print('可能会被360等杀毒软件杀掉使用前请关闭杀毒软件或把此启动器的所有文件加入白名单')
ty = input('是否同意使用本软件y/n')
with shelve.open('main') as db:
db['startgame'] = False
# db['vape_run'] = False
db.close()
print('初始化已完成!')
sleep(1.5)
os.startfile('pmcl_main.exe')
sys.exit()
if ty == 'y' or ty == 'Y':
print('欢迎使用Python Minecraft Launcher')
print('项目地址:https://gitee.com/dengrb1/pmcl')
print('作者:dengrb1')
print('本项目完全没有病毒,您可以放心使用!!')
with shelve.open('main') as db:
db['startgame'] = False
db['vaper'] = False
db.close()
run()
elif ty == 'n' or ty == 'N':
print('已拒绝!')
sleep(1)
sys.exit()
else:
print('输入错误!')
sleep(1)
sys.exit()

134
kg.ui Normal file
View File

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>306</width>
<height>250</height>
</rect>
</property>
<property name="windowTitle">
<string>选择外挂</string>
</property>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>90</x>
<y>190</y>
<width>121</width>
<height>23</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);
color: white;
font-size: 20px;
font-weight: bold;
border-radius: 25px;
}
QPushButton:hover {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);
}
QPushButton:pressed {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>确定</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>70</x>
<y>20</y>
<width>171</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:18pt; font-weight:600; color:#ff0000;&quot;&gt;请选择外挂&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>70</x>
<y>100</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;版本:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>120</x>
<y>100</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QComboBox {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #f5f5f7, stop:1 #dedee0);
border: 1px solid whitesmoke;
border-radius: 3px;
padding-left: 15px;
color: gray;
}
QComboBox::drop-down {
width: 22px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
QComboBox::down-arrow {
width: 16px;
height: 16px;
image: url(PATH_TO_IMG);
}
QComboBox QAbstractItemView {
color: gray;
border: none;
outline: none;
background-color: #dedee0;
}
QComboBox QScrollBar:vertical {
width: 2px;
background-color: white;
}
QComboBox QScrollBar::handle:vertical {
background-color: #b2bdaf;
}
&quot;&quot;&quot;)</string>
</property>
<item>
<property name="text">
<string>Vape lite</string>
</property>
</item>
<item>
<property name="text">
<string>Vape V4</string>
</property>
</item>
</widget>
</widget>
<resources/>
<connections/>
</ui>

499
pmcl.py
View File

@ -14,6 +14,11 @@ import sys
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtGui import QPalette, QColor
from PyQt5.QtWidgets import QWidget, QGraphicsBlurEffect
from PyQt5.QtCore import Qt
from time import sleep
class Ui_MainWindow(QtWidgets.QMainWindow):
@ -23,51 +28,185 @@ class Ui_MainWindow(QtWidgets.QMainWindow):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(475, 226)
MainWindow.resize(534, 226)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setObjectName("label_4")
self.horizontalLayout_3.addWidget(self.label_4)
self.maxmb_t = QtWidgets.QLineEdit(self.centralwidget)
self.maxmb_t.setObjectName("maxmb_t")
self.horizontalLayout_3.addWidget(self.maxmb_t)
self.gridLayout.addLayout(self.horizontalLayout_3, 2, 1, 1, 1)
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton, 4, 4, 1, 1)
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 1, 1, 4)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_3 = QtWidgets.QLabel(self.centralwidget)
self.label_3.setObjectName("label_3")
self.horizontalLayout_2.addWidget(self.label_3)
self.username = QtWidgets.QLineEdit(self.centralwidget)
self.username.setStyleSheet("QLineEdit {\n"
" border-top: none;\n"
" border-left: none;\n"
" border-right: none;\n"
" border-bottom: 1px solid black;\n"
" background-color: transparent;\n"
" }\n"
" \n"
" QLineEdit:focus {\n"
" border-bottom: 1px solid #2a70f4;\n"
" }\n"
" \"\"\")")
self.username.setObjectName("username")
self.horizontalLayout_2.addWidget(self.username)
self.gridLayout.addLayout(self.horizontalLayout_2, 2, 2, 1, 3)
spacerItem = QtWidgets.QSpacerItem(454, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 1, 1, 1, 4)
self.gridLayout.addLayout(self.horizontalLayout_2, 1, 2, 1, 3)
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 1, 1, 4)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.game_c = QtWidgets.QComboBox(self.centralwidget)
self.game_c.setStyleSheet("QComboBox {\n"
" background-color: white;\n"
" color: black;\n"
" border: 1px solid lightgray;\n"
" border-radius: 15px;\n"
" padding-left: 15px;\n"
" }\n"
" \n"
" QComboBox:on {\n"
" border: 1px solid #63acfb;\n"
" }\n"
"\n"
" QComboBox::drop-down {\n"
" width: 22px;\n"
" border-left: 1px solid lightgray;\n"
" border-top-right-radius: 15px;\n"
" border-bottom-right-radius: 15px;\n"
" }\n"
" \n"
" QComboBox::drop-down:on {\n"
" border-left: 1px solid #63acfb;\n"
" }\n"
"\n"
" QComboBox::down-arrow {\n"
" width: 16px;\n"
" height: 16px;\n"
" image: url(PATH_TO_IMG);\n"
" }\n"
"\n"
" QComboBox::down-arrow:on {\n"
" image: url(PATH_TO_IMG);\n"
" }\n"
"\n"
" QComboBox QAbstractItemView {\n"
" color: black;\n"
" border: none;\n"
" outline: none;\n"
" background-color: whitesmoke;\n"
" }\n"
"\n"
" QComboBox QScrollBar:vertical {\n"
" width: 2px;\n"
" background-color: white;\n"
" }\n"
"\n"
" QComboBox QScrollBar::handle:vertical {\n"
" background-color: #b2bdaf;\n"
" }\n"
" \"\"\")")
self.game_c.setObjectName("game_c")
self.game_c.addItem("")
self.game_c.addItem("")
self.horizontalLayout.addWidget(self.game_c)
self.gridLayout.addLayout(self.horizontalLayout, 3, 1, 1, 2)
self.gridLayout.addLayout(self.horizontalLayout, 2, 1, 1, 2)
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setStyleSheet("QPushButton {\n"
" background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #47a7ed, stop: 1 #a967b2);\n"
" color: white;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" border-radius: 25px;\n"
" }\n"
" \n"
" QPushButton:hover {\n"
" background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #459ee0, stop: 1 #995da1);\n"
" }\n"
" \n"
" QPushButton:pressed {\n"
" background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #4093d1, stop: 1 #87538e);\n"
" }\n"
" \"\"\")")
self.pushButton.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton, 4, 3, 1, 1)
self.settings = QtWidgets.QPushButton(self.centralwidget)
self.settings.setStyleSheet("QPushButton {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);\n"
" color: white;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" border-radius: 25px;\n"
" }\n"
"\n"
" QPushButton:hover {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);\n"
" }\n"
"\n"
" QPushButton:pressed {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);\n"
" }\n"
" \"\"\")")
self.settings.setObjectName("settings")
self.gridLayout.addWidget(self.settings, 4, 4, 1, 1)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setObjectName("label_4")
self.horizontalLayout_3.addWidget(self.label_4)
self.maxmb_t = QtWidgets.QLineEdit(self.centralwidget)
self.maxmb_t.setStyleSheet("QLineEdit {\n"
" border-top: none;\n"
" border-left: none;\n"
" border-right: none;\n"
" border-bottom: 1px solid black;\n"
" background-color: transparent;\n"
" }\n"
" \n"
" QLineEdit:focus {\n"
" border-bottom: 1px solid #2a70f4;\n"
" }\n"
" \"\"\")")
self.maxmb_t.setObjectName("maxmb_t")
self.horizontalLayout_3.addWidget(self.maxmb_t)
self.gridLayout.addLayout(self.horizontalLayout_3, 1, 1, 1, 1)
self.run_game = QtWidgets.QPushButton(self.centralwidget)
self.run_game.setStyleSheet("QPushButton {\n"
" background-color: #57bd6a;\n"
" color: #f9ffff;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" border-radius: 5px;\n"
" }\n"
"\n"
" QPushButton:pressed {\n"
" background-color: #4eaa5f;\n"
" }\n"
" \"\"\")")
self.run_game.setObjectName("run_game")
self.gridLayout.addWidget(self.run_game, 4, 3, 1, 1)
self.gridLayout.addWidget(self.run_game, 4, 1, 1, 1)
self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_2.setStyleSheet("QPushButton {\n"
" background-color: #292929;\n"
" border-radius: 5px;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" color: white;\n"
" border: 1px solid white;\n"
" }\n"
"\n"
" QPushButton:pressed {\n"
" background-color: black;\n"
" }\n"
" \"\"\")")
self.pushButton_2.setObjectName("pushButton_2")
self.gridLayout.addWidget(self.pushButton_2, 2, 3, 1, 2)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
@ -84,6 +223,22 @@ class Ui_MainWindow(QtWidgets.QMainWindow):
maxmb = self.maxmb_t.text()
username_text = self.username.text()
version = self.game_c.currentText()
if version == '1.12.2 Forge':
QMessageBox.critical(self, 'Error', '启动失败!版本不支持!')
return 'error'
else:
pass
# 检测maxmb变量是否为数
if username_text == None or maxmb == None or version == None:
QMessageBox.critical(self, 'ERROR', '请填完信息', QMessageBox.Ok)
if maxmb.isnumeric():
pass
else:
QMessageBox.critical(self, 'Error', '最大内存必须是数字!', QMessageBox.Ok)
return 'maxmb'
# 检测maxmb变量是否小于900
if int(maxmb) < 900:
QMessageBox.critical(self, 'ERROR', '内存设置必须要900mb以上', QMessageBox.Ok)
with open("username.txt", "w") as file:
file.write(username_text)
pass
@ -92,47 +247,291 @@ class Ui_MainWindow(QtWidgets.QMainWindow):
with open('version.txt', 'w') as version_f:
version_f.write(version)
print(maxmb, username_text, version)
if version == '1.8.9 Forge':
version = 'vapeV4.04'
with open('version.txt', 'w') as version_f:
version_f.write(version)
try:
with shelve.open('main') as db:
db['startgame'] = True
db.close()
os.startfile('start_game.bat')
except:
QMessageBox.critical(self, 'ERROR', '无法启动游戏,请尝试重新安装。')
try:
self.save_pro()
os.startfile('start_game.bat')
except:
QMessageBox.critical(self, 'Error' ,'启动失败!未知错误?' ,QMessageBox.Ok)
return 'error'
else:
QMessageBox.critical(self, 'ERROR', '暂未做完......', QMessageBox.Close)
def save_pro(self):
with shelve.open('main') as db:
db['username'] = self.username.text()
db['maxmb'] = self.maxmb_t.text()
db.close()
def dq_pro(self):
# 读取配置
with shelve.open('main') as db:
username = db.get('username')
maxmb = db.get('maxmb')
version = db.get('version')
self.username.setText(username)
self.maxmb_t.setText(maxmb)
self.game_c.setCurrentText(version)
db.close()
def kg(self):
# run
QMessageBox.information(self, 'warning', '启动后请不要关闭server.exe这个程序!!!!', QMessageBox.Ok)
QMessageBox.warning(self, '注意!', '可能有病毒,请小心使用!!')
try:
os.startfile('kg.exe')
except:
QMessageBox.critical(self, 'ERROR', '无法启动,请尝试重新安装!', QMessageBox.Ok)
# 打开Kg_Ui窗口
self.kg_ui = Kg_Ui()
self.kg_ui.show()
def open_setting_window(self):
# 打开设置窗口
self.s_ui = setting_UI()
self.s_ui.show()
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Pmcl 1.0.1"))
self.label_4.setText(_translate("MainWindow", "最大内存:"))
self.maxmb_t.setText(_translate("MainWindow", "1145"))
self.pushButton.setText(_translate("MainWindow", "开vape"))
self.label.setText(_translate("MainWindow",
"<html><head/><body><p><span style=\" font-size:18pt; font-weight:600; color:#1c33fe;\">Python minecraft launcher V1.0.1</span></p></body></html>"))
MainWindow.setWindowTitle(_translate("MainWindow", "Python minecraft launcher V1.1"))
self.label_3.setText(_translate("MainWindow", "游戏姓名:"))
self.username.setText(_translate("MainWindow", "sb001"))
self.label_2.setText(_translate("MainWindow",
"<html><head/><body><p><span style=\" font-size:11pt;\">游戏版本:</span></p></body></html>"))
self.label.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:18pt; font-weight:600; color:#1c33fe;\">Python minecraft launcher V1.1</span></p></body></html>"))
self.label_2.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:11pt;\">游戏版本:</span></p></body></html>"))
self.game_c.setItemText(0, _translate("MainWindow", "1.8.9 Forge"))
self.game_c.setItemText(1, _translate("MainWindow", "1.12.2 Forge"))
self.pushButton.setText(_translate("MainWindow", "开vape"))
self.settings.setText(_translate("MainWindow", "设置"))
self.label_4.setText(_translate("MainWindow", "最大内存:"))
self.maxmb_t.setText(_translate("MainWindow", "1145"))
self.run_game.setText(_translate("MainWindow", "开始游戏"))
self.pushButton_2.setText(_translate("MainWindow", "读取配置"))
self.pushButton_2.clicked.connect(self.dq_pro)
self.pushButton.clicked.connect(self.kg)
self.run_game.clicked.connect(self.run)
self.settings.clicked.connect(self.open_setting_window)
class setting_UI(QtWidgets.QDialog):
def __init__(self):
super(setting_UI, self).__init__()
self.setupUi(self)
self.setFixedSize(self.width(), self.height())
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(358, 300)
self.layoutWidget = QtWidgets.QWidget(Form)
self.layoutWidget.setGeometry(QtCore.QRect(90, 50, 172, 201))
self.layoutWidget.setObjectName("layoutWidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setObjectName("verticalLayout")
self.pushButton = QtWidgets.QPushButton(self.layoutWidget)
self.pushButton.setStyleSheet("QPushButton {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);\n"
" color: white;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" border-radius: 25px;\n"
" }\n"
"\n"
" QPushButton:hover {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);\n"
" }\n"
"\n"
" QPushButton:pressed {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);\n"
" }\n"
" \"\"\")")
self.pushButton.setObjectName("pushButton")
self.verticalLayout.addWidget(self.pushButton)
self.pushButton_2 = QtWidgets.QPushButton(self.layoutWidget)
self.pushButton_2.setStyleSheet("QPushButton {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);\n"
" color: white;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" border-radius: 25px;\n"
" }\n"
"\n"
" QPushButton:hover {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);\n"
" }\n"
"\n"
" QPushButton:pressed {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);\n"
" }\n"
" \"\"\")")
self.pushButton_2.setObjectName("pushButton_2")
self.verticalLayout.addWidget(self.pushButton_2)
self.pushButton_5 = QtWidgets.QPushButton(self.layoutWidget)
self.pushButton_5.setStyleSheet("QPushButton {\n"
" background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #47a7ed, stop: 1 #a967b2);\n"
" color: white;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" border-radius: 25px;\n"
" }\n"
" \n"
" QPushButton:hover {\n"
" background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #459ee0, stop: 1 #995da1);\n"
" }\n"
" \n"
" QPushButton:pressed {\n"
" background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #4093d1, stop: 1 #87538e);\n"
" }\n"
" \"\"\")")
self.pushButton_5.setObjectName("pushButton_5")
self.verticalLayout.addWidget(self.pushButton_5)
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(160, 10, 72, 31))
self.label.setObjectName("label")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def vape(self):
# 重置vape启动状态
QMessageBox.information(self, '提示', '处理成功!', QMessageBox.Ok)
with shelve.open('main') as db:
db['vaper'] = False
db.close()
self.close()
def game(self):
# 重置游戏启动状态
with shelve.open('main') as db:
db['startgame'] = False
db.close()
QMessageBox.information(self, '提示', '处理成功!', QMessageBox.Ok)
self.close()
def del_pro(self):
# 删除配置
with shelve.open('main') as db:
db['username'] = ''
db['maxmb'] = ''
db['version'] = ''
db.close()
QMessageBox.information(self, '提示', '处理成功!')
self.close()
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "设置"))
self.pushButton.setText(_translate("Form", "重置vape启动状态"))
self.pushButton_2.setText(_translate("Form", "重置游戏启动状态"))
self.pushButton_5.setText(_translate("Form", "删除配置"))
self.label.setText(_translate("Form", "<html><head/><body><p><span style=\" font-size:14pt; font-weight:600;\">设置</span></p></body></html>"))
self.pushButton.clicked.connect(self.vape)
self.pushButton_2.clicked.connect(self.game)
self.pushButton_5.clicked.connect(self.del_pro)
class Kg_Ui(QtWidgets.QDialog):
def __init__(self):
super(Kg_Ui, self).__init__()
self.setupUi(self)
self.setFixedSize(self.width(), self.height())
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(306, 250)
self.pushButton = QtWidgets.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(90, 190, 121, 23))
self.pushButton.setStyleSheet("QPushButton {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);\n"
" color: white;\n"
" font-size: 20px;\n"
" font-weight: bold;\n"
" border-radius: 25px;\n"
" }\n"
"\n"
" QPushButton:hover {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);\n"
" }\n"
"\n"
" QPushButton:pressed {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);\n"
" }\n"
" \"\"\")")
self.pushButton.setObjectName("pushButton")
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(70, 20, 171, 31))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(70, 100, 51, 21))
self.label_2.setObjectName("label_2")
self.comboBox = QtWidgets.QComboBox(Form)
self.comboBox.setGeometry(QtCore.QRect(120, 100, 111, 22))
self.comboBox.setStyleSheet("QComboBox {\n"
" background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #f5f5f7, stop:1 #dedee0);\n"
" border: 1px solid whitesmoke;\n"
" border-radius: 3px;\n"
" padding-left: 15px;\n"
" color: gray;\n"
" }\n"
"\n"
" QComboBox::drop-down {\n"
" width: 22px;\n"
" border-top-right-radius: 3px;\n"
" border-bottom-right-radius: 3px;\n"
" }\n"
"\n"
" QComboBox::down-arrow {\n"
" width: 16px;\n"
" height: 16px;\n"
" image: url(PATH_TO_IMG);\n"
" }\n"
"\n"
" QComboBox QAbstractItemView {\n"
" color: gray;\n"
" border: none;\n"
" outline: none;\n"
" background-color: #dedee0;\n"
" }\n"
"\n"
" QComboBox QScrollBar:vertical {\n"
" width: 2px;\n"
" background-color: white;\n"
" }\n"
"\n"
" QComboBox QScrollBar::handle:vertical {\n"
" background-color: #b2bdaf;\n"
" }\n"
" \"\"\")")
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def kg_run(self):
version_kg = self.comboBox.currentText()
if version_kg == 'Vape lite':
'''with shelve.open('main') as db:
db['vape_v'] == 'lite'
db.close()'''
QMessageBox.information(
self, '提示', '外挂获取渠道非官方渠道,请小心使用!', QMessageBox.Ok)
try:
os.startfile('fix.bat')
flie = os.getcwd()
os.system(f"'Kangaroo Patcher.exe' Vape_Lite.exe")
except:
QMessageBox.critical(
self, 'ERROR', '启动失败!请检查文件!', QMessageBox.Ok)
elif version_kg == 'Vape V4':
'''with shelve.open('main') as db:
db['vape_v'] == 'v4'
db.close()'''
QMessageBox.critical(self, 'ERROR', '无法使用!', QMessageBox.Ok)
# 关闭窗口
self.close()
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "选择外挂"))
self.pushButton.setText(_translate("Form", "确定"))
self.label.setText(_translate(
"Form", "<html><head/><body><p><span style=\" font-size:18pt; font-weight:600; color:#ff0000;\">请选择外挂</span></p></body></html>"))
self.label_2.setText(_translate(
"Form", "<html><head/><body><p><span style=\" font-size:11pt;\">版本:</span></p></body></html>"))
self.comboBox.setItemText(0, _translate("Form", "Vape lite"))
self.comboBox.setItemText(1, _translate("Form", "Vape V4"))
self.pushButton.clicked.connect(self.kg_run)
if __name__ == '__main__':
@ -141,4 +540,4 @@ if __name__ == '__main__':
ui = Ui_MainWindow()
ui.setupUi(mainloop)
mainloop.show()
sys.exit(app.exec_())
sys.exit(app.exec_())

View File

@ -6,48 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>475</width>
<width>534</width>
<height>226</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
<string>Python minecraft launcher V1.1</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>最大内存:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="maxmb_t">
<property name="text">
<string>1145</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="4">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>开vape</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="4">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:18pt; font-weight:600; color:#1c33fe;&quot;&gt;python minecraft launcher&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="2" colspan="3">
<item row="1" column="2" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
@ -61,6 +29,20 @@
</item>
<item>
<widget class="QLineEdit" name="username">
<property name="styleSheet">
<string notr="true">QLineEdit {
border-top: none;
border-left: none;
border-right: none;
border-bottom: 1px solid black;
background-color: transparent;
}
QLineEdit:focus {
border-bottom: 1px solid #2a70f4;
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>sb001</string>
</property>
@ -68,20 +50,14 @@
</item>
</layout>
</item>
<item row="1" column="1" colspan="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="0" column="1" colspan="4">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:18pt; font-weight:600; color:#1c33fe;&quot;&gt;Python minecraft launcher V1.1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>454</width>
<height>20</height>
</size>
</property>
</spacer>
</widget>
</item>
<item row="3" column="1" colspan="2">
<item row="2" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
@ -95,6 +71,57 @@
</item>
<item>
<widget class="QComboBox" name="game_c">
<property name="styleSheet">
<string notr="true">QComboBox {
background-color: white;
color: black;
border: 1px solid lightgray;
border-radius: 15px;
padding-left: 15px;
}
QComboBox:on {
border: 1px solid #63acfb;
}
QComboBox::drop-down {
width: 22px;
border-left: 1px solid lightgray;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
}
QComboBox::drop-down:on {
border-left: 1px solid #63acfb;
}
QComboBox::down-arrow {
width: 16px;
height: 16px;
image: url(PATH_TO_IMG);
}
QComboBox::down-arrow:on {
image: url(PATH_TO_IMG);
}
QComboBox QAbstractItemView {
color: black;
border: none;
outline: none;
background-color: whitesmoke;
}
QComboBox QScrollBar:vertical {
width: 2px;
background-color: white;
}
QComboBox QScrollBar::handle:vertical {
background-color: #b2bdaf;
}
&quot;&quot;&quot;)</string>
</property>
<item>
<property name="text">
<string>1.8.9 Forge</string>
@ -110,12 +137,130 @@
</layout>
</item>
<item row="4" column="3">
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #47a7ed, stop: 1 #a967b2);
color: white;
font-size: 20px;
font-weight: bold;
border-radius: 25px;
}
QPushButton:hover {
background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #459ee0, stop: 1 #995da1);
}
QPushButton:pressed {
background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #4093d1, stop: 1 #87538e);
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>开vape</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QPushButton" name="settings">
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);
color: white;
font-size: 20px;
font-weight: bold;
border-radius: 25px;
}
QPushButton:hover {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);
}
QPushButton:pressed {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>设置</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>最大内存:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="maxmb_t">
<property name="styleSheet">
<string notr="true">QLineEdit {
border-top: none;
border-left: none;
border-right: none;
border-bottom: 1px solid black;
background-color: transparent;
}
QLineEdit:focus {
border-bottom: 1px solid #2a70f4;
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>1145</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="run_game">
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: #57bd6a;
color: #f9ffff;
font-size: 20px;
font-weight: bold;
border-radius: 5px;
}
QPushButton:pressed {
background-color: #4eaa5f;
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>开始游戏</string>
</property>
</widget>
</item>
<item row="2" column="3" colspan="2">
<widget class="QPushButton" name="pushButton_2">
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: #292929;
border-radius: 5px;
font-size: 20px;
font-weight: bold;
color: white;
border: 1px solid white;
}
QPushButton:pressed {
background-color: black;
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>读取配置</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar"/>

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
PyQt5~=5.15.9

119
settings.ui Normal file
View File

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>358</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>设置</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>90</x>
<y>50</y>
<width>172</width>
<height>201</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);
color: white;
font-size: 20px;
font-weight: bold;
border-radius: 25px;
}
QPushButton:hover {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);
}
QPushButton:pressed {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>重置vape启动状态</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);
color: white;
font-size: 20px;
font-weight: bold;
border-radius: 25px;
}
QPushButton:hover {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);
}
QPushButton:pressed {
background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>重置游戏启动状态</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_5">
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #47a7ed, stop: 1 #a967b2);
color: white;
font-size: 20px;
font-weight: bold;
border-radius: 25px;
}
QPushButton:hover {
background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #459ee0, stop: 1 #995da1);
}
QPushButton:pressed {
background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #4093d1, stop: 1 #87538e);
}
&quot;&quot;&quot;)</string>
</property>
<property name="text">
<string>删除配置</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>160</x>
<y>10</y>
<width>72</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:14pt; font-weight:600;&quot;&gt;设置&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>