HMiscUtils.h
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// HMiscUtils.h
// SteveMaggieCpp
//
// Created by Katarzyna Kalinowska-Górska on 17.05.2017.
//
//
#ifndef HMiscUtils_h
#define HMiscUtils_h
#include "HPlainSprite.h"
class HMiscUtils
{
public:
enum class ExtendDirectionX {
BOTH = 0,
LEFT = 1,
RIGHT = 2
};
enum class ExtendDirectionY {
BOTH = 0,
UP = 1,
DOWN = 2,
};
enum class Level {
CHILD = 0,
TEEN = 1,
ADULT = 2
};
static float StandardAnimationTime;
static float QuickAnimationTime;
static const std::string MAGGIE_TOUCHED_UD_KEY;
static const std::string WHICH_LEVEL_UD_KEY;
static const std::string TOS_ACCEPTED_UD_KEY;
static const std::string BG_MUSIC_PLAYING_UD_KEY;
static void saveMaggieTouched();
static bool wasMaggieTouched();
static void saveTOSAccepted();
static bool wasTOSAccepted();
static void saveLastLevel(Level level);
static void saveLastLevel(int level);
static Level lastLevel();
static int nextLevel();
static void saveBgMusicPlaying(bool bgMusicPlaying);
static bool shouldBgMusicPlay();
static void showView(cocos2d::Node*, bool animated, float toAlpha = 255);
static void hideView(cocos2d::Node*, bool animated);
static void hideAndRemoveView(cocos2d::Node*, bool animated);
static cocos2d::Rect getExtendedActiveArea(cocos2d::Node* object, float extendPercentValueX = 0, float extendPercentValueY = 0, ExtendDirectionX extendDirX = ExtendDirectionX::BOTH, ExtendDirectionY extendDirY = ExtendDirectionY::BOTH);
static bool isNodeVisible(cocos2d::Node* node);
static void showAppCloseConfirmDialog(std::function<void()> onCancelCallback);
static bool closeAppCloseConfirmDialogIfNecessary();
};
#endif /* HMiscUtils_h */