mirror of
https://github.com/geode-sdk/geode.git
synced 2025-01-19 02:39:45 -05:00
18 lines
508 B
C++
18 lines
508 B
C++
|
#include <Geode/modify/CCTextInputNode.hpp>
|
||
|
|
||
|
#ifdef GEODE_IS_ANDROID
|
||
|
|
||
|
using namespace geode::prelude;
|
||
|
|
||
|
struct TextNodeFix : Modify<TextNodeFix, CCTextInputNode> {
|
||
|
bool onTextFieldInsertText(cocos2d::CCTextFieldTTF* field, char const* text, int count) {
|
||
|
auto change = count >= this->m_maxLabelLength ? 1 : 0;
|
||
|
|
||
|
this->m_maxLabelLength += change;
|
||
|
auto ret = CCTextInputNode::onTextFieldInsertText(field, text, count);
|
||
|
this->m_maxLabelLength -= change;
|
||
|
return ret;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif
|