mirror of
https://github.com/Polprzewodnikowy/N64FlashcartMenu.git
synced 2024-11-22 02:29:19 +01:00
Improve sprite alignment
Handle both sides of the action bar Fix start button.
This commit is contained in:
parent
619e1658fd
commit
d618b7d159
@ -175,19 +175,21 @@ void ui_components_actions_bar_text_draw (rdpq_align_t align, rdpq_valign_t vali
|
|||||||
char *formatted = vasnprintf(buffer, &nbytes, fmt, va);
|
char *formatted = vasnprintf(buffer, &nbytes, fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
// FIXME: take into account action bar align
|
uint16_t btn_offset_x = 0;
|
||||||
if(action_button != SPRITE_JOYPAD_BUTTON_NONE && align == ALIGN_LEFT) {
|
uint16_t btn_offset_y = 0;
|
||||||
switch (line)
|
|
||||||
{
|
|
||||||
case ACTION_BAR_LINE_ONE:
|
// FIXME: improve bar align and line offsets. Currently they are just best guesses!
|
||||||
ui_components_joypad_buttons_draw(action_button, VISIBLE_AREA_X0 + TEXT_MARGIN_HORIZONTAL, LAYOUT_ACTIONS_SEPARATOR_Y + BORDER_THICKNESS + TEXT_MARGIN_VERTICAL + TEXT_OFFSET_VERTICAL);
|
if (line == ACTION_BAR_LINE_TWO) {
|
||||||
break;
|
btn_offset_y = 18;
|
||||||
case ACTION_BAR_LINE_TWO:
|
}
|
||||||
ui_components_joypad_buttons_draw(action_button, VISIBLE_AREA_X0 + TEXT_MARGIN_HORIZONTAL, LAYOUT_ACTIONS_SEPARATOR_Y + BORDER_THICKNESS + TEXT_MARGIN_VERTICAL + TEXT_OFFSET_VERTICAL + 18);
|
|
||||||
break;
|
if (align == ALIGN_RIGHT) {
|
||||||
default:
|
btn_offset_x = 450;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
|
if(action_button != SPRITE_JOYPAD_BUTTON_NONE) {
|
||||||
|
ui_components_joypad_buttons_draw(action_button, VISIBLE_AREA_X0 + TEXT_MARGIN_HORIZONTAL + btn_offset_x, LAYOUT_ACTIONS_SEPARATOR_Y + BORDER_THICKNESS + TEXT_MARGIN_VERTICAL + TEXT_OFFSET_VERTICAL + btn_offset_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
rdpq_text_printn(
|
rdpq_text_printn(
|
||||||
|
@ -76,7 +76,7 @@ void ui_components_joypad_buttons_draw (sprite_joypad_button_type_t button, floa
|
|||||||
current_button = sprite_joypad_r;
|
current_button = sprite_joypad_r;
|
||||||
break;
|
break;
|
||||||
case SPRITE_JOYPAD_BUTTON_START:
|
case SPRITE_JOYPAD_BUTTON_START:
|
||||||
current_button = sprite_joypad_z;
|
current_button = sprite_joypad_start;
|
||||||
break;
|
break;
|
||||||
case SPRITE_JOYPAD_BUTTON_Z:
|
case SPRITE_JOYPAD_BUTTON_Z:
|
||||||
current_button = sprite_joypad_z;
|
current_button = sprite_joypad_z;
|
||||||
|
Loading…
Reference in New Issue
Block a user