diff --git a/src/api.lua b/src/api.lua index 2122cfa..8b0c161 100644 --- a/src/api.lua +++ b/src/api.lua @@ -321,7 +321,7 @@ function i3.hud_notif(name, msg, img) local player = get_player_by_name(name) if not player then return end - local max_y = -120 + local max_y = -125 local def = { show = true, diff --git a/src/common.lua b/src/common.lua index 8fcfb91..9dc9189 100644 --- a/src/common.lua +++ b/src/common.lua @@ -640,29 +640,29 @@ local function init_hud_notif(player) return { bg = player:hud_add { hud_elem_type = "image", - position = {x = 1, y = 1}, - offset = {x = -330, y = 0}, - alignment = {x = 1, y = 1}, - scale = {x = 0.6, y = 0.6}, + position = {x = 0, y = 1}, + offset = {x = 10, y = 0}, + alignment = {x = 1, y = 1}, + scale = {x = 0.6, y = 0.6}, text = "i3_bg_notif.png", z_index = 0xDEAD, }, img = player:hud_add { hud_elem_type = "image", - position = {x = 1, y = 1}, - offset = {x = -320, y = 20}, - alignment = {x = 1, y = 1}, - scale = {x = 1, y = 1}, + position = {x = 0, y = 1}, + offset = {x = 20, y = 20}, + alignment = {x = 1, y = 1}, + scale = {x = 1, y = 1}, text = "", z_index = 0xDEAD, }, text = player:hud_add { hud_elem_type = "text", - position = {x = 1, y = 1}, - offset = {x = -245, y = 40}, - alignment = {x = 1, y = 1}, + position = {x = 0, y = 1}, + offset = {x = 100, y = 40}, + alignment = {x = 1, y = 1}, number = 0xffffff, text = "", z_index = 0xDEAD, diff --git a/src/hud.lua b/src/hud.lua index 5019351..f6f81e6 100644 --- a/src/hud.lua +++ b/src/hud.lua @@ -1,4 +1,4 @@ -IMPORT("abs", "max", "ceil", "remove", "str_to_pos") +IMPORT("max", "ceil", "remove", "str_to_pos") IMPORT("get_connected_players", "add_hud_waypoint") local function init_hud(player) @@ -57,7 +57,7 @@ local function show_hud(player, data, notif, idx, dt) player:hud_change(def, "offset", { x = hud_info.offset.x, - y = hud_info.offset.y - (speed * max(1, (#data.hud.notifs - idx + 1) / 1.4)) + y = hud_info.offset.y - (speed * max(1, (#data.hud.notifs - idx + 1) / 1.45)) }) end elseif notif.show == false and notif.hud_timer >= i3.settings.hud_timer_max then @@ -67,11 +67,11 @@ local function show_hud(player, data, notif, idx, dt) local hud_info = player:hud_get(def) player:hud_change(def, "offset", { - x = hud_info.offset.x + speed, + x = hud_info.offset.x - speed, y = hud_info.offset.y }) - if hud_info.offset.x > abs(notif.max.x) then + if hud_info.offset.x < notif.max.x then player:hud_remove(def) remove(data.hud.notifs, idx) end diff --git a/textures/i3_bg_notif.png b/textures/i3_bg_notif.png index c136571..161bee0 100644 Binary files a/textures/i3_bg_notif.png and b/textures/i3_bg_notif.png differ