// Terminate a script, either because of error, or the script finished void script_end() { // Tell other code that script has ended camera_info.state.state_kbd_script_run = SCRIPT_STATE_INACTIVE; camera_info.state.osd_title_line = 1 ; // reset the script terminate key script_terminate_key = KEY_SHOOT_FULL ; script_print_screen_end(); console_set_autoredraw(1); // Force console display on in case script turned it off // Restore old handler - prevent calling MD draw after module unloaded if (old_gui_handler) { extern gui_handler defaultGuiHandler; // if script switched in or out of alt, try to preserve // TODO is there ever a situation where it should be something other than default or alt? if(old_gui_handler == &altGuiHandler && camera_info.state.gui_mode_none) { gui_set_mode(&defaultGuiHandler); } else if(old_gui_handler == &defaultGuiHandler && camera_info.state.gui_mode_alt) { gui_set_mode(&altGuiHandler); } else { gui_set_mode(old_gui_handler); } old_gui_handler = 0; } // Reset script language module libscriptapi->script_reset(); // Kill off the action_stack for the script, since we've just reset the script // language and unloaded the MD module, we don't need to let the stack empty // itself. action_stack_kill(running_script_stack_name); running_script_stack_name = -1; libshothisto->shot_histogram_set(0); kbd_key_release_all(); conf_setAutosave(1); // Turn on autosave of config file in conf_setValue in case script turned it off conf_update_prevent_shutdown(); }
static int luaCB_set_console_autoredraw( lua_State* L ) { console_set_autoredraw(luaL_checknumber(L,1)); return 0; }
void script_console_add_error(long str_id) { console_set_autoredraw(1); // Force console display on script_console_add_line(str_id); }