diff --git a/gen/src/skill.rs b/gen/src/skill.rs index 1c4e634..7fef850 100644 --- a/gen/src/skill.rs +++ b/gen/src/skill.rs @@ -173,7 +173,7 @@ fn process_skill_mode( if mode_row.use_init { Token::NewLine.write(out); - terms.get_tips("WD_UseInit", "TIPS_UseInit").write(out); + terms.get_tips("NM-TIPS_UseInit", "TIPS_UseInit").write(out); } tail @@ -289,7 +289,7 @@ fn act_node_formatter( } else { Token::Indent.write(out); terms - .get("DC-SkillNodeDesc-CritRate") + .get_tips("DC-SkillNodeDesc-CritRate", "TIPS_SCritRate") .map_var_1(|out| Token::Text(row.crit_rate.to_string()).write(out)) .write(out); } @@ -327,7 +327,7 @@ fn act_node_formatter( //let pair = row.inc_relate.split(':').collect::>(); let key = &row.inc_relate; match terms.try_get(&format!("NM-{}", key)) { - Some(s) => terms + Some(_) => terms .get_tips(&format!("NM-{}", key), &format!("{}", key)) .write(out), None => match terms.try_get(&format!("DC-SkillNodeDesc-Relate-{}", key)) { diff --git a/public/i18n/de/database.msgpack b/public/i18n/de/database.msgpack index 333f390..1571525 100644 Binary files a/public/i18n/de/database.msgpack and b/public/i18n/de/database.msgpack differ diff --git a/public/i18n/en/database.msgpack b/public/i18n/en/database.msgpack index ab05a91..b9979a8 100644 Binary files a/public/i18n/en/database.msgpack and b/public/i18n/en/database.msgpack differ diff --git a/public/i18n/es/database.msgpack b/public/i18n/es/database.msgpack index 95d8665..df38cf2 100644 Binary files a/public/i18n/es/database.msgpack and b/public/i18n/es/database.msgpack differ diff --git a/public/i18n/fr/database.msgpack b/public/i18n/fr/database.msgpack index 0bf9856..3535629 100644 Binary files a/public/i18n/fr/database.msgpack and b/public/i18n/fr/database.msgpack differ diff --git a/public/i18n/it/database.msgpack b/public/i18n/it/database.msgpack index 7df4da0..247d914 100644 Binary files a/public/i18n/it/database.msgpack and b/public/i18n/it/database.msgpack differ diff --git a/public/i18n/ja/database.msgpack b/public/i18n/ja/database.msgpack index e5bbe8d..66392e7 100644 Binary files a/public/i18n/ja/database.msgpack and b/public/i18n/ja/database.msgpack differ diff --git a/public/i18n/ko/database.msgpack b/public/i18n/ko/database.msgpack index b9e34ef..bf84c45 100644 Binary files a/public/i18n/ko/database.msgpack and b/public/i18n/ko/database.msgpack differ diff --git a/public/i18n/pt-BR/database.msgpack b/public/i18n/pt-BR/database.msgpack index 2e89903..00dbe22 100644 Binary files a/public/i18n/pt-BR/database.msgpack and b/public/i18n/pt-BR/database.msgpack differ diff --git a/public/i18n/pt/database.msgpack b/public/i18n/pt/database.msgpack index b4710b2..88398ac 100644 Binary files a/public/i18n/pt/database.msgpack and b/public/i18n/pt/database.msgpack differ diff --git a/public/i18n/ru/database.msgpack b/public/i18n/ru/database.msgpack index dc445f4..c9d90cb 100644 Binary files a/public/i18n/ru/database.msgpack and b/public/i18n/ru/database.msgpack differ diff --git a/public/i18n/zh-CN/database.msgpack b/public/i18n/zh-CN/database.msgpack index 18881bc..9d85471 100644 Binary files a/public/i18n/zh-CN/database.msgpack and b/public/i18n/zh-CN/database.msgpack differ diff --git a/public/i18n/zh-TW/database.msgpack b/public/i18n/zh-TW/database.msgpack index 6f1a231..85ccc84 100644 Binary files a/public/i18n/zh-TW/database.msgpack and b/public/i18n/zh-TW/database.msgpack differ diff --git a/src/components/skill_view.rs b/src/components/skill_view.rs index 05f1bdb..fbcd984 100644 --- a/src/components/skill_view.rs +++ b/src/components/skill_view.rs @@ -2,17 +2,20 @@ use dioxus::html::geometry::euclid::Rect; use dioxus::prelude::*; use dioxus_router::prelude::Link; use dioxus_signals::{use_selector, use_signal, Signal}; -use dioxus_web::WebEventExt; use fermi::use_read; -use crate::atoms::DATABASE; use data::token::{Token, Tokens}; +use crate::atoms::DATABASE; use crate::components::{Rarity, SpriteIcon}; use crate::pages::Route; #[component] -pub fn SkillView(cx: Scope, skill: Signal) -> Element { +pub fn SkillView( + cx: Scope, + skill: Signal, + #[props(default = false)] debug: bool, +) -> Element { render! { div { class: "flex flex-col border-solid border border-base-300 rounded-md my-2", @@ -34,7 +37,7 @@ pub fn SkillView(cx: Scope, skill: Signal) -> Element { div { class: "flex flex-row flex-wrap gap-2 p-2", for mode in skill.read().modes.iter().filter(|_m| true) { div { class: "flex-1 min-w-48", - SkillMode { mode: Signal::new(mode.clone()) } + SkillMode { mode: Signal::new(mode.clone()), debug: *debug } } } } @@ -43,7 +46,11 @@ pub fn SkillView(cx: Scope, skill: Signal) -> Element { } #[component] -pub fn SkillMode(cx: Scope, mode: Signal) -> Element { +pub fn SkillMode( + cx: Scope, + mode: Signal, + #[props(default = false)] debug: bool, +) -> Element { render! { div { class: "flex flex-col gap-2 bg-base-200 text-base-content rounded-md p-2", div { class: "flex flex-row items-center gap-2", @@ -51,26 +58,9 @@ pub fn SkillMode(cx: Scope, mode: Signal) -> Element { div { class: "flex-grow", "{mode.read().name}" } - // div { class: "dropdown", - // div { class: "btn btn-ghost btn-circle btn-sm", - // tabindex: 0, - // role: "button", - // dangerous_inner_html: r#""#, - // } - // ul { class: "menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52", - // tabindex: 0, - // li { - // button { - // class: "btn btn-ghost btn-sm justify-start", - // onclick: move |_| log::info!("{:#?}", mode), - // "Dump" - // } - // } - // } - // } } div { class: "bg-base-100 p-2", - Description { tokens: mode.read().format() } + Description { tokens: mode.read().format(), debug: *debug } } } } @@ -126,7 +116,7 @@ fn to_nodes(tokens: &Tokens) -> Vec { } #[component] -fn RenderNode(cx: Scope, node: Node, #[props(default = true)] debug: bool) -> Element { +fn RenderNode(cx: Scope, node: Node, #[props(default = false)] debug: bool) -> Element { match node { Node::Text(text) => render! { "{text}" }, Node::NewLine => render! { br {} }, @@ -158,7 +148,7 @@ fn RenderNode(cx: Scope, node: Node, #[props(default = true)] debug: bool) -> El span { class: "text-primary", title: "{title}", for node in &children { - RenderNode { node: node.clone() } + RenderNode { node: node.clone(), debug: *debug } } } } @@ -181,18 +171,23 @@ fn RenderNode(cx: Scope, node: Node, #[props(default = true)] debug: bool) -> El } #[component] -pub fn Description(cx: Scope, tokens: Tokens) -> Element { +pub fn Description(cx: Scope, tokens: Tokens, #[props(default = false)] debug: bool) -> Element { let nodes = to_nodes(tokens); render! { for node in &nodes { - RenderNode { node: node.clone() } + RenderNode { node: node.clone(), debug: *debug } } } } #[component] -pub fn Tooltip<'a>(cx: Scope<'a>, name: String, children: Element<'a>) -> Element { +pub fn Tooltip<'a>( + cx: Scope<'a>, + name: String, + #[props(default = false)] debug: bool, + children: Element<'a>, +) -> Element { let db = use_read(cx, &DATABASE); let title = db.term.get(&format!("NM-{}", name)); @@ -230,9 +225,9 @@ pub fn Tooltip<'a>(cx: Scope<'a>, name: String, children: Element<'a>) -> Elemen }, div { class: "card-body", span { class: "font-bold", - Description { tokens: title } + Description { tokens: title, debug: *debug } } - Description { tokens: body } + Description { tokens: body, debug: *debug } } } } diff --git a/src/pages.rs b/src/pages.rs index a4553ac..0e3855f 100644 --- a/src/pages.rs +++ b/src/pages.rs @@ -10,7 +10,7 @@ use crate::components::Footer; use crate::components::NavBar; use crate::pages::skill::SkillListQuery; use home::Home; -use skill::{SkillListPage, SkillPage}; +use skill::{SkillDebugPage, SkillListPage, SkillPage}; /// An enum of all of the possible routes in the app. #[derive(Routable, Clone)] @@ -20,6 +20,8 @@ pub enum Route { Home {}, #[route("/skill?:query")] SkillListPage { query: SkillListQuery }, + #[route("/skill/_debug")] + SkillDebugPage {}, #[route("/skill/:skill_id")] SkillPage { skill_id: String }, #[route("/:..route")] diff --git a/src/pages/skill.rs b/src/pages/skill.rs index cc44b03..f10aee0 100644 --- a/src/pages/skill.rs +++ b/src/pages/skill.rs @@ -1,5 +1,7 @@ +pub use debug::*; pub use list::*; pub use view::*; +mod debug; mod list; mod view; diff --git a/src/pages/skill/debug.rs b/src/pages/skill/debug.rs new file mode 100644 index 0000000..4909034 --- /dev/null +++ b/src/pages/skill/debug.rs @@ -0,0 +1,17 @@ +use dioxus::prelude::*; +use dioxus_signals::Signal; +use fermi::use_read; + +use crate::atoms::DATABASE; +use crate::components::SkillView; + +#[component] +pub fn SkillDebugPage(cx: Scope) -> Element { + let db = use_read(cx, &DATABASE); + + render! { + for skill in db.skill.iter() { + SkillView { skill: Signal::new(skill.clone()), debug: true } + } + } +}