| 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 | |
| 8 | namespace { |
| 9 | NERVE_IMPL(BootLayout, Appear); |
| 10 | NERVE_IMPL(BootLayout, Wait); |
| 11 | NERVE_IMPL(BootLayout, StartWipe); |
| 12 | NERVE_IMPL(BootLayout, EndWipe); |
| 13 | NERVE_IMPL(BootLayout, End); |
| 14 | |
| 15 | NERVES_MAKE_NOSTRUCT(BootLayout, Appear, Wait, StartWipe, EndWipe, End); |
| 16 | } // namespace |
| 17 | |
| 18 | BootLayout::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 | |
| 25 | void 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 | |
| 32 | void BootLayout::kill() { |
| 33 | al::LayoutActor::kill(); |
| 34 | } |
| 35 | |
| 36 | void 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 | |
| 43 | void BootLayout::endWipe() { |
| 44 | al::startAction(layout: mParBg, actionName: "Wait" , paneName: "Main" ); |
| 45 | al::LayoutActor::appear(); |
| 46 | al::setNerve(user: this, nerve: &EndWipe); |
| 47 | } |
| 48 | |
| 49 | void BootLayout::end() { |
| 50 | al::startAction(layout: this, actionName: "End" , paneName: "Main" ); |
| 51 | al::LayoutActor::appear(); |
| 52 | al::setNerve(user: this, nerve: &End); |
| 53 | } |
| 54 | |
| 55 | void BootLayout::endImmidiate() { |
| 56 | al::startFreezeActionEnd(layout: this, actionName: "End" , paneName: "Main" ); |
| 57 | al::LayoutActor::appear(); |
| 58 | al::setNerve(user: this, nerve: &End); |
| 59 | } |
| 60 | |
| 61 | bool BootLayout::isEndWipe() const { |
| 62 | return al::isNerve(user: this, nerve: &EndWipe); |
| 63 | } |
| 64 | |
| 65 | f32 BootLayout::getBgFrame() const { |
| 66 | return al::getActionFrame(layout: mParBg, paneName: 0); |
| 67 | } |
| 68 | |
| 69 | void BootLayout::exeAppear() { |
| 70 | if (al::isActionEnd(layout: this, paneName: 0)) |
| 71 | al::setNerve(user: this, nerve: &Wait); |
| 72 | } |
| 73 | |
| 74 | void BootLayout::exeWait() { |
| 75 | if (al::isFirstStep(user: this)) |
| 76 | al::startAction(layout: this, actionName: "Wait" , paneName: "Main" ); |
| 77 | } |
| 78 | |
| 79 | void 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 | |
| 88 | void BootLayout::exeEndWipe() {} |
| 89 | |
| 90 | void BootLayout::exeEnd() {} |
| 91 | |