From 6a4f4a9dfe04f26766880f16a4b5ebd4266af331 Mon Sep 17 00:00:00 2001 From: GreenComfyTea Date: Mon, 6 Mar 2023 13:24:01 +0200 Subject: [PATCH] Add include options for value/max labels --- reframework/autorun/MHR_Overlay.lua | 2 +- .../MHR_Overlay/Game_Handler/screen.lua | 4 +- .../autorun/MHR_Overlay/Misc/config.lua | 459 ++++++++++++------ .../autorun/MHR_Overlay/Misc/language.lua | 3 + .../UI/UI_Entities/ailment_UI_entity.lua | 20 +- .../UI/UI_Entities/body_part_UI_entity.lua | 49 +- .../UI/UI_Entities/health_UI_entity.lua | 14 +- .../UI/UI_Entities/rage_UI_entity.lua | 16 +- .../UI/UI_Entities/stamina_UI_entity.lua | 19 +- .../autorun/MHR_Overlay/UI/drawing.lua | 7 +- .../data/MHR Overlay/languages/en-us.json | 2 + .../data/MHR Overlay/languages/ja-jp.json | 2 + .../data/MHR Overlay/languages/ko-kr.json | 2 + .../data/MHR Overlay/languages/ru-ru.json | 2 + .../data/MHR Overlay/languages/zh-cn.json | 2 + .../data/MHR Overlay/languages/zh-tw.json | 2 + 16 files changed, 441 insertions(+), 164 deletions(-) diff --git a/reframework/autorun/MHR_Overlay.lua b/reframework/autorun/MHR_Overlay.lua index cc07249..fb84056 100644 --- a/reframework/autorun/MHR_Overlay.lua +++ b/reframework/autorun/MHR_Overlay.lua @@ -363,4 +363,4 @@ end if imgui.begin_table == nil then re.msg(language.current_language.customization_menu.reframework_outdated); -end +end \ No newline at end of file diff --git a/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua b/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua index 0a281e9..7bb32ff 100644 --- a/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua +++ b/reframework/autorun/MHR_Overlay/Game_Handler/screen.lua @@ -64,9 +64,7 @@ local height_field = size_type:get_field("h"); function screen.get_game_window_size() if scene_view == nil then - scene_view = sdk.call_native_func(singletons.scene_manager, - sdk.find_type_definition("via.SceneManager") - , "get_MainView"); + scene_view = sdk.call_native_func(singletons.scene_manager, sdk.find_type_definition("via.SceneManager") , "get_MainView"); if scene_view == nil then --log.error("[MHR_Overlay.lua] No scene view"); diff --git a/reframework/autorun/MHR_Overlay/Misc/config.lua b/reframework/autorun/MHR_Overlay/Misc/config.lua index 6aba7bf..2415f40 100644 --- a/reframework/autorun/MHR_Overlay/Misc/config.lua +++ b/reframework/autorun/MHR_Overlay/Misc/config.lua @@ -309,7 +309,7 @@ function config.init_default() monster_name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, @@ -337,7 +337,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = -22, y = -5 @@ -356,7 +356,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_health/max_health + offset = { x = 32, y = 0 @@ -375,7 +382,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = -5, @@ -475,7 +482,7 @@ function config.init_default() ailment_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { ailment_name = true, @@ -500,7 +507,9 @@ function config.init_default() text_label = { visibility = false, + text = language.current_language.UI.buildup, + offset = { x = -60, y = 6 @@ -519,7 +528,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_buildup/max_buildup + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_buildup/max_buildup + offset = { x = 60, y = 13 @@ -538,7 +554,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 0, @@ -558,7 +574,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -646,7 +662,7 @@ function config.init_default() activation_count = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = -17 @@ -666,7 +682,7 @@ function config.init_default() player_name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -685,11 +701,14 @@ function config.init_default() buildup_value_label = { visibility = true, - text = "%.0f", + + text_format = "%.0f", + offset = { x = 115, y = 0 }, + color = 0xFFb5dded, shadow = { @@ -704,7 +723,7 @@ function config.init_default() buildup_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 152, y = 0 @@ -723,7 +742,7 @@ function config.init_default() total_buildup_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -742,7 +761,7 @@ function config.init_default() total_buildup_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 115, y = 0 @@ -839,7 +858,7 @@ function config.init_default() monster_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { monster_name = true, @@ -875,7 +894,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = -25, y = 2 @@ -894,7 +913,14 @@ function config.init_default() value_label = { visibility = false, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_health/max_health + offset = { x = 5, y = 2 @@ -913,7 +939,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 150, @@ -989,7 +1015,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = -70, y = 0 @@ -1008,11 +1034,19 @@ function config.init_default() value_label = { visibility = false, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_current/max_stamina + offset = { x = 45, y = 17 }, + color = 0xFFFFFFFF, shadow = { @@ -1027,7 +1061,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 135, @@ -1047,7 +1081,7 @@ function config.init_default() timer_label = { visibility = false, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -1102,7 +1136,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = -70, y = 0 @@ -1121,7 +1155,14 @@ function config.init_default() value_label = { visibility = false, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_rage/max_rage + offset = { x = 45, y = 17 @@ -1140,7 +1181,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 135, @@ -1160,7 +1201,7 @@ function config.init_default() timer_label = { visibility = false, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -1240,7 +1281,7 @@ function config.init_default() part_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { part_name = true, @@ -1294,7 +1335,14 @@ function config.init_default() value_label = { visibility = true, - text = "%11s", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%11s", -- current_health/max_health + offset = { x = 100, y = -5 @@ -1313,7 +1361,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 190, @@ -1387,7 +1435,14 @@ function config.init_default() value_label = { visibility = true, - text = "%-9s", + + include = { + current_value = true, + max_value = true + }, + + text_format = "%-9s", + offset = { x = 5, y = 6 @@ -1407,7 +1462,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 5, @@ -1481,7 +1536,14 @@ function config.init_default() value_label = { visibility = true, - text = "%11s", + + include = { + current_value = true, + max_value = true + }, + + text_format = "%11s", + offset = { x = 6, y = 6 @@ -1500,7 +1562,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 41, @@ -1606,7 +1668,7 @@ function config.init_default() ailment_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { ailment_name = true, @@ -1650,7 +1712,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_buildup/max_buildup + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_buildup/max_buildup + offset = { x = 45, y = 13 @@ -1669,7 +1738,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 135, @@ -1689,7 +1758,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -1777,7 +1846,7 @@ function config.init_default() activation_count = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = -17 @@ -1797,7 +1866,7 @@ function config.init_default() player_name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -1816,7 +1885,7 @@ function config.init_default() buildup_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 115, y = 0 @@ -1835,7 +1904,7 @@ function config.init_default() buildup_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 152, y = 0 @@ -1854,7 +1923,7 @@ function config.init_default() total_buildup_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -1873,7 +1942,7 @@ function config.init_default() total_buildup_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 115, y = 0 @@ -1974,7 +2043,7 @@ function config.init_default() monster_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { monster_name = true, @@ -2010,7 +2079,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = -25, y = 2 @@ -2029,7 +2098,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_health/max_health + offset = { x = 5, y = 2 @@ -2048,7 +2124,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 150, @@ -2124,7 +2200,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = 15, y = 0 @@ -2143,7 +2219,14 @@ function config.init_default() value_label = { visibility = false, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_stamina/max_stamina + offset = { x = 55, y = 17 @@ -2162,7 +2245,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 145, @@ -2182,7 +2265,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -2237,7 +2320,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = 15, y = 19 @@ -2256,7 +2339,14 @@ function config.init_default() value_label = { visibility = false, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_rage/max_rage + offset = { x = 55, y = 36 @@ -2275,7 +2365,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 150, @@ -2295,7 +2385,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 157, @@ -2375,7 +2465,7 @@ function config.init_default() part_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { part_name = true, @@ -2429,7 +2519,14 @@ function config.init_default() value_label = { visibility = true, - text = "%11s", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%11s", -- current_health/max_health + offset = { x = 100, y = -5 @@ -2448,7 +2545,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 190, @@ -2522,7 +2619,14 @@ function config.init_default() value_label = { visibility = true, - text = "%-9s", + + include = { + current_value = true, + max_value = true + }, + + text_format = "%-9s", + offset = { x = 5, y = 6 @@ -2542,7 +2646,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 5, @@ -2616,7 +2720,14 @@ function config.init_default() value_label = { visibility = true, - text = "%11s", + + include = { + current_value = true, + max_value = true + }, + + text_format = "%11s", + offset = { x = 6, y = 6 @@ -2635,7 +2746,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 41, @@ -2742,7 +2853,7 @@ function config.init_default() ailment_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { ailment_name = true, @@ -2786,7 +2897,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_buildup/max_buildup + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_buildup/max_buildup + offset = { x = 45, y = 13 @@ -2805,7 +2923,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 135, @@ -2825,7 +2943,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -2913,7 +3031,7 @@ function config.init_default() activation_count = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = -17 @@ -2933,7 +3051,7 @@ function config.init_default() player_name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -2952,7 +3070,7 @@ function config.init_default() buildup_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 115, y = 0 @@ -2971,7 +3089,7 @@ function config.init_default() buildup_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 152, y = 0 @@ -2990,7 +3108,7 @@ function config.init_default() total_buildup_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -3009,7 +3127,7 @@ function config.init_default() total_buildup_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 115, y = 0 @@ -3096,7 +3214,7 @@ function config.init_default() monster_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { monster_name = true, @@ -3132,7 +3250,7 @@ function config.init_default() text_label = { visibility = false, - text = "%s", + text_format = "%s", offset = { x = -25, y = 2 @@ -3151,7 +3269,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_health/max_health + offset = { x = 5, y = 2 @@ -3170,7 +3295,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 150, @@ -3246,7 +3371,7 @@ function config.init_default() text_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 15 - 10, y = 0 @@ -3265,7 +3390,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_stamina/max_stamina + offset = { x = 45, y = 17 @@ -3284,7 +3416,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 135, @@ -3304,7 +3436,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -3359,7 +3491,7 @@ function config.init_default() text_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -3378,7 +3510,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_rage/max_rage + offset = { x = 45, y = 17 @@ -3397,7 +3536,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 135, @@ -3417,7 +3556,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -3497,7 +3636,7 @@ function config.init_default() part_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { part_name = true, @@ -3551,7 +3690,14 @@ function config.init_default() value_label = { visibility = true, - text = "%11s", -- current_health/max_health + + include = { + current_value = true, + max_value = true + }, + + text_format = "%11s", -- current_health/max_health + offset = { x = 100, y = -5 @@ -3570,7 +3716,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 190, @@ -3644,7 +3790,14 @@ function config.init_default() value_label = { visibility = true, - text = "%-9s", + + include = { + current_value = true, + max_value = true + }, + + text_format = "%-9s", + offset = { x = 5, y = 6 @@ -3664,7 +3817,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 5, @@ -3738,7 +3891,14 @@ function config.init_default() value_label = { visibility = true, - text = "%11s", + + include = { + current_value = true, + max_value = true + }, + + text_format = "%11s", + offset = { x = 6, y = 6 @@ -3757,7 +3917,7 @@ function config.init_default() percentage_label = { visibility = false, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 41, @@ -3863,7 +4023,7 @@ function config.init_default() ailment_name_label = { visibility = true, - text = "%s", + text_format = "%s", include = { ailment_name = true, @@ -3907,7 +4067,14 @@ function config.init_default() value_label = { visibility = true, - text = "%.0f/%.0f", -- current_buildup/max_buildup + + include = { + current_value = true, + max_value = true + }, + + text_format = "%s", -- current_buildup/max_buildup + offset = { x = 45, y = 13 @@ -3926,7 +4093,7 @@ function config.init_default() percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 135, @@ -3946,7 +4113,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 140, @@ -4034,7 +4201,7 @@ function config.init_default() activation_count = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = -17 @@ -4054,7 +4221,7 @@ function config.init_default() player_name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -4073,7 +4240,7 @@ function config.init_default() buildup_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 115, y = 0 @@ -4092,7 +4259,7 @@ function config.init_default() buildup_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 152, y = 0 @@ -4111,7 +4278,7 @@ function config.init_default() total_buildup_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -4130,7 +4297,7 @@ function config.init_default() total_buildup_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 115, y = 0 @@ -4213,7 +4380,7 @@ function config.init_default() time_label = { visibility = true, - text = "%02d:%06.3f", + text_format = "%02d:%06.3f", offset = { x = 0, y = 0 @@ -4312,7 +4479,7 @@ function config.init_default() name = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -4337,7 +4504,7 @@ function config.init_default() hunter_rank = true }, - text = "[%s]", + text_format = "[%s]", offset = { x = -65, y = 0 @@ -4357,7 +4524,7 @@ function config.init_default() cart_count_label = { visibility = false, - text = "%d", + text_format = "%d", offset = { x = 315, y = 0 @@ -4376,7 +4543,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -4396,7 +4563,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -4415,7 +4582,7 @@ function config.init_default() damage_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 262, y = 0 @@ -4472,7 +4639,7 @@ function config.init_default() name = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -4497,7 +4664,7 @@ function config.init_default() hunter_rank = true }, - text = "[%s]", + text_format = "[%s]", offset = { x = -65, y = 0 @@ -4517,7 +4684,7 @@ function config.init_default() cart_count_label = { visibility = false, - text = "%d", + text_format = "%d", offset = { x = 315, y = 0 @@ -4536,7 +4703,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -4556,7 +4723,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -4575,7 +4742,7 @@ function config.init_default() damage_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 262, y = 0 @@ -4629,7 +4796,7 @@ function config.init_default() name = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -4648,7 +4815,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -4668,7 +4835,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -4687,7 +4854,7 @@ function config.init_default() damage_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 262, y = 0 @@ -4742,7 +4909,7 @@ function config.init_default() name = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -4762,7 +4929,7 @@ function config.init_default() hunter_rank_label = { visibility = false, - text = "[%s]", + text_format = "[%s]", offset = { x = -30, y = 0 @@ -4781,7 +4948,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -4801,7 +4968,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -4820,7 +4987,7 @@ function config.init_default() damage_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 262, y = 0 @@ -4875,7 +5042,7 @@ function config.init_default() name = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -4895,7 +5062,7 @@ function config.init_default() hunter_rank_label = { visibility = false, - text = "[%s]", + text_format = "[%s]", offset = { x = -30, y = 0 @@ -4914,7 +5081,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -4934,7 +5101,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -4953,7 +5120,7 @@ function config.init_default() damage_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 262, y = 0 @@ -5008,7 +5175,7 @@ function config.init_default() name = true }, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -5028,7 +5195,7 @@ function config.init_default() hunter_rank_label = { visibility = false, - text = "[%s]", + text_format = "[%s]", offset = { x = -30, y = 0 @@ -5047,7 +5214,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -5067,7 +5234,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -5086,7 +5253,7 @@ function config.init_default() damage_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 262, y = 0 @@ -5134,7 +5301,7 @@ function config.init_default() name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -5154,7 +5321,7 @@ function config.init_default() cart_count_label = { visibility = false, - text = "%d/%d", + text_format = "%d/%d", offset = { x = 315, y = 0 @@ -5173,7 +5340,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -5193,7 +5360,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -5215,7 +5382,7 @@ function config.init_default() name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -5235,7 +5402,7 @@ function config.init_default() hunter_rank_label = { visibility = false, - text = "[%s]", + text_format = "[%s]", offset = { x = -65, y = 0 @@ -5255,7 +5422,7 @@ function config.init_default() cart_count_label = { visibility = false, - text = "%d", + text_format = "%d", offset = { x = 315, y = 0 @@ -5274,7 +5441,7 @@ function config.init_default() dps_label = { visibility = true, - text = "%.1f", + text_format = "%.1f", offset = { x = 155, @@ -5294,7 +5461,7 @@ function config.init_default() damage_value_label = { visibility = true, - text = "%.0f", + text_format = "%.0f", offset = { x = 205, y = 0 @@ -5313,7 +5480,7 @@ function config.init_default() damage_percentage_label = { visibility = true, - text = "%5.1f%%", + text_format = "%5.1f%%", offset = { x = 262, y = 0 @@ -5380,7 +5547,7 @@ function config.init_default() creature_name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 0, @@ -5428,7 +5595,7 @@ function config.init_default() name_label = { visibility = true, - text = "%s", + text_format = "%s", offset = { x = 5, y = 0 @@ -5447,7 +5614,7 @@ function config.init_default() timer_label = { visibility = true, - text = "%2.0f:%02.0f", + text_format = "%2.0f:%02.0f", offset = { x = 200, y = 0 diff --git a/reframework/autorun/MHR_Overlay/Misc/language.lua b/reframework/autorun/MHR_Overlay/Misc/language.lua index 9f1ad45..a984cdc 100644 --- a/reframework/autorun/MHR_Overlay/Misc/language.lua +++ b/reframework/autorun/MHR_Overlay/Misc/language.lua @@ -494,6 +494,9 @@ language.default_language = { duration = "Duration", hide_bar_for_infinite_buffs = "Hide Bar for infinite Buffs", hide_timer_for_infinite_buffs = "Hide Timer for infinite Buffs", + + current_value = "Current Value", + max_value = "Max Value" } }; diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua index 86ef98c..c0eede8 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/ailment_UI_entity.lua @@ -85,20 +85,32 @@ function ailment_UI_entity.draw(ailment, ailment_UI, cached_config, position_on_ ailment_name = ailment_name .. "x" .. tostring(ailment.activate_count); end + local total_buildup_string = ""; + if not ailment.is_active then + local include_current_value = ailment_UI.value_label.include.current_value; + local include_max_value = ailment_UI.value_label.include.max_value; + + if include_current_value and include_max_value then + total_buildup_string = string.format("%.0f/%.0f", ailment.total_buildup, ailment.buildup_limit); + elseif include_current_value then + total_buildup_string = string.format("%.0f", ailment.total_buildup); + elseif include_max_value then + total_buildup_string = string.format("%.0f", ailment.buildup_limit); + end + end + if ailment.is_active then drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.timer_percentage); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); - drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left, - ailment.seconds_left); + drawing.draw_label(ailment_UI.timer_label, position_on_screen, opacity_scale, ailment.minutes_left, ailment.seconds_left); else drawing.draw_bar(ailment_UI.bar, position_on_screen, opacity_scale, ailment.buildup_percentage); drawing.draw_label(ailment_UI.name_label, position_on_screen, opacity_scale, ailment_name); drawing.draw_label(ailment_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.buildup); - drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, ailment.total_buildup, - ailment.buildup_limit); + drawing.draw_label(ailment_UI.value_label, position_on_screen, opacity_scale, total_buildup_string); drawing.draw_label(ailment_UI.percentage_label, position_on_screen, opacity_scale, 100 * ailment.buildup_percentage); end end diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua index 7cbc64f..6e428ac 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/body_part_UI_entity.lua @@ -151,9 +151,50 @@ function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_scre end end - local health_string = string.format("%.0f/%.0f", part.health, part.max_health); - local break_health_string = string.format("%.0f/%.0f", part.break_health, part.break_max_health); - local loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); + -- health value string + local health_string = ""; + if draw_health then + local include_health_current_value = part_UI.flinch_value_label.include.current_value; + local include_health_max_value = part_UI.flinch_value_label.include.max_value; + + if include_health_current_value and include_health_max_value then + health_string = string.format("%.0f/%.0f", part.health, part.max_health); + elseif include_health_current_value then + health_string = string.format("%.0f", part.health); + elseif include_health_max_value then + health_string = string.format("%.0f", part.max_health); + end + end + + -- break health value string + local break_health_string = ""; + if draw_break then + local include_break_health_current_value = part_UI.break_value_label.include.current_value; + local include_break_health_max_value = part_UI.break_value_label.include.max_value; + + if include_break_health_current_value and include_break_health_max_value then + break_health_string = string.format("%.0f/%.0f", part.break_health, part.break_max_health); + elseif include_break_health_current_value then + break_health_string = string.format("%.0f", part.break_health); + elseif include_break_health_max_value then + break_health_string = string.format("%.0f", part.break_max_health); + end + end + + -- loss health value string + local loss_health_string = ""; + if draw_severe then + local include_loss_health_current_value = part_UI.loss_value_label.include.current_value; + local include_loss_health_max_value = part_UI.loss_value_label.include.max_value; + + if include_loss_health_current_value and include_loss_health_max_value then + loss_health_string = string.format("%.0f/%.0f", part.loss_health, part.loss_max_health); + elseif include_loss_health_current_value then + loss_health_string = string.format("%.0f", part.loss_health); + elseif include_loss_health_max_value then + loss_health_string = string.format("%.0f", part.loss_max_health); + end + end local flinch_position_on_screen = { x = position_on_screen.x + cached_config.part_health.offset.x, @@ -177,7 +218,7 @@ function body_part_UI_entity.draw(part, part_UI, cached_config, position_on_scre drawing.draw_bar(part_UI.flinch_bar, flinch_position_on_screen, opacity_scale, part.health_percentage); end - if draw_break then + if draw_break then drawing.draw_bar(part_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage); end diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua index a9e020d..90831d5 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/health_UI_entity.lua @@ -69,10 +69,22 @@ function health_UI_entity.draw(monster, health_UI, position_on_screen, opacity_s return; end + local include_current_value = health_UI.value_label.include.current_value; + local include_max_value = health_UI.value_label.include.max_value; + + local health_string; + if include_current_value and include_max_value then + health_string = string.format("%.0f/%.0f", monster.health, monster.max_health); + elseif include_current_value then + health_string = string.format("%.0f", monster.health); + elseif include_max_value then + health_string = string.format("%.0f", monster.max_health); + end + drawing.draw_bar(health_UI.bar, position_on_screen, opacity_scale, monster.health_percentage); drawing.draw_label(health_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.HP); - drawing.draw_label(health_UI.value_label, position_on_screen, opacity_scale, monster.health, monster.max_health); + drawing.draw_label(health_UI.value_label, position_on_screen, opacity_scale, health_string); drawing.draw_label(health_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.health_percentage); end diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua index 449e516..255f977 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/rage_UI_entity.lua @@ -73,6 +73,20 @@ function rage_UI_entity.draw(monster, rage_UI, position_on_screen, opacity_scale return; end + local rage_string = ""; + if not monster.is_in_rage then + local include_current_value = rage_UI.value_label.include.current_value; + local include_max_value = rage_UI.value_label.include.max_value; + + if include_current_value and include_max_value then + rage_string = string.format("%.0f/%.0f", monster.rage_point, monster.rage_limit); + elseif include_current_value then + rage_string = string.format("%.0f", monster.rage_point); + elseif include_max_value then + rage_string = string.format("%.0f", monster.rage_limit); + end + end + if monster.is_in_rage then drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_timer_percentage); @@ -83,7 +97,7 @@ function rage_UI_entity.draw(monster, rage_UI, position_on_screen, opacity_scale drawing.draw_bar(rage_UI.bar, position_on_screen, opacity_scale, monster.rage_percentage); drawing.draw_label(rage_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.rage); - drawing.draw_label(rage_UI.value_label, position_on_screen, opacity_scale, monster.rage_point, monster.rage_limit); + drawing.draw_label(rage_UI.value_label, position_on_screen, opacity_scale, rage_string); drawing.draw_label(rage_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.rage_percentage); end end diff --git a/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua b/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua index 6332824..2bbe56a 100644 --- a/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua +++ b/reframework/autorun/MHR_Overlay/UI/UI_Entities/stamina_UI_entity.lua @@ -71,17 +71,30 @@ function stamina_UI_entity.draw(monster, stamina_UI, position_on_screen, opacity return; end + local stamina_string = ""; + if not monster.is_tired then + local include_current_value = stamina_UI.value_label.include.current_value; + local include_max_value = stamina_UI.value_label.include.max_value; + + if include_current_value and include_max_value then + stamina_string = string.format("%.0f/%.0f", monster.stamina, monster.max_stamina); + elseif include_current_value then + stamina_string = string.format("%.0f", monster.stamina); + elseif include_max_value then + stamina_string = string.format("%.0f", monster.max_stamina); + end + end + drawing.draw_label(stamina_UI.text_label, position_on_screen, opacity_scale, language.current_language.UI.stamina); if monster.is_tired then drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.tired_timer_percentage); - drawing.draw_label(stamina_UI.timer_label, position_on_screen, opacity_scale, monster.tired_minutes_left, - monster.tired_seconds_left); + drawing.draw_label(stamina_UI.timer_label, position_on_screen, opacity_scale, monster.tired_minutes_left, monster.tired_seconds_left); else drawing.draw_bar(stamina_UI.bar, position_on_screen, opacity_scale, monster.stamina_percentage); - drawing.draw_label(stamina_UI.value_label, position_on_screen, opacity_scale, monster.stamina, monster.max_stamina); + drawing.draw_label(stamina_UI.value_label, position_on_screen, opacity_scale, stamina_string); drawing.draw_label(stamina_UI.percentage_label, position_on_screen, opacity_scale, 100 * monster.stamina_percentage); end end diff --git a/reframework/autorun/MHR_Overlay/UI/drawing.lua b/reframework/autorun/MHR_Overlay/UI/drawing.lua index 76415a3..6f75c48 100644 --- a/reframework/autorun/MHR_Overlay/UI/drawing.lua +++ b/reframework/autorun/MHR_Overlay/UI/drawing.lua @@ -124,7 +124,12 @@ function drawing.draw_label(label, position, opacity_scale, ...) return; end - local text = string.format(label.text, table.unpack({...})); + local text = string.format(label.text_format, table.unpack({...})); + + if text == "" then + return; + end + local position_x = position.x + label.offset.x; local position_y = position.y + label.offset.y; diff --git a/reframework/data/MHR Overlay/languages/en-us.json b/reframework/data/MHR Overlay/languages/en-us.json index 6480b94..1b95982 100644 --- a/reframework/data/MHR Overlay/languages/en-us.json +++ b/reframework/data/MHR Overlay/languages/en-us.json @@ -83,6 +83,7 @@ "creature_name_label": "Creature Name Label", "crown": "Crown", "crown_thresholds": "Crown Thresholds", + "current_value": "Current Value", "cutscene": "Cutscene", "damage": "Damage", "damage_bar": "Damage Bar", @@ -177,6 +178,7 @@ "master_rank": "Master Rank", "max_distance": "Max Distance", "max_monster_updates_per_tick": "Max Monster Updates per Tick", + "max_value": "Max Value", "me": "Me", "menu_font": "Menu Font", "menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!", diff --git a/reframework/data/MHR Overlay/languages/ja-jp.json b/reframework/data/MHR Overlay/languages/ja-jp.json index 3458d7e..a3e13dd 100644 --- a/reframework/data/MHR Overlay/languages/ja-jp.json +++ b/reframework/data/MHR Overlay/languages/ja-jp.json @@ -83,6 +83,7 @@ "creature_name_label": "モンスターの名前ラベル", "crown": "王冠", "crown_thresholds": "王冠の閾値", + "current_value": "Current Value", "cutscene": "Cutscene", "damage": "ダメージ", "damage_bar": "ダメージバー", @@ -177,6 +178,7 @@ "master_rank": "マスターランク", "max_distance": "最大距離", "max_monster_updates_per_tick": "モンスター情報をアップデートする間隔", + "max_value": "Max Value", "me": "自分", "menu_font": "メニューで使うフォント", "menu_font_change_disclaimer": "言語とメニューのフォントサイズを何度も変更すると、クラッシュが発生します。", diff --git a/reframework/data/MHR Overlay/languages/ko-kr.json b/reframework/data/MHR Overlay/languages/ko-kr.json index 20e901d..9c310aa 100644 --- a/reframework/data/MHR Overlay/languages/ko-kr.json +++ b/reframework/data/MHR Overlay/languages/ko-kr.json @@ -83,6 +83,7 @@ "creature_name_label": "환경생물 이름 정보", "crown": "금관", "crown_thresholds": "금관 판정값", + "current_value": "Current Value", "cutscene": "컷신", "damage": "대미지", "damage_bar": "대미지 막대", @@ -177,6 +178,7 @@ "master_rank": "마스터 랭크", "max_distance": "최대 거리", "max_monster_updates_per_tick": "틱당 최대 몬스터 갱신 횟수", + "max_value": "Max Value", "me": "나", "menu_font": "메뉴 글꼴", "menu_font_change_disclaimer": "언어 및 메뉴 글꼴 크기를 여러 번 변경하면 비정상 종료가 될 수 있습니다!", diff --git a/reframework/data/MHR Overlay/languages/ru-ru.json b/reframework/data/MHR Overlay/languages/ru-ru.json index a4cba3c..e964d11 100644 --- a/reframework/data/MHR Overlay/languages/ru-ru.json +++ b/reframework/data/MHR Overlay/languages/ru-ru.json @@ -83,6 +83,7 @@ "creature_name_label": "Метка имени существа", "crown": "Корона", "crown_thresholds": "Лимиты корон", + "current_value": "Current Value", "cutscene": "Катсцена", "damage": "Урон", "damage_bar": "Шкала урона", @@ -177,6 +178,7 @@ "master_rank": "Ранг мастера", "max_distance": "Макс. расстояние", "max_monster_updates_per_tick": "Макс. кол-во обновлений за тик", + "max_value": "Max Value", "me": "Я", "menu_font": "Шрифт меню", "menu_font_change_disclaimer": "Изменение языка и размера шрифта меню несколько раз приведёт к вылету!", diff --git a/reframework/data/MHR Overlay/languages/zh-cn.json b/reframework/data/MHR Overlay/languages/zh-cn.json index 4c42485..4ff4aaf 100644 --- a/reframework/data/MHR Overlay/languages/zh-cn.json +++ b/reframework/data/MHR Overlay/languages/zh-cn.json @@ -83,6 +83,7 @@ "creature_name_label": "生物名标签", "crown": "皇冠", "crown_thresholds": "皇冠阈值", + "current_value": "Current Value", "cutscene": "Cutscene", "damage": "伤害", "damage_bar": "伤害条", @@ -177,6 +178,7 @@ "master_rank": "Master Rank", "max_distance": "最大距离", "max_monster_updates_per_tick": "每次更新的最大怪物数量", + "max_value": "Max Value", "me": "我", "menu_font": "菜单字体", "menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!", diff --git a/reframework/data/MHR Overlay/languages/zh-tw.json b/reframework/data/MHR Overlay/languages/zh-tw.json index 98147f4..79bee35 100644 --- a/reframework/data/MHR Overlay/languages/zh-tw.json +++ b/reframework/data/MHR Overlay/languages/zh-tw.json @@ -83,6 +83,7 @@ "creature_name_label": "環境生物名稱", "crown": "皇冠", "crown_thresholds": "皇冠的大小判定範圍", + "current_value": "Current Value", "cutscene": "Cutscene", "damage": "傷害", "damage_bar": "傷害條", @@ -177,6 +178,7 @@ "master_rank": "大師等級", "max_distance": "最大距離", "max_monster_updates_per_tick": "每次更新的最大魔物數量", + "max_value": "Max Value", "me": "我", "menu_font": "選單字體大小", "menu_font_change_disclaimer": "重複變更語言和選單字型大小有可能會當機!",