- [NEW] Dialeg per a configurar els joysticks

This commit is contained in:
2025-08-16 10:09:42 +02:00
parent 864c6b929d
commit 8201d51668
9 changed files with 170 additions and 38 deletions

View File

@@ -39,6 +39,7 @@ namespace ui
void show()
{
ui::setoffset(0,0);
int mx, my;
Uint32 mb = SDL_GetMouseState(&mx, &my);
mx=mx/CHR_W; my=my/CHR_H;
@@ -52,8 +53,8 @@ namespace ui
uint8_t text_color = COLOR_WHITE;
if (my<1 && mx>=opt_pos && mx<opt_pos+text_size)
{
ui::printrect(opt_pos-1, 0, text_size, 1, COLOR_DARK_BLUE);
text_color = COLOR_WHITE;
ui::printrect(opt_pos-1, 0, text_size, 1, COLOR_WHITE);
text_color = COLOR_BLACK;
visible_menu = index;
menu_x = opt_pos-1;
}
@@ -73,10 +74,10 @@ namespace ui
{
const int text_size = (option.label.size()+2);
uint8_t text_color = COLOR_WHITE;
if (my==opt_pos && mx>=menu_x && mx<menu_x+text_size)
if (my==opt_pos && mx>=menu_x && mx<menu_x+20)
{
ui::printrect(menu_x+1, opt_pos, 20, 1, COLOR_DARK_BLUE);
text_color = COLOR_WHITE;
ui::printrect(menu_x+1, opt_pos, 20, 1, COLOR_WHITE);
text_color = COLOR_BLACK;
if (ui::getClicked())
{
if (option.callback) option.value = option.callback(option.value);