-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a pause persisting confirmation
- Loading branch information
1 parent
2036492
commit 5853578
Showing
10 changed files
with
67 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "Warning.hpp" | ||
|
||
CCScale9Sprite* Warning::warning = nullptr; | ||
|
||
void Warning::show() { | ||
ESCAPE_WHEN(Warning::warning,); | ||
const CCSize winSize = CCDirector::sharedDirector()->getWinSize(); | ||
Warning::warning = CCScale9Sprite::create("square02_001.png"); | ||
CCLabelBMFont* label = CCLabelBMFont::create("Requests Paused", "bigFont.fnt"); | ||
|
||
label->setScale(2); | ||
Warning::warning->setScale(0.25f); | ||
Warning::warning->setOpacity(0x7F); | ||
Warning::warning->setAnchorPoint(TOP_CENTER); | ||
Warning::warning->setContentSize(label->getScaledContentSize() + ccp(PADDING, PADDING) * 4); | ||
Warning::warning->setPosition({ winSize.width / 2, winSize.height - PADDING }); | ||
label->setPosition(Warning::warning->getContentSize() / 2); | ||
Warning::warning->addChild(label); | ||
|
||
ProxyHandler::pauseAll(); | ||
SceneManager::get()->keepAcrossScenes(Warning::warning); | ||
} | ||
|
||
void Warning::hide() { | ||
ESCAPE_WHEN(!Warning::warning,); | ||
SceneManager::get()->forget(Warning::warning); | ||
Warning::warning->removeFromParent(); | ||
Warning::warning = nullptr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include "../include.hpp" | ||
|
||
class Warning { | ||
public: | ||
static void show(); | ||
static void hide(); | ||
private: | ||
static CCScale9Sprite* warning; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters