2022-08-01 11:18:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-10-16 14:34:16 -04:00
|
|
|
#include <Geode/DefaultInclude.hpp>
|
2023-03-08 12:31:07 -05:00
|
|
|
#include <Geode/binding/CCTextInputNode.hpp>
|
2022-10-13 05:56:23 -04:00
|
|
|
#include <cocos2d.h>
|
2022-08-01 11:18:03 -04:00
|
|
|
|
|
|
|
namespace geode {
|
2022-09-12 17:37:25 -04:00
|
|
|
class GEODE_DLL InputNode : public cocos2d::CCMenuItem {
|
2022-09-14 12:21:35 -04:00
|
|
|
protected:
|
2022-08-01 11:18:03 -04:00
|
|
|
cocos2d::extension::CCScale9Sprite* m_bgSprite;
|
|
|
|
CCTextInputNode* m_input;
|
|
|
|
|
2022-10-30 14:59:20 -04:00
|
|
|
bool init(float, float, char const*, char const*, std::string const&, int);
|
|
|
|
bool init(float, char const*, char const*, std::string const&, int);
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-14 12:21:35 -04:00
|
|
|
public:
|
2022-08-01 11:18:03 -04:00
|
|
|
static InputNode* create(
|
2022-10-30 14:59:20 -04:00
|
|
|
float width, char const* placeholder, char const* fontFile, std::string const& filter,
|
2022-08-01 11:18:03 -04:00
|
|
|
int limit
|
|
|
|
);
|
|
|
|
static InputNode* create(
|
2022-10-30 14:59:20 -04:00
|
|
|
float width, char const* placeholder, std::string const& filter, int limit
|
2022-08-01 11:18:03 -04:00
|
|
|
);
|
2022-10-30 14:59:20 -04:00
|
|
|
static InputNode* create(float width, char const* placeholder, std::string const& filter);
|
|
|
|
static InputNode* create(float width, char const* placeholder, char const* fontFile);
|
|
|
|
static InputNode* create(float width, char const* placeholder);
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-12 17:37:25 -04:00
|
|
|
void activate() override;
|
|
|
|
|
|
|
|
CCTextInputNode* getInput() const;
|
|
|
|
cocos2d::extension::CCScale9Sprite* getBG() const;
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-28 09:21:05 -04:00
|
|
|
void setEnabled(bool enabled) override;
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-12 17:37:25 -04:00
|
|
|
void setString(std::string const&);
|
2022-10-30 14:59:20 -04:00
|
|
|
char const* getString();
|
2022-08-01 11:18:03 -04:00
|
|
|
};
|
|
|
|
}
|