From 56be838b40a1533ab4765568e02c7a0d8e1df8b9 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 6 Aug 2023 12:04:30 +0200 Subject: [PATCH] gobot:: -go-video command --- rogueviz/gobot.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rogueviz/gobot.cpp b/rogueviz/gobot.cpp index 9b584f7c..2a470f02 100644 --- a/rogueviz/gobot.cpp +++ b/rogueviz/gobot.cpp @@ -735,6 +735,24 @@ int rugArgs() { else if(argis("-go-save")) save_go(); + else if(argis("-go-video")) { + save_backup(); + shift(); string s = args(); + shift(); int fpmove = argi(); + shift(); int ffinal = argi(); + int N = isize(history); + anims::noframes = N * fpmove + ffinal; + anims::period = anims::noframes; + + int a = addHook(anims::hooks_anim, 100, [&] { + current = history[min(ticks / fpmove, N-1)]; + }); + anims::videofile = s; + anims::record_video_std(); + delHook(anims::hooks_anim, a); + undo(); + } + else return 1; return 0; }