LED menu item bool (like Case Lights)

This commit is contained in:
Scott Lahteine 2018-06-02 20:53:25 -05:00
parent ad8d3150aa
commit 2fd9ba56da
12 changed files with 14 additions and 29 deletions

View File

@ -148,8 +148,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupně") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupně")
#define MSG_LED_CONTROL _UxGT("LED Nastavení") #define MSG_LED_CONTROL _UxGT("LED Nastavení")
#define MSG_LEDS_ON _UxGT("Světla Zap") #define MSG_LEDS _UxGT("Světla")
#define MSG_LEDS_OFF _UxGT("Světla Vyp")
#define MSG_LED_PRESETS _UxGT("Světla Předvolby") #define MSG_LED_PRESETS _UxGT("Světla Předvolby")
#define MSG_SET_LEDS_RED _UxGT("Červená") #define MSG_SET_LEDS_RED _UxGT("Červená")
#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") #define MSG_SET_LEDS_ORANGE _UxGT("Oranžová")

View File

@ -309,8 +309,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL")
#define MSG_LED_CONTROL _UxGT("LED Kontrolle") #define MSG_LED_CONTROL _UxGT("LED Kontrolle")
#define MSG_LEDS_ON _UxGT("Licht an") #define MSG_LEDS _UxGT("Licht")
#define MSG_LEDS_OFF _UxGT("Licht aus")
#define MSG_LED_PRESETS _UxGT("Licht Einstellungen") #define MSG_LED_PRESETS _UxGT("Licht Einstellungen")
#define MSG_SET_LEDS_RED _UxGT("Rot") #define MSG_SET_LEDS_RED _UxGT("Rot")
#define MSG_SET_LEDS_ORANGE _UxGT("Orange") #define MSG_SET_LEDS_ORANGE _UxGT("Orange")

View File

@ -371,11 +371,8 @@
#ifndef MSG_LED_CONTROL #ifndef MSG_LED_CONTROL
#define MSG_LED_CONTROL _UxGT("LED Control") #define MSG_LED_CONTROL _UxGT("LED Control")
#endif #endif
#ifndef MSG_LEDS_ON #ifndef MSG_LEDS
#define MSG_LEDS_ON _UxGT("Lights On") #define MSG_LEDS _UxGT("Lights")
#endif
#ifndef MSG_LEDS_OFF
#define MSG_LEDS_OFF _UxGT("Lights Off")
#endif #endif
#ifndef MSG_LED_PRESETS #ifndef MSG_LED_PRESETS
#define MSG_LED_PRESETS _UxGT("Light Presets") #define MSG_LED_PRESETS _UxGT("Light Presets")

View File

@ -142,8 +142,7 @@
//#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") //#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped")
//#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") //#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL")
#define MSG_LED_CONTROL _UxGT("LED ezarpenak") #define MSG_LED_CONTROL _UxGT("LED ezarpenak")
#define MSG_LEDS_ON _UxGT("Argiak piztu") #define MSG_LEDS _UxGT("Argiak")
#define MSG_LEDS_OFF _UxGT("Argiak itzali")
#define MSG_LED_PRESETS _UxGT("Argi aurrehautaketak") #define MSG_LED_PRESETS _UxGT("Argi aurrehautaketak")
#define MSG_SET_LEDS_RED _UxGT("Gorria") #define MSG_SET_LEDS_RED _UxGT("Gorria")
#define MSG_SET_LEDS_ORANGE _UxGT("Laranja") #define MSG_SET_LEDS_ORANGE _UxGT("Laranja")

View File

@ -144,8 +144,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas à pas") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas à pas")
#define MSG_LED_CONTROL _UxGT("Contrôle LED") #define MSG_LED_CONTROL _UxGT("Contrôle LED")
#define MSG_LEDS_ON _UxGT("Lumière ON") #define MSG_LEDS _UxGT("Lumière")
#define MSG_LEDS_OFF _UxGT("Lumière OFF")
#define MSG_LED_PRESETS _UxGT("Préregl. LED") #define MSG_LED_PRESETS _UxGT("Préregl. LED")
#define MSG_SET_LEDS_RED _UxGT("Rouge") #define MSG_SET_LEDS_RED _UxGT("Rouge")
#define MSG_SET_LEDS_ORANGE _UxGT("Orange") #define MSG_SET_LEDS_ORANGE _UxGT("Orange")

View File

@ -143,8 +143,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo passo") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo passo")
#define MSG_LED_CONTROL _UxGT("Controllo LED") #define MSG_LED_CONTROL _UxGT("Controllo LED")
#define MSG_LEDS_ON _UxGT("Luci On") #define MSG_LEDS _UxGT("Luci")
#define MSG_LEDS_OFF _UxGT("Luci Off")
#define MSG_LED_PRESETS _UxGT("Preset luci") #define MSG_LED_PRESETS _UxGT("Preset luci")
#define MSG_SET_LEDS_RED _UxGT("Rosso") #define MSG_SET_LEDS_RED _UxGT("Rosso")
#define MSG_SET_LEDS_ORANGE _UxGT("Arancione") #define MSG_SET_LEDS_ORANGE _UxGT("Arancione")

