From 0f75c3d7e674a89c95717ea8e49e1aafb183d2ad Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 13 Jul 2023 05:48:19 -0700 Subject: modules/rkt: '=' for current Rocket scene in scener Pressing '=' at either prompts now makes scener's current scene the current Rocket scene. While you could already do this manually by just looking at the scenes list for the one with the '*' in the Rocket column while either watching a production and pressing repeatedly to keep refreshing the scenes list... that's cumbersome and annoying, now just use this shortcut. Since this just copies Rocket's scene to the Scener scene index, it needed to properly handle scene 99999... hence the previous commits. --- src/modules/rkt/rkt_scener.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/rkt/rkt_scener.c b/src/modules/rkt/rkt_scener.c index 1a7bc1a..1a3a025 100644 --- a/src/modules/rkt/rkt_scener.c +++ b/src/modules/rkt/rkt_scener.c @@ -318,6 +318,11 @@ static int rkt_scener_handle_input_scenes(rkt_context_t *ctxt) scener->state = RKT_SCENER_FSM_SEND_SCENES; break; + case '=': /* set scener scene idx to current Rocket scene idx, and go to edit scene view */ + scener->scene = ctxt->scene; + scener->state = RKT_SCENER_FSM_SEND_EDITSCENE; + break; + case '\0': /* if you don't say anything to even quote as "invalid input", just go back to the scenes dialog */ scener->state = RKT_SCENER_FSM_SEND_SCENES; break; @@ -644,6 +649,11 @@ static int rkt_scener_handle_input_editscene(rkt_context_t *ctxt) scener->state = RKT_SCENER_FSM_SEND_EDITSCENE; break; + case '=': /* set scener scene idx to current Rocket scene idx, and go to edit scene view */ + scener->scene = ctxt->scene; + scener->state = RKT_SCENER_FSM_SEND_EDITSCENE; + break; + case '\0': /* if you don't say anything to even quote as "invalid input", just go back to the scenes dialog */ scener->state = RKT_SCENER_FSM_SEND_SCENES; break; @@ -899,7 +909,7 @@ int rkt_scener_update(rkt_context_t *ctxt) return rkt_scener_err_close(scener, ENOMEM); if (i) { - if (til_str_appendf(output, " [0-%u]", i - 1) < 0) + if (til_str_appendf(output, " [0-%u,=]", i - 1) < 0) return rkt_scener_err_close(scener, ENOMEM); } @@ -1211,6 +1221,11 @@ int rkt_scener_update(rkt_context_t *ctxt) char *as_arg; til_str_t *output; + if (scener->scene == RKT_EXIT_SCENE_IDX) { + scener->state = RKT_SCENER_FSM_SEND_SCENES; + break; + } + if (!til_settings_get_value_by_idx(scenes_settings, scener->scene, &scene_setting)) return rkt_scener_err_close(scener, ENOENT); -- cgit v1.2.3