1#include "Layout/FooterParts.h"
2
3#include "Library/Layout/LayoutActionFunction.h"
4#include "Library/Layout/LayoutActorUtil.h"
5#include "Library/Layout/LayoutInitInfo.h"
6#include "Library/Nerve/NerveSetupUtil.h"
7#include "Library/Nerve/NerveUtil.h"
8
9namespace {
10NERVE_IMPL(FooterParts, Wait);
11NERVE_IMPL(FooterParts, FadeOut);
12NERVE_IMPL(FooterParts, FadeIn);
13
14NERVES_MAKE_NOSTRUCT(FooterParts, Wait, FadeOut, FadeIn);
15} // namespace
16
17FooterParts::FooterParts(al::LayoutActor* parentLayout, const al::LayoutInitInfo& info,
18 const char16* footerText, const char* textPane, const char* partPane)
19 : al::LayoutActor("フッターパーツ"), mTextPane(textPane), mText(footerText) {
20 al::initLayoutPartsActor(this, parentLayout, info, partPane, nullptr);
21
22 al::setPaneString(this, mTextPane, mText, 0);
23 initNerve(&Wait, 0);
24}
25
26void FooterParts::changeText(const char16* text) {
27 mText = text;
28 al::setPaneString(this, mTextPane, text, 0);
29}
30
31void FooterParts::changeTextFade(const char16* text) {
32 mText = text;
33 al::setNerve(user: this, nerve: &FadeIn);
34}
35
36bool FooterParts::tryChangeTextFade(const char16* text) {
37 if (mText == text)
38 return false;
39 changeTextFade(text);
40 return true;
41}
42
43void FooterParts::exeWait() {
44 if (al::isFirstStep(user: this))
45 al::startAction(layout: this, actionName: "Wait", paneName: 0);
46}
47
48void FooterParts::exeFadeOut() {}
49
50void FooterParts::exeFadeIn() {
51 if (al::isFirstStep(user: this)) {
52 al::setPaneString(this, mTextPane, mText, 0);
53 al::startAction(layout: this, actionName: "FadeIn", paneName: 0);
54 }
55 if (al::isActionEnd(layout: this, paneName: nullptr))
56 al::setNerve(user: this, nerve: &Wait);
57}
58