Remove old ace module in favor of ace workflow
This commit is contained in:
parent
5eaa34f91d
commit
2f958984f9
9 changed files with 28 additions and 3944 deletions
|
|
@ -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 //"*
|
- *"Add a new regex pattern to skip lines that start with //"*
|
||||||
- *"Change the wordwrap logic to break on full-width punctuation"*
|
- *"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"*
|
- *"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.
|
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
|
!*.csv
|
||||||
!*.ks
|
!*.ks
|
||||||
!*.tjs
|
!*.tjs
|
||||||
!*.yaml
|
|
||||||
!*.rb
|
!*.rb
|
||||||
!*.rvdata2
|
!*.rvdata2
|
||||||
# Other useful files
|
# Other useful files
|
||||||
|
|
|
||||||
|
|
@ -177,27 +177,21 @@ class ConfigTab(QWidget):
|
||||||
nav_layout.addWidget(btn_mvmz)
|
nav_layout.addWidget(btn_mvmz)
|
||||||
self.nav_buttons.append(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
|
# Wolf RPG button
|
||||||
btn_wolf = self.create_nav_button("🐺", "Wolf RPG")
|
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)
|
nav_layout.addWidget(btn_wolf)
|
||||||
self.nav_buttons.append(btn_wolf)
|
self.nav_buttons.append(btn_wolf)
|
||||||
|
|
||||||
# CSV button
|
# CSV button
|
||||||
btn_csv = self.create_nav_button("📄", "CSV")
|
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)
|
nav_layout.addWidget(btn_csv)
|
||||||
self.nav_buttons.append(btn_csv)
|
self.nav_buttons.append(btn_csv)
|
||||||
|
|
||||||
# SRPG Studio button
|
# SRPG Studio button
|
||||||
btn_srpg = self.create_nav_button("⚔️", "SRPG Studio")
|
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)
|
nav_layout.addWidget(btn_srpg)
|
||||||
self.nav_buttons.append(btn_srpg)
|
self.nav_buttons.append(btn_srpg)
|
||||||
|
|
||||||
|
|
@ -215,19 +209,15 @@ class ConfigTab(QWidget):
|
||||||
self.mvmz_tab = RPGMakerTab("MVMZ")
|
self.mvmz_tab = RPGMakerTab("MVMZ")
|
||||||
self.content_stack.addWidget(self.mvmz_tab)
|
self.content_stack.addWidget(self.mvmz_tab)
|
||||||
|
|
||||||
# Page 3: RPG Maker Ace Engine
|
# Page 3: Wolf RPG Engine
|
||||||
self.ace_tab = RPGMakerTab("ACE")
|
|
||||||
self.content_stack.addWidget(self.ace_tab)
|
|
||||||
|
|
||||||
# Page 4: Wolf RPG Engine
|
|
||||||
self.wolf_tab = WolfTab()
|
self.wolf_tab = WolfTab()
|
||||||
self.content_stack.addWidget(self.wolf_tab)
|
self.content_stack.addWidget(self.wolf_tab)
|
||||||
|
|
||||||
# Page 5: CSV Settings
|
# Page 4: CSV Settings
|
||||||
self.csv_tab = CSVTab()
|
self.csv_tab = CSVTab()
|
||||||
self.content_stack.addWidget(self.csv_tab)
|
self.content_stack.addWidget(self.csv_tab)
|
||||||
|
|
||||||
# Page 6: SRPG Studio Engine
|
# Page 5: SRPG Studio Engine
|
||||||
self.srpg_tab = SRPGTab()
|
self.srpg_tab = SRPGTab()
|
||||||
self.content_stack.addWidget(self.srpg_tab)
|
self.content_stack.addWidget(self.srpg_tab)
|
||||||
|
|
||||||
|
|
@ -279,7 +269,6 @@ class ConfigTab(QWidget):
|
||||||
"""Refresh engine config pages from their module files when shown."""
|
"""Refresh engine config pages from their module files when shown."""
|
||||||
engine_pages = {
|
engine_pages = {
|
||||||
1: getattr(self, "mvmz_tab", None),
|
1: getattr(self, "mvmz_tab", None),
|
||||||
2: getattr(self, "ace_tab", None),
|
|
||||||
}
|
}
|
||||||
page = engine_pages.get(index)
|
page = engine_pages.get(index)
|
||||||
if page is not None and hasattr(page, "refresh_from_module"):
|
if page is not None and hasattr(page, "refresh_from_module"):
|
||||||
|
|
@ -882,7 +871,6 @@ class ConfigTab(QWidget):
|
||||||
|
|
||||||
# Reset engine tabs
|
# Reset engine tabs
|
||||||
self.mvmz_tab.reset_to_defaults()
|
self.mvmz_tab.reset_to_defaults()
|
||||||
self.ace_tab.reset_to_defaults()
|
|
||||||
self.wolf_tab.reset_to_defaults()
|
self.wolf_tab.reset_to_defaults()
|
||||||
self.csv_tab.reset_to_defaults()
|
self.csv_tab.reset_to_defaults()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ based on signals from the Translation tab (engine selection).
|
||||||
|
|
||||||
Currently supports:
|
Currently supports:
|
||||||
- RPG Maker MV/MZ
|
- RPG Maker MV/MZ
|
||||||
- RPG Maker Ace
|
|
||||||
- Wolf RPG
|
- Wolf RPG
|
||||||
|
|
||||||
Easily extensible: add new engine widget + mapping entry.
|
Easily extensible: add new engine widget + mapping entry.
|
||||||
|
|
@ -31,7 +30,6 @@ class EngineConfigTab(QWidget):
|
||||||
|
|
||||||
# Engine widgets
|
# Engine widgets
|
||||||
self.mv_widget = RPGMakerTab("MVMZ")
|
self.mv_widget = RPGMakerTab("MVMZ")
|
||||||
self.ace_widget = RPGMakerTab("ACE")
|
|
||||||
self.wolf_widget = WolfTab()
|
self.wolf_widget = WolfTab()
|
||||||
|
|
||||||
# Placeholder when no engine selected
|
# Placeholder when no engine selected
|
||||||
|
|
@ -42,7 +40,6 @@ class EngineConfigTab(QWidget):
|
||||||
# Add to stack
|
# Add to stack
|
||||||
self.widget_map = {
|
self.widget_map = {
|
||||||
"mvmz": self.mv_widget,
|
"mvmz": self.mv_widget,
|
||||||
"ace": self.ace_widget,
|
|
||||||
"wolf": self.wolf_widget,
|
"wolf": self.wolf_widget,
|
||||||
}
|
}
|
||||||
self.stack.addWidget(self.placeholder) # index 0
|
self.stack.addWidget(self.placeholder) # index 0
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,7 @@ def create_section_label(text):
|
||||||
|
|
||||||
|
|
||||||
class RPGMakerTab(QWidget):
|
class RPGMakerTab(QWidget):
|
||||||
"""RPG Maker MV/MZ & Ace configuration tab.
|
"""RPG Maker MV/MZ 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).
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Default configuration values for RPG Maker MV/MZ
|
# Default configuration values for RPG Maker MV/MZ
|
||||||
DEFAULT_CONFIG = {
|
DEFAULT_CONFIG = {
|
||||||
|
|
@ -187,8 +183,7 @@ class RPGMakerTab(QWidget):
|
||||||
|
|
||||||
loaded_config = None
|
loaded_config = None
|
||||||
if self.config_integration:
|
if self.config_integration:
|
||||||
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
|
module_path = Path("modules") / "rpgmakermvmz.py"
|
||||||
module_path = Path("modules") / module_filename
|
|
||||||
loaded_config = self.config_integration.read_current_config(module_path)
|
loaded_config = self.config_integration.read_current_config(module_path)
|
||||||
|
|
||||||
# Use loaded module config if available, otherwise use canonical defaults
|
# Use loaded module config if available, otherwise use canonical defaults
|
||||||
|
|
@ -237,8 +232,7 @@ class RPGMakerTab(QWidget):
|
||||||
main_layout.setSpacing(12)
|
main_layout.setSpacing(12)
|
||||||
|
|
||||||
# Title
|
# Title
|
||||||
title = "RPG Maker MV/MZ" if self.engine != "ACE" else "RPG Maker Ace"
|
title_label = QLabel("RPG Maker MV/MZ Translation Settings")
|
||||||
title_label = QLabel(f"{title} Translation Settings")
|
|
||||||
title_label.setStyleSheet("font-size: 16px; font-weight: bold; color: #007acc;")
|
title_label.setStyleSheet("font-size: 16px; font-weight: bold; color: #007acc;")
|
||||||
main_layout.addWidget(title_label)
|
main_layout.addWidget(title_label)
|
||||||
|
|
||||||
|
|
@ -297,11 +291,6 @@ class RPGMakerTab(QWidget):
|
||||||
)
|
)
|
||||||
col1.addLayout(layout)
|
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()
|
col1.addStretch()
|
||||||
|
|
||||||
# ==================== COLUMN 2: DIALOGUE ====================
|
# ==================== COLUMN 2: DIALOGUE ====================
|
||||||
|
|
@ -516,8 +505,6 @@ class RPGMakerTab(QWidget):
|
||||||
self.tlsystemvariables_cb.stateChanged.disconnect()
|
self.tlsystemvariables_cb.stateChanged.disconnect()
|
||||||
self.tlsystemswitches_cb.stateChanged.disconnect()
|
self.tlsystemswitches_cb.stateChanged.disconnect()
|
||||||
self.join408_cb.stateChanged.disconnect()
|
self.join408_cb.stateChanged.disconnect()
|
||||||
if self.engine == "ACE":
|
|
||||||
self.speakers408_cb.stateChanged.disconnect()
|
|
||||||
|
|
||||||
# Main Codes
|
# Main Codes
|
||||||
self.code401_cb.stateChanged.disconnect()
|
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.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.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))
|
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
|
# Main Codes
|
||||||
self.code401_cb.stateChanged.connect(lambda: self.apply_to_module(show_messages=False))
|
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(),
|
"CODE111": self.code111_cb.isChecked(),
|
||||||
"CODE108": self.code108_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
|
return config
|
||||||
|
|
||||||
def set_config(self, config):
|
def set_config(self, config):
|
||||||
|
|
@ -645,10 +625,6 @@ class RPGMakerTab(QWidget):
|
||||||
self.tlsystemvariables_cb.setChecked(config.get("TLSYSTEMVARIABLES", False))
|
self.tlsystemvariables_cb.setChecked(config.get("TLSYSTEMVARIABLES", False))
|
||||||
self.tlsystemswitches_cb.setChecked(config.get("TLSYSTEMSWITCHES", False))
|
self.tlsystemswitches_cb.setChecked(config.get("TLSYSTEMSWITCHES", False))
|
||||||
self.join408_cb.setChecked(config.get("JOIN408", 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
|
# Main Codes
|
||||||
self.code401_cb.setChecked(config.get("CODE401", True))
|
self.code401_cb.setChecked(config.get("CODE401", True))
|
||||||
|
|
@ -760,11 +736,10 @@ class RPGMakerTab(QWidget):
|
||||||
return is_valid
|
return is_valid
|
||||||
|
|
||||||
def apply_to_module(self, show_messages=False):
|
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:
|
try:
|
||||||
config = self.get_config()
|
config = self.get_config()
|
||||||
# Select module filename based on engine
|
module_filename = "rpgmakermvmz.py"
|
||||||
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
|
|
||||||
module_path = Path(__file__).parent.parent / "modules" / module_filename
|
module_path = Path(__file__).parent.parent / "modules" / module_filename
|
||||||
|
|
||||||
if not module_path.exists():
|
if not module_path.exists():
|
||||||
|
|
@ -815,12 +790,12 @@ class RPGMakerTab(QWidget):
|
||||||
self.config_changed.emit()
|
self.config_changed.emit()
|
||||||
|
|
||||||
def load_from_module(self):
|
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:
|
if not self.config_integration:
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
|
module_filename = "rpgmakermvmz.py"
|
||||||
module_path = Path("modules") / module_filename
|
module_path = Path("modules") / module_filename
|
||||||
config = self.config_integration.read_current_config(module_path)
|
config = self.config_integration.read_current_config(module_path)
|
||||||
if config:
|
if config:
|
||||||
|
|
@ -841,8 +816,7 @@ class RPGMakerTab(QWidget):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
module_filename = "rpgmakermvmz.py" if self.engine != "ACE" else "rpgmakerace.py"
|
module_path = Path("modules") / "rpgmakermvmz.py"
|
||||||
module_path = Path("modules") / module_filename
|
|
||||||
config = self.config_integration.read_current_config(module_path)
|
config = self.config_integration.read_current_config(module_path)
|
||||||
if not config:
|
if not config:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
|
|
@ -325,11 +325,10 @@ class TranslationWorker(QThread):
|
||||||
threads = int(os.getenv("fileThreads", "1"))
|
threads = int(os.getenv("fileThreads", "1"))
|
||||||
total_cost = "Fail"
|
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.
|
# 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 ""
|
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_mvmz = "mv/mz" in module_name_lower
|
||||||
is_ace = "ace" in module_name_lower
|
|
||||||
|
|
||||||
# Change to project directory for module execution
|
# Change to project directory for module execution
|
||||||
old_cwd = os.getcwd()
|
old_cwd = os.getcwd()
|
||||||
|
|
@ -345,16 +344,12 @@ class TranslationWorker(QThread):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
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
|
# Run handlers sequentially in this worker process so globals are shared
|
||||||
try:
|
try:
|
||||||
if is_mvmz:
|
from modules.rpgmakermvmz import handleMVMZ as handler, setSpeakerParseMode, finalizeSpeakerParse, resetSpeakerState, TOKENS, calculateCost, MODEL
|
||||||
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
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
engine_name = "rpgmakermvmz" if is_mvmz else "rpgmakerace"
|
self.emit_log(f"❌ Could not import rpgmakermvmz for speaker-parse: {e}")
|
||||||
self.emit_log(f"❌ Could not import {engine_name} for speaker-parse: {e}")
|
|
||||||
self.finished_signal.emit(False, str(e))
|
self.finished_signal.emit(False, str(e))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -1106,7 +1101,6 @@ class TranslationTab(QWidget):
|
||||||
try:
|
try:
|
||||||
sys.path.append(str(self.project_root))
|
sys.path.append(str(self.project_root))
|
||||||
from modules.rpgmakermvmz import handleMVMZ
|
from modules.rpgmakermvmz import handleMVMZ
|
||||||
from modules.rpgmakerace import handleACE
|
|
||||||
from modules.csv import handleCSV
|
from modules.csv import handleCSV
|
||||||
from modules.tyrano import handleTyrano
|
from modules.tyrano import handleTyrano
|
||||||
from modules.kirikiri import handleKirikiri
|
from modules.kirikiri import handleKirikiri
|
||||||
|
|
@ -1126,7 +1120,6 @@ class TranslationTab(QWidget):
|
||||||
|
|
||||||
self.modules = [
|
self.modules = [
|
||||||
["RPG Maker MV/MZ", [".json"], handleMVMZ],
|
["RPG Maker MV/MZ", [".json"], handleMVMZ],
|
||||||
["RPG Maker Ace", [".yaml"], handleACE],
|
|
||||||
["CSV", [".csv"], handleCSV],
|
["CSV", [".csv"], handleCSV],
|
||||||
["Tyrano", [".ks"], handleTyrano],
|
["Tyrano", [".ks"], handleTyrano],
|
||||||
["Kirikiri", [".ks"], handleKirikiri],
|
["Kirikiri", [".ks"], handleKirikiri],
|
||||||
|
|
@ -1161,9 +1154,7 @@ class TranslationTab(QWidget):
|
||||||
|
|
||||||
def _on_module_changed(self, text: str):
|
def _on_module_changed(self, text: str):
|
||||||
lowered = text.lower()
|
lowered = text.lower()
|
||||||
if "ace" in lowered:
|
if "wolf" in lowered and "wolf rpg 2" not in lowered:
|
||||||
self.engine_changed.emit("ace")
|
|
||||||
elif "wolf" in lowered and "wolf rpg 2" not in lowered:
|
|
||||||
self.engine_changed.emit("wolf")
|
self.engine_changed.emit("wolf")
|
||||||
elif "mv/mz" in lowered:
|
elif "mv/mz" in lowered:
|
||||||
self.engine_changed.emit("mvmz")
|
self.engine_changed.emit("mvmz")
|
||||||
|
|
@ -1176,8 +1167,8 @@ class TranslationTab(QWidget):
|
||||||
self.mode_combo.addItem("Translate")
|
self.mode_combo.addItem("Translate")
|
||||||
self.mode_combo.addItem("Estimate")
|
self.mode_combo.addItem("Estimate")
|
||||||
|
|
||||||
# Add Parse Speakers for RPG Maker MV/MZ and RPG Maker Ace
|
# Add Parse Speakers for RPG Maker MV/MZ
|
||||||
if "mv/mz" in lowered or "ace" in lowered:
|
if "mv/mz" in lowered:
|
||||||
self.mode_combo.addItem("Parse Speakers")
|
self.mode_combo.addItem("Parse Speakers")
|
||||||
|
|
||||||
# Restore previous selection if it still exists
|
# Restore previous selection if it still exists
|
||||||
|
|
@ -1336,7 +1327,7 @@ class TranslationTab(QWidget):
|
||||||
try:
|
try:
|
||||||
selected_index = self.module_combo.currentIndex()
|
selected_index = self.module_combo.currentIndex()
|
||||||
if 0 <= selected_index < len(self.modules):
|
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:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.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.csv import handleCSV
|
||||||
from modules.tyrano import handleTyrano
|
from modules.tyrano import handleTyrano
|
||||||
from modules.kirikiri import handleKirikiri
|
from modules.kirikiri import handleKirikiri
|
||||||
|
|
@ -60,7 +59,6 @@ THREADS = int(os.getenv("fileThreads"))
|
||||||
MODULES = [
|
MODULES = [
|
||||||
["RPGMaker MV/MZ", ["json"], handleMVMZ],
|
["RPGMaker MV/MZ", ["json"], handleMVMZ],
|
||||||
["RPGMaker Plugins", ["js", "rb"], handlePlugin],
|
["RPGMaker Plugins", ["js", "rb"], handlePlugin],
|
||||||
["RPGMaker ACE", ["yaml"], handleACE],
|
|
||||||
["CSV (From Translator++)", ["csv"], handleCSV],
|
["CSV (From Translator++)", ["csv"], handleCSV],
|
||||||
["Tyrano", ["ks"], handleTyrano],
|
["Tyrano", ["ks"], handleTyrano],
|
||||||
["Kirikiri", ["ks", "tjs", "ssd", "asd"], handleKirikiri],
|
["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."
|
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
|
speaker_parse = False
|
||||||
if version in [0, 2] and not estimate:
|
if version == 0 and not estimate:
|
||||||
sub = ""
|
sub = ""
|
||||||
engine_name = "RPGMaker MV/MZ" if version == 0 else "RPGMaker ACE"
|
|
||||||
while sub == "":
|
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:
|
match sub:
|
||||||
case "1":
|
case "1":
|
||||||
speaker_parse = False
|
speaker_parse = False
|
||||||
|
|
@ -138,10 +135,7 @@ files to translate are in the /files folder and that you picked the right game e
|
||||||
case _:
|
case _:
|
||||||
sub = ""
|
sub = ""
|
||||||
if speaker_parse:
|
if speaker_parse:
|
||||||
if version == 0:
|
setSpeakerParseMVMZ(True)
|
||||||
setSpeakerParseMVMZ(True)
|
|
||||||
elif version == 2:
|
|
||||||
setSpeakerParseACE(True)
|
|
||||||
|
|
||||||
# Open File (Threads) - recursively walk 'files' and preserve directory structure
|
# 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
|
# 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
|
# Finalize speaker parse mode by writing collected speakers to vocab
|
||||||
if speaker_parse:
|
if speaker_parse:
|
||||||
if version == 0:
|
finalizeSpeakerParseMVMZ()
|
||||||
finalizeSpeakerParseMVMZ()
|
|
||||||
elif version == 2:
|
|
||||||
finalizeSpeakerParseACE()
|
|
||||||
|
|
||||||
# Delete Tmp Files
|
# Delete Tmp Files
|
||||||
if os.path.isfile("csv.tmp"):
|
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):
|
def deleteFolderFiles(folderPath):
|
||||||
for filename in os.listdir(folderPath):
|
for filename in os.listdir(folderPath):
|
||||||
file_path = os.path.join(folderPath, filename)
|
file_path = os.path.join(folderPath, filename)
|
||||||
if file_path.endswith((".json", ".yaml", ".ks")):
|
if file_path.endswith((".json", ".ks")):
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -3,7 +3,6 @@ colorama>=0.4.6
|
||||||
openai>=2.8.0
|
openai>=2.8.0
|
||||||
python-dotenv>=1.0.0
|
python-dotenv>=1.0.0
|
||||||
retry>=0.9.2
|
retry>=0.9.2
|
||||||
ruamel.yaml>=0.17.32
|
|
||||||
tiktoken>=0.8.0
|
tiktoken>=0.8.0
|
||||||
tqdm>=4.65.0
|
tqdm>=4.65.0
|
||||||
jsbeautifier>=1.14.0
|
jsbeautifier>=1.14.0
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,6 @@ def run_handler(project_root, module_name, filename, estimate_only):
|
||||||
if "RPG Maker MV/MZ" in module_name:
|
if "RPG Maker MV/MZ" in module_name:
|
||||||
from modules.rpgmakermvmz import handleMVMZ
|
from modules.rpgmakermvmz import handleMVMZ
|
||||||
handler = handleMVMZ
|
handler = handleMVMZ
|
||||||
elif "RPG Maker Ace" in module_name:
|
|
||||||
from modules.rpgmakerace import handleACE
|
|
||||||
handler = handleACE
|
|
||||||
elif "CSV" in module_name:
|
elif "CSV" in module_name:
|
||||||
from modules.csv import handleCSV
|
from modules.csv import handleCSV
|
||||||
handler = handleCSV
|
handler = handleCSV
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue