mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-25 04:48:22 -08:00
Bugfixes
Menu Font handling improved; Damage Meter UI: Normal Sorting Fixed;
This commit is contained in:
@@ -274,9 +274,9 @@ end
|
|||||||
local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager");
|
local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager");
|
||||||
local find_master_player_method = player_manager_type_def:get_method("findMasterPlayer");
|
local find_master_player_method = player_manager_type_def:get_method("findMasterPlayer");
|
||||||
|
|
||||||
local get_game_object_method = sdk.find_type_definition("via.Component"):get_method("get_GameObject")
|
local get_game_object_method = sdk.find_type_definition("via.Component"):get_method("get_GameObject");
|
||||||
local get_transform_method = sdk.find_type_definition("via.GameObject"):get_method("get_Transform")
|
local get_transform_method = sdk.find_type_definition("via.GameObject"):get_method("get_Transform");
|
||||||
local get_position_method = sdk.find_type_definition("via.Transform"):get_method("get_Position")
|
local get_position_method = sdk.find_type_definition("via.Transform"):get_method("get_Position");
|
||||||
|
|
||||||
function player.update_myself_position()
|
function player.update_myself_position()
|
||||||
if singletons.player_manager == nil then
|
if singletons.player_manager == nil then
|
||||||
|
|||||||
@@ -336,7 +336,11 @@ language.default_language = {
|
|||||||
loss_health = "Sever Health",
|
loss_health = "Sever Health",
|
||||||
loss_health_percentage = "Sever Health Percentage",
|
loss_health_percentage = "Sever Health Percentage",
|
||||||
|
|
||||||
monster_id = "Monster ID"
|
monster_id = "Monster ID",
|
||||||
|
|
||||||
|
apply = "Apply",
|
||||||
|
|
||||||
|
menu_font_change_disclaimer = "Changing Language and Menu Font Size several times will cause a crash!"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -90,13 +90,14 @@ function damage_meter_UI.draw()
|
|||||||
if not damage_meter_UI.freeze_displayed_players then
|
if not damage_meter_UI.freeze_displayed_players then
|
||||||
if #quest_players ~= 0 then
|
if #quest_players ~= 0 then
|
||||||
-- sort here
|
-- sort here
|
||||||
if cached_config.sorting.type == "Normal" and cached_config.sorting.reversed_order then
|
if cached_config.sorting.type == "Normal" then
|
||||||
|
if cached_config.sorting.reversed_order then
|
||||||
local reversed_quest_players = {};
|
local reversed_quest_players = {};
|
||||||
for i = #quest_players, 1, -1 do
|
for i = #quest_players, 1, -1 do
|
||||||
table.insert(reversed_quest_players, quest_players[i]);
|
table.insert(reversed_quest_players, quest_players[i]);
|
||||||
|
end
|
||||||
|
quest_players = reversed_quest_players;
|
||||||
end
|
end
|
||||||
quest_players = reversed_quest_players;
|
|
||||||
elseif cached_config.sorting.type == "DPS" then
|
elseif cached_config.sorting.type == "DPS" then
|
||||||
if cached_config.sorting.reversed_order then
|
if cached_config.sorting.reversed_order then
|
||||||
table.sort(quest_players, function(left, right)
|
table.sort(quest_players, function(left, right)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ customization_menu.window_size = Vector2f.new(720, 720);
|
|||||||
customization_menu.window_flags = 0x10120;
|
customization_menu.window_flags = 0x10120;
|
||||||
|
|
||||||
customization_menu.color_picker_flags = 327680;
|
customization_menu.color_picker_flags = 327680;
|
||||||
|
customization_menu.decimal_input_flags = 33;
|
||||||
|
|
||||||
customization_menu.selected_language_index = 1;
|
customization_menu.selected_language_index = 1;
|
||||||
|
|
||||||
@@ -129,25 +130,20 @@ customization_menu.time_UI_waiting_for_key = false;
|
|||||||
customization_menu.damage_meter_UI_waiting_for_key = false;
|
customization_menu.damage_meter_UI_waiting_for_key = false;
|
||||||
customization_menu.endemic_life_UI_waiting_for_key = false;
|
customization_menu.endemic_life_UI_waiting_for_key = false;
|
||||||
|
|
||||||
|
customization_menu.menu_font_changed = false;
|
||||||
|
|
||||||
function customization_menu.reload_font(pop_push)
|
function customization_menu.reload_font(pop_push)
|
||||||
local success, new_font = pcall(imgui.load_font, language.current_language.font_name,
|
customization_menu.font = imgui.load_font(language.current_language.font_name, config.current_config.global_settings.menu_font.size, customization_menu.font_range);
|
||||||
config.current_config.global_settings.menu_font.size, customization_menu.font_range);
|
|
||||||
if success then
|
|
||||||
if pop_push then
|
|
||||||
imgui.pop_font(customization_menu.font);
|
|
||||||
end
|
|
||||||
|
|
||||||
customization_menu.font = new_font;
|
if pop_push then
|
||||||
|
imgui.pop_font();
|
||||||
if pop_push then
|
imgui.push_font(customization_menu.font);
|
||||||
imgui.push_font(customization_menu.font);
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function customization_menu.init()
|
function customization_menu.init()
|
||||||
customization_menu.reload_font(false);
|
|
||||||
|
|
||||||
customization_menu.selected_language_index = table_helpers.find_index(language.language_names,
|
customization_menu.selected_language_index = table_helpers.find_index(language.language_names,
|
||||||
config.current_config.global_settings.language, false);
|
config.current_config.global_settings.language, false);
|
||||||
|
|
||||||
@@ -394,6 +390,8 @@ function customization_menu.draw()
|
|||||||
local damage_meter_UI_changed = false;
|
local damage_meter_UI_changed = false;
|
||||||
local endemic_life_UI_changed = false;
|
local endemic_life_UI_changed = false;
|
||||||
|
|
||||||
|
local apply_font_requested = false;
|
||||||
|
|
||||||
local status_string = tostring(customization_menu.status);
|
local status_string = tostring(customization_menu.status);
|
||||||
imgui.text(language.current_language.customization_menu.status .. ": " .. status_string);
|
imgui.text(language.current_language.customization_menu.status .. ": " .. status_string);
|
||||||
|
|
||||||
@@ -696,16 +694,18 @@ function customization_menu.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if imgui.tree_node(language.current_language.customization_menu.global_settings) then
|
if imgui.tree_node(language.current_language.customization_menu.global_settings) then
|
||||||
changed, customization_menu.selected_language_index = imgui.combo(language.current_language.customization_menu.language
|
imgui.text(language.current_language.customization_menu.menu_font_change_disclaimer);
|
||||||
|
|
||||||
|
changed, customization_menu.selected_language_index = imgui.combo(language.current_language.customization_menu.language .. "*"
|
||||||
, customization_menu.selected_language_index, language.language_names);
|
, customization_menu.selected_language_index, language.language_names);
|
||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
if changed then
|
if changed then
|
||||||
config.current_config.global_settings.language = language.language_names[customization_menu.selected_language_index];
|
config.current_config.global_settings.language = language.language_names[customization_menu.selected_language_index];
|
||||||
language.update(customization_menu.selected_language_index);
|
language.update(customization_menu.selected_language_index);
|
||||||
|
|
||||||
imgui.pop_font(customization_menu.font);
|
|
||||||
customization_menu.init();
|
customization_menu.init();
|
||||||
imgui.push_font(customization_menu.font);
|
apply_font_requested = true;
|
||||||
|
customization_menu.menu_font_changed = true;
|
||||||
|
|
||||||
part_names.init();
|
part_names.init();
|
||||||
large_monster.init_list();
|
large_monster.init_list();
|
||||||
@@ -720,15 +720,25 @@ function customization_menu.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if imgui.tree_node(language.current_language.customization_menu.menu_font) then
|
if imgui.tree_node(language.current_language.customization_menu.menu_font) then
|
||||||
changed, config.current_config.global_settings.menu_font.size = imgui.slider_int(" ",
|
local new_value = config.current_config.global_settings.menu_font.size;
|
||||||
config.current_config.global_settings.menu_font.size, 5, 100);
|
changed, new_value = imgui.input_text(" ", config.current_config.global_settings.menu_font.size, customization_menu.decimal_input_flags);
|
||||||
config_changed = config_changed or changed;
|
new_value = tonumber(new_value);
|
||||||
imgui.same_line();
|
|
||||||
|
if new_value ~= nil then
|
||||||
|
if new_value < 5 then
|
||||||
|
new_value = 5;
|
||||||
|
elseif new_value > 100 then
|
||||||
|
new_value = 100;
|
||||||
|
end
|
||||||
|
|
||||||
if changed then
|
config.current_config.global_settings.menu_font.size = math.floor(new_value);
|
||||||
customization_menu.reload_font(true);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config_changed = config_changed or changed;
|
||||||
|
customization_menu.menu_font_changed = customization_menu.menu_font_changed or changed;
|
||||||
|
|
||||||
|
imgui.same_line();
|
||||||
|
|
||||||
changed = imgui.button("-");
|
changed = imgui.button("-");
|
||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
imgui.same_line();
|
imgui.same_line();
|
||||||
@@ -738,7 +748,7 @@ function customization_menu.draw()
|
|||||||
if config.current_config.global_settings.menu_font.size < 5 then
|
if config.current_config.global_settings.menu_font.size < 5 then
|
||||||
config.current_config.global_settings.menu_font.size = 5;
|
config.current_config.global_settings.menu_font.size = 5;
|
||||||
else
|
else
|
||||||
customization_menu.reload_font(true);
|
customization_menu.menu_font_changed = customization_menu.menu_font_changed or changed;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -751,11 +761,15 @@ function customization_menu.draw()
|
|||||||
if config.current_config.global_settings.menu_font.size > 100 then
|
if config.current_config.global_settings.menu_font.size > 100 then
|
||||||
config.current_config.global_settings.menu_font.size = 100;
|
config.current_config.global_settings.menu_font.size = 100;
|
||||||
else
|
else
|
||||||
customization_menu.reload_font(true);
|
customization_menu.menu_font_changed = customization_menu.menu_font_changed or changed;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
imgui.text(language.current_language.customization_menu.size);
|
imgui.text(language.current_language.customization_menu.size .. "*");
|
||||||
|
|
||||||
|
if imgui.button(language.current_language.customization_menu.apply) then
|
||||||
|
apply_font_requested = true;
|
||||||
|
end
|
||||||
|
|
||||||
imgui.tree_pop();
|
imgui.tree_pop();
|
||||||
end
|
end
|
||||||
@@ -16183,7 +16197,7 @@ function customization_menu.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
imgui.end_window();
|
imgui.end_window();
|
||||||
imgui.pop_font(customization_menu.font);
|
imgui.pop_font();
|
||||||
|
|
||||||
if small_monster_UI_changed or modifiers_changed then
|
if small_monster_UI_changed or modifiers_changed then
|
||||||
for _, monster in pairs(small_monster.list) do
|
for _, monster in pairs(small_monster.list) do
|
||||||
@@ -16226,6 +16240,11 @@ function customization_menu.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if customization_menu.menu_font_changed and apply_font_requested then
|
||||||
|
customization_menu.menu_font_changed = false;
|
||||||
|
customization_menu.reload_font(false);
|
||||||
|
end
|
||||||
|
|
||||||
if config_changed then
|
if config_changed then
|
||||||
config.save();
|
config.save();
|
||||||
end
|
end
|
||||||
@@ -16245,6 +16264,7 @@ function customization_menu.init_module()
|
|||||||
keyboard = require("MHR_Overlay.Game_Handler.keyboard");
|
keyboard = require("MHR_Overlay.Game_Handler.keyboard");
|
||||||
|
|
||||||
customization_menu.init();
|
customization_menu.init();
|
||||||
|
customization_menu.reload_font(false);
|
||||||
end
|
end
|
||||||
|
|
||||||
return customization_menu;
|
return customization_menu;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
"ailments": "Ailments",
|
"ailments": "Ailments",
|
||||||
"all_UI": "All UI",
|
"all_UI": "All UI",
|
||||||
"anchor": "Anchor",
|
"anchor": "Anchor",
|
||||||
|
"apply": "Apply",
|
||||||
"assign_new_key": "Assign new key",
|
"assign_new_key": "Assign new key",
|
||||||
"background": "Background",
|
"background": "Background",
|
||||||
"bar": "Bar",
|
"bar": "Bar",
|
||||||
@@ -137,6 +138,7 @@
|
|||||||
"max_monster_updates_per_tick": "Max Monster Updates per Tick",
|
"max_monster_updates_per_tick": "Max Monster Updates per Tick",
|
||||||
"me": "Me",
|
"me": "Me",
|
||||||
"menu_font": "Menu Font",
|
"menu_font": "Menu Font",
|
||||||
|
"menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!",
|
||||||
"mod_name": "MHR Overlay",
|
"mod_name": "MHR Overlay",
|
||||||
"modifiers": "Modifiers",
|
"modifiers": "Modifiers",
|
||||||
"module_visibility_on_different_screens": "Module Visibility on Different Screens",
|
"module_visibility_on_different_screens": "Module Visibility on Different Screens",
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
"ailments": "상태이상",
|
"ailments": "상태이상",
|
||||||
"all_UI": "모든 UI",
|
"all_UI": "모든 UI",
|
||||||
"anchor": "기준",
|
"anchor": "기준",
|
||||||
|
"apply": "Apply",
|
||||||
"assign_new_key": "새 키를 할당",
|
"assign_new_key": "새 키를 할당",
|
||||||
"background": "배경색",
|
"background": "배경색",
|
||||||
"bar": "막대",
|
"bar": "막대",
|
||||||
@@ -137,6 +138,7 @@
|
|||||||
"max_monster_updates_per_tick": "틱당 갱신할 최대 몬스터",
|
"max_monster_updates_per_tick": "틱당 갱신할 최대 몬스터",
|
||||||
"me": "나",
|
"me": "나",
|
||||||
"menu_font": "메뉴 글꼴",
|
"menu_font": "메뉴 글꼴",
|
||||||
|
"menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!",
|
||||||
"mod_name": "MHR Overlay",
|
"mod_name": "MHR Overlay",
|
||||||
"modifiers": "설정 배율",
|
"modifiers": "설정 배율",
|
||||||
"module_visibility_on_different_screens": "상황별 모듈 표시",
|
"module_visibility_on_different_screens": "상황별 모듈 표시",
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
"ailments": "Аномальные статусы",
|
"ailments": "Аномальные статусы",
|
||||||
"all_UI": "Весь интерфейс",
|
"all_UI": "Весь интерфейс",
|
||||||
"anchor": "Привязка",
|
"anchor": "Привязка",
|
||||||
|
"apply": "Apply",
|
||||||
"assign_new_key": "Привязать клавишу",
|
"assign_new_key": "Привязать клавишу",
|
||||||
"background": "Фон",
|
"background": "Фон",
|
||||||
"bar": "Шкала",
|
"bar": "Шкала",
|
||||||
@@ -137,6 +138,7 @@
|
|||||||
"max_monster_updates_per_tick": "Макс. кол-во обновлений за тик",
|
"max_monster_updates_per_tick": "Макс. кол-во обновлений за тик",
|
||||||
"me": "Я",
|
"me": "Я",
|
||||||
"menu_font": "Шрифт меню",
|
"menu_font": "Шрифт меню",
|
||||||
|
"menu_font_change_disclaimer": "Изменение языка и размера шрифта меню несколько раз приведёт к вылету!",
|
||||||
"mod_name": "MHR Overlay",
|
"mod_name": "MHR Overlay",
|
||||||
"modifiers": "Модификаторы",
|
"modifiers": "Модификаторы",
|
||||||
"module_visibility_on_different_screens": "Видимость модулей на разных экранах",
|
"module_visibility_on_different_screens": "Видимость модулей на разных экранах",
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
"ailments": "状态异常",
|
"ailments": "状态异常",
|
||||||
"all_UI": "所有UI",
|
"all_UI": "所有UI",
|
||||||
"anchor": "锚点",
|
"anchor": "锚点",
|
||||||
|
"apply": "Apply",
|
||||||
"assign_new_key": "指定新按键",
|
"assign_new_key": "指定新按键",
|
||||||
"background": "背景",
|
"background": "背景",
|
||||||
"bar": "状态条",
|
"bar": "状态条",
|
||||||
@@ -137,6 +138,7 @@
|
|||||||
"max_monster_updates_per_tick": "每次更新的最大怪物数量",
|
"max_monster_updates_per_tick": "每次更新的最大怪物数量",
|
||||||
"me": "我",
|
"me": "我",
|
||||||
"menu_font": "菜单字体",
|
"menu_font": "菜单字体",
|
||||||
|
"menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!",
|
||||||
"mod_name": "MHR Overlay",
|
"mod_name": "MHR Overlay",
|
||||||
"modifiers": "更改项",
|
"modifiers": "更改项",
|
||||||
"module_visibility_on_different_screens": "不同场景中使用的模块",
|
"module_visibility_on_different_screens": "不同场景中使用的模块",
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
"ailments": "異常狀態",
|
"ailments": "異常狀態",
|
||||||
"all_UI": "全部UI",
|
"all_UI": "全部UI",
|
||||||
"anchor": "錨點",
|
"anchor": "錨點",
|
||||||
|
"apply": "Apply",
|
||||||
"assign_new_key": "指定新按鍵",
|
"assign_new_key": "指定新按鍵",
|
||||||
"background": "圖形化顯示條的背景底色",
|
"background": "圖形化顯示條的背景底色",
|
||||||
"bar": "圖形化顯示條",
|
"bar": "圖形化顯示條",
|
||||||
@@ -137,6 +138,7 @@
|
|||||||
"max_monster_updates_per_tick": "每次更新的最大魔物數量",
|
"max_monster_updates_per_tick": "每次更新的最大魔物數量",
|
||||||
"me": "我",
|
"me": "我",
|
||||||
"menu_font": "選單字體大小",
|
"menu_font": "選單字體大小",
|
||||||
|
"menu_font_change_disclaimer": "Changing Language and Menu Font Size several times will cause a crash!",
|
||||||
"mod_name": "MHR Overlay",
|
"mod_name": "MHR Overlay",
|
||||||
"modifiers": "更改項",
|
"modifiers": "更改項",
|
||||||
"module_visibility_on_different_screens": "不同場景中使用的模組",
|
"module_visibility_on_different_screens": "不同場景中使用的模組",
|
||||||
|
|||||||
Reference in New Issue
Block a user