From c5dbdaddd02b7f1cd5a454a10510b1be6e2f7d80 Mon Sep 17 00:00:00 2001 From: jugeeya Date: Tue, 15 Aug 2023 09:51:01 -0700 Subject: [PATCH] Dedupe, some color changes --- Cargo.toml | 3 ++- src/training/ui/input_log.rs | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c73956a..0e02116 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ skyline-web = { git = "https://github.com/skyline-rs/skyline-web.git" } bitflags = "1.2.1" parking_lot = { version = "0.12.0", features = ["nightly"] } include-flate = "0.1.4" +itertools = "0.11.0" lazy_static = "1.4.0" modular-bitfield = "0.11.2" owo-colors = "2.1.0" @@ -52,7 +53,7 @@ titleid = "01006A800016E000" plugin-dependencies = [ { name = "libnro_hook.nro", url = "https://github.com/ultimate-research/nro-hook-plugin/releases/download/v0.4.0/libnro_hook.nro" }, { name = "libparam_hook.nro", url = "https://github.com/ultimate-research/params-hook-plugin/releases/download/v0.1.1/libparam_hook.nro" }, - { name = "libnn_hid_hook.nro", url = "https://github.com/jugeeya/nn-hid-hook/releases/download/beta/libnn_hid_hook.nro" } + { name = "libnn_hid_hook.nro", url = "https://github.com/jugeeya/nn-hid-hook/releases/download/beta/libnn_hid_hook.nro" }, ] [features] diff --git a/src/training/ui/input_log.rs b/src/training/ui/input_log.rs index 87cdd6d..21bfb3c 100644 --- a/src/training/ui/input_log.rs +++ b/src/training/ui/input_log.rs @@ -1,3 +1,4 @@ +use itertools::Itertools; use skyline::nn::ui2d::*; use smash::ui2d::{SmashPane, SmashTextBox}; use training_mod_consts::ButtonConfig; @@ -62,8 +63,8 @@ pub unsafe fn draw(root_pane: &Pane) { Buttons::SPECIAL | Buttons::SPECIAL_RAW | Buttons::SPECIAL_RAW2 => ( name_to_font_glyph(ButtonConfig::B, *p1_style_ptr), ResColor { - r: 0, - g: 255, + r: 255, + g: 0, b: 0, a: 255, }, @@ -98,7 +99,7 @@ pub unsafe fn draw(root_pane: &Pane) { Buttons::STOCK_SHARE => ( name_to_font_glyph(ButtonConfig::PLUS, *p1_style_ptr), ResColor { - r: 255, + r: 0, g: 255, b: 255, a: 255, @@ -107,7 +108,7 @@ pub unsafe fn draw(root_pane: &Pane) { Buttons::APPEAL_HI => ( name_to_font_glyph(ButtonConfig::DPAD_UP, *p1_style_ptr), ResColor { - r: 255, + r: 0, g: 255, b: 255, a: 255, @@ -116,7 +117,7 @@ pub unsafe fn draw(root_pane: &Pane) { Buttons::APPEAL_LW => ( name_to_font_glyph(ButtonConfig::DPAD_DOWN, *p1_style_ptr), ResColor { - r: 255, + r: 0, g: 255, b: 255, a: 255, @@ -125,7 +126,7 @@ pub unsafe fn draw(root_pane: &Pane) { Buttons::APPEAL_SL => ( name_to_font_glyph(ButtonConfig::DPAD_LEFT, *p1_style_ptr), ResColor { - r: 255, + r: 0, g: 255, b: 255, a: 255, @@ -134,7 +135,7 @@ pub unsafe fn draw(root_pane: &Pane) { Buttons::APPEAL_SR => ( name_to_font_glyph(ButtonConfig::DPAD_RIGHT, *p1_style_ptr), ResColor { - r: 255, + r: 0, g: 255, b: 255, a: 255, @@ -150,6 +151,7 @@ pub unsafe fn draw(root_pane: &Pane) { None }) + .unique_by(|(icon, _)| *icon) .collect::>(); // Empty them first