mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
More widget additions and adjustments (#16287)
This commit is contained in:
parent
55b1ecb3f5
commit
3c4dd50974
@ -57,6 +57,8 @@ static const char
|
|||||||
|
|
||||||
"menu_hourglass.png",
|
"menu_hourglass.png",
|
||||||
"menu_check.png",
|
"menu_check.png",
|
||||||
|
"menu_add.png",
|
||||||
|
"menu_exit.png",
|
||||||
|
|
||||||
"menu_info.png",
|
"menu_info.png",
|
||||||
|
|
||||||
@ -258,6 +260,11 @@ void gfx_widgets_msg_queue_push(
|
|||||||
|
|
||||||
msg_widget->flags |= DISPWIDG_FLAG_UNFOLDED;
|
msg_widget->flags |= DISPWIDG_FLAG_UNFOLDED;
|
||||||
|
|
||||||
|
if (task->style == TASK_STYLE_POSITIVE)
|
||||||
|
msg_widget->flags |= DISPWIDG_FLAG_POSITIVE;
|
||||||
|
else if (task->style == TASK_STYLE_NEGATIVE)
|
||||||
|
msg_widget->flags |= DISPWIDG_FLAG_NEGATIVE;
|
||||||
|
|
||||||
msg_widget->width = font_driver_get_message_width(
|
msg_widget->width = font_driver_get_message_width(
|
||||||
p_dispwidget->gfx_widget_fonts.msg_queue.font,
|
p_dispwidget->gfx_widget_fonts.msg_queue.font,
|
||||||
title,
|
title,
|
||||||
@ -471,7 +478,7 @@ static void gfx_widgets_msg_queue_move(dispgfx_widget_t *p_dispwidget)
|
|||||||
|
|
||||||
y += (p_dispwidget->msg_queue_height / 2.0f / (msg->task_ptr ? 2.0f : 1.0f))
|
y += (p_dispwidget->msg_queue_height / 2.0f / (msg->task_ptr ? 2.0f : 1.0f))
|
||||||
+ (p_dispwidget->msg_queue_spacing * (msg->task_ptr ? 1.0f : 2.0f))
|
+ (p_dispwidget->msg_queue_spacing * (msg->task_ptr ? 1.0f : 2.0f))
|
||||||
+ (p_dispwidget->simple_widget_padding / 5.0f);
|
+ (p_dispwidget->simple_widget_padding / 10.0f);
|
||||||
|
|
||||||
if (!(msg->flags & DISPWIDG_FLAG_UNFOLDED))
|
if (!(msg->flags & DISPWIDG_FLAG_UNFOLDED))
|
||||||
unfold = msg;
|
unfold = msg;
|
||||||
@ -485,7 +492,7 @@ static void gfx_widgets_msg_queue_move(dispgfx_widget_t *p_dispwidget)
|
|||||||
entry.easing_enum = EASING_OUT_QUAD;
|
entry.easing_enum = EASING_OUT_QUAD;
|
||||||
entry.subject = &msg->offset_y;
|
entry.subject = &msg->offset_y;
|
||||||
entry.tag = (uintptr_t)msg;
|
entry.tag = (uintptr_t)msg;
|
||||||
entry.target_value = y;
|
entry.target_value = ceilf(y);
|
||||||
entry.userdata = unfold;
|
entry.userdata = unfold;
|
||||||
|
|
||||||
gfx_animation_push(&entry);
|
gfx_animation_push(&entry);
|
||||||
@ -873,12 +880,12 @@ static void gfx_widgets_layout(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p_dispwidget->msg_queue_icon_size_x = p_dispwidget->simple_widget_padding * 1.5f;
|
p_dispwidget->msg_queue_icon_size_x = p_dispwidget->simple_widget_padding * 1.4f;
|
||||||
p_dispwidget->msg_queue_icon_size_y = 0;
|
p_dispwidget->msg_queue_icon_size_y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_dispwidget->msg_queue_spacing = p_dispwidget->msg_queue_height / 4.0f;
|
p_dispwidget->msg_queue_spacing = p_dispwidget->msg_queue_height / 4.0f;
|
||||||
p_dispwidget->msg_queue_rect_start_x = p_dispwidget->msg_queue_spacing / 2.0f + p_dispwidget->msg_queue_icon_size_x + (p_dispwidget->simple_widget_padding / 4.0f);
|
p_dispwidget->msg_queue_rect_start_x = ceilf(p_dispwidget->msg_queue_spacing / 2.0f + p_dispwidget->msg_queue_icon_size_x + (p_dispwidget->simple_widget_padding / 4.0f));
|
||||||
p_dispwidget->msg_queue_internal_icon_size = p_dispwidget->msg_queue_icon_size_y;
|
p_dispwidget->msg_queue_internal_icon_size = p_dispwidget->msg_queue_icon_size_y;
|
||||||
p_dispwidget->msg_queue_internal_icon_offset = (p_dispwidget->msg_queue_icon_size_y - p_dispwidget->msg_queue_internal_icon_size) / 2;
|
p_dispwidget->msg_queue_internal_icon_offset = (p_dispwidget->msg_queue_icon_size_y - p_dispwidget->msg_queue_internal_icon_size) / 2;
|
||||||
p_dispwidget->msg_queue_icon_offset_y = (p_dispwidget->msg_queue_icon_size_y - p_dispwidget->msg_queue_height) / 2;
|
p_dispwidget->msg_queue_icon_offset_y = (p_dispwidget->msg_queue_icon_size_y - p_dispwidget->msg_queue_height) / 2;
|
||||||
@ -896,7 +903,7 @@ static void gfx_widgets_layout(
|
|||||||
if (!p_dispwidget->gfx_widgets_icons_textures[MENU_WIDGETS_ICON_HOURGLASS])
|
if (!p_dispwidget->gfx_widgets_icons_textures[MENU_WIDGETS_ICON_HOURGLASS])
|
||||||
p_dispwidget->msg_queue_task_text_start_x -= p_dispwidget->gfx_widget_fonts.msg_queue.glyph_width * 2.0f;
|
p_dispwidget->msg_queue_task_text_start_x -= p_dispwidget->gfx_widget_fonts.msg_queue.glyph_width * 2.0f;
|
||||||
|
|
||||||
p_dispwidget->msg_queue_regular_text_start = p_dispwidget->msg_queue_rect_start_x + (p_dispwidget->simple_widget_padding / 1.5f);
|
p_dispwidget->msg_queue_regular_text_start = p_dispwidget->msg_queue_rect_start_x + (p_dispwidget->simple_widget_padding / 2.5f);
|
||||||
|
|
||||||
p_dispwidget->msg_queue_task_hourglass_x = p_dispwidget->msg_queue_task_rect_start_x + (p_dispwidget->simple_widget_padding / 2.5f);
|
p_dispwidget->msg_queue_task_hourglass_x = p_dispwidget->msg_queue_task_rect_start_x + (p_dispwidget->simple_widget_padding / 2.5f);
|
||||||
|
|
||||||
@ -1169,8 +1176,10 @@ static void gfx_widgets_draw_task_msg(
|
|||||||
static float msg_queue_task_progress_2[16] = COLOR_HEX_TO_FLOAT(0x1D5B1D, 1.0f);
|
static float msg_queue_task_progress_2[16] = COLOR_HEX_TO_FLOAT(0x1D5B1D, 1.0f);
|
||||||
/* Margin bar */
|
/* Margin bar */
|
||||||
static float msg_queue_bar[16] = COLOR_HEX_TO_FLOAT(0xCCCCCC, 1.0f);
|
static float msg_queue_bar[16] = COLOR_HEX_TO_FLOAT(0xCCCCCC, 1.0f);
|
||||||
/* Bright green icon */
|
/* Green icon */
|
||||||
static float msg_queue_task_done[16] = COLOR_HEX_TO_FLOAT(0x00C80A, 1.0f);
|
static float msg_queue_task_positive[16] = COLOR_HEX_TO_FLOAT(0x00C80A, 1.0f);
|
||||||
|
/* Red icon */
|
||||||
|
static float msg_queue_task_negative[16] = COLOR_HEX_TO_FLOAT(0xC60000, 1.0f);
|
||||||
|
|
||||||
unsigned text_color;
|
unsigned text_color;
|
||||||
unsigned bar_width;
|
unsigned bar_width;
|
||||||
@ -1192,21 +1201,18 @@ static void gfx_widgets_draw_task_msg(
|
|||||||
if (msg->msg_new)
|
if (msg->msg_new)
|
||||||
draw_msg_new = !string_is_equal(msg->msg_new, msg->msg);
|
draw_msg_new = !string_is_equal(msg->msg_new, msg->msg);
|
||||||
|
|
||||||
task_percentage_offset =
|
|
||||||
p_dispwidget->gfx_widget_fonts.msg_queue.glyph_width
|
|
||||||
* ((msg->flags & DISPWIDG_FLAG_TASK_ERROR) ? 12 : 5)
|
|
||||||
+ p_dispwidget->simple_widget_padding * 1.25f; /*11 = STRLEN_CONST("Task failed") + 1 */
|
|
||||||
|
|
||||||
if (msg->flags & DISPWIDG_FLAG_TASK_FINISHED)
|
if (msg->flags & DISPWIDG_FLAG_TASK_FINISHED)
|
||||||
{
|
{
|
||||||
task_percentage_offset = p_dispwidget->simple_widget_padding * 2.0f;
|
if (msg->flags & DISPWIDG_FLAG_TASK_ERROR)
|
||||||
if (msg->flags & DISPWIDG_FLAG_TASK_ERROR) /* TODO/FIXME - localize */
|
strlcpy(task_percentage, msg_hash_to_str(MSG_ERROR), sizeof(task_percentage));
|
||||||
strlcpy(task_percentage, "Task failed", sizeof(task_percentage));
|
|
||||||
}
|
}
|
||||||
else if (msg->task_progress >= 0 && msg->task_progress <= 100)
|
else if (msg->task_progress >= 0 && msg->task_progress <= 100)
|
||||||
snprintf(task_percentage, sizeof(task_percentage),
|
snprintf(task_percentage, sizeof(task_percentage),
|
||||||
"%i%%", msg->task_progress);
|
"%i%%", msg->task_progress);
|
||||||
|
|
||||||
|
task_percentage_offset = p_dispwidget->gfx_widget_fonts.msg_queue.glyph_width
|
||||||
|
* strlen(task_percentage) + p_dispwidget->simple_widget_padding * 2.0f;
|
||||||
|
|
||||||
rect_width = p_dispwidget->simple_widget_padding
|
rect_width = p_dispwidget->simple_widget_padding
|
||||||
+ msg->width
|
+ msg->width
|
||||||
+ task_percentage_offset;
|
+ task_percentage_offset;
|
||||||
@ -1214,16 +1220,15 @@ static void gfx_widgets_draw_task_msg(
|
|||||||
text_color = COLOR_TEXT_ALPHA(0xFFFFFF00, (unsigned)(msg->alpha*255.0f));
|
text_color = COLOR_TEXT_ALPHA(0xFFFFFF00, (unsigned)(msg->alpha*255.0f));
|
||||||
|
|
||||||
/* Rect */
|
/* Rect */
|
||||||
|
msg_queue_current_background = msg_queue_task_progress_1;
|
||||||
|
|
||||||
if (msg->flags & DISPWIDG_FLAG_TASK_FINISHED)
|
if (msg->flags & DISPWIDG_FLAG_TASK_FINISHED)
|
||||||
|
{
|
||||||
if (msg->task_count == 1)
|
if (msg->task_count == 1)
|
||||||
msg_queue_current_background = msg_queue_task_progress_1;
|
msg_queue_current_background = msg_queue_task_progress_1;
|
||||||
else
|
else
|
||||||
msg_queue_current_background = msg_queue_task_progress_2;
|
msg_queue_current_background = msg_queue_task_progress_2;
|
||||||
else
|
}
|
||||||
if (msg->task_count == 1)
|
|
||||||
msg_queue_current_background = msg_queue_task_progress_1;
|
|
||||||
else
|
|
||||||
msg_queue_current_background = msg_queue_task_progress_1;
|
|
||||||
|
|
||||||
rect_x = p_dispwidget->msg_queue_rect_start_x - p_dispwidget->msg_queue_icon_size_x;
|
rect_x = p_dispwidget->msg_queue_rect_start_x - p_dispwidget->msg_queue_icon_size_x;
|
||||||
rect_y = video_height - msg->offset_y;
|
rect_y = video_height - msg->offset_y;
|
||||||
@ -1279,33 +1284,48 @@ static void gfx_widgets_draw_task_msg(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Icon */
|
/* Icon */
|
||||||
gfx_display_set_alpha(p_dispwidget->pure_white, msg->alpha);
|
|
||||||
gfx_display_set_alpha(msg_queue_task_done, msg->alpha);
|
|
||||||
if (dispctx && dispctx->blend_begin)
|
if (dispctx && dispctx->blend_begin)
|
||||||
dispctx->blend_begin(userdata);
|
dispctx->blend_begin(userdata);
|
||||||
{
|
{
|
||||||
float radians = 0.0f; /* rad */
|
float radians = 0.0f; /* rad */
|
||||||
float cosine = 1.0f; /* cos(rad) = cos(0) = 1.0f */
|
float cosine = 1.0f; /* cos(rad) = cos(0) = 1.0f */
|
||||||
float sine = 0.0f; /* sine(rad) = sine(0) = 0.0f */
|
float sine = 0.0f; /* sine(rad) = sine(0) = 0.0f */
|
||||||
|
int texture = MENU_WIDGETS_ICON_CHECK;
|
||||||
|
float *color = msg_queue_task_positive;
|
||||||
|
|
||||||
if (!(msg->flags & DISPWIDG_FLAG_TASK_FINISHED))
|
if (!(msg->flags & DISPWIDG_FLAG_TASK_FINISHED))
|
||||||
|
{
|
||||||
|
texture = MENU_WIDGETS_ICON_HOURGLASS;
|
||||||
|
color = msg_queue_task_progress_1;
|
||||||
radians = msg->hourglass_rotation;
|
radians = msg->hourglass_rotation;
|
||||||
|
}
|
||||||
|
else if (msg->flags & DISPWIDG_FLAG_POSITIVE)
|
||||||
|
{
|
||||||
|
texture = MENU_WIDGETS_ICON_ADD;
|
||||||
|
color = msg_queue_task_positive;
|
||||||
|
}
|
||||||
|
else if (msg->flags & DISPWIDG_FLAG_NEGATIVE)
|
||||||
|
{
|
||||||
|
texture = MENU_WIDGETS_ICON_EXIT;
|
||||||
|
color = msg_queue_task_negative;
|
||||||
|
}
|
||||||
|
|
||||||
|
gfx_display_set_alpha(color, msg->alpha);
|
||||||
gfx_widgets_draw_icon(
|
gfx_widgets_draw_icon(
|
||||||
userdata,
|
userdata,
|
||||||
p_disp,
|
p_disp,
|
||||||
video_width,
|
video_width,
|
||||||
video_height,
|
video_height,
|
||||||
p_dispwidget->msg_queue_height / 2,
|
p_dispwidget->msg_queue_height / 2.5f,
|
||||||
p_dispwidget->msg_queue_height / 2,
|
p_dispwidget->msg_queue_height / 2.5f,
|
||||||
p_dispwidget->gfx_widgets_icons_textures[
|
p_dispwidget->gfx_widgets_icons_textures[texture],
|
||||||
(msg->flags & DISPWIDG_FLAG_TASK_FINISHED)
|
p_dispwidget->msg_queue_task_hourglass_x + (p_dispwidget->msg_queue_height / MSG_QUEUE_FONT_SIZE),
|
||||||
? MENU_WIDGETS_ICON_CHECK : MENU_WIDGETS_ICON_HOURGLASS],
|
video_height - msg->offset_y + (p_dispwidget->msg_queue_height / MSG_QUEUE_FONT_SIZE) - 1.0f,
|
||||||
p_dispwidget->msg_queue_task_hourglass_x,
|
|
||||||
video_height - msg->offset_y,
|
|
||||||
radians,
|
radians,
|
||||||
cosine,
|
cosine,
|
||||||
sine,
|
sine,
|
||||||
(msg->flags & DISPWIDG_FLAG_TASK_FINISHED)
|
color);
|
||||||
? msg_queue_task_done : p_dispwidget->pure_white);
|
|
||||||
}
|
}
|
||||||
if (dispctx && dispctx->blend_end)
|
if (dispctx && dispctx->blend_end)
|
||||||
dispctx->blend_end(userdata);
|
dispctx->blend_end(userdata);
|
||||||
@ -1488,7 +1508,8 @@ static void gfx_widgets_draw_regular_msg(
|
|||||||
p_dispwidget->msg_queue_icon_size_y,
|
p_dispwidget->msg_queue_icon_size_y,
|
||||||
p_dispwidget->gfx_widgets_icons_textures[MENU_WIDGETS_ICON_INFO],
|
p_dispwidget->gfx_widgets_icons_textures[MENU_WIDGETS_ICON_INFO],
|
||||||
p_dispwidget->msg_queue_rect_start_x
|
p_dispwidget->msg_queue_rect_start_x
|
||||||
- p_dispwidget->msg_queue_icon_size_x + (p_dispwidget->simple_widget_padding / 2.0f),
|
- p_dispwidget->msg_queue_icon_size_x
|
||||||
|
+ (p_dispwidget->simple_widget_padding / 4.0f),
|
||||||
video_height - msg->offset_y - p_dispwidget->msg_queue_icon_offset_y,
|
video_height - msg->offset_y - p_dispwidget->msg_queue_icon_offset_y,
|
||||||
0.0f, /* rad */
|
0.0f, /* rad */
|
||||||
1.0f, /* cos(rad) = cos(0) = 1.0f */
|
1.0f, /* cos(rad) = cos(0) = 1.0f */
|
||||||
@ -1976,6 +1997,12 @@ static void gfx_widgets_context_reset(
|
|||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
if (p_dispwidget->gfx_widgets_icons_textures[MENU_WIDGETS_ICON_INFO])
|
||||||
|
p_dispwidget->flags |= DISPGFX_WIDGET_FLAG_MSG_QUEUE_HAS_ICONS;
|
||||||
|
else
|
||||||
|
p_dispwidget->flags &= ~DISPGFX_WIDGET_FLAG_MSG_QUEUE_HAS_ICONS;
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Message queue */
|
/* Message queue */
|
||||||
gfx_display_reset_textures_list(
|
gfx_display_reset_textures_list(
|
||||||
"msg_queue_icon.png",
|
"msg_queue_icon.png",
|
||||||
@ -2005,6 +2032,7 @@ static void gfx_widgets_context_reset(
|
|||||||
p_dispwidget->flags |= DISPGFX_WIDGET_FLAG_MSG_QUEUE_HAS_ICONS;
|
p_dispwidget->flags |= DISPGFX_WIDGET_FLAG_MSG_QUEUE_HAS_ICONS;
|
||||||
else
|
else
|
||||||
p_dispwidget->flags &= ~DISPGFX_WIDGET_FLAG_MSG_QUEUE_HAS_ICONS;
|
p_dispwidget->flags &= ~DISPGFX_WIDGET_FLAG_MSG_QUEUE_HAS_ICONS;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(widgets); i++)
|
for (i = 0; i < ARRAY_SIZE(widgets); i++)
|
||||||
{
|
{
|
||||||
@ -2179,6 +2207,7 @@ static void gfx_widgets_context_destroy(dispgfx_widget_t *p_dispwidget)
|
|||||||
for (i = 0; i < MENU_WIDGETS_ICON_LAST; i++)
|
for (i = 0; i < MENU_WIDGETS_ICON_LAST; i++)
|
||||||
video_driver_texture_unload(&p_dispwidget->gfx_widgets_icons_textures[i]);
|
video_driver_texture_unload(&p_dispwidget->gfx_widgets_icons_textures[i]);
|
||||||
|
|
||||||
|
#if 0
|
||||||
video_driver_texture_unload(&p_dispwidget->msg_queue_icon);
|
video_driver_texture_unload(&p_dispwidget->msg_queue_icon);
|
||||||
video_driver_texture_unload(&p_dispwidget->msg_queue_icon_outline);
|
video_driver_texture_unload(&p_dispwidget->msg_queue_icon_outline);
|
||||||
video_driver_texture_unload(&p_dispwidget->msg_queue_icon_rect);
|
video_driver_texture_unload(&p_dispwidget->msg_queue_icon_rect);
|
||||||
@ -2186,6 +2215,7 @@ static void gfx_widgets_context_destroy(dispgfx_widget_t *p_dispwidget)
|
|||||||
p_dispwidget->msg_queue_icon = 0;
|
p_dispwidget->msg_queue_icon = 0;
|
||||||
p_dispwidget->msg_queue_icon_outline = 0;
|
p_dispwidget->msg_queue_icon_outline = 0;
|
||||||
p_dispwidget->msg_queue_icon_rect = 0;
|
p_dispwidget->msg_queue_icon_rect = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Fonts */
|
/* Fonts */
|
||||||
gfx_widgets_font_free(&p_dispwidget->gfx_widget_fonts.regular);
|
gfx_widgets_font_free(&p_dispwidget->gfx_widget_fonts.regular);
|
||||||
|
@ -63,6 +63,8 @@ enum gfx_widgets_icon
|
|||||||
|
|
||||||
MENU_WIDGETS_ICON_HOURGLASS,
|
MENU_WIDGETS_ICON_HOURGLASS,
|
||||||
MENU_WIDGETS_ICON_CHECK,
|
MENU_WIDGETS_ICON_CHECK,
|
||||||
|
MENU_WIDGETS_ICON_ADD,
|
||||||
|
MENU_WIDGETS_ICON_EXIT,
|
||||||
|
|
||||||
MENU_WIDGETS_ICON_INFO,
|
MENU_WIDGETS_ICON_INFO,
|
||||||
|
|
||||||
@ -111,7 +113,10 @@ enum disp_widget_flags_enum
|
|||||||
DISPWIDG_FLAG_EXPIRED = (1 << 5),
|
DISPWIDG_FLAG_EXPIRED = (1 << 5),
|
||||||
/* Unfold animation */
|
/* Unfold animation */
|
||||||
DISPWIDG_FLAG_UNFOLDED = (1 << 6),
|
DISPWIDG_FLAG_UNFOLDED = (1 << 6),
|
||||||
DISPWIDG_FLAG_UNFOLDING = (1 << 7)
|
DISPWIDG_FLAG_UNFOLDING = (1 << 7),
|
||||||
|
/* Color style */
|
||||||
|
DISPWIDG_FLAG_POSITIVE = (1 << 8),
|
||||||
|
DISPWIDG_FLAG_NEGATIVE = (1 << 9)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* There can only be one message animation at a time to
|
/* There can only be one message animation at a time to
|
||||||
|
@ -225,7 +225,7 @@ static void gfx_widget_libretro_message_layout(
|
|||||||
state->frame_width = divider_width;
|
state->frame_width = divider_width;
|
||||||
|
|
||||||
/* X-alignment with other widget types */
|
/* X-alignment with other widget types */
|
||||||
state->bg_x = (float)state->text_padding * 1.44f;
|
state->bg_x = (float)state->text_padding * 1.33f;
|
||||||
state->bg_y_start = (float)last_video_height + (float)state->frame_width;
|
state->bg_y_start = (float)last_video_height + (float)state->frame_width;
|
||||||
state->bg_y_end = (float)last_video_height - (float)state->bg_height;
|
state->bg_y_end = (float)last_video_height - (float)state->bg_height;
|
||||||
state->text_x = state->bg_x + (float)state->text_padding;
|
state->text_x = state->bg_x + (float)state->text_padding;
|
||||||
|
@ -44,6 +44,13 @@ enum task_type
|
|||||||
TASK_TYPE_BLOCKING
|
TASK_TYPE_BLOCKING
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum task_style
|
||||||
|
{
|
||||||
|
TASK_STYLE_NONE,
|
||||||
|
TASK_STYLE_POSITIVE,
|
||||||
|
TASK_STYLE_NEGATIVE
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct retro_task retro_task_t;
|
typedef struct retro_task retro_task_t;
|
||||||
typedef void (*retro_task_callback_t)(retro_task_t *task,
|
typedef void (*retro_task_callback_t)(retro_task_t *task,
|
||||||
void *task_data,
|
void *task_data,
|
||||||
@ -114,6 +121,7 @@ struct retro_task
|
|||||||
uint32_t ident;
|
uint32_t ident;
|
||||||
|
|
||||||
enum task_type type;
|
enum task_type type;
|
||||||
|
enum task_style style;
|
||||||
|
|
||||||
/* if set to true, frontend will
|
/* if set to true, frontend will
|
||||||
use an alternative look for the
|
use an alternative look for the
|
||||||
|
@ -980,6 +980,7 @@ retro_task_t *task_init(void)
|
|||||||
task->progress_cb = NULL;
|
task->progress_cb = NULL;
|
||||||
task->title = NULL;
|
task->title = NULL;
|
||||||
task->type = TASK_TYPE_NONE;
|
task->type = TASK_TYPE_NONE;
|
||||||
|
task->style = TASK_STYLE_NONE;
|
||||||
task->ident = task_count++;
|
task->ident = task_count++;
|
||||||
task->frontend_userdata = NULL;
|
task->frontend_userdata = NULL;
|
||||||
task->alternative_look = false;
|
task->alternative_look = false;
|
||||||
|
@ -518,8 +518,12 @@ static void input_autoconfigure_connect_handler(retro_task_t *task)
|
|||||||
* > Note that 'connection successful' messages
|
* > Note that 'connection successful' messages
|
||||||
* may be suppressed, but error messages are
|
* may be suppressed, but error messages are
|
||||||
* always shown */
|
* always shown */
|
||||||
|
task->style = TASK_STYLE_NEGATIVE;
|
||||||
if (autoconfig_handle->device_info.autoconfigured)
|
if (autoconfig_handle->device_info.autoconfigured)
|
||||||
{
|
{
|
||||||
|
/* Successful addition style */
|
||||||
|
task->style = TASK_STYLE_POSITIVE;
|
||||||
|
|
||||||
if (match_found)
|
if (match_found)
|
||||||
{
|
{
|
||||||
/* A valid autoconfig was applied */
|
/* A valid autoconfig was applied */
|
||||||
@ -778,6 +782,9 @@ static void input_autoconfigure_disconnect_handler(retro_task_t *task)
|
|||||||
if (!(autoconfig_handle = (autoconfig_handle_t*)task->state))
|
if (!(autoconfig_handle = (autoconfig_handle_t*)task->state))
|
||||||
goto task_finished;
|
goto task_finished;
|
||||||
|
|
||||||
|
/* Removal style */
|
||||||
|
task->style = TASK_STYLE_NEGATIVE;
|
||||||
|
|
||||||
/* Get display name for task status message */
|
/* Get display name for task status message */
|
||||||
device_display_name = autoconfig_handle->device_info.display_name;
|
device_display_name = autoconfig_handle->device_info.display_name;
|
||||||
if (string_is_empty(device_display_name))
|
if (string_is_empty(device_display_name))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user