From 734b09b69f6080e91d4c439e88af42f6109983b0 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 29 Aug 2022 11:28:46 +0200 Subject: [PATCH] Minor cleaning --- src/hud.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/hud.lua b/src/hud.lua index 4326b26..28eb09a 100644 --- a/src/hud.lua +++ b/src/hud.lua @@ -105,28 +105,22 @@ core.register_globalstep(function(dt) local data = i3.data[name] if not data then return end - local function reset() - player:hud_change(data.hud.wielditem, "text", "") - data.timer = 0 - end - if not data.wielditem_hud then - return reset() + player:hud_change(data.hud.wielditem, "text", "") + return end data.timer = (data.timer or 0) + dt - local wieldidx = player:get_wield_index() if wieldidx == data.old_wieldidx then if data.timer >= i3.settings.wielditem_fade_after then - return reset() + player:hud_change(data.hud.wielditem, "text", "") end return - else - data.timer = 0 end + data.timer = 0 data.old_wieldidx = wieldidx local wielditem = player:get_wielded_item()