4 Commits
v2.6 ... v2.6.2

Author SHA1 Message Date
GreenComfyTea
3b89ce8303 Bump version to v2.6.2 2023-10-24 10:15:42 +03:00
GreenComfyTea
f2e23626cf Fix creating DEFAULT file in /data/ when no config 2023-10-24 10:15:19 +03:00
GreenComfyTea
8a55873e14 Bump version to 2.6.1 2023-10-16 08:56:48 +03:00
GreenComfyTea
b93bdd0338 Add Buff UI and Stats UI to Hotkeys
+ Fix a Bug when Removed Hotkey was not Saved in the Config
+ Allow Changing Selected Hotkey when Any Other Hotkey is Waiting for a Keypress
2023-10-16 08:55:46 +03:00
3 changed files with 255 additions and 118 deletions

View File

@@ -480,6 +480,28 @@ function this.register_hotkey(hard_keyboard)
return true; return true;
end end
end end
elseif customization_menu.buff_UI_waiting_for_key then
for key, key_name in pairs(this.keys) do
if get_release_method:call(hard_keyboard, key) then
cached_config.buff_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.buff_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.buff_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.buff_UI.key = key;
customization_menu.buff_UI_waiting_for_key = false;
return true;
end
end
elseif customization_menu.stats_UI_waiting_for_key then
for key, key_name in pairs(this.keys) do
if get_release_method:call(hard_keyboard, key) then
cached_config.stats_UI.ctrl = this.hotkey_modifiers_down.ctrl;
cached_config.stats_UI.shift = this.hotkey_modifiers_down.shift;
cached_config.stats_UI.alt = this.hotkey_modifiers_down.alt;
cached_config.stats_UI.key = key;
customization_menu.stats_UI_waiting_for_key = false;
return true;
end
end
end end
return false; return false;
@@ -503,7 +525,10 @@ function this.check_hotkeys(hard_keyboard)
or config.current_config.large_monster_UI.dynamic.enabled or config.current_config.large_monster_UI.dynamic.enabled
or config.current_config.large_monster_UI.static.enabled or config.current_config.large_monster_UI.static.enabled
or config.current_config.large_monster_UI.highlighted.enabled or config.current_config.large_monster_UI.highlighted.enabled
or config.current_config.damage_meter_UI.enabled; or config.current_config.damage_meter_UI.enabled
or config.current_config.endemic_life_UI.enabled
or config.current_config.buff_UI.enabled
or config.current_config.stats_UI.enabled;
config.current_config.time_UI.enabled = not is_any_enabled; config.current_config.time_UI.enabled = not is_any_enabled;
config.current_config.small_monster_UI.enabled = not is_any_enabled; config.current_config.small_monster_UI.enabled = not is_any_enabled;
@@ -511,6 +536,9 @@ function this.check_hotkeys(hard_keyboard)
config.current_config.large_monster_UI.static.enabled = not is_any_enabled; config.current_config.large_monster_UI.static.enabled = not is_any_enabled;
config.current_config.large_monster_UI.highlighted.enabled = not is_any_enabled; config.current_config.large_monster_UI.highlighted.enabled = not is_any_enabled;
config.current_config.damage_meter_UI.enabled = not is_any_enabled; config.current_config.damage_meter_UI.enabled = not is_any_enabled;
config.current_config.endemic_life_UI.enabled = not is_any_enabled;
config.current_config.buff_UI.enabled = not is_any_enabled;
config.current_config.stats_UI.enabled = not is_any_enabled;
end end
end end
@@ -631,6 +659,34 @@ function this.check_hotkeys(hard_keyboard)
config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled; config.current_config.endemic_life_UI.enabled = not config.current_config.endemic_life_UI.enabled;
end end
end end
if not (cached_config.buff_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
and not (cached_config.buff_UI.shift and not this.hotkey_modifiers_down.shift)
and not (cached_config.buff_UI.alt and not this.hotkey_modifiers_down.alt) then
local buff_UI_key_release = get_release_method:call(hard_keyboard, math.tointeger(cached_config.buff_UI.key));
if buff_UI_key_release == nil then
error_handler.report("keyboard.check_hotkeys", "Failed to access Data: buff_UI_key_release");
elseif buff_UI_key_release then
config.current_config.buff_UI.enabled = not config.current_config.buff_UI.enabled;
end
end
if not (cached_config.stats_UI.ctrl and not this.hotkey_modifiers_down.ctrl)
and not (cached_config.stats_UI.shift and not this.hotkey_modifiers_down.shift)
and not (cached_config.stats_UI.alt and not this.hotkey_modifiers_down.alt) then
local stats_UI_key_release = get_release_method:call(hard_keyboard, math.tointeger(cached_config.stats_UI.key));
if stats_UI_key_release == nil then
error_handler.report("keyboard.check_hotkeys", "Failed to access Data: stats_UI_key_release");
elseif stats_UI_key_release then
config.current_config.stats_UI.enabled = not config.current_config.stats_UI.enabled;
end
end
end end
function this.get_hotkey_name(hotkey) function this.get_hotkey_name(hotkey)

View File

@@ -36,7 +36,7 @@ local os = os;
local ValueType = ValueType; local ValueType = ValueType;
local package = package; local package = package;
this.version = "2.6"; this.version = "2.6.2";
this.config_folder = "MHR Overlay\\configs\\"; this.config_folder = "MHR Overlay\\configs\\";
this.current_config_value_file_name = "MHR Overlay\\config.json"; this.current_config_value_file_name = "MHR Overlay\\config.json";
@@ -292,6 +292,20 @@ function this.init_default()
ctrl = false, ctrl = false,
alt = false, alt = false,
key = 0 key = 0
},
buff_UI = {
shift = false,
ctrl = false,
alt = false,
key = 0
},
stats_UI = {
shift = false,
ctrl = false,
alt = false,
key = 0
} }
} }
}, },
@@ -9201,7 +9215,7 @@ function this.load_configs()
table.insert(this.config_names, this.current_config_name); table.insert(this.config_names, this.current_config_name);
table.insert(this.configs, this.current_config); table.insert(this.configs, this.current_config);
this.save(this.current_config_name, this.current_config); this.save(string.format("%s\\%s.json", this.config_folder, this.current_config_name), this.current_config);
end end
this.save_current_config_name(); this.save_current_config_name();

