mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 12:28:03 -08:00
Add Anomaly Core Health Bars to Parts UI
This commit is contained in:
@@ -47,171 +47,279 @@ local os = os;
|
||||
local ValueType = ValueType;
|
||||
local package = package;
|
||||
|
||||
this.large_monster_UI_parts_sorting_types = {};
|
||||
this.displayed_large_monster_UI_parts_sorting_types = {};
|
||||
|
||||
this.large_monster_UI_parts_filter_types = {};
|
||||
this.displayed_large_monster_UI_parts_filter_types = {};
|
||||
|
||||
function this.init()
|
||||
local default = language.default_language.customization_menu;
|
||||
local current = language.current_language.customization_menu;
|
||||
|
||||
this.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,
|
||||
default.anomaly_health,
|
||||
default.anomaly_health_percentage
|
||||
};
|
||||
|
||||
this.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,
|
||||
current.anomaly_health,
|
||||
current.anomaly_health_percentage
|
||||
};
|
||||
|
||||
this.large_monster_UI_parts_filter_types =
|
||||
{
|
||||
default.current_state,
|
||||
default.default_state
|
||||
};
|
||||
|
||||
this.displayed_large_monster_UI_parts_filter_types =
|
||||
{
|
||||
current.current_state,
|
||||
current.default_state
|
||||
};
|
||||
end
|
||||
|
||||
function this.draw(cached_config)
|
||||
local cached_language = language.current_language.customization_menu;
|
||||
|
||||
local changed = false;
|
||||
local config_changed = false;
|
||||
local index = 0;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.body_parts) then
|
||||
if imgui.tree_node(cached_language.body_parts) then
|
||||
changed, cached_config.visibility = imgui.checkbox(
|
||||
language.current_language.customization_menu.visible, cached_config.visibility);
|
||||
cached_language.visible, cached_config.visibility);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.offset) then
|
||||
if imgui.tree_node(cached_language.offset) then
|
||||
changed, cached_config.offset.x = imgui.drag_float(
|
||||
language.current_language.customization_menu.x, cached_config.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
cached_language.x, cached_config.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.offset.y = imgui.drag_float(
|
||||
language.current_language.customization_menu.y, cached_config.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
cached_language.y, cached_config.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.spacing) then
|
||||
if imgui.tree_node(cached_language.spacing) then
|
||||
changed, cached_config.spacing.x = imgui.drag_float(
|
||||
language.current_language.customization_menu.x, cached_config.spacing.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
cached_language.x, cached_config.spacing.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.spacing.y = imgui.drag_float(
|
||||
language.current_language.customization_menu.y, cached_config.spacing.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
cached_language.y, cached_config.spacing.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.settings) then
|
||||
if imgui.tree_node(cached_language.settings) then
|
||||
changed, cached_config.settings.hide_undamaged_parts = imgui.checkbox(
|
||||
language.current_language.customization_menu.hide_undamaged_parts, cached_config.settings.hide_undamaged_parts);
|
||||
cached_language.hide_undamaged_parts, cached_config.settings.hide_undamaged_parts);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, index = imgui.combo(language.current_language.customization_menu.filter_mode,
|
||||
utils.table.find_index(customization_menu.large_monster_UI_parts_filter_types, cached_config.settings.filter_mode),
|
||||
customization_menu.displayed_large_monster_UI_parts_filter_types);
|
||||
changed, cached_config.settings.render_inactive_anomaly_cores = imgui.checkbox(
|
||||
cached_language.render_inactive_anomaly_cores, cached_config.settings.render_inactive_anomaly_cores);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, index = imgui.combo(cached_language.filter_mode,
|
||||
utils.table.find_index(this.large_monster_UI_parts_filter_types, cached_config.settings.filter_mode),
|
||||
this.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];
|
||||
cached_config.settings.filter_mode = this.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");
|
||||
cached_language.time_limit, cached_config.settings.time_limit, 0.1, 0, 99999, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.sorting) then
|
||||
if imgui.tree_node(cached_language.sorting) then
|
||||
changed, index = imgui.combo(
|
||||
language.current_language.customization_menu.type,
|
||||
utils.table.find_index(customization_menu.large_monster_UI_parts_sorting_types, cached_config.sorting.type),
|
||||
customization_menu.displayed_large_monster_UI_parts_sorting_types);
|
||||
cached_language.type,
|
||||
utils.table.find_index(this.large_monster_UI_parts_sorting_types, cached_config.sorting.type),
|
||||
this.displayed_large_monster_UI_parts_sorting_types);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if changed then
|
||||
cached_config.sorting.type = customization_menu.large_monster_UI_parts_sorting_types[index];
|
||||
cached_config.sorting.type = this.large_monster_UI_parts_sorting_types[index];
|
||||
end
|
||||
|
||||
changed, cached_config.sorting.reversed_order = imgui.checkbox(
|
||||
language.current_language.customization_menu.reversed_order, cached_config.sorting.reversed_order);
|
||||
cached_language.reversed_order, cached_config.sorting.reversed_order);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.filter) then
|
||||
changed, cached_config.filter.health_break_severe = imgui.checkbox(
|
||||
language.current_language.customization_menu.health_break_severe_filter, cached_config.filter.health_break_severe);
|
||||
if imgui.tree_node(cached_language.filter) then
|
||||
changed, cached_config.filter.health_break_sever_anomaly = imgui.checkbox(
|
||||
cached_language.health_break_sever_anomaly_filter, cached_config.filter.health_break_sever_anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
|
||||
|
||||
changed, cached_config.filter.health_break_sever = imgui.checkbox(
|
||||
cached_language.health_break_sever_filter, cached_config.filter.health_break_sever);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.health_break_anomaly = imgui.checkbox(
|
||||
cached_language.health_break_anomaly_filter, cached_config.filter.health_break_anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.health_sever_anomaly = imgui.checkbox(
|
||||
cached_language.health_sever_anomaly_filter, cached_config.filter.health_sever_anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.break_sever_anomaly = imgui.checkbox(
|
||||
cached_language.break_sever_anomaly_filter, cached_config.filter.break_sever_anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
|
||||
|
||||
changed, cached_config.filter.health_break = imgui.checkbox(
|
||||
language.current_language.customization_menu.health_break_filter, cached_config.filter.health_break);
|
||||
cached_language.health_break_filter, cached_config.filter.health_break);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.health_severe = imgui.checkbox(
|
||||
language.current_language.customization_menu.health_severe_filter, cached_config.filter.health_severe);
|
||||
changed, cached_config.filter.health_sever = imgui.checkbox(
|
||||
cached_language.health_sever_filter, cached_config.filter.health_sever);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.health_anomaly = imgui.checkbox(
|
||||
cached_language.health_anomaly_filter, cached_config.filter.health_anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
|
||||
|
||||
changed, cached_config.filter.break_sever = imgui.checkbox(
|
||||
cached_language.break_sever_filter, cached_config.filter.break_sever);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.break_anomaly = imgui.checkbox(
|
||||
cached_language.break_anomaly_filter, cached_config.filter.break_anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.sever_anomaly = imgui.checkbox(
|
||||
cached_language.sever_anomaly_filter, cached_config.filter.sever_anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
|
||||
|
||||
changed, cached_config.filter.health = imgui.checkbox(
|
||||
language.current_language.customization_menu.health_filter, cached_config.filter.health);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.break_severe = imgui.checkbox(
|
||||
language.current_language.customization_menu.break_severe_filter, cached_config.filter.break_severe);
|
||||
cached_language.health_filter, cached_config.filter.health);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.break_ = imgui.checkbox(
|
||||
language.current_language.customization_menu.break_filter, cached_config.filter.break_);
|
||||
cached_language.break_filter, cached_config.filter.break_);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.severe = imgui.checkbox(
|
||||
language.current_language.customization_menu.severe_filter, cached_config.filter.severe);
|
||||
changed, cached_config.filter.sever = imgui.checkbox(
|
||||
cached_language.sever_filter, cached_config.filter.sever);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.filter.anomaly = imgui.checkbox(
|
||||
cached_language.anomaly_filter, cached_config.filter.anomaly);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.part_name_label) then
|
||||
if imgui.tree_node(cached_language.part_name_label) then
|
||||
changed, cached_config.part_name_label.visibility = imgui.checkbox(
|
||||
language.current_language.customization_menu.visible, cached_config.part_name_label.visibility);
|
||||
cached_language.visible, cached_config.part_name_label.visibility);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.include) then
|
||||
if imgui.tree_node(cached_language.include) then
|
||||
changed, cached_config.part_name_label.include.part_name = imgui.checkbox(
|
||||
language.current_language.customization_menu.part_name, cached_config.part_name_label.include.part_name);
|
||||
cached_language.part_name, cached_config.part_name_label.include.part_name);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_name_label.include.flinch_count = imgui.checkbox(
|
||||
language.current_language.customization_menu.flinch_count, cached_config.part_name_label.include.flinch_count);
|
||||
cached_language.flinch_count, cached_config.part_name_label.include.flinch_count);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_name_label.include.break_count = imgui.checkbox(
|
||||
language.current_language.customization_menu.break_count, cached_config.part_name_label.include.break_count);
|
||||
cached_language.break_count, cached_config.part_name_label.include.break_count);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_name_label.include.break_max_count = imgui.checkbox(
|
||||
language.current_language.customization_menu.break_max_count, cached_config.part_name_label.include.break_max_count);
|
||||
cached_language.break_max_count, cached_config.part_name_label.include.break_max_count);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.offset) then
|
||||
if imgui.tree_node(cached_language.offset) then
|
||||
changed, cached_config.part_name_label.offset.x = imgui.drag_float(
|
||||
language.current_language.customization_menu.x, cached_config.part_name_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
cached_language.x, cached_config.part_name_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_name_label.offset.y = imgui.drag_float(
|
||||
language.current_language.customization_menu.y, cached_config.part_name_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
cached_language.y, cached_config.part_name_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.color) then
|
||||
if imgui.tree_node(cached_language.color) then
|
||||
changed, cached_config.part_name_label.color = imgui.color_picker_argb(
|
||||
"", cached_config.part_name_label.color, customization_menu.color_picker_flags);
|
||||
|
||||
@@ -220,21 +328,21 @@ function this.draw(cached_config)
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.shadow) then
|
||||
if imgui.tree_node(cached_language.shadow) then
|
||||
changed, cached_config.part_name_label.shadow.visibility = imgui.checkbox(
|
||||
language.current_language.customization_menu.visible, cached_config.part_name_label.shadow.visibility);
|
||||
cached_language.visible, cached_config.part_name_label.shadow.visibility);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.offset) then
|
||||
if imgui.tree_node(cached_language.offset) then
|
||||
changed, cached_config.part_name_label.shadow.offset.x = imgui.drag_float(
|
||||
language.current_language.customization_menu.x, cached_config.part_name_label.shadow.offset.x,
|
||||
cached_language.x, cached_config.part_name_label.shadow.offset.x,
|
||||
0.1, -screen.width, screen.width, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_name_label.shadow.offset.y = imgui.drag_float(
|
||||
language.current_language.customization_menu.y, cached_config.part_name_label.shadow.offset.y,
|
||||
cached_language.y, cached_config.part_name_label.shadow.offset.y,
|
||||
0.1, -screen.height, screen.height, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
@@ -242,7 +350,7 @@ function this.draw(cached_config)
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.color) then
|
||||
if imgui.tree_node(cached_language.color) then
|
||||
changed, cached_config.part_name_label.shadow.color = imgui.color_picker_argb(
|
||||
"",cached_config.part_name_label.shadow.color, customization_menu.color_picker_flags);
|
||||
|
||||
@@ -257,106 +365,141 @@ function this.draw(cached_config)
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.part_health) then
|
||||
if imgui.tree_node(cached_language.part_health) then
|
||||
changed, cached_config.part_health.visibility = imgui.checkbox(
|
||||
language.current_language.customization_menu.visible, cached_config.part_health.visibility);
|
||||
cached_language.visible, cached_config.part_health.visibility);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.offset) then
|
||||
if imgui.tree_node(cached_language.offset) then
|
||||
changed, cached_config.part_health.offset.x = imgui.drag_float(
|
||||
language.current_language.customization_menu.x, cached_config.part_health.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
cached_language.x, cached_config.part_health.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_health.offset.y = imgui.drag_float(
|
||||
language.current_language.customization_menu.y, cached_config.part_health.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
cached_language.y, cached_config.part_health.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.text_label, cached_config.part_health.text_label);
|
||||
changed = label_customization.draw(cached_language.text_label, cached_config.part_health.text_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.value_label, cached_config.part_health.value_label);
|
||||
changed = label_customization.draw(cached_language.value_label, cached_config.part_health.value_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.percentage_label, cached_config.part_health.percentage_label);
|
||||
changed = label_customization.draw(cached_language.percentage_label, cached_config.part_health.percentage_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = bar_customization.draw(language.current_language.customization_menu.bar, cached_config.part_health.bar);
|
||||
changed = bar_customization.draw(cached_language.bar, cached_config.part_health.bar);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.break_health) then
|
||||
if imgui.tree_node(cached_language.break_health) then
|
||||
changed, cached_config.part_break.visibility = imgui.checkbox(
|
||||
language.current_language.customization_menu.visible, cached_config.part_break.visibility);
|
||||
cached_language.visible, cached_config.part_break.visibility);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.offset) then
|
||||
if imgui.tree_node(cached_language.offset) then
|
||||
changed, cached_config.part_break.offset.x = imgui.drag_float(
|
||||
language.current_language.customization_menu.x, cached_config.part_break.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
cached_language.x, cached_config.part_break.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_break.offset.y = imgui.drag_float(
|
||||
language.current_language.customization_menu.y, cached_config.part_break.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
cached_language.y, cached_config.part_break.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.text_label, cached_config.part_break.text_label);
|
||||
changed = label_customization.draw(cached_language.text_label, cached_config.part_break.text_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.value_label, cached_config.part_break.value_label);
|
||||
changed = label_customization.draw(cached_language.value_label, cached_config.part_break.value_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.percentage_label, cached_config.part_break.percentage_label);
|
||||
changed = label_customization.draw(cached_language.percentage_label, cached_config.part_break.percentage_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = bar_customization.draw(language.current_language.customization_menu.bar, cached_config.part_break.bar);
|
||||
changed = bar_customization.draw(cached_language.bar, cached_config.part_break.bar);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.loss_health) then
|
||||
if imgui.tree_node(cached_language.loss_health) then
|
||||
changed, cached_config.part_loss.visibility = imgui.checkbox(
|
||||
language.current_language.customization_menu.visible, cached_config.part_loss.visibility);
|
||||
cached_language.visible, cached_config.part_loss.visibility);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if imgui.tree_node(language.current_language.customization_menu.offset) then
|
||||
if imgui.tree_node(cached_language.offset) then
|
||||
changed, cached_config.part_loss.offset.x = imgui.drag_float(
|
||||
language.current_language.customization_menu.x, cached_config.part_loss.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
cached_language.x, cached_config.part_loss.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_loss.offset.y = imgui.drag_float(
|
||||
language.current_language.customization_menu.y, cached_config.part_loss.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
cached_language.y, cached_config.part_loss.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.text_label, cached_config.part_loss.text_label);
|
||||
changed = label_customization.draw(cached_language.text_label, cached_config.part_loss.text_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.value_label, cached_config.part_loss.value_label);
|
||||
changed = label_customization.draw(cached_language.value_label, cached_config.part_loss.value_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(language.current_language.customization_menu.percentage_label, cached_config.part_loss.percentage_label);
|
||||
changed = label_customization.draw(cached_language.percentage_label, cached_config.part_loss.percentage_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = bar_customization.draw(language.current_language.customization_menu.bar, cached_config.part_loss.bar);
|
||||
changed = bar_customization.draw(cached_language.bar, cached_config.part_loss.bar);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
if imgui.tree_node(cached_language.anomaly_health) then
|
||||
changed, cached_config.part_anomaly.visibility = imgui.checkbox(
|
||||
cached_language.visible, cached_config.part_anomaly.visibility);
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
if imgui.tree_node(cached_language.offset) then
|
||||
changed, cached_config.part_anomaly.offset.x = imgui.drag_float(
|
||||
cached_language.x, cached_config.part_anomaly.offset.x, 0.1, -screen.width, screen.width, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed, cached_config.part_anomaly.offset.y = imgui.drag_float(
|
||||
cached_language.y, cached_config.part_anomaly.offset.y, 0.1, -screen.height, screen.height, "%.1f");
|
||||
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
end
|
||||
|
||||
changed = label_customization.draw(cached_language.text_label, cached_config.part_anomaly.text_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(cached_language.value_label, cached_config.part_anomaly.value_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = label_customization.draw(cached_language.percentage_label, cached_config.part_anomaly.percentage_label);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
changed = bar_customization.draw(cached_language.bar, cached_config.part_anomaly.bar);
|
||||
config_changed = config_changed or changed;
|
||||
|
||||
imgui.tree_pop();
|
||||
|
||||
@@ -36,9 +36,11 @@ local os = os;
|
||||
local ValueType = ValueType;
|
||||
local package = package;
|
||||
|
||||
function this.new(part_visibility, part_name_label, flinch_visibility, flinch_bar, flinch_text_label,
|
||||
flinch_value_label, flinch_percentage_label, break_visibility, break_bar, break_text_label, break_value_label,
|
||||
break_percentage_label, loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label)
|
||||
function this.new(part_visibility, part_name_label,
|
||||
flinch_visibility, flinch_bar, flinch_text_label, flinch_value_label, flinch_percentage_label,
|
||||
break_visibility, break_bar, break_text_label, break_value_label, break_percentage_label,
|
||||
loss_visibility, loss_bar, loss_text_label, loss_value_label, loss_health_percentage_label,
|
||||
anomaly_visibility, anomaly_bar, anomaly_text_label, anomaly_value_label, anomaly_health_percentage_label)
|
||||
|
||||
local global_scale_modifier = config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
@@ -48,6 +50,7 @@ function this.new(part_visibility, part_name_label, flinch_visibility, flinch_ba
|
||||
entity.flinch_visibility = flinch_visibility;
|
||||
entity.break_visibility = break_visibility;
|
||||
entity.loss_visibility = loss_visibility;
|
||||
entity.anomaly_visibility = anomaly_visibility;
|
||||
|
||||
entity.part_name_label = utils.table.deep_copy(part_name_label);
|
||||
|
||||
@@ -117,6 +120,27 @@ function this.new(part_visibility, part_name_label, flinch_visibility, flinch_ba
|
||||
entity.loss_health_percentage_label.offset.x = entity.loss_health_percentage_label.offset.x * global_scale_modifier;
|
||||
entity.loss_health_percentage_label.offset.y = entity.loss_health_percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.anomaly_bar = utils.table.deep_copy(anomaly_bar);
|
||||
entity.anomaly_text_label = utils.table.deep_copy(anomaly_text_label);
|
||||
entity.anomaly_value_label = utils.table.deep_copy(anomaly_value_label);
|
||||
entity.anomaly_health_percentage_label = utils.table.deep_copy(anomaly_health_percentage_label);
|
||||
|
||||
entity.anomaly_bar.offset.x = entity.anomaly_bar.offset.x * global_scale_modifier;
|
||||
entity.anomaly_bar.offset.y = entity.anomaly_bar.offset.y * global_scale_modifier;
|
||||
entity.anomaly_bar.size.width = entity.anomaly_bar.size.width * global_scale_modifier;
|
||||
entity.anomaly_bar.size.height = entity.anomaly_bar.size.height * global_scale_modifier;
|
||||
entity.anomaly_bar.outline.thickness = entity.anomaly_bar.outline.thickness * global_scale_modifier;
|
||||
entity.anomaly_bar.outline.offset = entity.anomaly_bar.outline.offset * global_scale_modifier;
|
||||
|
||||
entity.anomaly_text_label.offset.x = entity.anomaly_text_label.offset.x * global_scale_modifier;
|
||||
entity.anomaly_text_label.offset.y = entity.anomaly_text_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.anomaly_value_label.offset.x = entity.anomaly_value_label.offset.x * global_scale_modifier;
|
||||
entity.anomaly_value_label.offset.y = entity.anomaly_value_label.offset.y * global_scale_modifier;
|
||||
|
||||
entity.anomaly_health_percentage_label.offset.x = entity.anomaly_health_percentage_label.offset.x * global_scale_modifier;
|
||||
entity.anomaly_health_percentage_label.offset.y = entity.anomaly_health_percentage_label.offset.y * global_scale_modifier;
|
||||
|
||||
return entity;
|
||||
end
|
||||
|
||||
@@ -127,9 +151,10 @@ function this.draw(part, part_UI, cached_config, position_on_screen, opacity_sca
|
||||
|
||||
local draw_health = part_UI.flinch_visibility and part.max_health > 0;
|
||||
local draw_break = part_UI.break_visibility and part.break_max_health > 0 and part.break_count < part.break_max_count;
|
||||
local draw_severe = part_UI.loss_visibility and part.loss_max_health > 0 and not part.is_severed;
|
||||
local draw_sever = part_UI.loss_visibility and part.loss_max_health > 0 and not part.is_severed;
|
||||
local draw_anomaly = part_UI.anomaly_visibility and part.anomaly_max_health > 0 and (part.anomaly_is_active or cached_config.settings.render_inactive_anomaly_cores);
|
||||
|
||||
if not draw_health and not draw_break and not draw_severe then
|
||||
if not draw_health and not draw_break and not draw_sever and not draw_anomaly then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -186,7 +211,7 @@ function this.draw(part, part_UI, cached_config, position_on_screen, opacity_sca
|
||||
|
||||
-- loss health value string
|
||||
local loss_health_string = "";
|
||||
if draw_severe then
|
||||
if draw_sever 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;
|
||||
|
||||
@@ -199,22 +224,39 @@ function this.draw(part, part_UI, cached_config, position_on_screen, opacity_sca
|
||||
end
|
||||
end
|
||||
|
||||
-- anomaly health value string
|
||||
local anomaly_health_string = "";
|
||||
if draw_anomaly then
|
||||
local include_anomaly_health_current_value = part_UI.anomaly_value_label.include.current_value;
|
||||
local include_anomaly_health_max_value = part_UI.anomaly_value_label.include.max_value;
|
||||
|
||||
if include_anomaly_health_current_value and include_anomaly_health_max_value then
|
||||
anomaly_health_string = string.format("%.0f/%.0f", part.anomaly_health, part.anomaly_max_health);
|
||||
elseif include_anomaly_health_current_value then
|
||||
anomaly_health_string = string.format("%.0f", part.anomaly_health);
|
||||
elseif include_anomaly_health_max_value then
|
||||
anomaly_health_string = string.format("%.0f", part.anomaly_max_health);
|
||||
end
|
||||
end
|
||||
|
||||
local flinch_position_on_screen = {
|
||||
x = position_on_screen.x + cached_config.part_health.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_health.offset.y,
|
||||
visibility = part_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local break_position_on_screen = {
|
||||
x = position_on_screen.x + cached_config.part_break.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_break.offset.y,
|
||||
visibility = part_UI.flinch_visibility
|
||||
};
|
||||
|
||||
local loss_position_on_screen = {
|
||||
x = position_on_screen.x + cached_config.part_loss.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_loss.offset.y,
|
||||
part_UI = part_UI.loss_visibility
|
||||
};
|
||||
|
||||
local anomaly_position_on_screen = {
|
||||
x = position_on_screen.x + cached_config.part_anomaly.offset.x,
|
||||
y = position_on_screen.y + cached_config.part_anomaly.offset.y,
|
||||
};
|
||||
|
||||
if draw_health then
|
||||
@@ -225,10 +267,14 @@ function this.draw(part, part_UI, cached_config, position_on_screen, opacity_sca
|
||||
drawing.draw_bar(part_UI.break_bar, break_position_on_screen, opacity_scale, part.break_health_percentage);
|
||||
end
|
||||
|
||||
if draw_severe then
|
||||
if draw_sever then
|
||||
drawing.draw_bar(part_UI.loss_bar, loss_position_on_screen, opacity_scale, part.loss_health_percentage);
|
||||
end
|
||||
|
||||
if draw_anomaly then
|
||||
drawing.draw_bar(part_UI.anomaly_bar, anomaly_position_on_screen, opacity_scale, part.anomaly_health_percentage);
|
||||
end
|
||||
|
||||
drawing.draw_label(part_UI.part_name_label, position_on_screen, opacity_scale, part_name);
|
||||
|
||||
if draw_health then
|
||||
@@ -243,11 +289,17 @@ function this.draw(part, part_UI, cached_config, position_on_screen, opacity_sca
|
||||
drawing.draw_label(part_UI.break_percentage_label, break_position_on_screen, opacity_scale, 100 * part.break_health_percentage);
|
||||
end
|
||||
|
||||
if draw_severe then
|
||||
if draw_sever then
|
||||
drawing.draw_label(part_UI.loss_text_label, loss_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part_UI.loss_value_label, loss_position_on_screen, opacity_scale, loss_health_string);
|
||||
drawing.draw_label(part_UI.loss_health_percentage_label, loss_position_on_screen, opacity_scale, 100 * part.loss_health_percentage);
|
||||
end
|
||||
|
||||
if draw_anomaly then
|
||||
drawing.draw_label(part_UI.anomaly_text_label, anomaly_position_on_screen, opacity_scale);
|
||||
drawing.draw_label(part_UI.anomaly_value_label, anomaly_position_on_screen, opacity_scale, anomaly_health_string);
|
||||
drawing.draw_label(part_UI.anomaly_health_percentage_label, anomaly_position_on_screen, opacity_scale, 100 * part.anomaly_health_percentage);
|
||||
end
|
||||
end
|
||||
|
||||
function this.init_module()
|
||||
|
||||
@@ -82,12 +82,6 @@ this.displayed_anchor_types = {};
|
||||
this.monster_UI_sorting_types = {};
|
||||
this.displayed_monster_UI_sorting_types = {};
|
||||
|
||||
this.large_monster_UI_parts_sorting_types = {};
|
||||
this.displayed_large_monster_UI_parts_sorting_types = {};
|
||||
|
||||
this.large_monster_UI_parts_filter_types = {};
|
||||
this.displayed_large_monster_UI_parts_filter_types = {};
|
||||
|
||||
this.buff_UI_sorting_types = {};
|
||||
this.displayed_buff_UI_sorting_types = {};
|
||||
|
||||
@@ -169,6 +163,7 @@ function this.init()
|
||||
bar_customization.init();
|
||||
ailments_customization.init();
|
||||
ailment_buildups_customization.init();
|
||||
body_parts_customization.init();
|
||||
|
||||
this.orientation_types =
|
||||
{
|
||||
@@ -214,44 +209,6 @@ function this.init()
|
||||
current.distance
|
||||
};
|
||||
|
||||
this.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
|
||||
};
|
||||
|
||||
this.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
|
||||
};
|
||||
|
||||
this.large_monster_UI_parts_filter_types =
|
||||
{
|
||||
default.current_state,
|
||||
default.default_state
|
||||
};
|
||||
|
||||
this.displayed_large_monster_UI_parts_filter_types =
|
||||
{
|
||||
current.current_state,
|
||||
current.default_state
|
||||
};
|
||||
|
||||
this.buff_UI_sorting_types =
|
||||
{
|
||||
default.name,
|
||||
|
||||
Reference in New Issue
Block a user