1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-24 02:44:17 +00:00

Small changes to fix notification ticks

This commit is contained in:
jugeeya 2024-02-19 17:52:37 -08:00
parent 66aa745e53
commit bb704a12ed
4 changed files with 4 additions and 23 deletions

View file

@ -786,13 +786,6 @@ unsafe fn handle_once_per_cpu_frame(_ctx: &mut InlineCtx) {
input_record::handle_recording();
frame_counter::tick_ingame();
tech::hide_tech();
// Tick notifications
let queue = &mut ui::notifications::QUEUE;
let notification = queue.first();
if notification.is_some() {
let notification = queue.first_mut().unwrap();
notification.tick();
}
}
#[skyline::hook(offset = *OFFSET_FIM)]

View file

@ -1,7 +1,7 @@
use skyline::nn::ui2d::*;
use smash::ui2d::{SmashPane, SmashTextBox};
use crate::common::{menu::QUICK_MENU_ACTIVE, TRAINING_MENU_ADDR};
use crate::common::menu::QUICK_MENU_ACTIVE;
use crate::training::ui;
macro_rules! display_parent_fmt {
($x:ident) => {
@ -22,8 +22,6 @@ macro_rules! display_txt_fmt {
}
pub unsafe fn draw(root_pane: &Pane) {
// Make sure the combo counter is being displayed before we draw
let cc_displayed = (*TRAINING_MENU_ADDR).combo_display_toggle != 0;
let notification_idx = 0;
let queue = &mut ui::notifications::QUEUE;
@ -32,20 +30,15 @@ pub unsafe fn draw(root_pane: &Pane) {
root_pane
.find_pane_by_name_recursive(display_parent_fmt!(notification_idx))
.unwrap()
.set_visible(notification.is_some() && !QUICK_MENU_ACTIVE && cc_displayed);
.set_visible(notification.is_some() && !QUICK_MENU_ACTIVE);
if notification.is_none() {
return;
}
let notification = notification.unwrap();
notification.tick();
let color = notification.color;
if !cc_displayed {
// Set the notification to drawn so we don't draw it
notification.set_drawn();
notification.force_complete();
}
if !notification.has_drawn() {
notification.set_drawn();
root_pane

View file

@ -34,11 +34,6 @@ impl Notification {
self.length -= 1;
}
// Used to force the notification to be removed from queue
pub fn force_complete(&mut self) {
self.length = 0;
}
// Returns: has_completed
pub fn check_completed(&mut self) -> bool {
if self.length <= 1 {

View file

@ -671,7 +671,7 @@ impl_toggletrait! {
OnOff,
"Frame Advantage",
"frame_advantage",
"Frame Advantage: Display the time difference between when the player is actionable and the CPU is actionable",
"Frame Advantage: Display the time difference between when the player is actionable and the CPU is actionable\nNote that the CPU must not be mashing any options.",
true,
1,
}