| 1 | #include "Layout/PlayGuideMap.h" |
| 2 | |
| 3 | #include "Library/Layout/LayoutActorUtil.h" |
| 4 | #include "Library/Nerve/NerveSetupUtil.h" |
| 5 | #include "Library/Nerve/NerveUtil.h" |
| 6 | #include "Library/Play/Layout/SimpleLayoutAppearWaitEnd.h" |
| 7 | |
| 8 | #include "Layout/MapLayout.h" |
| 9 | |
| 10 | namespace { |
| 11 | NERVE_IMPL(PlayGuideMap, Hide); |
| 12 | NERVE_IMPL(PlayGuideMap, End); |
| 13 | NERVE_IMPL(PlayGuideMap, Show); |
| 14 | |
| 15 | NERVES_MAKE_NOSTRUCT(PlayGuideMap, Show); |
| 16 | NERVES_MAKE_STRUCT(PlayGuideMap, Hide, End); |
| 17 | } // namespace |
| 18 | |
| 19 | PlayGuideMap::PlayGuideMap(const char* name, const al::LayoutInitInfo& info) |
| 20 | : al::NerveExecutor(name) { |
| 21 | mLayout = new al::SimpleLayoutAppearWaitEnd("[シーン情報]地図操作説明" , "PlayGuideMap" , info, |
| 22 | nullptr, false); |
| 23 | al::killLayoutIfActive(mLayout); |
| 24 | initNerve(nerve: &NrvPlayGuideMap.Hide, stateCount: 0); |
| 25 | } |
| 26 | |
| 27 | void PlayGuideMap::start() { |
| 28 | if (al::isNerve(user: this, nerve: &NrvPlayGuideMap.End)) |
| 29 | al::setNerve(user: this, nerve: &NrvPlayGuideMap.Hide); |
| 30 | } |
| 31 | |
| 32 | void PlayGuideMap::end() { |
| 33 | if (!al::isNerve(user: this, nerve: &NrvPlayGuideMap.End)) |
| 34 | al::setNerve(user: this, nerve: &NrvPlayGuideMap.End); |
| 35 | } |
| 36 | |
| 37 | void PlayGuideMap::endImmediate() { |
| 38 | al::killLayoutIfActive(mLayout); |
| 39 | al::setNerve(user: this, nerve: &NrvPlayGuideMap.End); |
| 40 | } |
| 41 | |
| 42 | void PlayGuideMap::exeHide() { |
| 43 | if (rs::isEnableCheckpointWarp(mLayout)) |
| 44 | al::setNerve(user: this, nerve: &Show); |
| 45 | } |
| 46 | |
| 47 | void PlayGuideMap::exeShow() { |
| 48 | if (al::isFirstStep(user: this)) |
| 49 | mLayout->appear(); |
| 50 | } |
| 51 | |
| 52 | void PlayGuideMap::exeEnd() { |
| 53 | if (al::isFirstStep(user: this)) |
| 54 | mLayout->end(); |
| 55 | } |
| 56 | |