Skip to content

Commit

Permalink
Allow smooth transition between games that handle the same spoiler logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Go1den committed Jul 1, 2024
1 parent 780046b commit 9ab7355
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def onGameChange(self, gameName):
self.clickedButtons = []
self.showWarningMessage("The current spoiler log is not compatible with the chosen game. Please select a valid spoiler log.")
else:
self.setAllButtons(True)
if self.tryParseLog(self.spoilerLog):
self.setAllButtons(True)
self.promptClearOutputFile()
else:
self.showErrorMessage("The selected spoiler log is incompatible with the current game.")

def onHintHandlerChange(self, hintHandler):
self.hintHandler = hintHandler
Expand Down Expand Up @@ -304,6 +308,11 @@ def resetButtons(self, override):
self.setAllButtons(True)
self.clickedButtons = []

def promptClearOutputFile(self):
reply = QMessageBox.question(self, 'Confirm', 'The current spoiler log is still compatible with the chosen game. Would you like to clear the output file?', QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if reply == QMessageBox.Yes:
clearFile(self.outputFile)

def clearOutputFile(self, override):
reply = QMessageBox.No
if not override:
Expand Down

0 comments on commit 9ab7355

Please sign in to comment.