mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Added hotkeys, separated player initialization and drawing.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user