Add option to filter parts based on current state

This commit is contained in:
GreenComfyTea
2023-03-06 13:48:55 +02:00
parent 6a4f4a9dfe
commit c2531b77a2
11 changed files with 75 additions and 21 deletions

View File

@@ -1260,6 +1260,7 @@ function config.init_default()
},
settings = {
filter_mode = "Current State",
hide_undamaged_parts = true,
time_limit = 15
},
@@ -2444,6 +2445,7 @@ function config.init_default()
},
settings = {
filter_mode = "Current State",
hide_undamaged_parts = true,
time_limit = 15
},
@@ -3615,6 +3617,7 @@ function config.init_default()
},
settings = {
filter_mode = "Current State",
hide_undamaged_parts = true,
time_limit = 15
},

View File

@@ -496,7 +496,11 @@ language.default_language = {
hide_timer_for_infinite_buffs = "Hide Timer for infinite Buffs",
current_value = "Current Value",
max_value = "Max Value"
max_value = "Max Value",
filter_mode = "Filter Mode",
current_state = "Current State",
default_state = "Default State"
}
};

View File

@@ -155,6 +155,16 @@ function body_part.draw(monster, part_UI, cached_config, parts_position_on_scree
local break_supported = part.break_max_health > 0;
local severe_supported = part.loss_max_health > 0;
if cached_config.settings.filter_mode == "Current State" then
if break_supported and part.break_count >= part.break_max_count then
break_supported = false;
end
if severe_supported and part.is_severed then
severe_supported = false;
end
end
if health_supported then
if break_supported then
if severe_supported then

View File

@@ -87,6 +87,16 @@ function body_parts_customization.draw(cached_config)
config_changed = config_changed or changed;
changed, index = imgui.combo(language.current_language.customization_menu.filter_mode,
table_helpers.find_index(customization_menu.large_monster_UI_parts_filter_types, cached_config.settings.filter_mode),
customization_menu.displayed_large_monster_UI_parts_filter_types);
config_changed = config_changed or changed;
if changed then
cached_config.settings.filter_mode = customization_menu.large_monster_UI_parts_filter_types[index];
end
changed, cached_config.settings.time_limit = imgui.drag_float(
language.current_language.customization_menu.time_limit, cached_config.settings.time_limit, 0.1, 0, 99999, "%.1f");
@@ -99,7 +109,7 @@ function body_parts_customization.draw(cached_config)
changed, index = imgui.combo(
language.current_language.customization_menu.type,
table_helpers.find_index(customization_menu.large_monster_UI_parts_sorting_types, cached_config.sorting.type),
customization_menu.displayed_monster_UI_parts_sorting_types);
customization_menu.displayed_large_monster_UI_parts_sorting_types);
config_changed = config_changed or changed;

View File

@@ -75,7 +75,8 @@ customization_menu.displayed_anchor_types = {};
customization_menu.displayed_outline_styles = {};
customization_menu.displayed_monster_UI_sorting_types = {};
customization_menu.displayed_monster_UI_parts_sorting_types = {};
customization_menu.displayed_large_monster_UI_parts_sorting_types = {};
customization_menu.displayed_large_monster_UI_parts_filter_types = {};
customization_menu.displayed_ailments_sorting_types = {};
customization_menu.displayed_ailment_buildups_sorting_types = {};
customization_menu.displayed_highlighted_buildup_bar_types = {};
@@ -96,6 +97,8 @@ customization_menu.anchor_types = {};
customization_menu.outline_styles = {};
customization_menu.monster_UI_sorting_types = {};
customization_menu.large_monster_UI_parts_sorting_types = {};
customization_menu.large_monster_UI_parts_filter_types = {};
customization_menu.ailments_sorting_types = {};
customization_menu.ailment_buildups_sorting_types = {};
customization_menu.highlighted_buildup_bar_types = {};
@@ -188,25 +191,31 @@ function customization_menu.init()
default.health_percentage,
default.distance};
customization_menu.displayed_monster_UI_parts_sorting_types = { current.normal,
current.health,
current.health_percentage,
current.flinch_count,
current.break_health,
current.break_health_percentage,
current.break_count,
current.loss_health,
current.loss_health_percentage};
customization_menu.displayed_large_monster_UI_parts_sorting_types = { current.normal,
current.health,
current.health_percentage,
current.flinch_count,
current.break_health,
current.break_health_percentage,
current.break_count,
current.loss_health,
current.loss_health_percentage};
customization_menu.large_monster_UI_parts_sorting_types = { default.normal,
default.health,
default.health_percentage,
default.flinch_count,
default.break_health,
default.break_health_percentage,
default.break_count,
default.loss_health,
default.loss_health_percentage};
customization_menu.large_monster_UI_parts_sorting_types = { default.normal,
default.health,
default.health_percentage,
default.flinch_count,
default.break_health,
default.break_health_percentage,
default.break_count,
default.loss_health,
default.loss_health_percentage};
customization_menu.displayed_large_monster_UI_parts_filter_types = { current.current_state,
current.default_state};
customization_menu.large_monster_UI_parts_filter_types = { default.current_state,
default.default_state};
customization_menu.displayed_ailments_sorting_types = { current.normal,
current.buildup,