View File

@@ -145,6 +145,8 @@ this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false; this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false; this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false; this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
this.menu_font_changed = false; this.menu_font_changed = false;
this.config_name_input = ""; this.config_name_input = "";
@@ -387,6 +389,7 @@ function this.draw()
local language_changed = false; local language_changed = false;
local modifiers_changed = false; local modifiers_changed = false;
local modules_changed = false; local modules_changed = false;
local hotkeys_changed = false;
local global_settings_changed = false; local global_settings_changed = false;
local timer_delays_changed = false; local timer_delays_changed = false;
local small_monster_UI_changed = false; local small_monster_UI_changed = false;
@@ -422,7 +425,7 @@ function this.draw()
config_changed, apply_font_requested = this.draw_config(); config_changed, apply_font_requested = this.draw_config();
modules_changed = this.draw_modules(); modules_changed = this.draw_modules();
this.draw_hotkeys(); hotkeys_changed = this.draw_hotkeys();
global_settings_changed, modifiers_changed, timer_delays_changed, apply_font_requested, language_changed = this.draw_global_settings(apply_font_requested, config_changed); global_settings_changed, modifiers_changed, timer_delays_changed, apply_font_requested, language_changed = this.draw_global_settings(apply_font_requested, config_changed);
small_monster_UI_changed = this.draw_small_monster_UI(); small_monster_UI_changed = this.draw_small_monster_UI();
@@ -517,7 +520,7 @@ function this.draw()
this.reload_font(); this.reload_font();
end end
if window_changed or modules_changed or global_settings_changed or small_monster_UI_changed or large_monster_dynamic_UI_changed or if window_changed or modules_changed or hotkeys_changed or global_settings_changed or small_monster_UI_changed or large_monster_dynamic_UI_changed or
large_monster_static_UI_changed or large_monster_highlighted_UI_changed or time_UI_changed or damage_meter_UI_changed or large_monster_static_UI_changed or large_monster_highlighted_UI_changed or time_UI_changed or damage_meter_UI_changed or
endemic_life_UI_changed or buff_UI_changed or stats_UI_changed or modifiers_changed or config_changed or debug_changed then endemic_life_UI_changed or buff_UI_changed or stats_UI_changed or modifiers_changed or config_changed or debug_changed then
config.save_current(); config.save_current();
@@ -653,6 +656,8 @@ function this.draw_modules()
end end
function this.draw_hotkeys() function this.draw_hotkeys()
local config_changed = false;
if imgui.tree_node(language.current_language.customization_menu.hotkeys) then if imgui.tree_node(language.current_language.customization_menu.hotkeys) then
if this.all_UI_waiting_for_key then if this.all_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
@@ -661,25 +666,26 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.all_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.all_UI.alt = false;
this.all_UI_waiting_for_key = false; this.all_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.all_UI) then elseif imgui.button(language.current_language.customization_menu.all_UI) then
local is_any_other_waiting = this.small_monster_UI_waiting_for_key or
this.large_monster_UI_waiting_for_key or
this.large_monster_dynamic_UI_waiting_for_key or
this.large_monster_static_UI_waiting_for_key or
this.large_monster_highlighted_UI_waiting_for_key or
this.time_UI_waiting_for_key or
this.damage_meter_UI_waiting_for_key or
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.all_UI_waiting_for_key = true; this.all_UI_waiting_for_key = true;
end this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.all_UI)); imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.all_UI));
if this.small_monster_UI_waiting_for_key then if this.small_monster_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.key = 0;
@@ -687,24 +693,25 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.alt = false;
this.small_monster_UI_waiting_for_key = false; this.small_monster_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.small_monster_UI) then elseif imgui.button(language.current_language.customization_menu.small_monster_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key or
this.large_monster_dynamic_UI_waiting_for_key or
this.large_monster_static_UI_waiting_for_key or
this.large_monster_highlighted_UI_waiting_for_key or
this.time_UI_waiting_for_key or
this.damage_meter_UI_waiting_for_key or
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.small_monster_UI_waiting_for_key = true; this.small_monster_UI_waiting_for_key = true;
end this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI)); imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI));
if this.large_monster_UI_waiting_for_key then if this.large_monster_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.key = 0;
@@ -712,24 +719,25 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.alt = false;
this.large_monster_UI_waiting_for_key = false; this.large_monster_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.large_monster_UI) then elseif imgui.button(language.current_language.customization_menu.large_monster_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key or this.small_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key or
this.large_monster_static_UI_waiting_for_key or
this.large_monster_highlighted_UI_waiting_for_key or
this.time_UI_waiting_for_key or
this.damage_meter_UI_waiting_for_key or
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.large_monster_UI_waiting_for_key = true; this.large_monster_UI_waiting_for_key = true;
end this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI)); imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI));
if this.large_monster_dynamic_UI_waiting_for_key then if this.large_monster_dynamic_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.key = 0;
@@ -737,25 +745,25 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.alt = false;
this.large_monster_dynamic_UI_waiting_for_key = false; this.large_monster_dynamic_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.large_monster_dynamic_UI) then elseif imgui.button(language.current_language.customization_menu.large_monster_dynamic_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key or this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key or this.large_monster_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key or
this.large_monster_highlighted_UI_waiting_for_key or
this.time_UI_waiting_for_key or
this.damage_meter_UI_waiting_for_key or
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.large_monster_dynamic_UI_waiting_for_key = true; this.large_monster_dynamic_UI_waiting_for_key = true;
end this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI));
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers
.large_monster_dynamic_UI));
if this.large_monster_static_UI_waiting_for_key then if this.large_monster_static_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.key = 0;
@@ -763,25 +771,25 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.alt = false;
this.large_monster_static_UI_waiting_for_key = false; this.large_monster_static_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.large_monster_static_UI) then elseif imgui.button(language.current_language.customization_menu.large_monster_static_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key or this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key or this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key or this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key or
this.time_UI_waiting_for_key or
this.damage_meter_UI_waiting_for_key or
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.large_monster_static_UI_waiting_for_key = true; this.large_monster_static_UI_waiting_for_key = true;
end this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI));
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers
.large_monster_static_UI));
if this.large_monster_highlighted_UI_waiting_for_key then if this.large_monster_highlighted_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.key = 0;
@@ -789,23 +797,25 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.alt = false;
this.large_monster_highlighted_UI_waiting_for_key = false; this.large_monster_highlighted_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.large_monster_highlighted_UI) then elseif imgui.button(language.current_language.customization_menu.large_monster_highlighted_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key or this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key or this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key or this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key or this.large_monster_static_UI_waiting_for_key = false;
this.time_UI_waiting_for_key or
this.damage_meter_UI_waiting_for_key or
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.large_monster_highlighted_UI_waiting_for_key = true; this.large_monster_highlighted_UI_waiting_for_key = true;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI));
.large_monster_highlighted_UI));
if this.time_UI_waiting_for_key then if this.time_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.time_UI.key = 0;
@@ -813,24 +823,25 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.time_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.time_UI.alt = false;
this.time_UI_waiting_for_key = false; this.time_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.time_UI) then elseif imgui.button(language.current_language.customization_menu.time_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key or this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key or this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key or this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key or this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key or this.large_monster_highlighted_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key or
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.time_UI_waiting_for_key = true; this.time_UI_waiting_for_key = true;
end this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.time_UI)); imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.time_UI));
if this.damage_meter_UI_waiting_for_key then if this.damage_meter_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.key = 0;
@@ -838,24 +849,25 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.alt = false;
this.damage_meter_UI_waiting_for_key = false; this.damage_meter_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.damage_meter_UI) then elseif imgui.button(language.current_language.customization_menu.damage_meter_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key or this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key or this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key or this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key or this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key or this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key or this.time_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key;
if not is_any_other_waiting then
this.damage_meter_UI_waiting_for_key = true; this.damage_meter_UI_waiting_for_key = true;
end this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI)); imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI));
if this.endemic_life_UI_waiting_for_key then if this.endemic_life_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.key = 0; config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.key = 0;
@@ -863,26 +875,81 @@ function this.draw_hotkeys()
config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.shift = false; config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.alt = false; config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI.alt = false;
this.endemic_life_UI_waiting_for_key = false; this.endemic_life_UI_waiting_for_key = false;
config_changed = true;
end end
elseif imgui.button(language.current_language.customization_menu.endemic_life_UI) then elseif imgui.button(language.current_language.customization_menu.endemic_life_UI) then
local is_any_other_waiting = this.all_UI_waiting_for_key or this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key or this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key or this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key or this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key or this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key or this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key or this.time_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key; this.damage_meter_UI_waiting_for_key = false;
if not is_any_other_waiting then
this.endemic_life_UI_waiting_for_key = true; this.endemic_life_UI_waiting_for_key = true;
end this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = false;
end end
imgui.same_line(); imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI)); imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.endemic_life_UI));
if this.buff_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.buff_UI.key = 0;
config.current_config.global_settings.hotkeys_with_modifiers.buff_UI.ctrl = false;
config.current_config.global_settings.hotkeys_with_modifiers.buff_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.buff_UI.alt = false;
this.buff_UI_waiting_for_key = false;
config_changed = true;
end
elseif imgui.button(language.current_language.customization_menu.buff_UI) then
this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = true;
this.stats_UI_waiting_for_key = false;
end
imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.buff_UI));
if this.stats_UI_waiting_for_key then
if imgui.button(language.current_language.customization_menu.press_any_key) then
config.current_config.global_settings.hotkeys_with_modifiers.stats_UI.key = 0;
config.current_config.global_settings.hotkeys_with_modifiers.stats_UI.ctrl = false;
config.current_config.global_settings.hotkeys_with_modifiers.stats_UI.shift = false;
config.current_config.global_settings.hotkeys_with_modifiers.stats_UI.alt = false;
this.stats_UI_waiting_for_key = false;
config_changed = true;
end
elseif imgui.button(language.current_language.customization_menu.stats_UI) then
this.all_UI_waiting_for_key = false;
this.small_monster_UI_waiting_for_key = false;
this.large_monster_UI_waiting_for_key = false;
this.large_monster_dynamic_UI_waiting_for_key = false;
this.large_monster_static_UI_waiting_for_key = false;
this.large_monster_highlighted_UI_waiting_for_key = false;
this.time_UI_waiting_for_key = false;
this.damage_meter_UI_waiting_for_key = false;
this.endemic_life_UI_waiting_for_key = false;
this.buff_UI_waiting_for_key = false;
this.stats_UI_waiting_for_key = true;
end
imgui.same_line();
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.stats_UI));
imgui.tree_pop(); imgui.tree_pop();
end end
return config_changed;
end end
function this.draw_global_settings(apply_font_requested, language_changed) function this.draw_global_settings(apply_font_requested, language_changed)