diff --git a/gui/translation_tab.py b/gui/translation_tab.py index 3264b64..ccc55fb 100644 --- a/gui/translation_tab.py +++ b/gui/translation_tab.py @@ -637,6 +637,12 @@ class TranslationWorker(QThread): # Report results if total_cost != "Fail" and not self.should_stop: + if self.batch_mode: + try: + from util.translation import clearBatchFiles + clearBatchFiles() + except Exception: + pass self.emit_log("") self.emit_log(f"💰 {total_cost}") if self.batch_mode: @@ -2426,18 +2432,25 @@ class TranslationTab(QWidget): "pointing at anthropic.com.\n\nChange your model/API settings and try again.", ) return - batch_resume_state = batchRunState() - if batch_resume_state and not skip_confirm: - reply = QMessageBox.question( - self, - "Resume Batch?", - f"A previous batch run was interrupted ({batch_resume_state}).\n\n" - "Resume it instead of re-collecting?\n" - "(Re-collecting would queue new requests and bill again.)", - QMessageBox.Yes | QMessageBox.No, - ) - if reply != QMessageBox.Yes: - batch_resume_state = None + if skip_confirm: + # Workflow auto-start: each phase is an independent batch run. + # Never resume stale queue/results left over from a prior phase. + from util.translation import clearBatchFiles + clearBatchFiles() + batch_resume_state = None + else: + batch_resume_state = batchRunState() + if batch_resume_state: + reply = QMessageBox.question( + self, + "Resume Batch?", + f"A previous batch run was interrupted ({batch_resume_state}).\n\n" + "Resume it instead of re-collecting?\n" + "(Re-collecting would queue new requests and bill again.)", + QMessageBox.Yes | QMessageBox.No, + ) + if reply != QMessageBox.Yes: + batch_resume_state = None # Confirm start (skipped when called programmatically from the Workflow tab) if not skip_confirm: diff --git a/modules/main.py b/modules/main.py index ca93613..c4dbc4b 100644 --- a/modules/main.py +++ b/modules/main.py @@ -343,6 +343,8 @@ files to translate are in the /files folder and that you picked the right game e totalCost = runFiles(False) finally: set_batch_phase(None) + if totalCost != "Fail": + clearBatchFiles() else: totalCost = runFiles(estimate) diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index 83167f1..c468964 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -143,13 +143,13 @@ TLSYSTEMSWITCHES = False JOIN408 = False # Dialogue / Scroll / Choices (Main Codes) -CODE101 = False -CODE401 = False -CODE405 = False -CODE102 = False +CODE101 = True +CODE401 = True +CODE405 = True +CODE102 = True # Optional -CODE408 = False +CODE408 = True # Variables CODE122 = False