This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
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
0 parents
commit 0f78a6f
Showing
7 changed files
with
595 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import zipfile | ||
import yaml | ||
import os | ||
|
||
def getconfig(): | ||
try: | ||
with open('./config.yaml', 'r') as confFile: | ||
conf = yaml.full_load(confFile) | ||
except FileNotFoundError: | ||
print('File not found') | ||
return conf | ||
|
||
def zipOutput(): | ||
with zipfile.ZipFile('SSE.zip', 'w', | ||
compression=zipfile.ZIP_DEFLATED, | ||
compresslevel=9) as zipArch: | ||
zipArch.write('SSE.exe') | ||
|
||
|
||
conf = getconfig() | ||
paramsStr = '--' + ' --'.join(conf['params']) | ||
plugins = conf['plugins'] | ||
icon = conf['main']['icon'] | ||
|
||
if __name__ == '__main__': | ||
os.system(f'nuitka {paramsStr} --plugin-enable={plugins} --windows-icon-from-ico={icon} ../SSE.py') | ||
zipOutput() |
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,13 @@ | ||
main: | ||
version: '0.0.1.0' | ||
author: 'intervision' | ||
authorlink: 'https://github.com/intervisionlord' | ||
icon: '../imgs/SSE_Icon.png' | ||
|
||
plugins: qt-plugins | ||
|
||
params: | ||
- windows-disable-console | ||
- onefile | ||
- standalone | ||
- remove-output |
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,16 @@ | ||
<center> | ||
<img src="https://i.imgur.com/DWfMCT7.png" width="256" height="256"> | ||
</center> | ||
|
||
# Stationeers Save Editor | ||
## Описание | ||
Позволяет редактировать некоторые параметры сохранения игры. | ||
|
||
На данный момент можно поменять название игрового мира, кол-во дней с момента начала игры и возможность использования исследований. | ||
|
||
### Версия 0.0.1.0 | ||
|
||
## Интерфейс | ||
<center> | ||
<img src = "https://i.imgur.com/KDF3Ztf.png"> | ||
</center> |
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,68 @@ | ||
from datetime import datetime | ||
from PyQt5.QtGui import QIcon | ||
from PyQt5.QtWidgets import QApplication, QMessageBox, QMainWindow | ||
import xml.etree.ElementTree as ET | ||
from shutil import copytree | ||
import time | ||
import sys | ||
import gui | ||
from os import environ, path, listdir | ||
|
||
class MainForm(QMainWindow, gui.Ui_mainWindow): | ||
def __init__(self): | ||
super().__init__() | ||
self.setupUi(self) | ||
self.setWindowIcon(QIcon('imgs/SSE_icon.png')) | ||
self.savesLabel.setText(self.getPaths()[0]) | ||
self.savesCombo.currentIndexChanged.connect(self.saveChangeSig) | ||
self.saveButton.clicked.connect(self.rewriteSave) | ||
|
||
def getPaths(self): | ||
self.myDocsPath = environ.get('USERPROFILE') | ||
self.savesPath = f'{self.myDocsPath}\\Documents\\My Games\\Stationeers\\saves' | ||
self.savesFile = f'{self.savesPath}\\{self.savesCombo.currentText()}\\world.xml' | ||
return self.savesPath, self.savesFile | ||
|
||
|
||
def getXMLRoot(self): | ||
xmlTree = ET.parse(self.savesFile) | ||
rootNode = xmlTree.getroot() | ||
return xmlTree, rootNode | ||
|
||
def saveChangeSig(self): | ||
self.dateModifLabel.setText(time.ctime(path.getmtime(self.getPaths()[1]))) | ||
rootNode = self.getXMLRoot()[1] | ||
for element in rootNode: | ||
if str(element.tag) == 'ResearchKey': | ||
self.researchCombo.setCurrentText(element.text) | ||
elif str(element.tag) == 'DaysPast': | ||
self.daysPastText.setText(element.text) | ||
elif str(element.tag) == 'WorldName': | ||
self.worldNameText.setText(element.text) | ||
|
||
def rewriteSave(self): | ||
xmlTree = self.getXMLRoot()[0] | ||
xmlTree.find('.//ResearchKey').text = self.researchCombo.currentText() | ||
xmlTree.find('.//DaysPast').text = self.daysPastText.text() | ||
dateformat = '%Y_%m_%d_%H_%M_%S' | ||
if self.backupCheck.isChecked(): | ||
copytree(f'{self.getPaths()[0]}\\{self.savesCombo.currentText()}', | ||
f'{self.getPaths()[0]}\\{self.savesCombo.currentText()}_{datetime.now().strftime(dateformat)}') | ||
xmlTree.write(f'{self.savesFile}') | ||
msgbox('Save File modified!') | ||
|
||
def msgbox(mText): | ||
mBox = QMessageBox() | ||
mBox.setWindowTitle('Info') | ||
mBox.setText(mText) | ||
mBox.setIcon(QMessageBox.Information) | ||
popupWindow = mBox.exec_() | ||
|
||
if __name__ == '__main__': | ||
app = QApplication(sys.argv) | ||
form = MainForm() | ||
form.show() | ||
for i in (listdir(form.savesPath)): | ||
if path.isdir(f'{form.savesPath}\\{i}'): | ||
form.savesCombo.addItem(str(i)) | ||
app.exec() |
Oops, something went wrong.