mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-23 20:08:05 -08:00
Bugfixes. Hotkey modifier support added.
This commit is contained in:
@@ -430,7 +430,6 @@ function player.update_player_list_on_quest()
|
||||
|
||||
local player_id = member_index_field:get_data(player_info);
|
||||
|
||||
x = player_info
|
||||
if player_id == nil then
|
||||
goto continue
|
||||
end
|
||||
@@ -470,18 +469,18 @@ end
|
||||
function player.init_total_UI(_player)
|
||||
_player.damage_UI = {
|
||||
total_damage_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_damage_label),
|
||||
damage_value_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_damage_value_label),
|
||||
total_damage_value_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_dps_label)
|
||||
total_damage_value_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_damage_value_label),
|
||||
total_dps_label = table_helpers.deep_copy(config.current_config.damage_meter_UI.total_dps_label)
|
||||
};
|
||||
|
||||
_player.damage_UI.total_damage_label.offset.x = _player.damage_UI.total_damage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
_player.damage_UI.total_damage_label.offset.y = _player.damage_UI.total_damage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
_player.damage_UI.damage_value_label.offset.x = _player.damage_UI.damage_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
_player.damage_UI.damage_value_label.offset.y = _player.damage_UI.damage_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
_player.damage_UI.total_damage_value_label.offset.x = _player.damage_UI.total_damage_value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
_player.damage_UI.total_damage_value_label.offset.y = _player.damage_UI.total_damage_value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
|
||||
_player.damage_UI.total_dps_label.offset.x = _player.damage_UI.total_dps_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
_player.damage_UI.total_dps_label.offset.y = _player.damage_UI.total_dps_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
|
||||
end
|
||||
|
||||
function player.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
|
||||
|
||||
@@ -16,6 +16,12 @@ local get_down_method = hard_keyboard_field_type_def:get_method("getDown");
|
||||
local get_trigger_method = hard_keyboard_field_type_def:get_method("getTrg");
|
||||
local get_release_method = hard_keyboard_field_type_def:get_method("getRelease");
|
||||
|
||||
keyboard.hotkey_modifiers_down = {
|
||||
ctrl = false,
|
||||
shift = false,
|
||||
alt = false
|
||||
};
|
||||
|
||||
keyboard.keys = {
|
||||
[0] = "None",
|
||||
[1] = "Left Mouse Button",
|
||||
@@ -307,6 +313,8 @@ function keyboard.update()
|
||||
return;
|
||||
end
|
||||
|
||||
keyboard.check_modifiers(hard_keyboard);
|
||||
|
||||
local new_hotkey_registered = keyboard.register_hotkey(hard_keyboard);
|
||||
|
||||
if new_hotkey_registered then
|
||||
@@ -314,13 +322,37 @@ function keyboard.update()
|
||||
else
|
||||
keyboard.check_hotkeys(hard_keyboard);
|
||||
end
|
||||
|
||||
keyboard.hotkey_modifiers_down.ctrl = false;
|
||||
keyboard.hotkey_modifiers_down.shift = false;
|
||||
keyboard.hotkey_modifiers_down.alt = false
|
||||
end
|
||||
|
||||
function keyboard.check_modifiers(hard_keyboard)
|
||||
local is_ctrl_down = get_down_method:call(hard_keyboard, 17);
|
||||
if is_ctrl_down ~= nil then
|
||||
keyboard.hotkey_modifiers_down.ctrl = is_ctrl_down;
|
||||
end
|
||||
|
||||
local is_shift_down = get_down_method:call(hard_keyboard, 16);
|
||||
if is_shift_down ~= nil then
|
||||
keyboard.hotkey_modifiers_down.shift = is_shift_down;
|
||||
end
|
||||
|
||||
local is_alt_down = get_down_method:call(hard_keyboard, 18);
|
||||
if is_alt_down ~= nil then
|
||||
keyboard.hotkey_modifiers_down.alt = is_alt_down;
|
||||
end
|
||||
end
|
||||
|
||||
function keyboard.register_hotkey(hard_keyboard)
|
||||
if customization_menu.all_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.all_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.key = key;
|
||||
customization_menu.all_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -328,7 +360,10 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
elseif customization_menu.small_monster_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.small_monster_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.key = key;
|
||||
customization_menu.small_monster_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -336,7 +371,10 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
elseif customization_menu.large_monster_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.key = key;
|
||||
customization_menu.large_monster_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -344,7 +382,10 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
elseif customization_menu.large_monster_dynamic_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_dynamic_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.key = key;
|
||||
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -352,7 +393,10 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
elseif customization_menu.large_monster_static_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_static_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.key = key;
|
||||
customization_menu.large_monster_static_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -360,7 +404,10 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
elseif customization_menu.large_monster_highlighted_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_highlighted_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.key = key;
|
||||
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -368,7 +415,10 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
elseif customization_menu.time_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.time_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.key = key;
|
||||
customization_menu.time_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -376,7 +426,10 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
elseif customization_menu.damage_meter_UI_waiting_for_key then
|
||||
for key, key_name in pairs(keyboard.keys) do
|
||||
if get_release_method:call(hard_keyboard, key) then
|
||||
config.current_config.global_settings.hotkeys.damage_meter_UI = key;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.ctrl = keyboard.hotkey_modifiers_down.ctrl;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.shift = keyboard.hotkey_modifiers_down.shift;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.alt = keyboard.hotkey_modifiers_down.alt;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.key = key;
|
||||
customization_menu.damage_meter_UI_waiting_for_key = false;
|
||||
return true;
|
||||
end
|
||||
@@ -385,57 +438,107 @@ function keyboard.register_hotkey(hard_keyboard)
|
||||
end
|
||||
|
||||
function keyboard.check_hotkeys(hard_keyboard)
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.all_UI) then
|
||||
local is_any_enabled = config.current_config.time_UI.enabled
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.all_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.all_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.all_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.all_UI.key)then
|
||||
local is_any_enabled = config.current_config.time_UI.enabled
|
||||
or config.current_config.small_monster_UI.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.highlighted.enabled
|
||||
or config.current_config.damage_meter_UI.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.large_monster_UI.dynamic.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.damage_meter_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.large_monster_UI.dynamic.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.damage_meter_UI.enabled = not is_any_enabled;
|
||||
end
|
||||
end
|
||||
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.small_monster_UI) then
|
||||
config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled;
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.key) then
|
||||
config.current_config.small_monster_UI.enabled = not config.current_config.small_monster_UI.enabled;
|
||||
end
|
||||
end
|
||||
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.large_monster_UI) then
|
||||
local is_any_enabled = config.current_config.large_monster_UI.dynamic.enabled
|
||||
or config.current_config.large_monster_UI.static.enabled
|
||||
or config.current_config.large_monster_UI.highlighted.enabled;
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.key) then
|
||||
local is_any_enabled = config.current_config.large_monster_UI.dynamic.enabled
|
||||
or config.current_config.large_monster_UI.static.enabled
|
||||
or config.current_config.large_monster_UI.highlighted.enabled;
|
||||
|
||||
config.current_config.large_monster_UI.dynamic.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.dynamic.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;
|
||||
end
|
||||
end
|
||||
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.large_monster_dynamic_UI) then
|
||||
config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled;
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI.key) then
|
||||
config.current_config.large_monster_UI.dynamic.enabled = not config.current_config.large_monster_UI.dynamic.enabled;
|
||||
end
|
||||
end
|
||||
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.large_monster_static_UI) then
|
||||
config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled;
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI.key) then
|
||||
config.current_config.large_monster_UI.static.enabled = not config.current_config.large_monster_UI.static.enabled;
|
||||
end
|
||||
end
|
||||
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.large_monster_highlighted_UI) then
|
||||
config.current_config.large_monster_UI.highlighted.enabled = not config.current_config.large_monster_UI.highlighted.enabled;
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI.key) then
|
||||
config.current_config.large_monster_UI.highlighted.enabled = not config.current_config.large_monster_UI.highlighted.enabled;
|
||||
end
|
||||
end
|
||||
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.time_UI) then
|
||||
config.current_config.time_UI.enabled = not config.current_config.time_UI.enabled;
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.time_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.time_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.time_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.time_UI.key) then
|
||||
config.current_config.time_UI.enabled = not config.current_config.time_UI.enabled;
|
||||
end
|
||||
end
|
||||
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys.damage_meter_UI) then
|
||||
config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled;
|
||||
if not (config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.ctrl and not keyboard.hotkey_modifiers_down.ctrl)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.shift and not keyboard.hotkey_modifiers_down.shift)
|
||||
and not (config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.alt and not keyboard.hotkey_modifiers_down.alt) then
|
||||
if get_release_method:call(hard_keyboard, config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.key) then
|
||||
config.current_config.damage_meter_UI.enabled = not config.current_config.damage_meter_UI.enabled;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function keyboard.get_hotkey_name(hotkey)
|
||||
local hotkey_name = "";
|
||||
|
||||
if hotkey.ctrl then
|
||||
hotkey_name = "Ctrl + ";
|
||||
end
|
||||
|
||||
if hotkey.shift then
|
||||
hotkey_name = hotkey_name .. "Shift + ";
|
||||
end
|
||||
|
||||
if hotkey.alt then
|
||||
hotkey_name = hotkey_name .. "Alt + ";
|
||||
end
|
||||
|
||||
return hotkey_name .. tostring(keyboard.keys[hotkey.key]);
|
||||
end
|
||||
|
||||
function keyboard.init_module()
|
||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||
|
||||
@@ -24,8 +24,8 @@ function config.init()
|
||||
},
|
||||
|
||||
modifiers = {
|
||||
global_position_modifier = 2,
|
||||
global_scale_modifier = 2
|
||||
global_position_modifier = 1,
|
||||
global_scale_modifier = 1
|
||||
},
|
||||
|
||||
performance = {
|
||||
@@ -60,15 +60,62 @@ function config.init()
|
||||
}
|
||||
},
|
||||
|
||||
hotkeys = {
|
||||
all_UI = 0,
|
||||
small_monster_UI = 0,
|
||||
large_monster_UI = 0,
|
||||
large_monster_dynamic_UI = 0,
|
||||
large_monster_static_UI = 0,
|
||||
large_monster_highlighted_UI = 0,
|
||||
time_UI = 0,
|
||||
damage_meter_UI = 0,
|
||||
hotkeys_with_modifiers = {
|
||||
all_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
},
|
||||
|
||||
small_monster_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
},
|
||||
|
||||
large_monster_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
},
|
||||
|
||||
large_monster_dynamic_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
},
|
||||
|
||||
large_monster_static_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
},
|
||||
|
||||
large_monster_highlighted_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
},
|
||||
|
||||
time_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
},
|
||||
|
||||
damage_meter_UI = {
|
||||
shift = false,
|
||||
ctrl = false,
|
||||
alt = false,
|
||||
key = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2026,7 +2073,7 @@ function config.init_module()
|
||||
|
||||
config.init();
|
||||
config.load();
|
||||
config.current_config.version = "v1.9";
|
||||
config.current_config.version = "v1.9.1";
|
||||
|
||||
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false));
|
||||
|
||||
|
||||
@@ -299,8 +299,9 @@ local get_transform_method = sdk.find_type_definition("via.GameObject"):get_meth
|
||||
local get_position_method = sdk.find_type_definition("via.Transform"):get_method("get_Position")
|
||||
|
||||
function large_monster.update_position(enemy)
|
||||
if not config.current_config.large_monster_UI.dynamic.enabled and
|
||||
not config.current_config.large_monster_UI.static.enabled then
|
||||
if not config.current_config.large_monster_UI.dynamic.enabled
|
||||
and not config.current_config.large_monster_UI.static.enabled
|
||||
and not config.current_config.large_monster_UI.highlighted.enabled then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -341,8 +342,9 @@ end
|
||||
|
||||
function large_monster.update(enemy)
|
||||
-- maybe more checks are needed here i'm not fully aware of how the code flows here
|
||||
if not config.current_config.large_monster_UI.dynamic.enabled and
|
||||
not config.current_config.large_monster_UI.static.enabled then
|
||||
if not config.current_config.large_monster_UI.dynamic.enabled
|
||||
and not config.current_config.large_monster_UI.static.enabled
|
||||
and not config.current_config.large_monster_UI.highlighted.enabled then
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
@@ -283,7 +283,10 @@ function customization_menu.draw()
|
||||
if imgui.tree_node(language.current_language.customization_menu.hotkeys) then
|
||||
if customization_menu.all_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.all_UI = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.key = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.all_UI.ctrl = 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;
|
||||
customization_menu.all_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.all_UI) then
|
||||
@@ -301,13 +304,16 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.all_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.all_UI));
|
||||
|
||||
|
||||
|
||||
if customization_menu.small_monster_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.small_monster_UI = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.key = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI.ctrl = 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;
|
||||
customization_menu.small_monster_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.small_monster_UI) then
|
||||
@@ -327,13 +333,16 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.small_monster_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.small_monster_UI));
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_UI = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.key = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI.ctrl = 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;
|
||||
customization_menu.large_monster_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_UI) then
|
||||
@@ -351,13 +360,16 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_UI));
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_dynamic_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_dynamic_UI = 0;
|
||||
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.ctrl = 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;
|
||||
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_dynamic_UI) then
|
||||
@@ -375,13 +387,16 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_dynamic_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_dynamic_UI));
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_static_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_static_UI = 0;
|
||||
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.ctrl = 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;
|
||||
customization_menu.large_monster_static_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_static_UI) then
|
||||
@@ -399,13 +414,16 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_static_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_static_UI));
|
||||
|
||||
|
||||
|
||||
if customization_menu.large_monster_highlighted_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.large_monster_highlighted_UI = 0;
|
||||
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.ctrl = 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;
|
||||
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.large_monster_highlighted_UI) then
|
||||
@@ -423,13 +441,16 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.large_monster_highlighted_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.large_monster_highlighted_UI));
|
||||
|
||||
|
||||
|
||||
if customization_menu.time_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.time_UI = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.key = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.time_UI.ctrl = 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;
|
||||
customization_menu.time_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.time_UI) then
|
||||
@@ -447,13 +468,16 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.time_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.time_UI));
|
||||
|
||||
|
||||
|
||||
if customization_menu.damage_meter_UI_waiting_for_key then
|
||||
if imgui.button(language.current_language.customization_menu.press_any_key) then
|
||||
config.current_config.global_settings.hotkeys.damage_meter_UI = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.key = 0;
|
||||
config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI.ctrl = 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;
|
||||
customization_menu.damage_meter_UI_waiting_for_key = false;
|
||||
end
|
||||
elseif imgui.button(language.current_language.customization_menu.damage_meter_UI) then
|
||||
@@ -471,7 +495,7 @@ function customization_menu.draw()
|
||||
end
|
||||
|
||||
imgui.same_line();
|
||||
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.damage_meter_UI]);
|
||||
imgui.text(keyboard.get_hotkey_name(config.current_config.global_settings.hotkeys_with_modifiers.damage_meter_UI));
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user