menu: Support changing branding title screen

This commit is contained in:
mintsuki 2020-12-10 07:32:15 +01:00
parent 0a8eae7bbe
commit cdfc454ae2
5 changed files with 9 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -13,6 +13,8 @@
#include <mm/pmm.h> #include <mm/pmm.h>
#include <drivers/vbe.h> #include <drivers/vbe.h>
static char *menu_branding = NULL;
static void cursor_back(void) { static void cursor_back(void) {
int x, y; int x, y;
get_cursor_pos(&x, &y); get_cursor_pos(&x, &y);
@ -104,7 +106,7 @@ static char *config_entry_editor(bool *ret, const char *orig_entry) {
refresh: refresh:
clear(true); clear(true);
disable_cursor(); disable_cursor();
print("\n\n \e[36m Limine " LIMINE_VERSION " \e[37m\n\n\n"); print("\n\n \e[36m %s \e[37m\n\n\n", menu_branding);
print("Editing entry.\n"); print("Editing entry.\n");
print("Press esc to return to main menu and discard changes, press F10 to boot.\n"); print("Press esc to return to main menu and discard changes, press F10 to boot.\n");
@ -240,6 +242,10 @@ static int print_tree(int level, int base_index, int selected_entry,
} }
char *menu(char **cmdline) { char *menu(char **cmdline) {
menu_branding = config_get_value(NULL, 0, "MENU_BRANDING");
if (menu_branding == NULL)
menu_branding = "Limine " LIMINE_VERSION;
if (menu_tree == NULL) if (menu_tree == NULL)
panic("Config contains no valid entries."); panic("Config contains no valid entries.");
@ -343,7 +349,7 @@ char *menu(char **cmdline) {
refresh: refresh:
clear(true); clear(true);
print("\n\n \e[36m Limine " LIMINE_VERSION " \e[37m\n\n\n"); print("\n\n \e[36m %s \e[37m\n\n\n", menu_branding);
print("Select an entry:\n\n"); print("Select an entry:\n\n");

View File

@ -1,3 +1,4 @@
MENU_BRANDING=Limine's test image
DEFAULT_ENTRY=2 DEFAULT_ENTRY=2
TIMEOUT=3 TIMEOUT=3
GRAPHICS=yes GRAPHICS=yes