Remove old ace module in favor of ace workflow

This commit is contained in:
DazedAnon 2026-05-07 13:40:04 -05:00
parent 5eaa34f91d
commit 2f958984f9
9 changed files with 28 additions and 3944 deletions

View file

@ -263,7 +263,6 @@ Open the DazedMTLTool folder in VSCode and ask Copilot to make changes to the tr
- *"Add a new regex pattern to skip lines that start with //"*
- *"Change the wordwrap logic to break on full-width punctuation"*
- *"Make this module also handle .yaml files"*
- *"Explain what CODE 356 does in rpgmakermvmz.py"*
Copilot can read the surrounding code and suggest context-aware edits — you just review and accept. This makes it easy to customize the tool for specific games without deep Python knowledge.
@ -308,7 +307,6 @@ Not every file needs to be tracked. Create a file called `.gitignore` in the gam
!*.csv
!*.ks
!*.tjs
!*.yaml
!*.rb
!*.rvdata2
# Other useful files

View file

@ -177,27 +177,21 @@ class ConfigTab(QWidget):
nav_layout.addWidget(btn_mvmz)
self.nav_buttons.append(btn_mvmz)
# RPG Maker Ace button
btn_ace = self.create_nav_button("🎲", "RPG Maker Ace")
btn_ace.clicked.connect(lambda: self.switch_page(2))
nav_layout.addWidget(btn_ace)
self.nav_buttons.append(btn_ace)
# Wolf RPG button
btn_wolf = self.create_nav_button("🐺", "Wolf RPG")
btn_wolf.clicked.connect(lambda: self.switch_page(3))
btn_wolf.clicked.connect(lambda: self.switch_page(2))
nav_layout.addWidget(btn_wolf)
self.nav_buttons.append(btn_wolf)
# CSV button
btn_csv = self.create_nav_button("📄", "CSV")
btn_csv.clicked.connect(lambda: self.switch_page(4))
btn_csv.clicked.connect(lambda: self.switch_page(3))
nav_layout.addWidget(btn_csv)
self.nav_buttons.append(btn_csv)
# SRPG Studio button
btn_srpg = self.create_nav_button("⚔️", "SRPG Studio")
btn_srpg.clicked.connect(lambda: self.switch_page(5))
btn_srpg.clicked.connect(lambda: self.switch_page(4))
nav_layout.addWidget(btn_srpg)
self.nav_buttons.append(btn_srpg)
@ -215,19 +209,15 @@ class ConfigTab(QWidget):
self.mvmz_tab = RPGMakerTab("MVMZ")
self.content_stack.addWidget(self.mvmz_tab)
# Page 3: RPG Maker Ace Engine
self.ace_tab = RPGMakerTab("ACE")
self.content_stack.addWidget(self.ace_tab)
# Page 4: Wolf RPG Engine
# Page 3: Wolf RPG Engine
self.wolf_tab = WolfTab()
self.content_stack.addWidget(self.wolf_tab)
# Page 5: CSV Settings
# Page 4: CSV Settings
self.csv_tab = CSVTab()
self.content_stack.addWidget(self.csv_tab)
# Page 6: SRPG Studio Engine
# Page 5: SRPG Studio Engine
self.srpg_tab = SRPGTab()
self.content_stack.addWidget(self.srpg_tab)
@ -279,7 +269,6 @@ class ConfigTab(QWidget):
"""Refresh engine config pages from their module files when shown."""
engine_pages = {
1: getattr(self, "mvmz_tab", None),
2: getattr(self, "ace_tab", None),
}
page = engine_pages.get(index)
if page is not None and hasattr(page, "refresh_from_module"):
@ -882,7 +871,6 @@ class ConfigTab(QWidget):
# Reset engine tabs
self.mvmz_tab.reset_to_defaults()
self.ace_tab.reset_to_defaults()
self.wolf_tab.reset_to_defaults()
self.csv_tab.reset_to_defaults()

View file

@ -5,7 +5,6 @@ based on signals from the Translation tab (engine selection).
Currently supports:
- RPG Maker MV/MZ
- RPG Maker Ace
- Wolf RPG
Easily extensible: add new engine widget + mapping entry.
@ -31,7 +30,6 @@ class EngineConfigTab(QWidget):
# Engine widgets
self.mv_widget = RPGMakerTab("MVMZ")
self.ace_widget = RPGMakerTab("ACE")
self.wolf_widget = WolfTab()
# Placeholder when no engine selected
@ -42,7 +40,6 @@ class EngineConfigTab(QWidget):
# Add to stack
self.widget_map = {
"mvmz": self.mv_widget,
"ace": self.ace_widget,
"wolf": self.wolf_widget,
}
self.stack.addWidget(self.placeholder) # index 0

View file

@ -40,11 +40,7 @@ def create_section_label(text):
class RPGMakerTab(QWidget):
"""RPG Maker MV/MZ & Ace configuration tab.
This widget now supports both MV/MZ and Ace engines. Pass engine="ACE" to
target rpgmakerace.py; otherwise it will default to MV/MZ (rpgmakermvmz.py).
"""
"""RPG Maker MV/MZ configuration tab."""
# Default configuration values for RPG Maker MV/MZ
DEFAULT_CONFIG = {
@ -187,8 +183,7 @@ class RPGMakerTab(QWidget):
loaded_config = None
if self.config_integration:
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
module_path = Path("modules") / module_filename
module_path = Path("modules") / "rpgmakermvmz.py"
loaded_config = self.config_integration.read_current_config(module_path)
# Use loaded module config if available, otherwise use canonical defaults
@ -237,8 +232,7 @@ class RPGMakerTab(QWidget):
main_layout.setSpacing(12)
# Title
title = "RPG Maker MV/MZ" if self.engine != "ACE" else "RPG Maker Ace"
title_label = QLabel(f"{title} Translation Settings")
title_label = QLabel("RPG Maker MV/MZ Translation Settings")
title_label.setStyleSheet("font-size: 16px; font-weight: bold; color: #007acc;")
main_layout.addWidget(title_label)
@ -297,11 +291,6 @@ class RPGMakerTab(QWidget):
)
col1.addLayout(layout)
self.speakers408_cb, layout = self._create_checkbox_with_description(
"408 Speakers", "Detect speakers in comment blocks", "Apply speaker logic to comment blocks."
)
col1.addLayout(layout)
col1.addStretch()
# ==================== COLUMN 2: DIALOGUE ====================
@ -516,8 +505,6 @@ class RPGMakerTab(QWidget):
self.tlsystemvariables_cb.stateChanged.disconnect()
self.tlsystemswitches_cb.stateChanged.disconnect()
self.join408_cb.stateChanged.disconnect()
if self.engine == "ACE":
self.speakers408_cb.stateChanged.disconnect()
# Main Codes
self.code401_cb.stateChanged.disconnect()
@ -559,8 +546,6 @@ class RPGMakerTab(QWidget):
self.tlsystemvariables_cb.stateChanged.connect(lambda: self.apply_to_module(show_messages=False))
self.tlsystemswitches_cb.stateChanged.connect(lambda: self.apply_to_module(show_messages=False))
self.join408_cb.stateChanged.connect(lambda: self.apply_to_module(show_messages=False))
if self.engine == "ACE":
self.speakers408_cb.stateChanged.connect(lambda: self.apply_to_module(show_messages=False))
# Main Codes
self.code401_cb.stateChanged.connect(lambda: self.apply_to_module(show_messages=False))
@ -626,11 +611,6 @@ class RPGMakerTab(QWidget):
"CODE111": self.code111_cb.isChecked(),
"CODE108": self.code108_cb.isChecked(),
}
# Only include SPEAKERS408 for ACE engine
if self.engine == "ACE":
config["SPEAKERS408"] = self.speakers408_cb.isChecked()
return config
def set_config(self, config):
@ -645,10 +625,6 @@ class RPGMakerTab(QWidget):
self.tlsystemvariables_cb.setChecked(config.get("TLSYSTEMVARIABLES", False))
self.tlsystemswitches_cb.setChecked(config.get("TLSYSTEMSWITCHES", False))
self.join408_cb.setChecked(config.get("JOIN408", False))
# Only set SPEAKERS408 for ACE engine
if self.engine == "ACE":
self.speakers408_cb.setChecked(config.get("SPEAKERS408", False))
# Main Codes
self.code401_cb.setChecked(config.get("CODE401", True))
@ -760,11 +736,10 @@ class RPGMakerTab(QWidget):
return is_valid
def apply_to_module(self, show_messages=False):
"""Apply current configuration to the correct RPG Maker module (MV/MZ or Ace)."""
"""Apply current configuration to the RPG Maker MV/MZ module."""
try:
config = self.get_config()
# Select module filename based on engine
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
module_filename = "rpgmakermvmz.py"
module_path = Path(__file__).parent.parent / "modules" / module_filename
if not module_path.exists():
@ -815,12 +790,12 @@ class RPGMakerTab(QWidget):
self.config_changed.emit()
def load_from_module(self):
"""Load configuration from the actual module file based on engine."""
"""Load configuration from the RPG Maker MV/MZ module file."""
if not self.config_integration:
return
try:
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
module_filename = "rpgmakermvmz.py"
module_path = Path("modules") / module_filename
config = self.config_integration.read_current_config(module_path)
if config:
@ -841,8 +816,7 @@ class RPGMakerTab(QWidget):
return False
try:
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
module_path = Path("modules") / module_filename
module_path = Path("modules") / "rpgmakermvmz.py"
config = self.config_integration.read_current_config(module_path)
if not config:
return False

