@@ -882,8 +882,6 @@ static void gfx_widgets_layout(
882882 if (!p_dispwidget -> gfx_widgets_icons_textures [MENU_WIDGETS_ICON_HOURGLASS ])
883883 p_dispwidget -> msg_queue_task_text_start_x -= p_dispwidget -> gfx_widget_fonts .msg_queue .glyph_width * 2.0f ;
884884
885- p_dispwidget -> msg_queue_task_hourglass_x = p_dispwidget -> msg_queue_rect_start_x + (p_dispwidget -> simple_widget_padding / 2.5f );
886-
887885 p_dispwidget -> msg_queue_default_rect_width_menu_alive
888886 = p_dispwidget -> gfx_widget_fonts .msg_queue .glyph_width * 40.0f ;
889887 p_dispwidget -> msg_queue_default_rect_width = p_dispwidget -> last_video_width
@@ -1145,20 +1143,14 @@ static void gfx_widgets_draw_task_msg(
11451143 unsigned video_width ,
11461144 unsigned video_height )
11471145{
1148- /* Color of first progress bar in a task message */
1149- static float msg_queue_task_progress_1 [16 ] = COLOR_HEX_TO_FLOAT (BG_COLOR_DEFAULT , 1.0f );
1150- /* Color of second progress bar in a task message
1151- * (for multiple tasks with same message) */
1152- static float msg_queue_task_progress_2 [16 ] = COLOR_HEX_TO_FLOAT (BG_COLOR_PROGRESS , 1.0f );
1153- /* Margin bar */
1154- static float msg_queue_bar [16 ] = COLOR_HEX_TO_FLOAT (BG_COLOR_MARGIN , 1.0f );
1155- /* Red icon */
1156- static float msg_queue_task_negative [16 ] = COLOR_HEX_TO_FLOAT (ICON_COLOR_RED , 1.0f );
1157- /* Green icon */
1158- static float msg_queue_task_positive [16 ] = COLOR_HEX_TO_FLOAT (ICON_COLOR_GREEN , 1.0f );
1159- /* Blue icon */
1160- static float msg_queue_task_neutral [16 ] = COLOR_HEX_TO_FLOAT (ICON_COLOR_BLUE , 1.0f );
1161-
1146+ static float msg_queue_background [16 ] = COLOR_HEX_TO_FLOAT (BG_COLOR_DEFAULT , 1.0f );
1147+ static float msg_queue_bar [16 ] = COLOR_HEX_TO_FLOAT (BG_COLOR_MARGIN , 1.0f );
1148+ static float msg_queue_task_progress [16 ] = COLOR_HEX_TO_FLOAT (BG_COLOR_PROGRESS , 1.0f );
1149+ static float msg_queue_task_negative [16 ] = COLOR_HEX_TO_FLOAT (ICON_COLOR_RED , 1.0f );
1150+ static float msg_queue_task_positive [16 ] = COLOR_HEX_TO_FLOAT (ICON_COLOR_GREEN , 1.0f );
1151+ static float msg_queue_task_neutral [16 ] = COLOR_HEX_TO_FLOAT (ICON_COLOR_BLUE , 1.0f );
1152+
1153+ unsigned msg_queue_height = p_dispwidget -> msg_queue_height ;
11621154 unsigned text_color ;
11631155 unsigned bar_width ;
11641156
@@ -1170,12 +1162,13 @@ static void gfx_widgets_draw_task_msg(
11701162 float text_y_base ;
11711163
11721164 float * msg_queue_current_background ;
1173- float * msg_queue_current_bar ;
1165+ float * msg_queue_current_progress ;
11741166
11751167 size_t _len = 0 ;
1168+ size_t task_percentage_offset = 0 ;
11761169 char task_percentage [256 ] = "" ;
11771170 bool draw_msg_new = false;
1178- size_t task_percentage_offset = 0 ;
1171+ bool msg_alternative = ( task_get_flags ( msg -> task_ptr ) & RETRO_TASK_FLG_ALTERNATIVE_LOOK ) ;
11791172
11801173 if (msg -> msg_new )
11811174 draw_msg_new = !string_is_equal (msg -> msg_new , msg -> msg );
@@ -1184,43 +1177,58 @@ static void gfx_widgets_draw_task_msg(
11841177 {
11851178 if (msg -> flags & DISPWIDG_FLAG_TASK_ERROR )
11861179 _len = strlcpy (task_percentage , msg_hash_to_str (MSG_ERROR ), sizeof (task_percentage ));
1180+
1181+ /* Not finished yet really */
1182+ if (msg -> task_progress > 0 && msg -> task_progress < 100 )
1183+ msg -> flags &= ~DISPWIDG_FLAG_TASK_FINISHED ;
11871184 }
11881185 else if (msg -> task_progress >= 0 && msg -> task_progress <= 100 )
11891186 _len = snprintf (task_percentage , sizeof (task_percentage ),
11901187 "%i%%" , msg -> task_progress );
11911188
11921189 task_percentage_offset = p_dispwidget -> gfx_widget_fonts .msg_queue .glyph_width * (_len + 1 );
1193- rect_width = p_dispwidget -> msg_queue_padding * 5.0f + msg -> width + task_percentage_offset ;
1190+ rect_width = (msg_alternative )
1191+ ? video_width
1192+ : (p_dispwidget -> msg_queue_padding * 5.0f ) + msg -> width + task_percentage_offset ;
11941193 bar_width = rect_width * msg -> task_progress /100.0f ;
11951194 text_color = COLOR_TEXT_ALPHA (TEXT_COLOR_INFO , (unsigned )(msg -> alpha * 255.0f ));
11961195
11971196 /* Rect */
1198- msg_queue_current_background = msg_queue_task_progress_1 ;
1197+ if ( msg -> flags & DISPWIDG_FLAG_TASK_FINISHED
1198+ && msg_alternative )
1199+ msg_queue_current_background = msg_queue_task_progress ;
1200+ else
1201+ msg_queue_current_background = msg_queue_background ;
11991202
1200- if (msg -> flags & DISPWIDG_FLAG_TASK_FINISHED )
1201- {
1202- if (msg -> task_count == 1 )
1203- msg_queue_current_background = msg_queue_task_progress_1 ;
1204- else
1205- msg_queue_current_background = msg_queue_task_progress_2 ;
1206- }
1203+ if (msg_alternative )
1204+ msg_queue_height *= 1.25f ;
12071205
12081206 rect_x = p_dispwidget -> msg_queue_rect_start_x ;
12091207 rect_y = video_height - msg -> offset_y ;
1210- rect_height = p_dispwidget -> msg_queue_height / 2 ;
1208+ rect_height = msg_queue_height / 2 ;
12111209 rect_margin = p_dispwidget -> simple_widget_padding * 0.15f ;
12121210
1213- gfx_display_set_alpha (msg_queue_bar , msg -> alpha );
1214- gfx_display_draw_quad (
1215- p_disp ,
1216- userdata ,
1217- video_width , video_height ,
1218- rect_x , rect_y ,
1219- rect_margin , rect_height ,
1220- video_width , video_height ,
1221- msg_queue_bar ,
1222- NULL
1223- );
1211+ if (msg_alternative )
1212+ {
1213+ rect_x = 0 ;
1214+ rect_y = video_height - rect_height ;
1215+ rect_margin = 0 ;
1216+ }
1217+
1218+ if (rect_margin )
1219+ {
1220+ gfx_display_set_alpha (msg_queue_bar , msg -> alpha );
1221+ gfx_display_draw_quad (
1222+ p_disp ,
1223+ userdata ,
1224+ video_width , video_height ,
1225+ rect_x , rect_y ,
1226+ rect_margin , rect_height ,
1227+ video_width , video_height ,
1228+ msg_queue_bar ,
1229+ NULL
1230+ );
1231+ }
12241232
12251233 gfx_display_set_alpha (msg_queue_current_background , msg -> alpha );
12261234 gfx_display_draw_quad (
@@ -1239,21 +1247,17 @@ static void gfx_widgets_draw_task_msg(
12391247 && (msg -> task_progress >= 0 )
12401248 && (msg -> task_progress <= 100 ))
12411249 {
1242- if (msg -> task_count == 1 )
1243- msg_queue_current_bar = msg_queue_task_progress_1 ;
1244- else
1245- msg_queue_current_bar = msg_queue_task_progress_2 ;
1250+ msg_queue_current_progress = msg_queue_task_progress ;
12461251
1247- gfx_display_set_alpha (msg_queue_current_bar , 1.0f );
1252+ gfx_display_set_alpha (msg_queue_current_progress , msg -> alpha );
12481253 gfx_display_draw_quad (
12491254 p_disp ,
12501255 userdata ,
12511256 video_width , video_height ,
1252- p_dispwidget -> msg_queue_rect_start_x + rect_margin ,
1253- video_height - msg -> offset_y ,
1257+ rect_x + rect_margin , rect_y ,
12541258 bar_width , rect_height ,
12551259 video_width , video_height ,
1256- msg_queue_current_bar ,
1260+ msg_queue_current_progress ,
12571261 NULL
12581262 );
12591263 }
@@ -1268,11 +1272,19 @@ static void gfx_widgets_draw_task_msg(
12681272 int texture = MENU_WIDGETS_ICON_CHECK ;
12691273 float * color = msg_queue_task_positive ;
12701274
1275+ gfx_display_set_alpha (color , msg -> alpha );
1276+
12711277 if (!(msg -> flags & DISPWIDG_FLAG_TASK_FINISHED ))
12721278 {
12731279 texture = MENU_WIDGETS_ICON_HOURGLASS ;
12741280 color = msg_queue_task_neutral ;
12751281 radians = msg -> hourglass_rotation ;
1282+
1283+ if (msg_alternative )
1284+ {
1285+ color = msg_queue_bar ;
1286+ gfx_display_set_alpha (color , msg -> alpha * 0.5f );
1287+ }
12761288 }
12771289 else if (msg -> flags & DISPWIDG_FLAG_POSITIVE )
12781290 {
@@ -1285,17 +1297,16 @@ static void gfx_widgets_draw_task_msg(
12851297 color = msg_queue_task_negative ;
12861298 }
12871299
1288- gfx_display_set_alpha (color , msg -> alpha );
12891300 gfx_widgets_draw_icon (
12901301 userdata ,
12911302 p_disp ,
12921303 video_width ,
12931304 video_height ,
1294- p_dispwidget -> msg_queue_height / 2.5f ,
1295- p_dispwidget -> msg_queue_height / 2.5f ,
1305+ msg_queue_height / 2.5f ,
1306+ msg_queue_height / 2.5f ,
12961307 p_dispwidget -> gfx_widgets_icons_textures [texture ],
1297- p_dispwidget -> msg_queue_task_hourglass_x + (p_dispwidget -> msg_queue_height / MSG_QUEUE_FONT_SIZE ),
1298- video_height - msg -> offset_y + (p_dispwidget -> msg_queue_height / MSG_QUEUE_FONT_SIZE ),
1308+ rect_x + (msg_queue_height / 9.0f ) + ( msg_queue_height / MSG_QUEUE_FONT_SIZE ),
1309+ rect_y + (msg_queue_height / MSG_QUEUE_FONT_SIZE ),
12991310 radians ,
13001311 cosine ,
13011312 sine ,
@@ -1305,9 +1316,8 @@ static void gfx_widgets_draw_task_msg(
13051316 dispctx -> blend_end (userdata );
13061317
13071318 /* Text */
1308- text_y_base = video_height
1309- - msg -> offset_y
1310- + p_dispwidget -> msg_queue_height / 4.0f
1319+ text_y_base = rect_y
1320+ + (msg_queue_height / 4.0f )
13111321 + p_dispwidget -> gfx_widget_fonts .msg_queue .line_centre_offset ;
13121322
13131323 if (draw_msg_new )
@@ -1323,7 +1333,7 @@ static void gfx_widgets_draw_task_msg(
13231333 gfx_widgets_draw_text (& p_dispwidget -> gfx_widget_fonts .msg_queue ,
13241334 msg -> msg_new ,
13251335 p_dispwidget -> msg_queue_task_text_start_x ,
1326- text_y_base - p_dispwidget -> msg_queue_height / 2.0f + msg -> msg_transition_animation ,
1336+ text_y_base - msg_queue_height / 2.0f + msg -> msg_transition_animation ,
13271337 video_width , video_height ,
13281338 text_color ,
13291339 TEXT_ALIGN_LEFT ,
@@ -1352,8 +1362,7 @@ static void gfx_widgets_draw_task_msg(
13521362 text_color = COLOR_TEXT_ALPHA (TEXT_COLOR_INFO , (unsigned )(msg -> alpha /2 * 255.0f ));
13531363 gfx_widgets_draw_text (& p_dispwidget -> gfx_widget_fonts .msg_queue ,
13541364 task_percentage ,
1355- p_dispwidget -> msg_queue_rect_start_x
1356- + rect_width - p_dispwidget -> gfx_widget_fonts .msg_queue .glyph_width ,
1365+ rect_x + rect_width - p_dispwidget -> gfx_widget_fonts .msg_queue .glyph_width * 2 ,
13571366 text_y_base ,
13581367 video_width , video_height ,
13591368 text_color ,
@@ -1396,7 +1405,6 @@ static void gfx_widgets_draw_regular_msg(
13961405 else
13971406 msg_queue_info = msg_queue_info_blue ;
13981407
1399- /* Icon */
14001408 gfx_display_set_alpha (msg_queue_info , msg -> alpha );
14011409 gfx_display_set_alpha (p_dispwidget -> pure_white , msg -> alpha );
14021410 gfx_display_set_alpha (p_dispwidget -> msg_queue_bg , msg -> alpha );
@@ -1498,6 +1506,7 @@ static void gfx_widgets_draw_regular_msg(
14981506 dispctx -> scissor_end (userdata , video_width , video_height );
14991507 }
15001508
1509+ /* Icon */
15011510 if (p_dispwidget -> flags & DISPGFX_WIDGET_FLAG_MSG_QUEUE_HAS_ICONS )
15021511 {
15031512 float icon_size = p_dispwidget -> msg_queue_icon_size_x / ((msg -> flags & DISPWIDG_FLAG_SMALL ) ? 2 : 1 );
@@ -1517,7 +1526,7 @@ static void gfx_widgets_draw_regular_msg(
15171526 icon_size ,
15181527 p_dispwidget -> gfx_widgets_icons_textures [MENU_WIDGETS_ICON_INFO ],
15191528 p_dispwidget -> msg_queue_rect_start_x
1520- + (p_dispwidget -> simple_widget_padding / 4 .0f ),
1529+ + (p_dispwidget -> msg_queue_height / 9 .0f ),
15211530 video_height - msg -> offset_y - p_dispwidget -> msg_queue_icon_offset_y ,
15221531 0.0f , /* rad */
15231532 (invert_y ? -1.0f : 1.0f ), /* cosine */
0 commit comments