From ab4bf57090dc28374f9349683c917cc12b945973 Mon Sep 17 00:00:00 2001 From: ipkpjersi Date: Sat, 19 Oct 2024 21:28:57 -0400 Subject: [PATCH 1/2] Added menu text position variable and set menu text position to top --- src/ui/menu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ui/menu.c b/src/ui/menu.c index 9fa56612..da5d61bb 100644 --- a/src/ui/menu.c +++ b/src/ui/menu.c @@ -1,4 +1,6 @@ #include "menu.h" +#define MENU_TEXT_TOP 1 +#define MENU_TEXT_BOTTOM 2 static int get_entry_height(mudclient *mud); @@ -633,6 +635,8 @@ void mudclient_create_top_mouse_menu(mudclient *mud) { int is_touch = mudclient_is_touch(mud); + int menu_text_position = MENU_TEXT_TOP; + if (strlen(menu_text) > 0) { int y_position = 14; int y_offset = 35; @@ -643,9 +647,13 @@ void mudclient_create_top_mouse_menu(mudclient *mud) { y_offset = 18; } - y_position = mud->surface->height - y_offset; + if (menu_text_position == MENU_TEXT_TOP) { + y_position = 11; + } else { + y_position = mud->surface->height - y_offset; + } - if (mud->is_in_wilderness) { + if (menu_text_position == MENU_TEXT_BOTTOM && mud->is_in_wilderness) { x_position = 76; } } From 7681e42db37307d3d2ffdb473e4b625aea04ad7c Mon Sep 17 00:00:00 2001 From: ipkpjersi Date: Sat, 19 Oct 2024 21:28:57 -0400 Subject: [PATCH 2/2] Added menu text position variable and set menu text position to top --- src/ui/menu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ui/menu.c b/src/ui/menu.c index 9fa56612..da5d61bb 100644 --- a/src/ui/menu.c +++ b/src/ui/menu.c @@ -1,4 +1,6 @@ #include "menu.h" +#define MENU_TEXT_TOP 1 +#define MENU_TEXT_BOTTOM 2 static int get_entry_height(mudclient *mud); @@ -633,6 +635,8 @@ void mudclient_create_top_mouse_menu(mudclient *mud) { int is_touch = mudclient_is_touch(mud); + int menu_text_position = MENU_TEXT_TOP; + if (strlen(menu_text) > 0) { int y_position = 14; int y_offset = 35; @@ -643,9 +647,13 @@ void mudclient_create_top_mouse_menu(mudclient *mud) { y_offset = 18; } - y_position = mud->surface->height - y_offset; + if (menu_text_position == MENU_TEXT_TOP) { + y_position = 11; + } else { + y_position = mud->surface->height - y_offset; + } - if (mud->is_in_wilderness) { + if (menu_text_position == MENU_TEXT_BOTTOM && mud->is_in_wilderness) { x_position = 76; } }