diff --git a/loader/src/hooks/TextInputNodeFix.cpp b/loader/src/hooks/TextInputNodeFix.cpp new file mode 100644 index 00000000..73aa6051 --- /dev/null +++ b/loader/src/hooks/TextInputNodeFix.cpp @@ -0,0 +1,18 @@ +#include + +#ifdef GEODE_IS_ANDROID + +using namespace geode::prelude; + +struct TextNodeFix : Modify { + 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 \ No newline at end of file