diff --git a/ui.cpp b/ui.cpp index 06044ae..a81c377 100644 --- a/ui.cpp +++ b/ui.cpp @@ -41,7 +41,6 @@ namespace ui void setrenderer(SDL_Renderer *renderer, SDL_Texture *texture) { - if (ren==renderer) return; ren = renderer; tex = texture; offset_x = offset_y = 0; diff --git a/zx_dialog_joystick.cpp b/zx_dialog_joystick.cpp index a17bda4..fc7743e 100644 --- a/zx_dialog_joystick.cpp +++ b/zx_dialog_joystick.cpp @@ -40,12 +40,20 @@ namespace dialogs { char name[] = "JOYSTICK 0"; name[9] = 48+i; - if (selected==i) { - ui::printrect(0,i,18,1, COLOR_WHITE); - ui::printtxt(0,i,name, COLOR_BLACK); - } else { - ui::printtxt(0,i,name, COLOR_WHITE); + back_color = COLOR_DARK; + front_color = COLOR_WHITE; + if (ui::mouseInside(0,i,18,1)) { + back_color = COLOR_BLACK; + if (ui::getClicked()) { + selected = i; + } } + if (selected==i) { + back_color = COLOR_WHITE; + front_color = COLOR_BLACK; + } + ui::printrect(0,i,18,1, back_color); + ui::printtxt(0,i,name, front_color); } ui::panel(60,17,20,8,"TYPE:"); const int selected_type = gamepad::getGamepadType(selected);