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 {
|
2024-02-17 11:24:23 -05: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:
|
2024-02-17 11:24:23 -05:00
|
|
|
[[deprecated("Use geode::TextInput from the ui/TextInput.hpp header instead")]]
|
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
|
|
|
|
);
|
2024-02-17 11:24:23 -05:00
|
|
|
[[deprecated("Use geode::TextInput from the ui/TextInput.hpp header instead")]]
|
2022-08-01 11:18:03 -04:00
|
|
|
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
|
|
|
);
|
2024-02-17 11:24:23 -05:00
|
|
|
[[deprecated("Use geode::TextInput from the ui/TextInput.hpp header instead")]]
|
2022-10-30 14:59:20 -04:00
|
|
|
static InputNode* create(float width, char const* placeholder, std::string const& filter);
|
2024-02-17 11:24:23 -05:00
|
|
|
[[deprecated("Use geode::TextInput from the ui/TextInput.hpp header instead")]]
|
2022-10-30 14:59:20 -04:00
|
|
|
static InputNode* create(float width, char const* placeholder, char const* fontFile);
|
2024-02-17 11:24:23 -05:00
|
|
|
[[deprecated("Use geode::TextInput from the ui/TextInput.hpp header instead")]]
|
2022-10-30 14:59:20 -04:00
|
|
|
static InputNode* create(float width, char const* placeholder);
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-12 17:37:25 -04:00
|
|
|
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&);
|
2024-01-16 11:58:31 -05:00
|
|
|
std::string getString();
|
2022-08-01 11:18:03 -04:00
|
|
|
};
|
|
|
|
}
|