_G.HOXHUD = _G.HOXHUD or {}
HOXHUD.mod_path = ModPath

Hooks:PostHook(HUDBlackScreen, "init", "init_hox", function(self, hud)
    local hox_text = self._blackscreen_panel:text({
        name = "hox_text",
        y = 100,
        vertical = "center",
        align = "center",
        text = "000",
        visible = true,
        layer = 1,
        color = Color.white,
        valign = {
            0.8,
            1
        },
        font_size = tweak_data.hud.default_font_size,
        font = tweak_data.hud.medium_font,
        w = self._blackscreen_panel:w()
    })
    local _, _, _, h1 = hox_text:text_rect()

    hox_text:set_h(h1)
    hox_text:set_center_x(self._blackscreen_panel:center_x())
    hox_text:set_center_y(self._blackscreen_panel:h() / 2.9)
end)

Hooks:PostHook(HUDBlackScreen, "set_mid_text", "set_mid_text_hox", function(self, text)
    local hox_text = self._blackscreen_panel:child("hox_text")

    hox_text:set_alpha(0)
    hox_text:set_text(utf8.to_upper("HOXHUD v1.133769420 INITIALIZED"))
    if blt.xaudio then
        blt.xaudio.setup()
        XAudio.Source:new(XAudio.Buffer:new(HOXHUD.mod_path .. "hoxhud-initialised.ogg"))
    end
end)
    

Hooks:PostHook(HUDBlackScreen, "fade_in_mid_text", "fade_in_hox_text", function(self, ...)
    self._blackscreen_panel:child("hox_text"):animate(callback(self, self, "_animate_fade_in"))
end)

Hooks:PostHook(HUDBlackScreen, "fade_out_mid_text", "fade_out_hox_text", function(self, ...)
    self._blackscreen_panel:child("hox_text"):animate(callback(self, self, "_animate_fade_out"))
end)
