-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a200ce
commit 9b4619d
Showing
3 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,7 +135,7 @@ | |
{ | ||
"title": "许可协议", | ||
"names": [ | ||
"沙雕资源包本体使用GNU GPL-V3许可条款", | ||
"沙雕资源包本体与附属模组(开发中)使用GNU GPL-V3许可条款", | ||
"沙雕附加包使用CC BY-NC-SA 4.0国际许可条款" | ||
] | ||
}, | ||
|
@@ -172,7 +172,7 @@ | |
"names": [ | ||
"邮箱:[email protected]", | ||
"QQ群:1004245106", | ||
"网站:https://moerain.cn", | ||
"网站:https://main.moerain.cn", | ||
"哔哩:辉夜星瞳", | ||
"", | ||
"", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"pack" : { | ||
"pack_format" : 45, | ||
"description" : "沙雕翻译包24w46a测试版,版本为snap-24w46a-git.20241119" | ||
"pack_format" : 46, | ||
"description" : "沙雕翻译包1.21.4-pre1测试版,版本为snap-1.21.4pre1-git.20241120" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import sys | ||
import requests | ||
from PyQt5.QtWidgets import ( | ||
QApplication, QWidget, QVBoxLayout, QHBoxLayout, | ||
QPushButton, QTableWidget, QTableWidgetItem, QTextEdit, QLabel | ||
) | ||
import json | ||
|
||
|
||
class MinecraftVersionViewer(QWidget): | ||
def __init__(self): | ||
super().__init__() | ||
self.setWindowTitle("Minecraft 版本查看器") | ||
self.setGeometry(200, 200, 800, 500) | ||
|
||
# Layouts | ||
self.layout = QVBoxLayout() | ||
self.setLayout(self.layout) | ||
|
||
# UI Elements | ||
self.refresh_button = QPushButton("刷新当前版本") | ||
self.table_widget = QTableWidget() | ||
self.table_widget.setColumnCount(3) | ||
self.table_widget.setHorizontalHeaderLabels(["版本号", "发布类型", "发布日期"]) | ||
self.detail_view = QTextEdit() | ||
self.detail_view.setReadOnly(True) | ||
self.status_label = QLabel("状态:就绪") | ||
|
||
# Adding elements to the layout | ||
self.layout.addWidget(self.refresh_button) | ||
self.layout.addWidget(self.table_widget) | ||
self.layout.addWidget(QLabel("版本细节:")) | ||
self.layout.addWidget(self.detail_view) | ||
self.layout.addWidget(self.status_label) | ||
|
||
# Connect signals | ||
self.refresh_button.clicked.connect(self.load_versions) | ||
self.table_widget.cellClicked.connect(self.show_version_details) | ||
|
||
# Data | ||
self.versions = {} | ||
|
||
def load_versions(self): | ||
"""Fetch the version manifest and populate the table.""" | ||
self.status_label.setText("状态:正在下载元文件") | ||
try: | ||
url = "https://launchermeta.mojang.com/mc/game/version_manifest.json" | ||
response = requests.get(url) | ||
response.raise_for_status() | ||
data = response.json() | ||
|
||
self.versions = {version["id"]: version for version in data["versions"]} | ||
self.table_widget.setRowCount(len(self.versions)) | ||
|
||
for row, version in enumerate(data["versions"]): | ||
self.table_widget.setItem(row, 0, QTableWidgetItem(version["id"])) | ||
self.table_widget.setItem(row, 1, QTableWidgetItem(version["type"])) | ||
self.table_widget.setItem(row, 2, QTableWidgetItem(version["releaseTime"])) | ||
|
||
self.status_label.setText("状态:版本载入完成!") | ||
except Exception as e: | ||
self.status_label.setText(f"Status: Error - {str(e)}") | ||
|
||
def show_version_details(self, row, column): | ||
"""Display details of the selected version.""" | ||
version_id = self.table_widget.item(row, 0).text() | ||
version_data = self.versions.get(version_id, {}) | ||
self.detail_view.setPlainText(json.dumps(version_data, indent=4)) | ||
|
||
|
||
if __name__ == "__main__": | ||
app = QApplication(sys.argv) | ||
viewer = MinecraftVersionViewer() | ||
viewer.show() | ||
sys.exit(app.exec_()) |