From fddfaaa1fc46f707390fae867ea15dbf5fb8c90a Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Thu, 14 Nov 2024 15:40:08 +0000 Subject: [PATCH] Vehicle: add and return `custom_mode_state` struct on `register_custom_mode` --- libraries/AP_Vehicle/AP_Vehicle.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index ffa70eec6d..f56262e0c3 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -247,8 +247,11 @@ public: // returns true on success and control_value is set to a value in the range -1 to +1 virtual bool get_control_output(AP_Vehicle::ControlOutput control_output, float &control_value) { return false; } - // Register a custom mode with given number and names - virtual bool register_custom_mode(const uint8_t number, const char* full_name, const char* short_name) { return false; } + // Register a custom mode with given number and names, return a structure which the script can edit + struct custom_mode_state { + bool allow_entry; + }; + virtual custom_mode_state* register_custom_mode(const uint8_t number, const char* full_name, const char* short_name) { return nullptr; } #endif // AP_SCRIPTING_ENABLED