Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97e5f4ac06
|
||
|
|
69a8af761f
|
No files matched your search
@@ -136,6 +136,19 @@ class MainWindow(QMainWindow):
|
||||
levelDataButtons.addWidget(self.levelDataIsOfficial, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
levelDataButtons.addStretch()
|
||||
|
||||
gdLvlGDShareLabel = QLabel("GDLVL/GDShare")
|
||||
|
||||
self.convertToGdLvl = QPushButton("Convert to GDLVL")
|
||||
self.convertToGdLvl.clicked.connect(self.on_convert_to_gdlvl_click)
|
||||
self.convertToGmd = QPushButton("Convert to GMD")
|
||||
self.convertToGmd.clicked.connect(self.on_convert_to_gmd_click)
|
||||
|
||||
gdLvlGDShareButtons = QHBoxLayout()
|
||||
gdLvlGDShareButtons.addStretch()
|
||||
gdLvlGDShareButtons.addWidget(self.convertToGdLvl, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
gdLvlGDShareButtons.addWidget(self.convertToGmd, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
gdLvlGDShareButtons.addStretch()
|
||||
|
||||
gjpLabel = QLabel("GJP")
|
||||
|
||||
self.gjpDecode = QPushButton("Decode")
|
||||
@@ -160,6 +173,8 @@ class MainWindow(QMainWindow):
|
||||
layout.addLayout(saveFileButtons)
|
||||
layout.addWidget(levelDataLabel, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
layout.addLayout(levelDataButtons)
|
||||
layout.addWidget(gdLvlGDShareLabel, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
layout.addLayout(gdLvlGDShareButtons)
|
||||
layout.addWidget(gjpLabel, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
layout.addLayout(gjpButtons)
|
||||
layout.addWidget(gjp2Label, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
@@ -263,6 +278,56 @@ class MainWindow(QMainWindow):
|
||||
self.apply_mica(msg)
|
||||
msg.exec()
|
||||
|
||||
def on_convert_to_gdlvl_click(self):
|
||||
file_path, _ = QFileDialog.getOpenFileName(
|
||||
self,
|
||||
"Select a GDLVL file",
|
||||
"",
|
||||
"GDLVL Files (*.gdlvl)"
|
||||
)
|
||||
if not file_path:
|
||||
return
|
||||
|
||||
output_file_path, _ = QFileDialog.getSaveFileName(
|
||||
self,
|
||||
"Select a location for the output GMD file",
|
||||
file_path.removesuffix(".gdlvl") + ".gmd",
|
||||
"GMD Files (*.gmd)"
|
||||
)
|
||||
if not output_file_path:
|
||||
return
|
||||
|
||||
with open(file_path, "r") as f:
|
||||
data = f.read()
|
||||
|
||||
with open(output_file_path, "w") as f:
|
||||
f.write(decode_level(data, is_official_level=False))
|
||||
|
||||
def on_convert_to_gmd_click(self):
|
||||
file_path, _ = QFileDialog.getOpenFileName(
|
||||
self,
|
||||
"Select a GMD file",
|
||||
"",
|
||||
"GMD Files (*.gmd)"
|
||||
)
|
||||
if not file_path:
|
||||
return
|
||||
|
||||
output_file_path, _ = QFileDialog.getSaveFileName(
|
||||
self,
|
||||
"Select a location for the output GDLVL file",
|
||||
file_path.removesuffix(".gmd") + ".gdlvl",
|
||||
"GDLVL Files (*.gdlvl)"
|
||||
)
|
||||
if not output_file_path:
|
||||
return
|
||||
|
||||
with open(file_path, "r") as f:
|
||||
data = f.read()
|
||||
|
||||
with open(output_file_path, "w") as f:
|
||||
f.write(encode_level(data, is_official_level=False))
|
||||
|
||||
def on_gjp_decode_click(self):
|
||||
dialog = QInputDialog(self)
|
||||
dialog.setWindowTitle("GJP decoder")
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
PyQt6
|
||||
pycryptodome
|
||||
pyperclip
|
||||
winmica
|
||||
winmica ; sys_platform == 'win32'
|
||||
Reference in new issue
Block a user