Added hotkeys, separated player initialization and drawing.

This commit is contained in:
GreenComfyTea
2022-02-20 19:23:36 +02:00
parent 39e324e0a5
commit c6669e5df0
25 changed files with 1458 additions and 361 deletions

View File

@@ -1,5 +1,6 @@
x = "";
local keyboard = require("MHR_Overlay.Game_Handler.keyboard");
local quest_status = require("MHR_Overlay.Game_Handler.quest_status");
local screen = require("MHR_Overlay.Game_Handler.screen");
local singletons = require("MHR_Overlay.Game_Handler.singletons");
@@ -65,6 +66,8 @@ large_monster_UI.init_module();
small_monster_UI.init_module();
time_UI.init_module();
keyboard.init_module();
log.info("[MHR Overlay] loaded");
-- #endregion
------------------------INIT MODULES-------------------------
@@ -78,7 +81,6 @@ re.on_draw_ui(function()
end);
re.on_frame(function()
if not reframework:is_drawing_ui() then
customization_menu.is_opened = false;
end
@@ -86,6 +88,8 @@ re.on_frame(function()
if customization_menu.is_opened then
pcall(customization_menu.draw);
end
keyboard.update();
end);
re.on_frame(function()
@@ -106,8 +110,20 @@ end, function()
singletons.init();
player.update_myself_position();
quest_status.update_is_online();
quest_status.update_is_result_screen();
time.tick();
if quest_status.index < 2 then
player.update_player_list_in_village();
else
player.update_player_list_on_quest();
end
--onQuestEnd()
--onQuestErrorEnd()
--onResultEnd()
--resultEndSub()
if quest_status.index < 2 then
quest_status.update_is_training_area();
@@ -130,8 +146,40 @@ end, function()
end
end
end
elseif quest_status.is_result_screen then
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI then
local success = pcall(small_monster_UI.draw);
if not success then
customization_menu.status = "Small monster drawing function threw an exception";
end
end
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI;
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
if not success then
customization_menu.status = "Large monster drawing function threw an exception";
end
end
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.time_UI then
local success = pcall(time_UI.draw);
if not success then
customization_menu.status = "Time drawing function threw an exception";
end
end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = "Damage meter drawing function threw an exception";
end
end
elseif quest_status.index == 2 then
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.during_quest.small_monster_UI then
local success = pcall(small_monster_UI.draw);
if not success then
@@ -165,37 +213,5 @@ end, function()
customization_menu.status = "Damage meter drawing function threw an exception";
end
end
elseif quest_status.index > 2 then
if config.current_config.small_monster_UI.enabled and config.current_config.global_settings.module_visibility.quest_summary_screen.small_monster_UI then
local success = pcall(small_monster_UI.draw);
if not success then
customization_menu.status = "Small monster drawing function threw an exception";
end
end
local dynamic_enabled = config.current_config.large_monster_UI.dynamic.enabled and config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_dynamic_UI;
local static_enabled = config.current_config.large_monster_UI.static.enabled and config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_static_UI;
local highlighted_enabled = config.current_config.large_monster_UI.highlighted.enabled and config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_highlighted_UI;
if dynamic_enabled or static_enabled or highlighted_enabled then
local success = pcall(large_monster_UI.draw, dynamic_enabled, static_enabled, highlighted_enabled);
if not success then
customization_menu.status = "Large monster drawing function threw an exception";
end
end
if config.current_config.time_UI.enabled and config.current_config.global_settings.module_visibility.quest_summary_screen.time_UI then
local success = pcall(time_UI.draw);
if not success then
customization_menu.status = "Time drawing function threw an exception";
end
end
if config.current_config.damage_meter_UI.enabled and config.current_config.global_settings.module_visibility.quest_summary_screen.damage_meter_UI then
local success = pcall(damage_meter_UI.draw);
if not success then
customization_menu.status = "Damage meter drawing function threw an exception";
end
end
end
end);

View File

@@ -5,10 +5,12 @@ local singletons;
local customization_menu;
local damage_UI_entity;
local time;
local quest_status;
local drawing;
local language;
player.list = {};
player.myself = nil;
player.myself_id = nil;
player.myself_position = Vector3f.new(0, 0, 0);
player.total = nil;
@@ -18,7 +20,7 @@ function player.new(player_id, player_name, player_hunter_rank)
new_player.name = player_name;
new_player.hunter_rank = player_hunter_rank;
new_player.join_time = time.total_elapsed_seconds;
new_player.join_time = -1;
new_player.first_hit_time = -1;
new_player.dps = 0;
@@ -102,16 +104,17 @@ function player.new(player_id, player_name, player_hunter_rank)
new_player.display.elemental_damage = 0;
new_player.display.ailment_damage = 0;
player.init_UI(new_player);
if player_name == "Total" then
player.init_total_UI(new_player);
else
player.init_UI(new_player);
end
return new_player;
end
function player.get_player(player_id)
if player.list[player_id] == nil then
return nil;
end
return player.list[player_id];
end
@@ -262,8 +265,194 @@ function player.update_myself_position()
player.myself_position = master_player_position;
end
function player.init_total()
function player.init()
player.list = {};
player.total = player.new(0, "Total", 0);
player.myself = player.new(-1, "Dummy", -1);
end
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
local my_hunter_info_field = lobby_manager_type_def:get_field("_myHunterInfo");
local myself_index_field = lobby_manager_type_def:get_field("_myselfIndex");
local myself_quest_index_field = lobby_manager_type_def:get_field("_myselfQuestIndex");
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
local hunter_info_field = lobby_manager_type_def:get_field("_hunterInfo");
local my_hunter_info_type_def = my_hunter_info_field:get_type();
local name_field = my_hunter_info_type_def:get_field("_name");
local member_index_field = my_hunter_info_type_def:get_field("_memberIndex");
local hunter_rank_field = my_hunter_info_type_def:get_field("_hunterRank");
local hunter_info_type_def = hunter_info_field:get_type();
local get_count_method = hunter_info_type_def:get_method("get_Count");
local get_item_method = hunter_info_type_def:get_method("get_Item");
local progress_manager_type_def = sdk.find_type_definition("snow.progress.ProgressManager");
local get_hunter_rank_method = progress_manager_type_def:get_method("get_HunterRank");
function player.update_player_list_in_village()
if singletons.lobby_manager == nil then
return;
end
if singletons.progress_manager == nil then
return;
end
-- myself player
local myself_player_info = my_hunter_info_field:get_data(singletons.lobby_manager);
if myself_player_info == nil then
customization_menu.status = "No myself player info list";
return;
end
local myself_player_name = name_field:get_data(myself_player_info);
if myself_player_name == nil then
customization_menu.status = "No myself player name";
return;
end
local myself_hunter_rank = get_hunter_rank_method:call(singletons.progress_manager);
if myself_hunter_rank == nil then
customization_menu.status = "No myself hunter rank";
myself_hunter_rank = 0;
end
local myself_id = myself_index_field:get_data(singletons.lobby_manager);
if myself_id == nil then
customization_menu.status = "No myself player id";
elseif player.myself == nil or myself_id ~= player.myself.id then
player.myself = player.new(myself_id, myself_player_name, myself_hunter_rank);
player.list[myself_id] = player.myself;
end
-- other players
local player_info_list = hunter_info_field:get_data(singletons.lobby_manager);
if player_info_list == nil then
customization_menu.status = "No player info list";
return;
end
local count = get_count_method:call(player_info_list);
if count == nil then
customization_menu.status = "No player info list count";
return;
end
for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then
goto continue
end
local player_id = member_index_field:get_data(player_info);
if player_id == nil then
goto continue
end
local player_hunter_rank = hunter_rank_field:get_data(player_info);
if player_hunter_rank == nil then
goto continue
end
local player_name = name_field:get_data(player_info);
if player_name == nil then
goto continue
end
if player.myself.id == player_id then
player.list[player_id] = player.myself;
elseif player.list[player_id] == nil or player.list[player_id].name ~= player_name then
player.list[player_id] = player.new(player_id, player_name, player_hunter_rank);
end
::continue::
end
end
function player.update_player_list_on_quest()
if singletons.lobby_manager == nil then
return;
end
if singletons.progress_manager == nil then
return;
end
-- myself player
local myself_player_info = my_hunter_info_field:get_data(singletons.lobby_manager);
if myself_player_info == nil then
customization_menu.status = "No myself player info list";
return;
end
local myself_player_name = name_field:get_data(myself_player_info);
if myself_player_name == nil then
customization_menu.status = "No myself player name";
return;
end
local myself_hunter_rank = get_hunter_rank_method:call(singletons.progress_manager);
if myself_hunter_rank == nil then
customization_menu.status = "No myself hunter rank";
myself_hunter_rank = 0;
end
local myself_id = myself_quest_index_field:get_data(singletons.lobby_manager);
if myself_id == nil then
customization_menu.status = "No myself player quest id";
elseif player.myself == nil or myself_id ~= player.myself.id then
player.myself = player.new(myself_id, myself_player_name, myself_hunter_rank);
player.list[myself_id] = player.myself;
end
-- other players
local player_info_list = quest_hunter_info_field:get_data(singletons.lobby_manager);
if player_info_list == nil then
customization_menu.status = "No player info list";
return;
end
local count = get_count_method:call(player_info_list);
if count == nil then
customization_menu.status = "No player info list count";
return;
end
for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then
goto continue
end
local player_id = member_index_field:get_data(player_info);
x = player_info
if player_id == nil then
goto continue
end
local player_hunter_rank = hunter_rank_field:get_data(player_info);
if player_hunter_rank == nil then
goto continue
end
local player_name = name_field:get_data(player_info);
if player_name == nil then
goto continue
end
if player.myself.id == player_id then
player.list[player_id] = player.myself;
elseif player.list[player_id] == nil or player.list[player_id].name ~= player_name then
player.list[player_id] = player.new(player_id, player_name, player_hunter_rank);
end
::continue::
end
end
function player.init_UI(_player)
@@ -278,10 +467,33 @@ function player.init_UI(_player)
);
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)
};
_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;
end
function player.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps);
end
function player.draw_total(position_on_screen, opacity_scale)
drawing.draw_label(player.total.damage_UI.total_damage_label, position_on_screen, opacity_scale, language.current_language.UI.total_damage);
drawing.draw_label(player.total.damage_UI.total_damage_value_label, position_on_screen, opacity_scale, player.total.display.total_damage);
drawing.draw_label(player.total.damage_UI.total_dps_label, position_on_screen, opacity_scale, player.total.dps);
end
function player.init_module()
config = require("MHR_Overlay.Misc.config");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
@@ -289,8 +501,11 @@ function player.init_module()
customization_menu = require("MHR_Overlay.UI.customization_menu");
damage_UI_entity = require("MHR_Overlay.UI.UI_Entities.damage_UI_entity");
time = require("MHR_Overlay.Game_Handler.time");
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
player.init_total();
player.init();
end
return player;

View File

@@ -0,0 +1,449 @@
local config = require "MHR_Overlay.Misc.config"
local keyboard = {};
local singletons;
local customization_menu;
local player;
local small_monster;
local large_monster;
local damage_meter_UI;
local time;
local game_keyboard_type_def = sdk.find_type_definition("snow.GameKeyboard");
local hard_keyboard_field = game_keyboard_type_def:get_field("hardKeyboard");
local hard_keyboard_field_type_def = hard_keyboard_field:get_type();
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.keys = {
[0] = "None",
[1] = "Left Mouse Button",
[2] = "Right Mouse Button",
[3] = "Control-Break",
[4] = "Middle Mouse Button",
[5] = "X1 Mouse Button",
[6] = "X2 Mouse Button",
--[7] = "Undefined 7",
[8] = "Backspace",
[9] = "Tab",
--[10] = "Reserved 10",
--[11] = "Reserved 11",
[12] = "Clear",
[13] = "Enter",
--[14] = "Undefined 14",
--[15] = "Undefined 15",
[16] = "Shift",
[17] = "Ctrl",
[18] = "Alt",
[19] = "Pause Break",
[20] = "Caps Lock",
[21] = "IME Kana/Hanguel/Hangul Mode",
[22] = "IME On",
[23] = "IME Junja Mode",
[24] = "IME Final Mode",
[25] = "IME Hanja/Kanji Mode",
[26] = "IME On",
[27] = "Esc",
[28] = "IME Convert",
[29] = "IME NonConvert",
[30] = "IME Accept",
[31] = "IME Mode Change Request",
[32] = "Spacebar",
[33] = "Page Up",
[34] = "Page Down",
[35] = "End",
[36] = "Home",
[37] = "Left Arrow",
[38] = "Up Arrow",
[39] = "Right Arrow",
[40] = "Down Arrow",
[41] = "Select",
[42] = "Print Screen", -- Print
[43] = "Execute",
[44] = "Print Screen",
[45] = "Ins",
[46] = "Del",
[47] = "Help",
[48] = "0",
[49] = "1",
[50] = "2",
[51] = "3",
[52] = "4",
[53] = "5",
[54] = "6",
[55] = "7",
[56] = "8",
[57] = "9",
--[58] = "Undefined 58",
--[59] = "Undefined 59",
--[60] = "Undefined 60",
--[61] = "Undefined 60"", -- =+
--[62] = "Undefined 62",
--[63] = "Undefined 63",
--[64] = "Undefined 64",
[65] = "A",
[66] = "B",
[67] = "C",
[68] = "D",
[69] = "E",
[70] = "F",
[71] = "G",
[72] = "H",
[73] = "I",
[74] = "J",
[75] = "K",
[76] = "L",
[77] = "M",
[78] = "N",
[79] = "O",
[80] = "P",
[81] = "Q",
[82] = "R",
[83] = "S",
[84] = "T",
[85] = "U",
[86] = "V",
[87] = "W",
[88] = "X",
[89] = "Y",
[90] = "Z",
[91] = "Left Win",
[92] = "Right Win",
[93] = "Applications",
--[94] = "Reserved 94",
[95] = "Sleep",
[96] = "Numpad 0",
[97] = "Numpad 1",
[98] = "Numpad 2",
[99] = "Numpad 3",
[100] = "Numpad 4",
[101] = "Numpad 5",
[102] = "Numpad 6",
[103] = "Numpad 7",
[104] = "Numpad 8",
[105] = "Numpad 9",
[106] = "Numpad *",
[107] = "Numpad +",
[108] = "Numpad Separator",
[109] = "Numpad -",
[110] = "Numpad .",
[111] = "Numpad /",
[112] = "F1",
[113] = "F2",
[114] = "F3",
[115] = "F4",
[116] = "F5",
[117] = "F6",
[118] = "F7",
[119] = "F8",
[120] = "F9",
[121] = "F10",
[122] = "F11",
[123] = "F12",
[124] = "F13",
[125] = "F14",
[126] = "F15",
[127] = "F16",
[128] = "F17",
[129] = "F18",
[130] = "F19",
[131] = "F20",
[132] = "F21",
[133] = "F22",
[134] = "F23",
[135] = "F24",
--[136] = "Unassigned 136",
--[137] = "Unassigned 137",
--[138] = "Unassigned 138",
--[139] = "Unassigned 139",
--[140] = "Unassigned 140",
--[141] = "Unassigned 141",
--[142] = "Unassigned 142",
--[143] = "Unassigned 143",
[144] = "Num Lock",
[145] = "Scroll Lock",
[146] = "Numpad Enter", -- OEM Specific 146
[147] = "OEM Specific 147",
[148] = "OEM Specific 148",
[149] = "OEM Specific 149",
[150] = "OEM Specific 150",
[151] = "OEM Specific 151",
[152] = "OEM Specific 152",
[153] = "OEM Specific 153",
[154] = "OEM Specific 154",
[155] = "OEM Specific 155",
[156] = "OEM Specific 156",
[157] = "OEM Specific 157",
[158] = "OEM Specific 158",
[159] = "OEM Specific 159",
[160] = "Left Shift",
[161] = "Right Shift",
[162] = "Left Ctrl",
[163] = "Right Ctrl",
[164] = "Left Alt",
[165] = "Right Alt",
[166] = "Browser Back",
[167] = "Browser Forward",
[168] = "Browser Refresh",
[169] = "Browser Stop",
[170] = "Browser Search",
[171] = "Browser Favourites",
[172] = "Browser Start and Home",
[173] = "Volume Mute",
[174] = "Volume Down",
[175] = "Volume Up",
[176] = "Next Track",
[177] = "Previous Track",
[178] = "Stop Media",
[179] = "Play/Pause Media",
[180] = "Start Mail",
[181] = "Select Media",
[182] = "Start Application 1",
[183] = "Start Application 2",
--[184] = "Reserved!",
--[185] = "Reserved!",
[186] = ";:",
[187] = ";:", -- +
[188] = ",<",
[189] = "-",
[190] = ".>",
[191] = "/?",
[192] = "`~",
--[193] = "Reserved!",
--[194] = "Reserved!",
--[195] = "Reserved!",
--[196] = "Reserved!",
--[197] = "Reserved!",
--[198] = "Reserved!",
--[199] = "Reserved!",
--[200] = "Reserved!",
--[201] = "Reserved!",
--[202] = "Reserved!",
--[203] = "Reserved!",
--[204] = "Reserved!",
--[205] = "Reserved!",
--[206] = "Reserved!",
--[207] = "Reserved!",
--[208] = "Reserved!",
--[209] = "Reserved!",
--[210] = "Reserved!",
--[211] = "Reserved!",
--[212] = "Reserved!",
--[213] = "Reserved!",
--[214] = "Reserved!",
--[215] = "Reserved!",
--[216] = "Unassigned 216",
--[217] = "Unassigned 217",
--[218] = "Unassigned 218",
[219] = "[{",
[220] = "\\|",
[221] = "]}",
[222] = "\' \"",
[223] = "OEM_8",
--[224] = "Reserved",
[225] = "OEM Specific 225",
[226] = "<>",
[227] = "OEM Specific 227",
[228] = "OEM Specific 228",
[229] = "IME Process",
[230] = "OEM Specific 230",
[231] = "!!!!!!!!!!!!!!!!!!!!!!!",
--[232] = "Unassigned 232",
[233] = "OEM Specific 233",
[234] = "OEM Specific 234",
[235] = "OEM Specific 235",
[236] = "OEM Specific 236",
[237] = "OEM Specific 237",
[238] = "OEM Specific 238",
[239] = "OEM Specific 239",
[240] = "OEM Specific 240",
[241] = "OEM Specific 241",
[242] = "OEM Specific 242",
[243] = "OEM Specific 243",
[244] = "OEM Specific 244",
[245] = "OEM Specific 245",
[246] = "Attn",
[247] = "CrSel",
[248] = "ExSel",
[249] = "Erase EOF",
[250] = "Play",
[251] = "Zoom",
--[252] = "Reserved 252",
[253] = "PA1",
--[254] = "Clear"
};
function keyboard.update()
if singletons.game_keyboard == nil then
customization_menu.status = "No game keyboard";
return;
end
local hard_keyboard = hard_keyboard_field:get_data(singletons.game_keyboard);
if hard_keyboard == nil then
customization_menu.status = "No hard keyboard";
return;
end
local new_hotkey_registered = keyboard.register_hotkey(hard_keyboard);
if new_hotkey_registered then
config.save();
else
keyboard.check_hotkeys(hard_keyboard);
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;
customization_menu.all_UI_waiting_for_key = false;
return true;
end
end
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;
customization_menu.small_monster_UI_waiting_for_key = false;
return true;
end
end
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;
customization_menu.large_monster_UI_waiting_for_key = false;
return true;
end
end
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;
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
return true;
end
end
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;
customization_menu.large_monster_static_UI_waiting_for_key = false;
return true;
end
end
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;
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
return true;
end
end
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;
customization_menu.time_UI_waiting_for_key = false;
return true;
end
end
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;
customization_menu.damage_meter_UI_waiting_for_key = false;
return true;
end
end
end
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
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;
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;
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;
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
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;
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;
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;
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;
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;
end
end
function keyboard.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
player = require("MHR_Overlay.Damage_Meter.player");
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
damage_meter_UI = require("MHR_Overlay.UI.Modules.damage_meter_UI");
time = require("MHR_Overlay.Game_Handler.time");
end
return keyboard;

View File

@@ -5,10 +5,12 @@ local player;
local small_monster;
local large_monster;
local damage_meter_UI;
local time;
quest_status.index = 0;
quest_status.is_online = false;
quest_status.is_training_area = false;
quest_status.update_is_result_screen = false;
local quest_manager_type_definition = sdk.find_type_definition("snow.QuestManager");
local on_changed_game_status = quest_manager_type_definition:get_method("onChangedGameStatus");
@@ -25,14 +27,15 @@ end);
function quest_status.update(args)
local new_quest_status = sdk.to_int64(args[3]);
if new_quest_status ~= nil then
if (quest_status.index < 2 and new_quest_status == 2) or
new_quest_status < 2 then
if (quest_status.index < 2 and new_quest_status == 2)
or new_quest_status < 2 then
player.list = {};
player.total = player.new(0, "Total", 0);
player.init();
small_monster.list = {};
large_monster.list = {};
damage_meter_UI.freeze_displayed_players = false;
damage_meter_UI.last_displayed_players = {};
time.last_whole_seconds = 0;
end
quest_status.index = new_quest_status;
@@ -53,6 +56,7 @@ function quest_status.init()
quest_status.index = new_quest_status;
quest_status.update_is_online();
quest_status.update_is_training_area();
quest_status.update_is_result_screen();
end
function quest_status.update_is_online()
@@ -86,6 +90,20 @@ function quest_status.update_is_training_area()
quest_status.is_training_area = _is_training_area;
end
function quest_status.update_is_result_screen()
if singletons.quest_manager == nil then
customization_menu.status = "No quest manager";
return;
end
local is_result_demo_play_start = singletons.quest_manager:call("isResultDemoPlayStart");
if is_result_demo_play_start == nil then
return;
end
quest_status.is_result_screen = is_result_demo_play_start;
end
function quest_status.init_module()
singletons = require("MHR_Overlay.Game_Handler.singletons");
customization_menu = require("MHR_Overlay.UI.customization_menu");
@@ -93,6 +111,7 @@ function quest_status.init_module()
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
damage_meter_UI = require("MHR_Overlay.UI.Modules.damage_meter_UI");
time = require("MHR_Overlay.Game_Handler.time");
quest_status.init();
end

View File

@@ -1,4 +1,6 @@
local config = require "MHR_Overlay.Misc.config"
local screen = {};
local config;
screen.width = 1920;
screen.height = 1080;
@@ -16,35 +18,40 @@ function screen.update_window_size()
end
function screen.calculate_absolute_coordinates(position)
local _position = {
x = position.x * config.current_config.global_settings.modifiers.global_position_modifier;
y = position.y * config.current_config.global_settings.modifiers.global_position_modifier;
}
-- top left
if position.anchor == "Top-Left" then
return {x = position.x, y = position.y};
return {x = _position.x, y = _position.y};
end
-- top right
if position.anchor == "Top-Right" then
local screen_x = screen.width - position.x;
return {x = screen_x, y = position.y};
local screen_x = screen.width - _position.x;
return {x = screen_x, y = _position.y};
end
-- bottom left
if position.anchor == "Bottom-Left" then
local screen_y = screen.height - position.y;
return {x = position.x, y = screen_y};
local screen_y = screen.height - _position.y;
return {x = _position.x, y = screen_y};
end
-- bottom right
if position.anchor == "Bottom-Right" then
local screen_x = screen.width - position.x;
local screen_y = screen.height - position.y;
local screen_x = screen.width - _position.x;
local screen_y = screen.height - _position.y;
return {x = screen_x, y = screen_y};
end
return {x = position.x, y = position.y};
return {x = _position.x, y = _position.y};
end
function screen.init_module()
config = require("MHR_Overlay.Misc.config");
end
return screen;

View File

@@ -8,6 +8,7 @@ singletons.quest_manager = nil;
singletons.player_manager = nil;
singletons.village_area_manager = nil;
singletons.gui_manager = nil;
singletons.game_keyboard = nil;
function singletons.init()
singletons.init_message_manager();
@@ -18,6 +19,7 @@ function singletons.init()
singletons.init_player_manager();
singletons.init_village_area_manager();
singletons.init_gui_manager();
singletons.init_game_keyboard()
end
function singletons.init_message_manager()
@@ -126,6 +128,18 @@ function singletons.init_gui_manager()
return singletons.gui_manager;
end
function singletons.init_game_keyboard()
if singletons.game_keyboard ~= nil then
return;
end
singletons.game_keyboard = sdk.get_managed_singleton("snow.GameKeyboard");
if singletons.game_keyboard == nil then
--log.error("[MHR Overlay] No game keyboard");
end
return singletons.ggame_keyboard;
end
function singletons.init_module()
singletons.init();

View File

@@ -43,9 +43,12 @@ function time.tick()
end
function time.update_players_dps()
local new_total_dps = 0;
for _, _player in pairs(player.list) do
if _player.join_time == -1 then
_player.join_time = time.total_elapsed_seconds;
end
if config.current_config.damage_meter_UI.settings.dps_mode == "Quest Time" then
if time.total_elapsed_seconds > 0 then
_player.dps = _player.display.total_damage / time.total_elapsed_seconds;

View File

