2022-08-01 11:18:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-10-13 05:56:23 -04:00
|
|
|
#include <cocos2d.h>
|
2022-08-01 11:18:03 -04:00
|
|
|
|
|
|
|
namespace geode {
|
|
|
|
enum class CircleBaseSize {
|
2022-10-30 14:59:20 -04:00
|
|
|
Tiny = 0, // Equivalent to the tiny delete button
|
|
|
|
Small = 1, // Equivalent to most circular buttons in the editor
|
|
|
|
Small2 = 2, // Equivalent to the trash button in the editor
|
|
|
|
Medium = 3, // Equivalent to most buttons
|
2022-08-01 11:18:03 -04:00
|
|
|
Medium2 = 4, // Equivalent to the bottom buttons in MenuLayer
|
2022-10-30 14:59:20 -04:00
|
|
|
Big = 5, // Equivalent to the New button
|
|
|
|
Big2 = 6, // Equivalent to the Account button
|
|
|
|
Large = 7, // Equivalent to the big Play Button
|
2022-08-01 11:18:03 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class CrossBaseSize {
|
|
|
|
Small = 0,
|
|
|
|
Huge = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class CircleBaseColor {
|
|
|
|
Green = 0,
|
|
|
|
Pink = 1,
|
|
|
|
Gray = 2,
|
|
|
|
Blue = 3,
|
|
|
|
Cyan = 4,
|
|
|
|
Geode = 5,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class AccountBaseColor {
|
|
|
|
Blue = 0,
|
|
|
|
Gray = 1,
|
|
|
|
Purple = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class IconSelectBaseColor {
|
|
|
|
Gray = 0,
|
|
|
|
Selected = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class EditorBaseColor {
|
|
|
|
LightBlue = 0,
|
|
|
|
Green = 1,
|
|
|
|
Orange = 2,
|
|
|
|
DarkGray = 3,
|
|
|
|
Gray = 4,
|
|
|
|
Pink = 5,
|
|
|
|
Teal = 6,
|
|
|
|
Aqua = 7,
|
|
|
|
Cyan = 8,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class TabBaseColor {
|
|
|
|
Unselected = 0,
|
|
|
|
Selected = 1,
|
|
|
|
UnselectedDark = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class BaseType {
|
2022-09-17 08:42:33 -04:00
|
|
|
// Circle buttons
|
2022-08-01 11:18:03 -04:00
|
|
|
Circle = 0,
|
2022-09-17 08:42:33 -04:00
|
|
|
// Like the buttons in the main menu
|
2022-08-01 11:18:03 -04:00
|
|
|
Cross = 1,
|
2022-09-17 08:42:33 -04:00
|
|
|
// Like the friend request / account buttons
|
|
|
|
BevelledSquare = 2,
|
|
|
|
// Like the icon select button
|
2022-08-01 11:18:03 -04:00
|
|
|
IconSelect = 3,
|
2022-09-17 08:42:33 -04:00
|
|
|
// Like the leaderboard buttons
|
|
|
|
BevelledSquare2 = 4,
|
|
|
|
// Like the buttons in the editor sidebar
|
2022-08-01 11:18:03 -04:00
|
|
|
Editor = 5,
|
2022-09-17 08:42:33 -04:00
|
|
|
// Like a list view tab
|
2022-08-01 11:18:03 -04:00
|
|
|
Tab = 6,
|
2022-09-17 08:42:33 -04:00
|
|
|
// Like the buttons in CreatorLayer
|
|
|
|
Category = 7,
|
2022-08-01 11:18:03 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2022-10-30 14:59:20 -04:00
|
|
|
* Represents a GD button sprite where there's
|
|
|
|
* an icon sprite on top another default sprite.
|
2022-08-01 11:18:03 -04:00
|
|
|
* You know, it has a base. It's based.
|
|
|
|
* lmao trademark lizbith
|
|
|
|
*/
|
|
|
|
class GEODE_DLL BasedButtonSprite : public cocos2d::CCSprite {
|
|
|
|
protected:
|
|
|
|
int m_type;
|
|
|
|
int m_size;
|
|
|
|
int m_color;
|
|
|
|
cocos2d::CCNode* m_onTop = nullptr;
|
|
|
|
|
|
|
|
bool init(cocos2d::CCNode* ontop, int type, int size, int color);
|
2022-10-30 14:59:20 -04:00
|
|
|
bool initWithSprite(char const* sprName, float sprScale, int type, int size, int color);
|
|
|
|
bool initWithSpriteFrameName(
|
|
|
|
char const* sprName, float sprScale, int type, int size, int color
|
|
|
|
);
|
2022-08-01 11:18:03 -04:00
|
|
|
|
|
|
|
cocos2d::CCPoint getTopOffset() const;
|
|
|
|
|
|
|
|
virtual ~BasedButtonSprite();
|
2022-10-30 14:59:20 -04:00
|
|
|
|
2022-08-01 11:18:03 -04:00
|
|
|
public:
|
|
|
|
static BasedButtonSprite* create(cocos2d::CCNode* ontop, int type, int size, int color);
|
2022-09-03 09:36:07 -04:00
|
|
|
|
|
|
|
cocos2d::CCNode* getTopNode() const;
|
2022-08-01 11:18:03 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class GEODE_DLL CircleButtonSprite : public BasedButtonSprite {
|
|
|
|
public:
|
|
|
|
static CircleButtonSprite* create(
|
2022-10-30 14:59:20 -04:00
|
|
|
cocos2d::CCNode* top, CircleBaseColor color = CircleBaseColor::Green,
|
2022-08-01 11:18:03 -04:00
|
|
|
CircleBaseSize size = CircleBaseSize::Medium
|
|
|
|
);
|
|
|
|
static CircleButtonSprite* createWithSprite(
|
2022-10-30 14:59:20 -04:00
|
|
|
char const* sprName, float sprScale = 1.f,
|
2022-08-01 11:18:03 -04:00
|
|
|
CircleBaseColor color = CircleBaseColor::Green,
|
|
|
|
CircleBaseSize size = CircleBaseSize::Medium
|
|
|
|
);
|
|
|
|
static CircleButtonSprite* createWithSpriteFrameName(
|
2022-10-30 14:59:20 -04:00
|
|
|
char const* sprName, float sprScale = 1.f,
|
2022-08-01 11:18:03 -04:00
|
|
|
CircleBaseColor color = CircleBaseColor::Green,
|
|
|
|
CircleBaseSize size = CircleBaseSize::Medium
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
class GEODE_DLL EditorButtonSprite : public BasedButtonSprite {
|
|
|
|
public:
|
|
|
|
static EditorButtonSprite* create(cocos2d::CCNode* top, EditorBaseColor color);
|
|
|
|
static EditorButtonSprite* createWithSprite(
|
2022-10-30 14:59:20 -04:00
|
|
|
char const* sprName, float sprScale = 1.f,
|
2022-08-01 11:18:03 -04:00
|
|
|
EditorBaseColor color = EditorBaseColor::Green
|
|
|
|
);
|
|
|
|
static EditorButtonSprite* createWithSpriteFrameName(
|
2022-10-30 14:59:20 -04:00
|
|
|
char const* sprName, float sprScale = 1.f,
|
2022-08-01 11:18:03 -04:00
|
|
|
EditorBaseColor color = EditorBaseColor::Green
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
class GEODE_DLL TabButtonSprite : public BasedButtonSprite {
|
|
|
|
public:
|
2022-10-30 14:59:20 -04:00
|
|
|
static TabButtonSprite* create(char const* text, TabBaseColor color);
|
2022-08-01 11:18:03 -04:00
|
|
|
};
|
|
|
|
}
|