View File

@ -148,8 +148,7 @@
#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensação Z parou") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Compensação Z parou")
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo a passo")
#define MSG_LED_CONTROL _UxGT("Controle do LED") #define MSG_LED_CONTROL _UxGT("Controle do LED")
#define MSG_LEDS_ON _UxGT("Luz Acesa") #define MSG_LEDS _UxGT("Luz")
#define MSG_LEDS_OFF _UxGT("Luz Apagada")
#define MSG_LED_PRESETS _UxGT("Configuração da Luz") #define MSG_LED_PRESETS _UxGT("Configuração da Luz")
#define MSG_SET_LEDS_RED _UxGT("Luz Vermelha") #define MSG_SET_LEDS_RED _UxGT("Luz Vermelha")
#define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja") #define MSG_SET_LEDS_ORANGE _UxGT("Luz Laranja")

View File

@ -144,8 +144,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Пошаговое UBL") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Пошаговое UBL")
#define MSG_LED_CONTROL _UxGT("Настройки LED") #define MSG_LED_CONTROL _UxGT("Настройки LED")
#define MSG_LEDS_ON _UxGT("Включить подсветку") #define MSG_LEDS _UxGT("Подсветку")
#define MSG_LEDS_OFF _UxGT("Выключить подсветку")
#define MSG_LED_PRESETS _UxGT("Предустановки света") #define MSG_LED_PRESETS _UxGT("Предустановки света")
#define MSG_SET_LEDS_RED _UxGT("Красный свет") #define MSG_SET_LEDS_RED _UxGT("Красный свет")
#define MSG_SET_LEDS_ORANGE _UxGT("Оранжевый свет") #define MSG_SET_LEDS_ORANGE _UxGT("Оранжевый свет")

View File

@ -153,8 +153,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupne")
#define MSG_LED_CONTROL _UxGT("Nastavenie LED") #define MSG_LED_CONTROL _UxGT("Nastavenie LED")
#define MSG_LEDS_ON _UxGT("Zapnúť svetlo") #define MSG_LEDS _UxGT("Svetlo")
#define MSG_LEDS_OFF _UxGT("Vypnúť svetlo")
#define MSG_LED_PRESETS _UxGT("Prednastavené farby") #define MSG_LED_PRESETS _UxGT("Prednastavené farby")
#define MSG_SET_LEDS_RED _UxGT("Červená") #define MSG_SET_LEDS_RED _UxGT("Červená")
#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová") #define MSG_SET_LEDS_ORANGE _UxGT("Oranžová")

View File

@ -143,8 +143,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL"
#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") #define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control")
#define MSG_LEDS_ON _UxGT("灯亮") // "Lights On") #define MSG_LEDS _UxGT("灯") // "Lights")
#define MSG_LEDS_OFF _UxGT("灯灭") // "Lights Off")
#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") #define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets")
#define MSG_SET_LEDS_RED _UxGT("红") // "Red") #define MSG_SET_LEDS_RED _UxGT("红") // "Red")
#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") #define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange")

View File

@ -143,8 +143,7 @@
#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL" #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("一步步UBL") // "Step-By-Step UBL"
#define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control") #define MSG_LED_CONTROL _UxGT("灯管控制") // "LED Control")
#define MSG_LEDS_ON _UxGT("灯亮") // "Lights On") #define MSG_LEDS _UxGT("灯") // "Lights")
#define MSG_LEDS_OFF _UxGT("灯灭") // "Lights Off")
#define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets") #define MSG_LED_PRESETS _UxGT("灯预置") // "Light Presets")
#define MSG_SET_LEDS_RED _UxGT("红") // "Red") #define MSG_SET_LEDS_RED _UxGT("红") // "Red")
#define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange") #define MSG_SET_LEDS_ORANGE _UxGT("橙") // "Orange")

View File

@ -4255,10 +4255,8 @@ void lcd_quick_feedback(const bool clear_buttons) {
void lcd_led_menu() { void lcd_led_menu() {
START_MENU(); START_MENU();
MENU_BACK(MSG_MAIN); MENU_BACK(MSG_MAIN);
if (leds.lights_on) bool led_on = leds.lights_on;
MENU_ITEM(function, MSG_LEDS_OFF, leds.toggle); MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle);
else
MENU_ITEM(function, MSG_LEDS_ON, leds.toggle);
MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default);
#if ENABLED(LED_COLOR_PRESETS) #if ENABLED(LED_COLOR_PRESETS)
MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu); MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu);