Version 3.4.0: Edit tab (edit list, large subtitle, replacements with effects and presets), Sounds tab only browses, ackit fx (pedalboard + own reverb) and replace --fx, first Linux build, catalog without a mod package
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Render the user-guide screenshots headless (docs/img/*.png). Read-only: never applies anything.
|
||||
|
||||
python tools/screenshots.py [--game DIR] [--lang INT]
|
||||
python tools/screenshots.py [--game DIR] [--lang INT] [--only main,browse,settings,edit]
|
||||
|
||||
The app starts in the game's language as always; the screenshots then switch to --lang (default INT, the
|
||||
game's English) the way a user does, through the Language list.
|
||||
@@ -22,7 +22,10 @@ def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--game")
|
||||
ap.add_argument("--lang", default="INT", help="language shown in the screenshots (default: INT)")
|
||||
ap.add_argument("--only", default="main,browse,settings,edit",
|
||||
help="which screenshots (comma-separated): main, browse, settings, edit (editor.png)")
|
||||
a = ap.parse_args()
|
||||
only = set(a.only.split(","))
|
||||
from PySide6.QtWidgets import QApplication
|
||||
from ackit import audio
|
||||
from app.dialogs import SettingsDialog
|
||||
@@ -49,31 +52,19 @@ def main():
|
||||
app.processEvents()
|
||||
# status bar: show the store where users have it, not this temporary folder (no local user names)
|
||||
w.lbl_game.setText(w.lbl_game.text().replace(os.path.join(td, "data"), r"%APPDATA%\UnheardCity"))
|
||||
# 1: browser filtered by character
|
||||
# 1: browser filtered by character, a line selected (preview below the list)
|
||||
from PySide6.QtTest import QTest
|
||||
w.cmb_char.setCurrentText("Joker")
|
||||
w._filters_changed()
|
||||
w.search.setText("")
|
||||
w._filter_text()
|
||||
w.fit_editor()
|
||||
rows = [w.proxy.sound_at(w.proxy.index(r, 1)) for r in range(w.proxy.rowCount())]
|
||||
with_sub = [s for s in rows if w.ws.texts.for_sound(s, w.language)] # show the subtitle column too
|
||||
with_sub = [s for s in rows if w.ws.texts.for_sound(s, w.language)] # show the subtitle too
|
||||
target = max(with_sub or rows, key=lambda s: min(s.seconds, 6.0))
|
||||
w.select_name(target.name)
|
||||
app.processEvents()
|
||||
# a replacement loaded for display only (not applied)
|
||||
x, sr = w.editor.orig
|
||||
t = np.arange(len(x)) / sr
|
||||
rep = (0.5 * x[:, :1] * (0.6 + 0.4 * np.sin(2 * np.pi * 0.7 * t))[:, None]).astype(np.float32)
|
||||
path = os.path.join(td, "my_line.wav")
|
||||
audio.save_wav(path, rep, sr)
|
||||
w.editor.load_file(path)
|
||||
w.editor.cb_match.setChecked(True)
|
||||
w.editor._update_new()
|
||||
w.editor.sp_a.setValue(0.2)
|
||||
app.processEvents()
|
||||
w.grab().save(os.path.join(out, "main.png"))
|
||||
from PySide6.QtCore import QPoint, QRect # the editor area, cut from the window (full styling)
|
||||
w.grab(QRect(w.scroll.mapTo(w, QPoint(0, 0)), w.scroll.size())).save(os.path.join(out, "editor.png"))
|
||||
if "main" in only:
|
||||
w.grab().save(os.path.join(out, "main.png"))
|
||||
# 2: category browsing
|
||||
w.clear_filters()
|
||||
w.cmb_group.setCurrentText("Speech")
|
||||
@@ -83,14 +74,35 @@ def main():
|
||||
w.search.setText("joker")
|
||||
w._filter_text()
|
||||
app.processEvents()
|
||||
w.grab().save(os.path.join(out, "browse.png"))
|
||||
if "browse" in only:
|
||||
w.grab().save(os.path.join(out, "browse.png"))
|
||||
# 3: settings
|
||||
d = SettingsDialog(w.settings, w)
|
||||
d.bg_on.setChecked(True) # show the user's default (on), only the screenshots run without it
|
||||
d.show()
|
||||
app.processEvents()
|
||||
d.grab().save(os.path.join(out, "settings.png"))
|
||||
d.close()
|
||||
if "settings" in only:
|
||||
d = SettingsDialog(w.settings, w)
|
||||
d.bg_on.setChecked(True) # show the user's default (on), only the screenshots run without it
|
||||
d.show()
|
||||
app.processEvents()
|
||||
d.grab().save(os.path.join(out, "settings.png"))
|
||||
d.close()
|
||||
# 4: the Edit tab: Mr. Freeze's lines on the edit list, one with a replacement (the original, reshaped,
|
||||
# for display only) and the Mr. Freeze preset
|
||||
if "edit" in only:
|
||||
w.clear_filters()
|
||||
w.cmb_char.setCurrentText("Mr. Freeze")
|
||||
w._filters_changed()
|
||||
freeze = [w.proxy.sound_at(w.proxy.index(r, 1)) for r in range(min(w.proxy.rowCount(), 12))]
|
||||
target = max(freeze, key=lambda s: (bool(w.ws.texts.for_sound(s, w.language)), min(s.seconds, 4.0)))
|
||||
w.edit_sounds([target] + [s for s in freeze if s is not target])
|
||||
app.processEvents()
|
||||
x, sr = w.editor.orig
|
||||
t = np.arange(len(x)) / sr
|
||||
new = (0.5 * x.mean(axis=1, keepdims=True) * (0.6 + 0.4 * np.sin(2 * np.pi * 0.7 * t))[:, None])
|
||||
path = os.path.join(td, "new_line.wav")
|
||||
audio.save_wav(path, new.astype(np.float32), sr)
|
||||
w.editor.load_file(path)
|
||||
w.edit.rack.apply_look("Mr. Freeze")
|
||||
QTest.qWait(1500) # the effects render in the background, then the settings are saved
|
||||
w.grab().save(os.path.join(out, "editor.png"))
|
||||
w.close()
|
||||
print("screenshots in", out)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user