- [NEW] Dialeg per a configurar els joysticks
This commit is contained in:
11
ui_menu.cpp
11
ui_menu.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user