From 54415c5bb479078f93968b7b60885c334ee6da37 Mon Sep 17 00:00:00 2001 From: ArthurKun <16458204+ArthurKun21@users.noreply.github.com> Date: Wed, 14 Aug 2024 19:03:47 +0800 Subject: [PATCH] fix kukulkan showing on master skills (#1842) --- .../ui/skill_maker/SkillMakerActivity.kt | 1 + .../ui/skill_maker/SkillMakerTarget.kt | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerActivity.kt b/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerActivity.kt index 71d25ab83..0372dd3dd 100644 --- a/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerActivity.kt +++ b/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerActivity.kt @@ -152,6 +152,7 @@ fun SkillMakerUI( onSpaceIshtar = { navigate(SkillMakerNav.SpaceIshtar(nav.skill)) }, + showKukulkan = nav.skill !is Skill.Master, onKukulkan = { navigate(SkillMakerNav.Kukulkan(nav.skill)) }, diff --git a/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerTarget.kt b/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerTarget.kt index da15b2795..3211e6395 100644 --- a/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerTarget.kt +++ b/app/src/main/java/io/github/fate_grand_automata/ui/skill_maker/SkillMakerTarget.kt @@ -28,6 +28,7 @@ fun SkillMakerTarget( onEmiya: () -> Unit, showSpaceIshtar: Boolean, onSpaceIshtar: () -> Unit, + showKukulkan: Boolean, onKukulkan: () -> Unit, showMelusine: Boolean, onMelusine: () -> Unit @@ -72,8 +73,10 @@ fun SkillMakerTarget( modifier = Modifier .fillMaxWidth() ) { - Button(onClick = onKukulkan) { - Text(stringResource(R.string.skill_maker_kukulkan)) + if (showKukulkan) { + Button(onClick = onKukulkan) { + Text(stringResource(R.string.skill_maker_kukulkan)) + } } if ( @@ -118,7 +121,12 @@ fun TestSkillMakerTargetIshtar() = TestSkillMaker(showSpaceIshtar = true) fun TestSkillMakerOnlyKukulkan() = TestSkillMaker() @Composable -private fun TestSkillMaker(showEmiya: Boolean = false, showSpaceIshtar: Boolean = false, showMelusine: Boolean = showEmiya) { +private fun TestSkillMaker( + showEmiya: Boolean = false, + showKukulkan: Boolean = false, + showSpaceIshtar: Boolean = false, + showMelusine: Boolean = showEmiya +) { FGATheme { SkillMakerTarget( onSkillTarget = {}, @@ -126,6 +134,7 @@ private fun TestSkillMaker(showEmiya: Boolean = false, showSpaceIshtar: Boolean onEmiya = {}, showSpaceIshtar = showSpaceIshtar, onSpaceIshtar = {}, + showKukulkan = showKukulkan, onKukulkan = {}, showMelusine = showMelusine, onMelusine = {}