mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-23 03:15:58 -04:00
add editorpauselayer::get
This commit is contained in:
parent
370be30e76
commit
fa3a62255b
1 changed files with 11 additions and 0 deletions
|
@ -1103,6 +1103,17 @@ class EditorOptionsLayer {
|
|||
}
|
||||
|
||||
class EditorPauseLayer : CCBlockLayer, FLAlertLayerProtocol {
|
||||
static EditorPauseLayer* get() {
|
||||
if (!EditorUI::get()) return nullptr;
|
||||
|
||||
auto editor = LevelEditorLayer::get();
|
||||
for (auto i = 0; i < editor->getChildrenCount(); ++i) {
|
||||
if (auto layer = cast::safe_cast<EditorPauseLayer*>(editor->getChildren()->objectAtIndex(i))) {
|
||||
return layer;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
static EditorPauseLayer* create(LevelEditorLayer* editor) {
|
||||
auto pRet = new EditorPauseLayer();
|
||||
if (pRet && pRet->init(editor)) {
|
||||
|
|
Loading…
Reference in a new issue