public void RunTick() { if (this.notifications.Count == 0 && this.incomingNotif is UIGroupNotify == false) { return; } UIGroupNotify delNotif = null; // Update the Incoming Notification Position, if applicable. if (this.incomingNotif is UIGroupNotify) { // Update the Incoming Notification's Y Total Movement. this.incomingMoved += 2; // We need to snap the Incoming Notification into place once it arrives. if (this.incomingMoved > this.incomingNotif.height) { this.SendIncomingNotificationToList(); } } // Loop through all notifications and process transitions, exit frames. foreach (var notif in this.notifications) { // Check Notification Exit Mechanics if (notif.exitFrame > 0 && notif.exitFrame <= Systems.timer.UniFrame) { int finalFrame = notif.exitFrame + UIHandler.theme.notifs.exitDuration; // Draw Fade Effect during the fade itself. notif.alpha = 1 - Spectrum.GetPercentFromValue(Systems.timer.UniFrame, notif.exitFrame, finalFrame); // Delete the notification if their exit has finalized. if (Systems.timer.UniFrame > finalFrame) { delNotif = notif; } } } // Remove a notification that was marked for deletion this frame. if (delNotif is UIGroupNotify) { this.notifications.Remove(delNotif); } }
public void RunTick() { // Check Notification Exit Mechanics if (this.exitFrame > 0 && this.exitFrame <= Systems.timer.UniFrame) { int finalFrame = this.exitFrame + UIHandler.theme.notifs.exitDuration; // Draw Fade Effect during the fade itself. this.alpha = 1 - Spectrum.GetPercentFromValue(Systems.timer.UniFrame, this.exitFrame, finalFrame); // Delete the thisication if their exit has finalized. if (Systems.timer.UniFrame > finalFrame) { this.alpha = 0; this.exitFrame = 0; } } }
public void RunTick() { // Only Run Tool Tip Mechanics if it's been maintained. if (this.endFrame == 0) { return; } // Check Notification Exit Mechanics if (this.endFrame <= Systems.timer.UniFrame) { int finalFrame = this.endFrame + UIHandler.theme.tooltips.EndDuration; // Draw Fade Effect during the fade itself. this.alpha = 1 - Spectrum.GetPercentFromValue(Systems.timer.UniFrame, this.endFrame, finalFrame); // Clear the ToolTip mechanics if it's been ended. if (Systems.timer.UniFrame > finalFrame) { this.endFrame = 0; } } }
public static float ConvertToPercent(float radian) { return(Spectrum.GetPercentFromValue(Radians.Wrap(radian), (0 - (float)Math.PI), (float)Math.PI)); }
// Conversions public static float ConvertToPercent(float degrees) { return(Spectrum.GetPercentFromValue(Radians.Wrap(degrees), -180f, 180f)); }