From bc5b1b9d608d62506f208f03e980fa8500f46f8b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 25 Nov 2016 22:43:42 +0100 Subject: [PATCH] Cleanups --- menu/drivers/materialui.c | 17 ++++++++--------- menu/drivers/xmb.c | 9 ++------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 11718251cf..7a8b7ed5c1 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -633,18 +633,22 @@ static void mui_render_label_value(mui_handle_t *mui, y + mui->line_height / 2 + label_offset, width, height, color, TEXT_ALIGN_LEFT, 1.0f, false, 0); - if (string_is_equal(value, "disabled") || string_is_equal(value, "off")) + if (string_is_equal(value, "disabled") || + (string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))) { - if (mui->textures.list[MUI_TEXTURE_SWITCH_OFF]) { + if (mui->textures.list[MUI_TEXTURE_SWITCH_OFF]) + { texture_switch = mui->textures.list[MUI_TEXTURE_SWITCH_OFF]; switch_is_on = false; } else do_draw_text = true; } - else if (string_is_equal(value, "enabled") || string_is_equal(value, "on")) + else if (string_is_equal(value, "enabled") || + (string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON)))) { - if (mui->textures.list[MUI_TEXTURE_SWITCH_ON]) { + if (mui->textures.list[MUI_TEXTURE_SWITCH_ON]) + { texture_switch = mui->textures.list[MUI_TEXTURE_SWITCH_ON]; switch_is_on = true; } @@ -655,11 +659,6 @@ static void mui_render_label_value(mui_handle_t *mui, { enum msg_file_type type = msg_hash_to_file_type(msg_hash_calculate(value)); - if (string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) - type = FILE_TYPE_BOOL_OFF; - else if (string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))) - type = FILE_TYPE_BOOL_ON; - switch (type) { case FILE_TYPE_COMPRESSED: diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 060433f917..c7aafc3cd5 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2012,7 +2012,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, menu_entry_get_value(i, list, entry_value, sizeof(entry_value)); if (string_is_equal(entry_value, "disabled") || - string_is_equal(entry_value, "off")) + (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))) { if (xmb->textures.list[XMB_TEXTURE_SWITCH_OFF]) texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_OFF]; @@ -2020,7 +2020,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, do_draw_text = true; } else if (string_is_equal(entry_value, "enabled") || - string_is_equal(entry_value, "on")) + (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON)))) { if (xmb->textures.list[XMB_TEXTURE_SWITCH_ON]) texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_ON]; @@ -2031,11 +2031,6 @@ static void xmb_draw_items(xmb_handle_t *xmb, { enum msg_file_type type = msg_hash_to_file_type(msg_hash_calculate(entry_value)); - if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) - type = FILE_TYPE_BOOL_OFF; - else if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))) - type = FILE_TYPE_BOOL_ON; - switch (type) { case FILE_TYPE_COMPRESSED: