mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-25 12:58:06 -08:00
Add option to Freeze DPS on Quest Clear
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
local time = {};
|
local time = {};
|
||||||
local singletons;
|
local singletons;
|
||||||
local customization_menu;
|
local customization_menu;
|
||||||
|
local quest_status;
|
||||||
local player;
|
local player;
|
||||||
local config;
|
local config;
|
||||||
local small_monster;
|
local small_monster;
|
||||||
@@ -47,28 +48,25 @@ function time.tick()
|
|||||||
if time.total_elapsed_script_seconds - time.last_elapsed_script_seconds > 1 then
|
if time.total_elapsed_script_seconds - time.last_elapsed_script_seconds > 1 then
|
||||||
time.last_elapsed_script_seconds = time.total_elapsed_script_seconds;
|
time.last_elapsed_script_seconds = time.total_elapsed_script_seconds;
|
||||||
time.update_players_dps();
|
time.update_players_dps();
|
||||||
--time.update_small_monsters();
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function time.update_players_dps()
|
function time.update_players_dps()
|
||||||
local cached_config = config.current_config.damage_meter_UI.settings;
|
local cached_config = config.current_config.damage_meter_UI.settings;
|
||||||
|
|
||||||
local myself_updated = false;
|
if cached_config.freeze_dps_on_quest_clear and quest_status.is_quest_clear then
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
local new_total_dps = 0;
|
local new_total_dps = 0;
|
||||||
for _, _player in pairs(player.list) do
|
for _, _player in pairs(player.list) do
|
||||||
if _player == player.myself then
|
|
||||||
myself_updated = true;
|
|
||||||
end
|
|
||||||
|
|
||||||
if _player.join_time == -1 then
|
if _player.join_time == -1 then
|
||||||
_player.join_time = time.total_elapsed_script_seconds;
|
_player.join_time = time.total_elapsed_script_seconds;
|
||||||
end
|
end
|
||||||
|
|
||||||
if cached_config.dps_mode == "Quest Time" then
|
if cached_config.dps_mode == "Quest Time" then
|
||||||
if time.total_elapsed_seconds > 0 then
|
if time.total_elapsed_seconds > 0 then
|
||||||
player.myself.dps = player.myself.display.total_damage / time.total_elapsed_seconds;
|
_player.dps = _player.display.total_damage / time.total_elapsed_seconds;
|
||||||
end
|
end
|
||||||
elseif cached_config.dps_mode == "Join Time" then
|
elseif cached_config.dps_mode == "Join Time" then
|
||||||
if time.total_elapsed_script_seconds - _player.join_time > 0 then
|
if time.total_elapsed_script_seconds - _player.join_time > 0 then
|
||||||
@@ -83,44 +81,16 @@ function time.update_players_dps()
|
|||||||
new_total_dps = new_total_dps + _player.dps;
|
new_total_dps = new_total_dps + _player.dps;
|
||||||
end
|
end
|
||||||
|
|
||||||
if not myself_updated then
|
|
||||||
if player.myself.join_time == -1 then
|
|
||||||
player.myself.join_time = time.total_elapsed_script_seconds;
|
|
||||||
end
|
|
||||||
|
|
||||||
if cached_config.dps_mode == "Quest Time" then
|
|
||||||
if time.total_elapsed_seconds > 0 then
|
|
||||||
player.myself.dps = player.myself.display.total_damage / time.total_elapsed_seconds;
|
|
||||||
end
|
|
||||||
elseif cached_config.dps_mode == "Join Time" then
|
|
||||||
if time.total_elapsed_script_seconds - player.myself.join_time > 0 then
|
|
||||||
player.myself.dps = player.myself.display.total_damage / (time.total_elapsed_script_seconds - player.myself.join_time);
|
|
||||||
end
|
|
||||||
elseif cached_config.dps_mode == "First Hit" then
|
|
||||||
if time.total_elapsed_script_seconds - player.myself.first_hit_time > 0 then
|
|
||||||
player.myself.dps = player.myself.display.total_damage / (time.total_elapsed_script_seconds - player.myself.first_hit_time);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
new_total_dps = new_total_dps + player.myself.dps;
|
|
||||||
end
|
|
||||||
|
|
||||||
player.total.dps = new_total_dps;
|
player.total.dps = new_total_dps;
|
||||||
end
|
end
|
||||||
|
|
||||||
function time.update_small_monsters()
|
|
||||||
for enemy, monster in pairs(small_monster.list) do
|
|
||||||
small_monster.update(enemy, monster);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function time.init_module()
|
function time.init_module()
|
||||||
player = require("MHR_Overlay.Damage_Meter.player");
|
player = require("MHR_Overlay.Damage_Meter.player");
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
customization_menu = require("MHR_Overlay.UI.customization_menu");
|
||||||
time = require("MHR_Overlay.Game_Handler.time");
|
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
small_monster = require("MHR_Overlay.Monsters.small_monster");
|
||||||
|
quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||||
end
|
end
|
||||||
|
|
||||||
return time;
|
return time;
|
||||||
@@ -3740,21 +3740,26 @@ function config.init()
|
|||||||
},
|
},
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
orientation = "Vertical", -- "Vertical" or "Horizontal"
|
|
||||||
|
|
||||||
|
hide_myself = false,
|
||||||
|
hide_other_players = false,
|
||||||
|
hide_total_damage = false,
|
||||||
|
|
||||||
hide_module_if_total_damage_is_zero = false,
|
hide_module_if_total_damage_is_zero = false,
|
||||||
hide_player_if_player_damage_is_zero = false,
|
hide_player_if_player_damage_is_zero = false,
|
||||||
hide_total_if_total_damage_is_zero = false,
|
hide_total_if_total_damage_is_zero = false,
|
||||||
total_damage_offset_is_relative = true,
|
total_damage_offset_is_relative = true,
|
||||||
|
|
||||||
|
freeze_dps_on_quest_clear = true,
|
||||||
|
|
||||||
|
orientation = "Vertical", -- "Vertical" or "Horizontal"
|
||||||
highlighted_bar = "Me",
|
highlighted_bar = "Me",
|
||||||
damage_bar_relative_to = "Top Damage", -- "total damage" or "top damage"
|
damage_bar_relative_to = "Top Damage", -- "total damage" or "top damage"
|
||||||
my_damage_bar_location = "First", -- "normal" or "first" or "last"
|
my_damage_bar_location = "First", -- "normal" or "first" or "last"
|
||||||
dps_mode = "First Hit",
|
dps_mode = "First Hit",
|
||||||
|
|
||||||
hide_myself = false,
|
|
||||||
hide_other_players = false,
|
|
||||||
hide_total_damage = false,
|
|
||||||
|
|
||||||
player_name_size_limit = 150
|
player_name_size_limit = 150
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -382,6 +382,8 @@ language.default_language = {
|
|||||||
|
|
||||||
prioritize_large_monsters = "Large Monsters on High Priority",
|
prioritize_large_monsters = "Large Monsters on High Priority",
|
||||||
max_monster_updates_per_tick = "Max Monster Updates per Tick",
|
max_monster_updates_per_tick = "Max Monster Updates per Tick",
|
||||||
|
|
||||||
|
freeze_dps_on_quest_clear = "Freeze DPS when Quest is cleared"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15018,6 +15018,12 @@ function customization_menu.draw()
|
|||||||
config_changed = config_changed or changed;
|
config_changed = config_changed or changed;
|
||||||
damage_meter_UI_changed = damage_meter_UI_changed or changed;
|
damage_meter_UI_changed = damage_meter_UI_changed or changed;
|
||||||
|
|
||||||
|
changed, config.current_config.damage_meter_UI.settings.freeze_dps_on_quest_clear = imgui.checkbox(
|
||||||
|
language.current_language.customization_menu.freeze_dps_on_quest_clear,
|
||||||
|
config.current_config.damage_meter_UI.settings.freeze_dps_on_quest_clear);
|
||||||
|
config_changed = config_changed or changed;
|
||||||
|
damage_meter_UI_changed = damage_meter_UI_changed or changed;
|
||||||
|
|
||||||
changed, customization_menu.damage_meter_UI_orientation_index = imgui.combo(language.current_language.customization_menu
|
changed, customization_menu.damage_meter_UI_orientation_index = imgui.combo(language.current_language.customization_menu
|
||||||
.orientation,
|
.orientation,
|
||||||
customization_menu.damage_meter_UI_orientation_index, customization_menu.displayed_orientation_types);
|
customization_menu.damage_meter_UI_orientation_index, customization_menu.displayed_orientation_types);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"blast": "Blast",
|
"blast": "Blast",
|
||||||
"dung_bomb": "Dung Bomb",
|
"dung_bomb": "Dung Bomb",
|
||||||
"exhaust": "Exhaust",
|
"exhaust": "Exhaust",
|
||||||
"fall_otomo_trap": "Fall Otomo Trap",
|
"fall_otomo_trap": "Fall Buddy Trap",
|
||||||
"fall_trap": "Fall Trap",
|
"fall_trap": "Fall Trap",
|
||||||
"fireblight": "Fireblight",
|
"fireblight": "Fireblight",
|
||||||
"flash": "Flash",
|
"flash": "Flash",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"poison": "Poison",
|
"poison": "Poison",
|
||||||
"quick_sand": "Quick Sand",
|
"quick_sand": "Quick Sand",
|
||||||
"ride": "Wyvern Riding",
|
"ride": "Wyvern Riding",
|
||||||
"shock_otomo_trap": "Shock Otomo Trap",
|
"shock_otomo_trap": "Shock Buddy Trap",
|
||||||
"shock_trap": "Shock Trap",
|
"shock_trap": "Shock Trap",
|
||||||
"sleep": "Sleep",
|
"sleep": "Sleep",
|
||||||
"steel_fang": "Steel Fang",
|
"steel_fang": "Steel Fang",
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
"first_hit": "First Hit",
|
"first_hit": "First Hit",
|
||||||
"flinch_count": "Flinch Count",
|
"flinch_count": "Flinch Count",
|
||||||
"foreground": "Foreground",
|
"foreground": "Foreground",
|
||||||
|
"freeze_dps_on_quest_clear": "Freeze DPS when Quest is cleared",
|
||||||
"global_position_modifier": "Global Position Modifier",
|
"global_position_modifier": "Global Position Modifier",
|
||||||
"global_scale_modifier": "Global Scale Modifier",
|
"global_scale_modifier": "Global Scale Modifier",
|
||||||
"global_settings": "Global Settings",
|
"global_settings": "Global Settings",
|
||||||
@@ -164,7 +165,7 @@
|
|||||||
"orientation": "Orientation",
|
"orientation": "Orientation",
|
||||||
"other_damage": "Other Damage",
|
"other_damage": "Other Damage",
|
||||||
"other_players": "Other Players",
|
"other_players": "Other Players",
|
||||||
"otomo_damage": "Otomo Damage",
|
"otomo_damage": "Buddy Damage",
|
||||||
"part_health": "Part Health",
|
"part_health": "Part Health",
|
||||||
"part_name": "Part Name",
|
"part_name": "Part Name",
|
||||||
"part_name_label": "Part Name Label",
|
"part_name_label": "Part Name Label",
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
"first_hit": "첫 공격",
|
"first_hit": "첫 공격",
|
||||||
"flinch_count": "경직 횟수",
|
"flinch_count": "경직 횟수",
|
||||||
"foreground": "전경색",
|
"foreground": "전경색",
|
||||||
|
"freeze_dps_on_quest_clear": "Freeze DPS when Quest is cleared",
|
||||||
"global_position_modifier": "전역 위치 배율",
|
"global_position_modifier": "전역 위치 배율",
|
||||||
"global_scale_modifier": "전역 크기 배율",
|
"global_scale_modifier": "전역 크기 배율",
|
||||||
"global_settings": "전역 설정",
|
"global_settings": "전역 설정",
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
"first_hit": "Первый удар",
|
"first_hit": "Первый удар",
|
||||||
"flinch_count": "Кол-во вздрагиваний",
|
"flinch_count": "Кол-во вздрагиваний",
|
||||||
"foreground": "Передний план",
|
"foreground": "Передний план",
|
||||||
|
"freeze_dps_on_quest_clear": "Заморозить УВС после завершения квеста",
|
||||||
"global_position_modifier": "Глобальный модификатор расположения",
|
"global_position_modifier": "Глобальный модификатор расположения",
|
||||||
"global_scale_modifier": "Глобальный модификатор размера",
|
"global_scale_modifier": "Глобальный модификатор размера",
|
||||||
"global_settings": "Общие настройки",
|
"global_settings": "Общие настройки",
|
||||||
@@ -239,7 +240,7 @@
|
|||||||
"font_name": "NotoSansKR-Bold.otf",
|
"font_name": "NotoSansKR-Bold.otf",
|
||||||
"parts": {
|
"parts": {
|
||||||
"abdomen": "Брюхо",
|
"abdomen": "Брюхо",
|
||||||
"antenna": "Antenna",
|
"antenna": "Антернна",
|
||||||
"arms": "Передние лапы",
|
"arms": "Передние лапы",
|
||||||
"arms_mud": "Передние лапы (в грязи)",
|
"arms_mud": "Передние лапы (в грязи)",
|
||||||
"back": "Спина",
|
"back": "Спина",
|
||||||
@@ -247,49 +248,49 @@
|
|||||||
"body": "Тело",
|
"body": "Тело",
|
||||||
"body_mud": "Тело (в грязи)",
|
"body_mud": "Тело (в грязи)",
|
||||||
"carapace": "Панцирь",
|
"carapace": "Панцирь",
|
||||||
"chest": "Chest",
|
"chest": "Грудь",
|
||||||
"chest_windsac": "Грудь (мешочек)",
|
"chest_windsac": "Грудь (мешочек)",
|
||||||
"claw": "Когти",
|
"claw": "Когти",
|
||||||
"crest": "Crest",
|
"crest": "Crest",
|
||||||
"dorsal_fin": "Спинной плавник",
|
"dorsal_fin": "Спинной плавник",
|
||||||
"foreleg": "Foreleg",
|
"foreleg": "Передняя лапа",
|
||||||
"forelegs": "Forelegs",
|
"forelegs": "Передние лапы",
|
||||||
"head": "Голова",
|
"head": "Голова",
|
||||||
"head_mud": "Голова (в грязи)",
|
"head_mud": "Голова (в грязи)",
|
||||||
"hind_leg": "Hind Leg",
|
"hind_leg": "Задняя лапа",
|
||||||
"hind_legs": "Hind Legs",
|
"hind_legs": "Задние лапы",
|
||||||
"large_mudbulb": "Большой мешочек грязи",
|
"large_mudbulb": "Большой мешочек грязи",
|
||||||
"left_arm": "Передняя лапа Л",
|
"left_arm": "Передняя лапа Л",
|
||||||
"left_arm_ice": "Передняя лапа Л (во льду)",
|
"left_arm_ice": "Передняя лапа Л (во льду)",
|
||||||
"left_claw": "Клешня Л",
|
"left_claw": "Клешня Л",
|
||||||
"left_cutwing": "Крыло Л",
|
"left_cutwing": "Крыло Л",
|
||||||
"left_foreleg": "Foreleg L",
|
"left_foreleg": "Передняя лапа Л",
|
||||||
"left_hind_leg": "Hind Leg L",
|
"left_hind_leg": "Задня лапа Л",
|
||||||
"left_leg": "Задняя лапа Л",
|
"left_leg": "Задняя лапа Л",
|
||||||
"left_leg_mud": "Задняя лапа Л (в грязи)",
|
"left_leg_mud": "Задняя лапа Л (в грязи)",
|
||||||
"left_legs": "Левые лапы",
|
"left_legs": "Левые лапы",
|
||||||
"left_wing": "Крыло Л",
|
"left_wing": "Крыло Л",
|
||||||
"left_wingclaw": "Wingclaw L",
|
"left_wingclaw": "Крыло-коготь Л",
|
||||||
"legs": "Задние лапы",
|
"legs": "Задние лапы",
|
||||||
"lower_back": "Нижняя часть спины",
|
"lower_back": "Нижняя часть спины",
|
||||||
"lower_body": "Нижняя часть тела",
|
"lower_body": "Нижняя часть тела",
|
||||||
"mane": "Грива",
|
"mane": "Грива",
|
||||||
"mudbulb": "Mudbulb",
|
"mudbulb": "Мешочек грязи",
|
||||||
"neck": "Шея",
|
"neck": "Шея",
|
||||||
"rear": "Зад",
|
"rear": "Зад",
|
||||||
"right_arm": "Передняя лапа П",
|
"right_arm": "Передняя лапа П",
|
||||||
"right_arm_ice": "Передняя лапа П (во льду)",
|
"right_arm_ice": "Передняя лапа П (во льду)",
|
||||||
"right_claw": "Клешня П",
|
"right_claw": "Клешня П",
|
||||||
"right_cutwing": "Крыло П",
|
"right_cutwing": "Крыло П",
|
||||||
"right_foreleg": "Foreleg R",
|
"right_foreleg": "Передняя лапа П",
|
||||||
"right_hind_leg": "Hind Leg R",
|
"right_hind_leg": "Задняя лапа П",
|
||||||
"right_leg": "Задняя лапа П",
|
"right_leg": "Задняя лапа П",
|
||||||
"right_leg_mud": "Задняя лапа П (в грязи)",
|
"right_leg_mud": "Задняя лапа П (в грязи)",
|
||||||
"right_legs": "Правые лапы",
|
"right_legs": "Правые лапы",
|
||||||
"right_wing": "Крыло П",
|
"right_wing": "Крыло П",
|
||||||
"right_wingclaw": "Wingclaw R",
|
"right_wingclaw": "Крыло-коготь П",
|
||||||
"rock": "Камень",
|
"rock": "Камень",
|
||||||
"shell": "Shell",
|
"shell": "Панцирь",
|
||||||
"spinning": "Вращение",
|
"spinning": "Вращение",
|
||||||
"tail": "Хвост",
|
"tail": "Хвост",
|
||||||
"tail_mud": "Хвост (в грязи)",
|
"tail_mud": "Хвост (в грязи)",
|
||||||
@@ -300,8 +301,8 @@
|
|||||||
"unknown": "?",
|
"unknown": "?",
|
||||||
"upper_back": "Верхняя часть спины",
|
"upper_back": "Верхняя часть спины",
|
||||||
"upper_body": "Верхняя часть тела",
|
"upper_body": "Верхняя часть тела",
|
||||||
"wingclaw": "Wingclaw",
|
"wingclaw": "Крыло-коготь",
|
||||||
"wingclaws": "Wingclaws",
|
"wingclaws": "Крыло-коготь",
|
||||||
"wings": "Крылья"
|
"wings": "Крылья"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
"first_hit": "第一击",
|
"first_hit": "第一击",
|
||||||
"flinch_count": "胆怯次数",
|
"flinch_count": "胆怯次数",
|
||||||
"foreground": "前景",
|
"foreground": "前景",
|
||||||
|
"freeze_dps_on_quest_clear": "Freeze DPS when Quest is cleared",
|
||||||
"global_position_modifier": "全局位置更改",
|
"global_position_modifier": "全局位置更改",
|
||||||
"global_scale_modifier": "全局比例更改",
|
"global_scale_modifier": "全局比例更改",
|
||||||
"global_settings": "全局设定",
|
"global_settings": "全局设定",
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
"first_hit": "第一擊",
|
"first_hit": "第一擊",
|
||||||
"flinch_count": "膽怯次數",
|
"flinch_count": "膽怯次數",
|
||||||
"foreground": "圖形化顯示條的底色",
|
"foreground": "圖形化顯示條的底色",
|
||||||
|
"freeze_dps_on_quest_clear": "Freeze DPS when Quest is cleared",
|
||||||
"global_position_modifier": "全域位置更改",
|
"global_position_modifier": "全域位置更改",
|
||||||
"global_scale_modifier": "全域比例更改",
|
"global_scale_modifier": "全域比例更改",
|
||||||
"global_settings": "全域設定",
|
"global_settings": "全域設定",
|
||||||
|
|||||||
Reference in New Issue
Block a user