1#include "Layout/BootLayout.h"
2
3#include "Library/Layout/LayoutActionFunction.h"
4#include "Library/Layout/LayoutInitInfo.h"
5#include "Library/Nerve/NerveSetupUtil.h"
6#include "Library/Nerve/NerveUtil.h"
7
8namespace {
9NERVE_IMPL(BootLayout, Appear);
10NERVE_IMPL(BootLayout, Wait);
11NERVE_IMPL(BootLayout, StartWipe);
12NERVE_IMPL(BootLayout, EndWipe);
13NERVE_IMPL(BootLayout, End);
14
15NERVES_MAKE_NOSTRUCT(BootLayout, Appear, Wait, StartWipe, EndWipe, End);
16} // namespace
17
18BootLayout::BootLayout(const al::LayoutInitInfo& info) : al::LayoutActor("[起動]BootLoading") {
19 al::initLayoutActor(this, info, "BootLoading", 0);
20 mParBg = new al::LayoutActor("[起動]BG");
21 al::initLayoutPartsActor(mParBg, this, info, "ParBG", 0);
22 initNerve(&Appear, 0);
23}
24
25void BootLayout::appear() {
26 al::startAction(layout: this, actionName: "Appear", paneName: 0);
27 al::startAction(layout: mParBg, actionName: "Hide", paneName: 0);
28 al::LayoutActor::appear();
29 al::setNerve(user: this, nerve: &Appear);
30}
31
32void BootLayout::kill() {
33 al::LayoutActor::kill();
34}
35
36void BootLayout::startWipe() {
37 al::startAction(layout: this, actionName: "Wait", paneName: 0);
38 al::startAction(layout: mParBg, actionName: "Hide", paneName: 0);
39 al::LayoutActor::appear();
40 al::setNerve(user: this, nerve: &StartWipe);
41}
42
43void BootLayout::endWipe() {
44 al::startAction(layout: mParBg, actionName: "Wait", paneName: "Main");
45 al::LayoutActor::appear();
46 al::setNerve(user: this, nerve: &EndWipe);
47}
48
49void BootLayout::end() {
50 al::startAction(layout: this, actionName: "End", paneName: "Main");
51 al::LayoutActor::appear();
52 al::setNerve(user: this, nerve: &End);
53}
54
55void BootLayout::endImmidiate() {
56 al::startFreezeActionEnd(layout: this, actionName: "End", paneName: "Main");
57 al::LayoutActor::appear();
58 al::setNerve(user: this, nerve: &End);
59}
60
61bool BootLayout::isEndWipe() const {
62 return al::isNerve(user: this, nerve: &EndWipe);
63}
64
65f32 BootLayout::getBgFrame() const {
66 return al::getActionFrame(layout: mParBg, paneName: 0);
67}
68
69void BootLayout::exeAppear() {
70 if (al::isActionEnd(layout: this, paneName: 0))
71 al::setNerve(user: this, nerve: &Wait);
72}
73
74void BootLayout::exeWait() {
75 if (al::isFirstStep(user: this))
76 al::startAction(layout: this, actionName: "Wait", paneName: "Main");
77}
78
79void BootLayout::exeStartWipe() {
80 if (al::isFirstStep(user: this))
81 al::startAction(layout: mParBg, actionName: "Appear", paneName: "Main");
82 if (!al::isActionEnd(layout: mParBg, paneName: 0))
83 return;
84 al::startAction(layout: mParBg, actionName: "Wait", paneName: "Main");
85 al::setNerve(user: this, nerve: &EndWipe);
86}
87
88void BootLayout::exeEndWipe() {}
89
90void BootLayout::exeEnd() {}
91