View file

@ -325,11 +325,10 @@ class TranslationWorker(QThread):
threads = int(os.getenv("fileThreads", "1"))
total_cost = "Fail"
# If we're doing Parse Speakers for RPGMaker MV/MZ or ACE, run handlers in-process so
# If we're doing Parse Speakers for RPGMaker MV/MZ, run handlers in-process so
# speaker collection is shared in this process and finalizeSpeakerParse() can run once.
module_name_lower = self.module_info[0].lower() if isinstance(self.module_info[0], str) else ""
is_mvmz = "mv/mz" in module_name_lower
is_ace = "ace" in module_name_lower
# Change to project directory for module execution
old_cwd = os.getcwd()
@ -345,16 +344,12 @@ class TranslationWorker(QThread):
pass
try:
if self.parse_speakers and (is_mvmz or is_ace):
if self.parse_speakers and is_mvmz:
# Run handlers sequentially in this worker process so globals are shared
try:
if is_mvmz:
from modules.rpgmakermvmz import handleMVMZ as handler, setSpeakerParseMode, finalizeSpeakerParse, resetSpeakerState, TOKENS, calculateCost, MODEL
elif is_ace:
from modules.rpgmakerace import handleACE as handler, setSpeakerParseMode, finalizeSpeakerParse, resetSpeakerState, TOKENS, calculateCost, MODEL
from modules.rpgmakermvmz import handleMVMZ as handler, setSpeakerParseMode, finalizeSpeakerParse, resetSpeakerState, TOKENS, calculateCost, MODEL
except Exception as e:
engine_name = "rpgmakermvmz" if is_mvmz else "rpgmakerace"
self.emit_log(f"❌ Could not import {engine_name} for speaker-parse: {e}")
self.emit_log(f"❌ Could not import rpgmakermvmz for speaker-parse: {e}")
self.finished_signal.emit(False, str(e))
return
@ -1106,7 +1101,6 @@ class TranslationTab(QWidget):
try:
sys.path.append(str(self.project_root))
from modules.rpgmakermvmz import handleMVMZ
from modules.rpgmakerace import handleACE
from modules.csv import handleCSV
from modules.tyrano import handleTyrano
from modules.kirikiri import handleKirikiri
@ -1126,7 +1120,6 @@ class TranslationTab(QWidget):
self.modules = [
["RPG Maker MV/MZ", [".json"], handleMVMZ],
["RPG Maker Ace", [".yaml"], handleACE],
["CSV", [".csv"], handleCSV],
["Tyrano", [".ks"], handleTyrano],
["Kirikiri", [".ks"], handleKirikiri],
@ -1161,9 +1154,7 @@ class TranslationTab(QWidget):
def _on_module_changed(self, text: str):
lowered = text.lower()
if "ace" in lowered:
self.engine_changed.emit("ace")
elif "wolf" in lowered and "wolf rpg 2" not in lowered:
if "wolf" in lowered and "wolf rpg 2" not in lowered:
self.engine_changed.emit("wolf")
elif "mv/mz" in lowered:
self.engine_changed.emit("mvmz")
@ -1176,8 +1167,8 @@ class TranslationTab(QWidget):
self.mode_combo.addItem("Translate")
self.mode_combo.addItem("Estimate")
# Add Parse Speakers for RPG Maker MV/MZ and RPG Maker Ace
if "mv/mz" in lowered or "ace" in lowered:
# Add Parse Speakers for RPG Maker MV/MZ
if "mv/mz" in lowered:
self.mode_combo.addItem("Parse Speakers")
# Restore previous selection if it still exists
@ -1336,7 +1327,7 @@ class TranslationTab(QWidget):
try:
selected_index = self.module_combo.currentIndex()
if 0 <= selected_index < len(self.modules):
accepted_extensions = self.modules[selected_index][1] # List of extensions like [".json", ".yaml"]
accepted_extensions = self.modules[selected_index][1] # List of extensions like [".json"]
except Exception:
pass

View file

@ -34,7 +34,6 @@ these values using an .env file, for an example see .env.example"
)
from modules.rpgmakermvmz import handleMVMZ, setSpeakerParseMode as setSpeakerParseMVMZ, finalizeSpeakerParse as finalizeSpeakerParseMVMZ
from modules.rpgmakerace import handleACE, setSpeakerParseMode as setSpeakerParseACE, finalizeSpeakerParse as finalizeSpeakerParseACE
from modules.csv import handleCSV
from modules.tyrano import handleTyrano
from modules.kirikiri import handleKirikiri
@ -60,7 +59,6 @@ THREADS = int(os.getenv("fileThreads"))
MODULES = [
["RPGMaker MV/MZ", ["json"], handleMVMZ],
["RPGMaker Plugins", ["js", "rb"], handlePlugin],
["RPGMaker ACE", ["yaml"], handleACE],
["CSV (From Translator++)", ["csv"], handleCSV],
["Tyrano", ["ks"], handleTyrano],
["Kirikiri", ["ks", "tjs", "ssd", "asd"], handleKirikiri],
@ -123,13 +121,12 @@ def main():
files to translate are in the /files folder and that you picked the right game engine."
)
# If translating RPGMaker MV/MZ (index 0) or RPGMaker ACE (index 2) prompt for speaker parse mode
# If translating RPGMaker MV/MZ, prompt for speaker parse mode
speaker_parse = False
if version in [0, 2] and not estimate:
if version == 0 and not estimate:
sub = ""
engine_name = "RPGMaker MV/MZ" if version == 0 else "RPGMaker ACE"
while sub == "":
sub = input(f"{engine_name} options:\n\n 1. Standard Translate\n 2. Parse Speakers (collect speaker names only)\n")
sub = input("RPGMaker MV/MZ options:\n\n 1. Standard Translate\n 2. Parse Speakers (collect speaker names only)\n")
match sub:
case "1":
speaker_parse = False
@ -138,10 +135,7 @@ files to translate are in the /files folder and that you picked the right game e
case _:
sub = ""
if speaker_parse:
if version == 0:
setSpeakerParseMVMZ(True)
elif version == 2:
setSpeakerParseACE(True)
setSpeakerParseMVMZ(True)
# Open File (Threads) - recursively walk 'files' and preserve directory structure
# Prepare per-run log file so CLI runs also write to a run-specific history file
@ -259,10 +253,7 @@ files to translate are in the /files folder and that you picked the right game e
# Finalize speaker parse mode by writing collected speakers to vocab
if speaker_parse:
if version == 0:
finalizeSpeakerParseMVMZ()
elif version == 2:
finalizeSpeakerParseACE()
finalizeSpeakerParseMVMZ()
# Delete Tmp Files
if os.path.isfile("csv.tmp"):
@ -295,5 +286,5 @@ files to translate are in the /files folder and that you picked the right game e
def deleteFolderFiles(folderPath):
for filename in os.listdir(folderPath):
file_path = os.path.join(folderPath, filename)
if file_path.endswith((".json", ".yaml", ".ks")):
if file_path.endswith((".json", ".ks")):
os.remove(file_path)

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,6 @@ colorama>=0.4.6
openai>=2.8.0
python-dotenv>=1.0.0
retry>=0.9.2
ruamel.yaml>=0.17.32
tiktoken>=0.8.0
tqdm>=4.65.0
jsbeautifier>=1.14.0

View file

@ -74,9 +74,6 @@ def run_handler(project_root, module_name, filename, estimate_only):
if "RPG Maker MV/MZ" in module_name:
from modules.rpgmakermvmz import handleMVMZ
handler = handleMVMZ
elif "RPG Maker Ace" in module_name:
from modules.rpgmakerace import handleACE
handler = handleACE
elif "CSV" in module_name:
from modules.csv import handleCSV
handler = handleCSV