From 22ded3b379f4b2ed98896e98b445c59491a97a1a Mon Sep 17 00:00:00 2001 From: jugeeya Date: Thu, 23 Feb 2023 09:51:50 -0800 Subject: [PATCH] Fix arena UI disappearing (#494) --- src/training/ui/mod.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/training/ui/mod.rs b/src/training/ui/mod.rs index 7a2262c..87d1e24 100644 --- a/src/training/ui/mod.rs +++ b/src/training/ui/mod.rs @@ -15,19 +15,27 @@ pub mod notifications; #[skyline::hook(offset = 0x4b620)] pub unsafe fn handle_draw(layout: *mut Layout, draw_info: u64, cmd_buffer: u64) { - let layout_name = &skyline::from_c_str((*layout).layout_name); + let layout_name = skyline::from_c_str((*layout).layout_name); let root_pane = &mut *(*layout).root_pane; // Set HUD to invisible if HUD is toggled off - if is_training_mode() && is_ready_go() && layout_name != "info_training" { + if is_training_mode() + && is_ready_go() + && [ + "info_playercursor", + "info_playercursor_item", + "info_melee", + "info_radar_a", + "info_radar_b", + ] + .contains(&layout_name.as_str()) + { // InfluencedAlpha means "Should my children panes' alpha be influenced by mine, as the parent?" root_pane.flags |= 1 << PaneFlag::InfluencedAlpha as u8; root_pane.set_visible(MENU.hud == OnOff::On); - } else { - root_pane.set_visible(true); } - damage::draw(root_pane, layout_name); + damage::draw(root_pane, &layout_name); if layout_name == "info_training" { display::draw(root_pane);