1#include "Layout/LoadLayoutCtrl.h"
2
3#include "Library/Layout/LayoutActionFunction.h"
4#include "Library/Layout/LayoutActorUtil.h"
5#include "Library/Nerve/NerveSetupUtil.h"
6#include "Library/Nerve/NerveUtil.h"
7#include "Library/Play/Layout/SimpleLayoutAppearWaitEnd.h"
8
9namespace {
10NERVE_IMPL(LoadLayoutCtrl, EndLoad);
11NERVE_IMPL(LoadLayoutCtrl, WaitCount);
12NERVE_IMPL(LoadLayoutCtrl, WaitLoad);
13
14NERVES_MAKE_NOSTRUCT(LoadLayoutCtrl, WaitLoad);
15NERVES_MAKE_STRUCT(LoadLayoutCtrl, EndLoad, WaitCount);
16} // namespace
17
18LoadLayoutCtrl::LoadLayoutCtrl(const al::LayoutInitInfo& info) : NerveExecutor("LoadLayoutCtrl") {
19 initNerve(nerve: &NrvLoadLayoutCtrl.EndLoad, stateCount: 0);
20 mSaveMessageLayout =
21 new al::SimpleLayoutAppearWaitEnd("ロードレイアウト", "SaveMessage", info, nullptr, false);
22 mSaveMessageLayout->kill();
23}
24
25void LoadLayoutCtrl::startWaitLoad() {
26 if (al::isNerve(user: this, nerve: &NrvLoadLayoutCtrl.EndLoad))
27 al::setNerve(user: this, nerve: &NrvLoadLayoutCtrl.WaitCount);
28}
29
30void LoadLayoutCtrl::endLoad() {
31 if (!al::isNerve(user: this, nerve: &NrvLoadLayoutCtrl.EndLoad))
32 al::setNerve(user: this, nerve: &NrvLoadLayoutCtrl.EndLoad);
33}
34
35void LoadLayoutCtrl::exeWaitCount() {
36 if (al::isGreaterEqualStep(user: this, step: 240))
37 al::setNerve(user: this, nerve: &WaitLoad);
38}
39
40void LoadLayoutCtrl::exeWaitLoad() {
41 if (al::isFirstStep(user: this)) {
42 mSaveMessageLayout->appear();
43 al::startAction(layout: mSaveMessageLayout, actionName: "Loop", paneName: "Loop");
44
45 hideTxtPane();
46 }
47}
48
49void LoadLayoutCtrl::hideTxtPane() {
50 al::hidePane(mSaveMessageLayout, "TxtSave");
51 al::hidePane(mSaveMessageLayout, "TxtSaveSh");
52}
53
54void LoadLayoutCtrl::exeEndLoad() {
55 if (al::isFirstStep(user: this))
56 al::killLayoutIfActive(mSaveMessageLayout);
57 if (al::isActive(mSaveMessageLayout))
58 hideTxtPane();
59}
60