@@ -12,6 +12,22 @@ function config.init()
global_settings = {
language = "default",
menu_font = {
size = 17
},
UI_font = {
family = "Consolas",
size = 13,
bold = true,
italic = false
},
modifiers = {
global_position_modifier = 2,
global_scale_modifier = 2
},
performance = {
max_monster_updates_per_tick = 2,
prioritize_large_monsters = false,
@@ -27,7 +43,7 @@ function config.init()
damage_meter_UI = true
},
quest_summary_screen = {
quest_result_screen = {
small_monster_UI = false,
large_monster_dynamic_UI = false,
large_monster_static_UI = true,
@@ -44,16 +60,16 @@ function config.init()
}
},
menu_font = {
size = 17
},
UI_font = {
family = "Consolas",
size = 13,
bold = true,
italic = false
},
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,
}
},
small_monster_UI = {
@@ -662,7 +678,7 @@ function config.init()
include = {
part_name = true,
break_count = true
flinch_count = true
},
offset = {
@@ -1136,7 +1152,7 @@ function config.init()
include = {
part_name = true,
break_count = true
flinch_count = true
},
offset = {
@@ -1236,10 +1252,6 @@ function config.init()
highlighted = {
enabled = true,
settings = {
hide_dead_or_captured = true
},
position = {
x = 615,
y = 25,--y = 44,
@@ -1596,7 +1608,7 @@ function config.init()
include = {
part_name = true,
break_count = true
flinch_count = true
},
offset = {
@@ -1776,12 +1788,14 @@ function config.init()
include = {
myself = {
hunter_rank = true,
word_player = false,
player_id = false,
player_name = true
},
others = {
hunter_rank = true,
word_player = false,
player_id = false,
player_name = true
@@ -1790,7 +1804,7 @@ function config.init()
text = "%s",
offset = {
x = 45,
x = 5,
y = 0
},
color = 0xFFCCF4E1,
@@ -1806,7 +1820,7 @@ function config.init()
},
hunter_rank_label = {
visibility = true,
visibility = false,
enable_for = {
me = true,
@@ -1815,7 +1829,7 @@ function config.init()
text = "[%d]",
offset = {
x = 5,
x = -35,
y = 0
},
color = 0xFFCCF4E1,
@@ -2012,7 +2026,7 @@ function config.init_module()
config.init();
config.load();
config.current_config.version = "v1.8";
config.current_config.version = "v1.9";
language.update(table_helpers.find_index(language.language_names, config.current_config.global_settings.language, false));

View File

@@ -86,7 +86,7 @@ language.default_language = {
language = "Language",
module_visibility_on_different_screens = "Module Visibility on Different Screens",
during_quest = "During Quest",
quest_summary_screen = "Quest Summary Screen",
quest_result_screen = "Quest Result Screen",
training_area = "Training Area",
performance = "Performance",
@@ -170,7 +170,7 @@ language.default_language = {
body_parts = "Body Parts",
hide_undamaged_parts = "Hide Undamaged Parts",
part_name = "Part Name",
break_count = "Break Count",
flinch_count = "Flinch Count",
orientation = "Orientation",
horizontal = "Horizontal",
@@ -244,8 +244,16 @@ language.default_language = {
first_hit = "First Hit",
quest_time = "Quest Time",
join_time = "Join Time",
fight_time = "Fight Time"
fight_time = "Fight Time",
modifiers = "Modifiers",
global_scale_modifier = "Global Scale Modifier",
global_position_modifier = "Global Position Modifier",
hotkeys = "Hotkeys",
all_UI = "All UI",
assign_new_key = "Assign new key",
press_any_key = "Press any key..."
}
};
@@ -264,7 +272,6 @@ function language.load()
for i, language_file_name in ipairs(language_files) do
local language_name = language_file_name:gsub(language.language_folder, ""):gsub(".json", "");
-- language_file will be something like `my-cool-mod\config-file-1.json`;
local loaded_language = json.load_file(language_file_name);
if loaded_language ~= nil then
log.info("[MHR Overlay] " .. language_name .. ".json loaded successfully");

View File

@@ -24,7 +24,7 @@ function body_part.new(REpart, name, id)
part.health_percentage = 0;
part.name = name;
part.break_count = 0;
part.flinch_count = 0;
body_part.init_dynamic_UI(part);
body_part.init_static_UI(part);
@@ -73,7 +73,7 @@ function body_part.update(part, new_health, new_max_health)
end
if new_health > part.health then
part.break_count = part.break_count + 1;
part.flinch_count = part.flinch_count + 1;
end
part.health = new_health;

View File

@@ -147,6 +147,9 @@ end
function large_monster.init_static_UI(monster)
monster.static_name_label = table_helpers.deep_copy(config.current_config.large_monster_UI.static.monster_name_label);
monster.static_name_label.offset.x = monster.static_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.static_name_label.offset.y = monster.static_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_static_UI = health_UI_entity.new(
config.current_config.large_monster_UI.static.health.visibility,
config.current_config.large_monster_UI.static.health.bar,
@@ -155,6 +158,11 @@ function large_monster.init_static_UI(monster)
config.current_config.large_monster_UI.static.health.percentage_label
);
monster.health_static_UI.bar.capture_line.offset.x = monster.health_static_UI.bar.capture_line.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_static_UI.bar.capture_line.offset.y = monster.health_static_UI.bar.capture_line.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.width = monster.health_static_UI.bar.capture_line.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_static_UI.bar.capture_line.size.height = monster.health_static_UI.bar.capture_line.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_static_UI.bar.colors = config.current_config.large_monster_UI.static.health.bar.normal_colors;
monster.stamina_static_UI = stamina_UI_entity.new(
@@ -190,8 +198,12 @@ function large_monster.init_dynamic_UI(monster)
config.current_config.large_monster_UI.dynamic.health.percentage_label
);
monster.health_dynamic_UI.bar.colors = config.current_config.large_monster_UI.dynamic.health.bar.normal_colors;
monster.health_dynamic_UI.bar.capture_line.offset.x = monster.health_dynamic_UI.bar.capture_line.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.offset.y = monster.health_dynamic_UI.bar.capture_line.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.width = monster.health_dynamic_UI.bar.capture_line.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_dynamic_UI.bar.capture_line.size.height = monster.health_dynamic_UI.bar.capture_line.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_dynamic_UI.bar.colors = config.current_config.large_monster_UI.dynamic.health.bar.normal_colors;
monster.stamina_dynamic_UI = stamina_UI_entity.new(
config.current_config.large_monster_UI.dynamic.stamina.visibility,
@@ -226,6 +238,11 @@ function large_monster.init_highlighted_UI(monster)
config.current_config.large_monster_UI.highlighted.health.percentage_label
);
monster.health_highlighted_UI.bar.capture_line.offset.x = monster.health_highlighted_UI.bar.capture_line.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.offset.y = monster.health_highlighted_UI.bar.capture_line.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.width = monster.health_highlighted_UI.bar.capture_line.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_highlighted_UI.bar.capture_line.size.height = monster.health_highlighted_UI.bar.capture_line.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_highlighted_UI.bar.colors = config.current_config.large_monster_UI.highlighted.health.bar.normal_colors;
monster.stamina_highlighted_UI = stamina_UI_entity.new(
@@ -562,23 +579,23 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale)
drawing.draw_label(monster.dynamic_name_label, position_on_screen, opacity_scale, monster_name_text);
local health_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.health.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.health.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local stamina_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.stamina.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.stamina.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local rage_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.rage.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.rage.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.rage.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.rage.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local parts_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.parts.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.parts.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.parts.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.parts.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
health_UI_entity.draw(monster, monster.health_dynamic_UI, health_position_on_screen, opacity_scale);
@@ -590,7 +607,7 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale)
--sort parts here
local displayed_parts = {};
for REpart, part in pairs(monster.parts) do
if config.current_config.large_monster_UI.dynamic.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.break_count == 0 then
if config.current_config.large_monster_UI.dynamic.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
goto continue;
end
@@ -632,8 +649,8 @@ function large_monster.draw_dynamic(monster, position_on_screen, opacity_scale)
for j, part in ipairs(displayed_parts) do
local part_position_on_screen = {
x = parts_position_on_screen.x + config.current_config.large_monster_UI.dynamic.parts.spacing.x * (j - 1),
y = parts_position_on_screen.y + config.current_config.large_monster_UI.dynamic.parts.spacing.y * (j - 1);
x = parts_position_on_screen.x + config.current_config.large_monster_UI.dynamic.parts.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier,
y = parts_position_on_screen.y + config.current_config.large_monster_UI.dynamic.parts.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier;
}
body_part.draw_dynamic(part, part_position_on_screen, opacity_scale);
@@ -667,23 +684,23 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
drawing.draw_label(monster.static_name_label, position_on_screen, opacity_scale, monster_name_text);
local health_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.static.health.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.static.health.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.static.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.static.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local stamina_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.static.stamina.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.static.stamina.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.static.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.static.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local rage_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.static.rage.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.static.rage.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.static.rage.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.static.rage.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local parts_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.static.parts.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.static.parts.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.static.parts.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.static.parts.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
health_UI_entity.draw(monster, monster.health_static_UI, health_position_on_screen, opacity_scale);
@@ -695,7 +712,7 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
--sort parts here
local displayed_parts = {};
for REpart, part in pairs(monster.parts) do
if config.current_config.large_monster_UI.static.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.break_count == 0 then
if config.current_config.large_monster_UI.static.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
goto continue;
end
@@ -737,8 +754,8 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
for j, part in ipairs(displayed_parts) do
local part_position_on_screen = {
x = parts_position_on_screen.x + config.current_config.large_monster_UI.static.parts.spacing.x * (j - 1),
y = parts_position_on_screen.y + config.current_config.large_monster_UI.static.parts.spacing.y * (j - 1);
x = parts_position_on_screen.x + config.current_config.large_monster_UI.static.parts.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier,
y = parts_position_on_screen.y + config.current_config.large_monster_UI.static.parts.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier;
}
body_part.draw_static(part, part_position_on_screen, opacity_scale);
@@ -772,23 +789,23 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
drawing.draw_label(monster.highlighted_name_label, position_on_screen, opacity_scale, monster_name_text);
local health_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.health.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.health.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local stamina_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.stamina.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.stamina.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local rage_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.rage.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.rage.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.rage.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.rage.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local parts_position_on_screen = {
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.parts.offset.x,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.parts.offset.y
x = position_on_screen.x + config.current_config.large_monster_UI.highlighted.parts.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.large_monster_UI.highlighted.parts.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
health_UI_entity.draw(monster, monster.health_highlighted_UI, health_position_on_screen, opacity_scale);
@@ -800,7 +817,7 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
--sort parts here
local displayed_parts = {};
for REpart, part in pairs(monster.parts) do
if config.current_config.large_monster_UI.highlighted.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.break_count == 0 then
if config.current_config.large_monster_UI.highlighted.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
goto continue;
end
@@ -842,8 +859,8 @@ function large_monster.draw_highlighted(monster, position_on_screen, opacity_sca
for j, part in ipairs(displayed_parts) do
local part_position_on_screen = {
x = parts_position_on_screen.x + config.current_config.large_monster_UI.highlighted.parts.spacing.x * (j - 1),
y = parts_position_on_screen.y + config.current_config.large_monster_UI.highlighted.parts.spacing.y * (j - 1);
x = parts_position_on_screen.x + config.current_config.large_monster_UI.highlighted.parts.spacing.x * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier,
y = parts_position_on_screen.y + config.current_config.large_monster_UI.highlighted.parts.spacing.y * (j - 1) * config.current_config.global_settings.modifiers.global_scale_modifier;
}
body_part.draw_highlighted(part, part_position_on_screen, opacity_scale);

View File

@@ -66,6 +66,9 @@ end
function small_monster.init_UI(monster)
monster.name_label = table_helpers.deep_copy(config.current_config.small_monster_UI.monster_name_label);
monster.name_label.offset.x = monster.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.name_label.offset.y = monster.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
monster.health_UI = health_UI_entity.new(
config.current_config.small_monster_UI.health.visibility,
config.current_config.small_monster_UI.health.bar,
@@ -235,13 +238,13 @@ function small_monster.draw(monster, position_on_screen, opacity_scale)
drawing.draw_label(monster.name_label, position_on_screen, opacity_scale, monster.name);
local health_position_on_screen = {
x = position_on_screen.x + config.current_config.small_monster_UI.health.offset.x,
y = position_on_screen.y + config.current_config.small_monster_UI.health.offset.y
x = position_on_screen.x + config.current_config.small_monster_UI.health.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.small_monster_UI.health.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
local stamina_position_on_screen = {
x = position_on_screen.x + config.current_config.small_monster_UI.stamina.offset.x,
y = position_on_screen.y + config.current_config.small_monster_UI.stamina.offset.y
x = position_on_screen.x + config.current_config.small_monster_UI.stamina.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier,
y = position_on_screen.y + config.current_config.small_monster_UI.stamina.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier
};
health_UI_entity.draw(monster, monster.health_UI, health_position_on_screen, opacity_scale);

View File

@@ -12,14 +12,8 @@ damage_meter_UI.last_displayed_players = {};
damage_meter_UI.freeze_displayed_players = false;
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
local my_hunter_info_field = lobby_manager_type_def:get_field("_myHunterInfo");
local myself_index_field = lobby_manager_type_def:get_field("_myselfIndex");
local myself_quest_index_field = lobby_manager_type_def:get_field("_myselfQuestIndex");
local quest_hunter_info_field = lobby_manager_type_def:get_field("_questHunterInfo");
local my_hunter_info_type_def = my_hunter_info_field:get_type();
local name_field = my_hunter_info_type_def:get_field("_name");
local hunter_info_field = lobby_manager_type_def:get_field("_hunterInfo");
local quest_hunter_info_type_def = quest_hunter_info_field:get_type();
local get_count_method = quest_hunter_info_type_def:get_method("get_Count");
@@ -27,10 +21,48 @@ local get_item_method = quest_hunter_info_type_def:get_method("get_Item");
local hunter_info_type_def = sdk.find_type_definition("snow.LobbyManager.HunterInfo");
local member_index_field = hunter_info_type_def:get_field("_memberIndex");
local hunter_rank_field = hunter_info_type_def:get_field("_hunterRank");
local progress_manager_type_def = sdk.find_type_definition("snow.progress.ProgressManager");
local get_hunter_rank_method = progress_manager_type_def:get_method("get_HunterRank");
function damage_meter_UI.get_players(player_info_list)
-- other players
if player_info_list == nil then
customization_menu.status = "No player info list";
return {};
end
local quest_players = {};
local count = get_count_method:call(player_info_list);
if count == nil then
customization_menu.status = "No player info list count";
return {};
end
for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then
goto continue;
end
local player_id = member_index_field:get_data(player_info);
if player_id == nil then
goto continue;
end
local _player = player.get_player(player_id);
if _player ~= nil then
if player_id == player.myself.id and config.current_config.damage_meter_UI.settings.my_damage_bar_location ~= "Normal" then
goto continue;
end
table.insert(quest_players, _player);
end
::continue::
end
return quest_players;
end
function damage_meter_UI.draw()
@@ -38,147 +70,57 @@ function damage_meter_UI.draw()
return;
end
if singletons.lobby_manager == nil then
return;
end
if singletons.progress_manager == nil then
return;
end
-- myself player
local myself_player_info = my_hunter_info_field:get_data(singletons.lobby_manager);
if myself_player_info == nil then
customization_menu.status = "No myself player info list";
return;
end
local myself_player_name = name_field:get_data(myself_player_info);
if myself_player_name == nil then
customization_menu.status = "No myself player name";
return;
end
if quest_status.is_online then
player.myself_id = myself_quest_index_field:get_data(singletons.lobby_manager);
if player.myself_id == nil then
customization_menu.status = "No myself player id";
return;
end
else
player.myself_id = myself_index_field:get_data(singletons.lobby_manager);
if player.myself_id == nil then
customization_menu.status = "No myself player id";
return;
end
end
local myself_hunter_rank = get_hunter_rank_method:call(singletons.progress_manager);
if myself_hunter_rank == nil then
customization_menu.status = "No myself hunter rank";
myself_hunter_rank = 0;
end
if player.list[player.myself_id] == nil then
player.list[player.myself_id] = player.new(player.myself_id, myself_player_name, myself_hunter_rank);
player.myself = player.list[player.myself_id];
else
end
local quest_players = {};
if damage_meter_UI.freeze_displayed_players then
if damage_meter_UI.freeze_displayed_players and damage_meter_UI.last_displayed_players ~= {} then
quest_players = damage_meter_UI.last_displayed_players;
elseif quest_status.index < 2 then
local player_info_list = hunter_info_field:get_data(singletons.lobby_manager);
quest_players = damage_meter_UI.get_players(player_info_list);
else
-- other players
local player_info_list = quest_hunter_info_field:get_data(singletons.lobby_manager);
if player_info_list == nil then
customization_menu.status = "No player info list";
end
quest_players = damage_meter_UI.get_players(player_info_list);
end
local count = get_count_method:call(player_info_list);
if count == nil then
customization_menu.status = "No player info list count";
return;
end
if not damage_meter_UI.freeze_displayed_players then
if #quest_players ~= 0 then
-- sort here
if config.current_config.damage_meter_UI.sorting.type == "Normal" and config.current_config.damage_meter_UI.sorting.reversed_order then
for i = 0, count - 1 do
local player_info = get_item_method:call(player_info_list, i);
if player_info == nil then
goto continue
end
local player_id = member_index_field:get_data(player_info)
if player_id == nil then
goto continue
end
local player_hunter_rank = hunter_rank_field:get_data(player_info);
if player_hunter_rank == nil then
goto continue
end
if player_id == player.myself_id and config.current_config.damage_meter_UI.settings.my_damage_bar_location ~= "Normal" then
player.list[player.myself_id].hunter_rank = player_hunter_rank;
goto continue
end
local player_name = name_field:get_data(player_info);
if player_name == nil then
goto continue
end
if player.list[player_id] == nil then
player.list[player_id] = player.new(player_id, player_name, player_hunter_rank);
elseif player.list[player_id].name ~= player_name then
player.list[player_id] = player.new(player_id, player_name, player_hunter_rank);
end
table.insert(quest_players, player.list[player_id]);
::continue::
end
-- sort here
if config.current_config.damage_meter_UI.sorting.type == "Normal" and config.current_config.damage_meter_UI.sorting.reversed_order then
local reversed_quest_players = {};
for i = #quest_players, 1, -1 do
table.insert(reversed_quest_players, quest_players[i]);
end
quest_players = reversed_quest_players;
elseif config.current_config.damage_meter_UI.sorting.type == "DPS" then
if config.current_config.damage_meter_UI.sorting.reversed_order then
table.sort(quest_players, function(left, right)
return left.dps < right.dps;
end);
local reversed_quest_players = {};
for i = #quest_players, 1, -1 do
table.insert(reversed_quest_players, quest_players[i]);
end
quest_players = reversed_quest_players;
elseif config.current_config.damage_meter_UI.sorting.type == "DPS" then
if config.current_config.damage_meter_UI.sorting.reversed_order then
table.sort(quest_players, function(left, right)
return left.dps < right.dps;
end);
else
table.sort(quest_players, function(left, right)
return left.dps > right.dps;
end);
end
else
table.sort(quest_players, function(left, right)
return left.dps > right.dps;
end);
end
else
if config.current_config.damage_meter_UI.sorting.reversed_order then
table.sort(quest_players, function(left, right)
return left.display.total_damage < right.display.total_damage;
end);
else
table.sort(quest_players, function(left, right)
return left.display.total_damage > right.display.total_damage;
end);
if config.current_config.damage_meter_UI.sorting.reversed_order then
table.sort(quest_players, function(left, right)
return left.display.total_damage < right.display.total_damage;
end);
else
table.sort(quest_players, function(left, right)
return left.display.total_damage > right.display.total_damage;
end);
end
end
end
if config.current_config.damage_meter_UI.settings.my_damage_bar_location == "First" then
table.insert(quest_players, 1, player.list[player.myself_id]);
table.insert(quest_players, 1, player.myself);
elseif config.current_config.damage_meter_UI.settings.my_damage_bar_location == "Last" then
table.insert(quest_players, #quest_players + 1, player.list[player.myself_id]);
elseif #quest_players == 0 then
table.insert(quest_players, 1, player.list[player.myself_id]);
table.insert(quest_players, #quest_players + 1, player.myself);
elseif #player.list == 0 then
table.insert(quest_players, player.myself);
end
damage_meter_UI.last_displayed_players = quest_players;
end
@@ -205,9 +147,9 @@ function damage_meter_UI.draw()
player.draw(_player, position_on_screen, 1, top_damage, top_dps);
if config.current_config.damage_meter_UI.settings.orientation == "Horizontal" then
position_on_screen.x = position_on_screen.x + config.current_config.damage_meter_UI.spacing.x;
position_on_screen.x = position_on_screen.x + config.current_config.damage_meter_UI.spacing.x * config.current_config.global_settings.modifiers.global_scale_modifier;
else
position_on_screen.y = position_on_screen.y + config.current_config.damage_meter_UI.spacing.y;
position_on_screen.y = position_on_screen.y + config.current_config.damage_meter_UI.spacing.y * config.current_config.global_settings.modifiers.global_scale_modifier;
end
::continue1::
@@ -223,9 +165,7 @@ function damage_meter_UI.draw()
position_on_screen = screen.calculate_absolute_coordinates(config.current_config.damage_meter_UI.position);
end
drawing.draw_label(config.current_config.damage_meter_UI.total_damage_label, position_on_screen, 1, language.current_language.UI.total_damage);
drawing.draw_label(config.current_config.damage_meter_UI.total_damage_value_label, position_on_screen, 1, player.total.display.total_damage);
drawing.draw_label(config.current_config.damage_meter_UI.total_dps_label, position_on_screen, 1, player.total.dps);
player.draw_total(position_on_screen, 1);
end
function damage_meter_UI.init_module()

View File

@@ -23,6 +23,7 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
local displayed_monsters = {};
local highlighted_id = -1;
local monster_id_shift = 0;
local highlighted_monster = nil;
if singletons.gui_manager ~= nil then
@@ -36,7 +37,6 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
end
end
local enemy_count = get_boss_enemy_count_method:call(singletons.enemy_manager);
if enemy_count == nil then
return;
@@ -55,7 +55,9 @@ function large_monster_UI.draw(dynamic_enabled, static_enabled, highlighted_enab
goto continue;
end
if i == highlighted_id then
if monster.dead_or_captured then
monster_id_shift = monster_id_shift + 1;
elseif i == highlighted_id + monster_id_shift then
highlighted_monster = monster;
end
@@ -114,8 +116,8 @@ function large_monster_UI.draw_dynamic(displayed_monsters, highlighted_monster)
goto continue;
end
position_on_screen.x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.viewport_offset.x;
position_on_screen.y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.viewport_offset.y;
position_on_screen.x = position_on_screen.x + config.current_config.large_monster_UI.dynamic.viewport_offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
position_on_screen.y = position_on_screen.y + config.current_config.large_monster_UI.dynamic.viewport_offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
local opacity_scale = 1;
if monster.distance > config.current_config.large_monster_UI.dynamic.settings.max_distance then
@@ -199,9 +201,9 @@ function large_monster_UI.draw_static(displayed_monsters, highlighted_monster)
}
if config.current_config.large_monster_UI.static.settings.orientation == "Horizontal" then
monster_position_on_screen.x = monster_position_on_screen.x + config.current_config.large_monster_UI.static.spacing.x * i;
monster_position_on_screen.x = monster_position_on_screen.x + config.current_config.large_monster_UI.static.spacing.x * i * config.current_config.global_settings.modifiers.global_scale_modifier;
else
monster_position_on_screen.y = monster_position_on_screen.y + config.current_config.large_monster_UI.static.spacing.y * i;
monster_position_on_screen.y = monster_position_on_screen.y + config.current_config.large_monster_UI.static.spacing.y * i * config.current_config.global_settings.modifiers.global_scale_modifier;
end
large_monster.draw_static(monster, monster_position_on_screen, 1);

View File

@@ -3,6 +3,9 @@ local time;
local screen;
local config;
local drawing;
local table_helpers;
time_UI.label = nil;
function time_UI.draw()
local elapsed_minutes = time.elapsed_minutes;
@@ -14,7 +17,14 @@ function time_UI.draw()
local position_on_screen = screen.calculate_absolute_coordinates(config.current_config.time_UI.position);
drawing.draw_label(config.current_config.time_UI.time_label, position_on_screen, 1, elapsed_minutes, elapsed_seconds);
drawing.draw_label(time_UI.label , position_on_screen, 1, elapsed_minutes, elapsed_seconds);
end
function time_UI.init_UI()
time_UI.label = table_helpers.deep_copy(config.current_config.time_UI.time_label);
time_UI.label.offset.x = time_UI.label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
time_UI.label.offset.y = time_UI.label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
end
function time_UI.init_module()
@@ -22,6 +32,9 @@ function time_UI.init_module()
screen = require("MHR_Overlay.Game_Handler.screen");
config = require("MHR_Overlay.Misc.config");
drawing = require("MHR_Overlay.UI.drawing");
table_helpers = require("MHR_Overlay.Misc.table_helpers");
time_UI.init_UI()
end
return time_UI;

View File

@@ -13,6 +13,23 @@ function body_part_UI_entity.new(visibility, bar, name_label, text_label, value_
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.name_label.offset.x = entity.name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.name_label.offset.y = entity.name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
return entity;
end
@@ -25,8 +42,8 @@ function body_part_UI_entity.draw_dynamic(part, position_on_screen, opacity_scal
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.part_name then
part_name = part.name .. " ";
end
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_count and part.break_count ~= 0 then
part_name = part_name .. "x" .. tostring(part.break_count);
if config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
part_name = part_name .. "x" .. tostring(part.flinch_count);
end
drawing.draw_bar(part.body_part_dynamic_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
@@ -46,8 +63,8 @@ function body_part_UI_entity.draw_static(part, position_on_screen, opacity_scale
if config.current_config.large_monster_UI.static.parts.part_name_label.include.part_name then
part_name = part.name .. " ";
end
if config.current_config.large_monster_UI.static.parts.part_name_label.include.break_count and part.break_count ~= 0 then
part_name = part_name .. "x" .. tostring(part.break_count);
if config.current_config.large_monster_UI.static.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
part_name = part_name .. "x" .. tostring(part.flinch_count);
end
drawing.draw_bar(part.body_part_static_UI.bar, position_on_screen, opacity_scale, part.health_percentage);
@@ -67,8 +84,8 @@ function body_part_UI_entity.draw_highlighted(part, position_on_screen, opacity_
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.part_name then
part_name = part.name .. " ";
end
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_count and part.break_count ~= 0 then
part_name = part_name .. "x" .. tostring(part.break_count);
if config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.flinch_count and part.flinch_count ~= 0 then
part_name = part_name .. "x" .. tostring(part.flinch_count);
end
drawing.draw_bar(part.body_part_highlighted_UI.bar, position_on_screen, opacity_scale, part.health_percentage);

View File

@@ -17,20 +17,49 @@ function damage_UI_entity.new(bar, highlighted_bar, player_name_label, dps_label
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.highlighted_bar.offset.x = entity.highlighted_bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.highlighted_bar.offset.y = entity.highlighted_bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.highlighted_bar.size.width = entity.highlighted_bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.highlighted_bar.size.height = entity.highlighted_bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.player_name_label.offset.x = entity.player_name_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.player_name_label.offset.y = entity.player_name_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.dps_label.offset.x = entity.dps_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.dps_label.offset.y = entity.dps_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.hunter_rank_label.offset.x = entity.hunter_rank_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.hunter_rank_label.offset.y = entity.hunter_rank_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
return entity;
end
function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_damage, top_dps)
local player_include = config.current_config.damage_meter_UI.player_name_label.include.others;
if _player.id == _player.myself_id then
if _player.id == player.myself.id then
player_include = config.current_config.damage_meter_UI.player_name_label.include.myself;
end
local player_name_text = "";
if player_include.hunter_rank then
player_name_text = string.format("[%d] ", _player.hunter_rank);
end
if player_include.word_player then
player_name_text = language.current_language.UI.player .. " ";
player_name_text = player_name_text .. language.current_language.UI.player .. " ";
end
if player_include.player_id then
@@ -57,9 +86,7 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
end
end
x = string.format("%s / %s", tostring(_player.dps), tostring(top_dps));
if _player.id == player.myself_id and config.current_config.damage_meter_UI.settings.highlighted_bar == "Me" then
if _player.id == player.myself.id and config.current_config.damage_meter_UI.settings.highlighted_bar == "Me" then
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
elseif config.current_config.damage_meter_UI.settings.highlighted_bar == "Top Damage" and _player.display.total_damage == top_damage then
drawing.draw_bar(_player.damage_UI.highlighted_bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
@@ -69,7 +96,7 @@ function damage_UI_entity.draw(_player, position_on_screen, opacity_scale, top_d
drawing.draw_bar(_player.damage_UI.bar, position_on_screen, opacity_scale, player_damage_bar_percentage);
end
if _player.id == player.myself_id then
if _player.id == player.myself.id then
if _player.damage_UI.hunter_rank_label.enable_for.me then
drawing.draw_label(_player.damage_UI.hunter_rank_label, position_on_screen, opacity_scale, _player.hunter_rank);
end

View File

@@ -2,6 +2,7 @@ local health_UI_entity = {};
local table_helpers;
local drawing;
local language;
local config;
function health_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
local entity = {};
@@ -12,6 +13,20 @@ function health_UI_entity.new(visibility, bar, text_label, value_label, percenta
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
return entity;
end
@@ -31,6 +46,7 @@ function health_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
end
return health_UI_entity;

View File

@@ -2,6 +2,7 @@ local rage_UI_entity = {};
local table_helpers;
local drawing;
local language;
local config;
function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage_label, timer_label)
local entity = {};
@@ -13,6 +14,23 @@ function rage_UI_entity.new(visibility, bar, text_label, value_label, percentage
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.timer_label = table_helpers.deep_copy(timer_label);
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.timer_label.offset.x = entity.timer_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.timer_label.offset.y = entity.timer_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
return entity;
end
@@ -39,6 +57,7 @@ function rage_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
end
return rage_UI_entity;

View File

@@ -2,6 +2,7 @@ local stamina_UI_entity = {};
local table_helpers;
local drawing;
local language;
local config;
function stamina_UI_entity.new(visibility, bar, text_label, value_label, percentage_label)
local entity = {};
@@ -12,6 +13,20 @@ function stamina_UI_entity.new(visibility, bar, text_label, value_label, percent
entity.value_label = table_helpers.deep_copy(value_label);
entity.percentage_label = table_helpers.deep_copy(percentage_label);
entity.bar.offset.x = entity.bar.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.offset.y = entity.bar.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.width = entity.bar.size.width * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.bar.size.height = entity.bar.size.height * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.x = entity.text_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.text_label.offset.y = entity.text_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.x = entity.value_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.value_label.offset.y = entity.value_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.x = entity.percentage_label.offset.x * config.current_config.global_settings.modifiers.global_scale_modifier;
entity.percentage_label.offset.y = entity.percentage_label.offset.y * config.current_config.global_settings.modifiers.global_scale_modifier;
return entity;
end
@@ -31,6 +46,7 @@ function stamina_UI_entity.init_module()
table_helpers = require("MHR_Overlay.Misc.table_helpers");
drawing = require("MHR_Overlay.UI.drawing");
language = require("MHR_Overlay.Misc.language");
config = require("MHR_Overlay.Misc.config");
end
return stamina_UI_entity;

View File

@@ -8,6 +8,8 @@ local large_monster;
local small_monster;
local language;
local part_names;
local time_UI;
local keyboard;
customization_menu.font = nil;
customization_menu.font_range = { 0x1, 0xFFFF, 0 };
@@ -84,6 +86,20 @@ customization_menu.damage_meter_UI_anchor_index = 1;
customization_menu.selected_UI_font_index = 9;
customization_menu.all_UI_waiting_for_key = false;
customization_menu.small_monster_UI_waiting_for_key = false;
customization_menu.large_monster_UI_waiting_for_key = false;
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
customization_menu.large_monster_static_UI_waiting_for_key = false;
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
customization_menu.time_UI_waiting_for_key = false;
customization_menu.damage_meter_UI_waiting_for_key = false;
function customization_menu.reload_font(pop_push)
local success, new_font = pcall(imgui.load_font, language.current_language.font_name, config.current_config.global_settings.menu_font.size, customization_menu.font_range);
if success then
@@ -218,6 +234,15 @@ function customization_menu.draw()
local config_changed = false;
local changed = false;
local modifiers_changed = false;
local small_monster_UI_changed = false;
local large_monster_dynamic_UI_changed = false;
local large_monster_static_UI_changed = false;
local large_monster_highlighted_UI_changed = false;
local time_UI_changed = false;
local damage_meter_UI_changed = false;
local status_string = tostring(customization_menu.status);
imgui.text(language.current_language.customization_menu.status .. ": " .. status_string);
@@ -229,19 +254,22 @@ function customization_menu.draw()
changed, config.current_config.large_monster_UI.dynamic.enabled =
imgui.checkbox(language.current_language.customization_menu.large_monster_dynamic_UI, config.current_config.large_monster_UI.dynamic.enabled);
config_changed = config_changed or changed;
imgui.same_line();
changed, config.current_config.large_monster_UI.static.enabled =
imgui.checkbox(language.current_language.customization_menu.large_monster_static_UI, config.current_config.large_monster_UI.static.enabled);
config_changed = config_changed or changed;
changed, config.current_config.large_monster_UI.highlighted.enabled =
imgui.checkbox(language.current_language.customization_menu.large_monster_highlighted_UI, config.current_config.large_monster_UI.highlighted.enabled);
config_changed = config_changed or changed;
changed, config.current_config.time_UI.enabled = imgui.checkbox(language.current_language.customization_menu.time_UI, config.current_config.time_UI.enabled);
config_changed = config_changed or changed;
imgui.same_line();
changed, config.current_config.damage_meter_UI.enabled = imgui.checkbox(language.current_language.customization_menu.damage_meter_UI,
config.current_config.damage_meter_UI.enabled);
@@ -250,6 +278,207 @@ function customization_menu.draw()
imgui.tree_pop();
end
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;
customization_menu.all_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.all_UI) then
local is_any_other_waiting = customization_menu.small_monster_UI_waiting_for_key
or customization_menu.large_monster_UI_waiting_for_key
or customization_menu.large_monster_dynamic_UI_waiting_for_key
or customization_menu.large_monster_static_UI_waiting_for_key
or customization_menu.large_monster_highlighted_UI_waiting_for_key
or customization_menu.time_UI_waiting_for_key
or customization_menu.damage_meter_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.all_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.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;
customization_menu.small_monster_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.small_monster_UI) then
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
or customization_menu.large_monster_UI_waiting_for_key
or customization_menu.large_monster_dynamic_UI_waiting_for_key
or customization_menu.large_monster_static_UI_waiting_for_key
or customization_menu.large_monster_highlighted_UI_waiting_for_key
or customization_menu.time_UI_waiting_for_key
or customization_menu.damage_meter_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.small_monster_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.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;
customization_menu.large_monster_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.large_monster_UI) then
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
or customization_menu.small_monster_UI_waiting_for_key
or customization_menu.large_monster_dynamic_UI_waiting_for_key
or customization_menu.large_monster_static_UI_waiting_for_key
or customization_menu.large_monster_highlighted_UI_waiting_for_key
or customization_menu.time_UI_waiting_for_key
or customization_menu.damage_meter_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.large_monster_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.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;
customization_menu.large_monster_dynamic_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.large_monster_dynamic_UI) then
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
or customization_menu.small_monster_UI_waiting_for_key
or customization_menu.large_monster_UI_waiting_for_key
or customization_menu.large_monster_static_UI_waiting_for_key
or customization_menu.large_monster_highlighted_UI_waiting_for_key
or customization_menu.time_UI_waiting_for_key
or customization_menu.damage_meter_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.large_monster_dynamic_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.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;
customization_menu.large_monster_static_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.large_monster_static_UI) then
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
or customization_menu.small_monster_UI_waiting_for_key
or customization_menu.large_monster_UI_waiting_for_key
or customization_menu.large_monster_dynamic_UI_waiting_for_key
or customization_menu.large_monster_highlighted_UI_waiting_for_key
or customization_menu.time_UI_waiting_for_key
or customization_menu.damage_meter_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.large_monster_static_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.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;
customization_menu.large_monster_highlighted_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.large_monster_highlighted_UI) then
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
or customization_menu.small_monster_UI_waiting_for_key
or customization_menu.large_monster_UI_waiting_for_key
or customization_menu.large_monster_dynamic_UI_waiting_for_key
or customization_menu.large_monster_static_UI_waiting_for_key
or customization_menu.time_UI_waiting_for_key
or customization_menu.damage_meter_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.large_monster_highlighted_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.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;
customization_menu.time_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.time_UI) then
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
or customization_menu.small_monster_UI_waiting_for_key
or customization_menu.large_monster_UI_waiting_for_key
or customization_menu.large_monster_dynamic_UI_waiting_for_key
or customization_menu.large_monster_static_UI_waiting_for_key
or customization_menu.large_monster_highlighted_UI_waiting_for_key
or customization_menu.damage_meter_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.time_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.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;
customization_menu.damage_meter_UI_waiting_for_key = false;
end
elseif imgui.button(language.current_language.customization_menu.damage_meter_UI) then
local is_any_other_waiting = customization_menu.all_UI_waiting_for_key
or customization_menu.small_monster_UI_waiting_for_key
or customization_menu.large_monster_UI_waiting_for_key
or customization_menu.large_monster_dynamic_UI_waiting_for_key
or customization_menu.large_monster_static_UI_waiting_for_key
or customization_menu.large_monster_highlighted_UI_waiting_for_key
or customization_menu.time_UI_waiting_for_key;
if not is_any_other_waiting then
customization_menu.damage_meter_UI_waiting_for_key = true;
end
end
imgui.same_line();
imgui.text(keyboard.keys[config.current_config.global_settings.hotkeys.damage_meter_UI]);
imgui.tree_pop();
end
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, customization_menu.selected_language_index, language.language_names);
config_changed = config_changed or changed;
@@ -339,6 +568,20 @@ function customization_menu.draw()
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.modifiers) then
changed, config.current_config.global_settings.modifiers.global_position_modifier =
imgui.drag_float(language.current_language.customization_menu.global_position_modifier, config.current_config.global_settings.modifiers.global_position_modifier, 0.01, 0.01, 10, "%.1f");
config_changed = config_changed or changed;
modifiers_changed = modifiers_changed or changed;
changed, config.current_config.global_settings.modifiers.global_scale_modifier =
imgui.drag_float(language.current_language.customization_menu.global_scale_modifier, config.current_config.global_settings.modifiers.global_scale_modifier, 0.01, 0.01, 10, "%.1f");
config_changed = config_changed or changed;
modifiers_changed = modifiers_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.performance) then
changed, config.current_config.global_settings.performance.max_monster_updates_per_tick =
imgui.slider_int(language.current_language.customization_menu.max_monster_updates_per_tick, config.current_config.global_settings.performance.max_monster_updates_per_tick, 1, 150);
@@ -351,6 +594,7 @@ function customization_menu.draw()
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.module_visibility_on_different_screens) then
if imgui.tree_node(language.current_language.customization_menu.during_quest) then
@@ -386,36 +630,36 @@ function customization_menu.draw()
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.quest_summary_screen) then
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.small_monster_UI =
if imgui.tree_node(language.current_language.customization_menu.quest_result_screen) then
changed, config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI =
imgui.checkbox(language.current_language.customization_menu.small_monster_UI,
config.current_config.global_settings.module_visibility.quest_summary_screen.small_monster_UI);
config.current_config.global_settings.module_visibility.quest_result_screen.small_monster_UI);
config_changed = config_changed or changed;
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_dynamic_UI =
changed, config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_dynamic_UI =
imgui.checkbox(language.current_language.customization_menu.large_monster_dynamic_UI, config.current_config.global_settings.module_visibility
.quest_summary_screen.large_monster_dynamic_UI);
.quest_result_screen.large_monster_dynamic_UI);
config_changed = config_changed or changed;
imgui.same_line();
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_static_UI =
changed, config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_static_UI =
imgui.checkbox(language.current_language.customization_menu.large_monster_static_UI, config.current_config.global_settings.module_visibility
.quest_summary_screen.large_monster_static_UI);
.quest_result_screen.large_monster_static_UI);
config_changed = config_changed or changed;
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.large_monster_highlighted_UI =
changed, config.current_config.global_settings.module_visibility.quest_result_screen.large_monster_highlighted_UI =
imgui.checkbox(language.current_language.customization_menu.large_monster_highlighted_UI, config.current_config.global_settings.module_visibility
.quest_summary_screen.large_monster_highlighted_UI);
.quest_result_screen.large_monster_highlighted_UI);
config_changed = config_changed or changed;
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.time_UI = imgui.checkbox(
language.current_language.customization_menu.time_UI, config.current_config.global_settings.module_visibility.quest_summary_screen.time_UI);
changed, config.current_config.global_settings.module_visibility.quest_result_screen.time_UI = imgui.checkbox(
language.current_language.customization_menu.time_UI, config.current_config.global_settings.module_visibility.quest_result_screen.time_UI);
config_changed = config_changed or changed;
imgui.same_line();
changed, config.current_config.global_settings.module_visibility.quest_summary_screen.damage_meter_UI =
changed, config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI =
imgui.checkbox(language.current_language.customization_menu.damage_meter_UI,
config.current_config.global_settings.module_visibility.quest_summary_screen.damage_meter_UI);
config.current_config.global_settings.module_visibility.quest_result_screen.damage_meter_UI);
config_changed = config_changed or changed;
imgui.tree_pop();
@@ -447,7 +691,6 @@ function customization_menu.draw()
end
if imgui.tree_node(language.current_language.customization_menu.small_monster_UI) then
local small_monster_UI_changed = false;
changed, config.current_config.small_monster_UI.enabled = imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config
.small_monster_UI.enabled);
config_changed = config_changed or changed;
@@ -1175,8 +1418,6 @@ function customization_menu.draw()
if imgui.tree_node(language.current_language.customization_menu.large_monster_UI) then
if imgui.tree_node(language.current_language.customization_menu.dynamically_positioned) then
local large_monster_dynamic_UI_changed = false;
changed, config.current_config.large_monster_UI.dynamic.enabled =
imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config.large_monster_UI.dynamic.enabled);
config_changed = config_changed or changed;
@@ -2398,9 +2639,9 @@ function customization_menu.draw()
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
changed, config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_count =
imgui.checkbox(language.current_language.customization_menu.break_count,
config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.break_count);
changed, config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.flinch_count =
imgui.checkbox(language.current_language.customization_menu.flinch_count,
config.current_config.large_monster_UI.dynamic.parts.part_name_label.include.flinch_count);
config_changed = config_changed or changed;
large_monster_dynamic_UI_changed = large_monster_dynamic_UI_changed or changed;
@@ -2731,18 +2972,10 @@ function customization_menu.draw()
imgui.tree_pop();
end
if large_monster_dynamic_UI_changed then
for _, monster in pairs(large_monster.list) do
large_monster.init_dynamic_UI(monster);
end
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.statically_positioned) then
local large_monster_static_UI_changed = false;
changed, config.current_config.large_monster_UI.static.enabled =
imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config.large_monster_UI.static.enabled);
config_changed = config_changed or changed;
@@ -3996,8 +4229,8 @@ function customization_menu.draw()
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
changed, config.current_config.large_monster_UI.static.parts.part_name_label.include.break_count = imgui.checkbox(
language.current_language.customization_menu.break_count, config.current_config.large_monster_UI.static.parts.part_name_label.include.break_count);
changed, config.current_config.large_monster_UI.static.parts.part_name_label.include.flinch_count = imgui.checkbox(
language.current_language.customization_menu.flinch_count, config.current_config.large_monster_UI.static.parts.part_name_label.include.flinch_count);
config_changed = config_changed or changed;
large_monster_static_UI_changed = large_monster_static_UI_changed or changed;
@@ -4327,31 +4560,15 @@ function customization_menu.draw()
imgui.tree_pop();
end
if large_monster_static_UI_changed then
for _, monster in pairs(large_monster.list) do
large_monster.init_static_UI(monster);
end
end
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.highlighted) then
local large_monster_highlighted_UI_changed = false;
changed, config.current_config.large_monster_UI.highlighted.enabled =
imgui.checkbox(language.current_language.customization_menu.enabled, config.current_config.large_monster_UI.highlighted.enabled);
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.settings) then
changed, config.current_config.large_monster_UI.highlighted.settings.hide_dead_or_captured = imgui.checkbox(language.current_language.customization_menu.hide_dead_or_captured, config.current_config.
large_monster_UI.highlighted.settings.hide_dead_or_captured);
config_changed = config_changed or changed;
imgui.tree_pop();
end
if imgui.tree_node(language.current_language.customization_menu.position) then
changed, config.current_config.large_monster_UI.highlighted.position.x =
imgui.drag_float(language.current_language.customization_menu.x, config.current_config.large_monster_UI.highlighted.position.x, 0.1, 0, screen.width, "%.1f");
@@ -5528,8 +5745,8 @@ function customization_menu.draw()
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
changed, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_count = imgui.checkbox(
language.current_language.customization_menu.break_count, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.break_count);
changed, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.flinch_count = imgui.checkbox(
language.current_language.customization_menu.flinch_count, config.current_config.large_monster_UI.highlighted.parts.part_name_label.include.flinch_count);
config_changed = config_changed or changed;
large_monster_highlighted_UI_changed = large_monster_highlighted_UI_changed or changed;
@@ -5859,12 +6076,6 @@ function customization_menu.draw()
imgui.tree_pop();
end
if large_monster_highlighted_UI_changed then
for _, monster in pairs(large_monster.list) do
large_monster.init_highlighted_UI(monster);
end
end
imgui.tree_pop();
end
@@ -5899,6 +6110,7 @@ function customization_menu.draw()
changed, config.current_config.time_UI.time_label.visibility =
imgui.checkbox(language.current_language.customization_menu.visible, config.current_config.time_UI.time_label.visibility);
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
-- add text format
@@ -5906,10 +6118,12 @@ function customization_menu.draw()
changed, config.current_config.time_UI.time_label.offset.x =
imgui.drag_float(language.current_language.customization_menu.x, config.current_config.time_UI.time_label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
changed, config.current_config.time_UI.time_label.offset.y =
imgui.drag_float(language.current_language.customization_menu.y, config.current_config.time_UI.time_label.offset.y, 0.1, -screen.height, screen.height, "%.1f");
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
imgui.tree_pop();
end
@@ -5917,6 +6131,7 @@ function customization_menu.draw()
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.time_UI.time_label.color = imgui.color_picker_argb("", config.current_config.time_UI.time_label.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
imgui.tree_pop();
end
@@ -5925,17 +6140,20 @@ function customization_menu.draw()
changed, config.current_config.time_UI.time_label.shadow.visibility =
imgui.checkbox(language.current_language.customization_menu.visible, config.current_config.time_UI.time_label.shadow.visibility);
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
if imgui.tree_node(language.current_language.customization_menu.offset) then
changed, config.current_config.time_UI.time_label.shadow.offset.x =
imgui.drag_float(language.current_language.customization_menu.x, config.current_config.time_UI.time_label.shadow.offset.x, 0.1, -screen.width, screen.width,
"%.1f");
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
changed, config.current_config.time_UI.time_label.shadow.offset.y =
imgui.drag_float(language.current_language.customization_menu.y, config.current_config.time_UI.time_label.shadow.offset.y, 0.1, -screen.height,
screen.height, "%.1f");
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
imgui.tree_pop();
end
@@ -5943,6 +6161,7 @@ function customization_menu.draw()
if imgui.tree_node(language.current_language.customization_menu.color) then
changed, config.current_config.time_UI.time_label.shadow.color = imgui.color_picker_argb("", config.current_config.time_UI.time_label.shadow.color, customization_menu.color_picker_flags);
config_changed = config_changed or changed;
time_UI_changed = time_UI_changed or changed;
imgui.tree_pop();
end
@@ -5956,8 +6175,6 @@ function customization_menu.draw()
end
if imgui.tree_node(language.current_language.customization_menu.damage_meter_UI) then
local damage_meter_UI_changed = false;
changed, config.current_config.damage_meter_UI.enabled = imgui.checkbox(language.current_language.customization_menu.enabled,
config.current_config.damage_meter_UI.enabled);
config_changed = config_changed or changed;
@@ -6173,6 +6390,11 @@ function customization_menu.draw()
if imgui.tree_node(language.current_language.customization_menu.include) then
if imgui.tree_node(language.current_language.customization_menu.me) then
changed, config.current_config.damage_meter_UI.player_name_label.include.myself.hunter_rank = imgui.checkbox(
language.current_language.customization_menu.hunter_rank, config.current_config.damage_meter_UI.player_name_label.include.myself.hunter_rank);
config_changed = config_changed or changed;
damage_meter_UI_changed = damage_meter_UI_changed or changed;
changed, config.current_config.damage_meter_UI.player_name_label.include.myself.word_player = imgui.checkbox(
language.current_language.customization_menu.word_player, config.current_config.damage_meter_UI.player_name_label.include.myself.word_player);
config_changed = config_changed or changed;
@@ -6192,6 +6414,11 @@ function customization_menu.draw()
end
if imgui.tree_node(language.current_language.customization_menu.other_players) then
changed, config.current_config.damage_meter_UI.player_name_label.include.others.hunter_rank = imgui.checkbox(
language.current_language.customization_menu.hunter_rank, config.current_config.damage_meter_UI.player_name_label.include.others.hunter_rank);
config_changed = config_changed or changed;
damage_meter_UI_changed = damage_meter_UI_changed or changed;
changed, config.current_config.damage_meter_UI.player_name_label.include.others.word_player = imgui.checkbox(
language.current_language.customization_menu.word_player, config.current_config.damage_meter_UI.player_name_label.include.others.word_player);
config_changed = config_changed or changed;
@@ -6858,18 +7085,41 @@ function customization_menu.draw()
imgui.tree_pop();
end
if damage_meter_UI_changed then
for _, _player in pairs(player.list) do
player.init_UI(_player);
end
end
imgui.tree_pop();
end
imgui.end_window();
imgui.pop_font(customization_menu.font);
if large_monster_dynamic_UI_changed or modifiers_changed then
for _, monster in pairs(large_monster.list) do
large_monster.init_dynamic_UI(monster);
end
end
if large_monster_static_UI_changed or modifiers_changed then
for _, monster in pairs(large_monster.list) do
large_monster.init_static_UI(monster);
end
end
if large_monster_highlighted_UI_changed or modifiers_changed then
for _, monster in pairs(large_monster.list) do
large_monster.init_highlighted_UI(monster);
end
end
if time_UI_changed or modifiers_changed then
time_UI.init_UI();
end
if damage_meter_UI_changed or modifiers_changed then
for _, _player in pairs(player.list) do
player.init_UI(_player);
player.init_total_UI(player.total);
end
end
if config_changed then
config.save();
end
@@ -6884,6 +7134,8 @@ function customization_menu.init_module()
small_monster = require("MHR_Overlay.Monsters.small_monster");
large_monster = require("MHR_Overlay.Monsters.large_monster");
part_names = require("MHR_Overlay.Misc.part_names");
time_UI = require("MHR_Overlay.UI.Modules.time_UI");
keyboard = require("MHR_Overlay.Game_Handler.keyboard");
customization_menu.init();
end

View File

@@ -12,7 +12,9 @@
"customization_menu": {
"UI_font": "UI Font",
"UI_font_notice": "Any changes to the font require script reload!",
"all_UI": "All UI",
"anchor": "Anchor",
"assign_new_key": "Assign new key",
"background": "Background",
"bar": "Bar",
"body_parts": "Body Parts",
@@ -20,7 +22,6 @@
"bomb_damage": "Bomb Damage",
"bottom_left": "Bottom-Left",
"bottom_right": "Bottom-Right",
"break_count": "Break Count",
"capture_line": "Capture Line",
"color": "Color",
"colors": "Colors",
@@ -45,7 +46,10 @@
"fight_time": "Fight Time",
"first": "First",
"first_hit": "First Hit",
"flinch_count": "Flinch Count",
"foreground": "Foreground",
"global_position_modifier": "Global Position Modifier",
"global_scale_modifier": "Global Scale Modifier",
"global_settings": "Global Settings",
"health": "Health",
"health_percentage": "Health Percentage",
@@ -59,6 +63,7 @@
"highlighted_bar": "Highlighted Bar",
"highlighted_damage_bar": "Highlighted Damage Bar",
"horizontal": "Horizontal",
"hotkeys": "Hotkeys",
"hunter_rank": "Hunter Rank",
"hunter_rank_label": "Hunter Rank Label",
"include": "Include",
@@ -78,6 +83,7 @@
"me": "Me",
"menu_font": "Menu Font",
"mod_name": "MHR Overlay",
"modifiers": "Modifiers",
"module_visibility_on_different_screens": "Module Visibility on Different Screens",
"modules": "Modules",
"monster_can_be_captured": "Monster can be captured",
@@ -101,8 +107,9 @@
"player_name": "Player Name",
"player_name_label": "Player Name Label",
"position": "Position",
"press_any_key": "Press any key...",
"prioritize_large_monsters": "Large Monsters on High Priority",
"quest_summary_screen": "Quest Summary Screen",
"quest_result_screen": "Quest Result Screen",
"quest_time": "Quest Time",
"rage": "Rage",
"render_highlighted_monster": "Render Highlighted Monster",

View File

@@ -12,7 +12,9 @@
"customization_menu": {
"UI_font": "UI 글꼴",
"UI_font_notice": "글꼴 변경시 스크립트를 리로드 해야합니다!",
"all_UI": "All UI",
"anchor": "기준",
"assign_new_key": "Assign new key",
"background": "배경색",
"bar": "막대",
"body_parts": "부위",
@@ -45,9 +47,12 @@
"fight_time": "Fight Time",
"first": "처음",
"first_hit": "First Hit",
"flinch_count": "Break Count",
"font": "글꼴",
"font_notice": "글꼴 설정 변경시 스크립트 리로드가 필수입니다!",
"foreground": "전경색",
"global_position_modifier": "Global Position Modifier",
"global_scale_modifier": "Global Scale",
"global_settings": "전역 설정",
"health": "체력",
"health_percentage": "체력 비율",
@@ -62,6 +67,7 @@
"highlighted_damage_bar": "강조된 대미지 막대",
"higlighted_bar": "강조된 막대",
"horizontal": "가로",
"hotkeys": "Hotkeys",
"hunter_rank": "헌터 랭크",
"hunter_rank_label": "Hunter Rank Label",
"include": "포함",
@@ -81,6 +87,7 @@
"me": "나",
"menu_font": "메뉴 글꼴",
"mod_name": "MHR Overlay",
"modifiers": "Modifiers",
"module_visibility_on_different_screens": "상황별 모듈 표시",
"modules": "모듈",
"monster_can_be_captured": "몬스터 포획 가능",
@@ -104,8 +111,9 @@
"player_name": "헌터명",
"player_name_label": "헌터명 라벨",
"position": "위치",
"press_any_key": "Press any key...",
"prioritize_large_monsters": "대형 몬스터를 우선적으로",
"quest_summary_screen": "퀘스트 결과 화면",
"quest_result_screen": "Quest Result Screen",
"quest_time": "Quest Time",
"rage": "분노",
"render_highlighted_monster": "Render Highlighted Monster",

View File

@@ -12,7 +12,9 @@
"customization_menu": {
"UI_font": "Шрифт интерфейса",
"UI_font_notice": "Любые изменения шрифта требуют перезагрузку скрипта!",
"all_UI": "Весь интерфейс",
"anchor": "Привязка",
"assign_new_key": "Привязать клавишу",
"background": "Фон",
"bar": "Шкала",
"body_parts": "Части тела",
@@ -45,7 +47,10 @@
"fight_time": "Время в бою",
"first": "Первый",
"first_hit": "Первый удар",
"flinch_count": "Кол-во повреждений",
"foreground": "Передний план",
"global_position_modifier": "Глобальный модификатор расположения",
"global_scale_modifier": "Глобальный модификатор размера",
"global_settings": "Общие настройки",
"health": "Здоровье",
"health_percentage": "Здоровье в процентах",
@@ -59,6 +64,7 @@
"highlighted_bar": "Помеченная шкала",
"highlighted_damage_bar": "Помеченная шкала урона",
"horizontal": "Горизонтально",
"hotkeys": "Горячие клавиши",
"hunter_rank": "Ранг охотника",
"hunter_rank_label": "Метка ранга охотника",
"include": "Элементы",
@@ -78,6 +84,7 @@
"me": "Я",
"menu_font": "Шрифт меню",
"mod_name": "MHR Overlay",
"modifiers": "Modifiers",
"module_visibility_on_different_screens": "Видимость модулей на разных экранах",
"modules": "Модули",
"monster_can_be_captured": "Монстр может быть схвачен",
@@ -101,9 +108,10 @@
"player_name": "Имя игрока",
"player_name_label": "Метка имени игрока",
"position": "Расположение",
"press_any_key": "Нажмите любую клавишу...",
"prioritize_large_monsters": "Большие монстры в приоритете",
"quest_summary_screen": "Экран результатов квеста",
"quest_time": "Quest Time",
"quest_result_screen": "Экран результатов квеста",
"quest_time": "Время квеста",
"rage": "Ярость",
"render_highlighted_monster": "Показывать помеченного монстра",
"render_not_highlighted_monsters": "Показывать непомеченных монстров",

View File

@@ -12,7 +12,9 @@
"customization_menu": {
"UI_font": "UI 字體",
"UI_font_notice": "當更改文字時,請重新載入",
"all_UI": "All UI",
"anchor": "錨點",
"assign_new_key": "Assign new key",
"background": "圖形化顯示條的背景底色",
"bar": "圖形化顯示條",
"body_parts": "身體部位",
@@ -43,10 +45,13 @@
"enable_on": "Enable on",
"enabled": "可見",
"family": "字體",
"fight_time": "Over Time spent in Fight",
"fight_time": "Fight Time",
"first": "第一",
"first_hit": "Starting at First Hit",
"first_hit": "First Hit",
"flinch_count": "Flinch Count",
"foreground": "圖形化顯示條的底色",
"global_position_modifier": "Global Position Modifier",
"global_scale_modifier": "Global Scale",
"global_settings": "全域設定",
"health": "生命",
"health_percentage": "生命百分比",
@@ -60,12 +65,13 @@
"highlighted_bar": "重點條",
"highlighted_damage_bar": "重點傷害條",
"horizontal": "水平",
"hotkeys": "Hotkeys",
"hunter_rank": "獵人等級",
"hunter_rank_label": "Hunter Rank Label",
"include": "細部資訊調整",
"installation_damage": "設備傷害",
"italic": "斜體",
"join_time": "Starting at Join",
"join_time": "Join Time",
"kunai_damage": "苦無傷害",
"language": "語言",
"large_monster_UI": "大型魔物 UI",
@@ -79,6 +85,7 @@
"me": "我",
"menu_font": "選單字體大小",
"mod_name": "MHR Overlay",
"modifiers": "Modifiers",
"module_visibility_on_different_screens": "不同場景中使用的模組",
"modules": "模組",
"monster_can_be_captured": "可捕獲的魔物",
@@ -102,8 +109,9 @@
"player_name": "玩家名稱",
"player_name_label": "玩家名稱",
"position": "位置",
"press_any_key": "Press any key...",
"prioritize_large_monsters": "大型魔物優先",
"quest_summary_screen": "任務結算畫面",
"quest_result_screen": "Quest Result Screen",
"quest_time": "Quest Time",
"rage": "憤怒度",
"render_highlighted_monster": "Render Highlighted Monster",