This commit is contained in:
altalk23 2023-09-20 15:29:55 +03:00
commit 2e0e5929d8
8 changed files with 52 additions and 10 deletions
CHANGELOG.mdVERSION
bindings
loader
include/Geode
src
loader
ui/internal/settings

View file

@ -1,5 +1,9 @@
# Geode Changelog
## v1.3.4
* Implement string setting character filters (cf8fbba)
* Update bindings
## v1.3.3
* Reunify resources.zip (81de161)

View file

@ -1 +1 @@
1.3.3
1.3.4

View file

@ -1261,12 +1261,24 @@ class cocos2d {
static auto ccDrawSolidRect(cocos2d::CCPoint, cocos2d::CCPoint, cocos2d::_ccColor4F) = mac 0xecf00;
static auto ccGLEnableVertexAttribs(unsigned int) = mac 0x1ae740;
static auto ccGLBindTexture2D(GLuint) = mac 0x1ae610;
static auto ccGLBindTexture2DN(GLuint, GLuint) = mac 0x1ae650;
static float ccpDistance(cocos2d::CCPoint const&, cocos2d::CCPoint const&) = mac 0x1aaf90;
static void ccDrawPoly(cocos2d::CCPoint const*, unsigned int, bool) = mac 0xed0a0;
static void ccDrawColor4B(GLubyte, GLubyte, GLubyte, GLubyte) = mac 0xeddd0;
static void CCMessageBox(const char* msg, const char* title) = mac 0xbabc0;
}
//uintptr_t macNumberOfDraws() {
// return geode::base::get() + 0x69ae90;
//}
//void ccIncrementGLDraws(int n) {
//#ifdef GEODE_IS_MACOS
// *reinterpret_cast<int*>(macNumberOfDraws()) += n;
//#else
// CC_INCREMENT_GL_DRAWS(n);
//#endif
//}
[[link(win)]]
class DS_Dictionary {
DS_Dictionary() = mac 0xbe9a0;

View file

@ -1628,9 +1628,12 @@ class EffectGameObject : GameObject {
PAD = mac 0x28, win 0x24;
}
class EndLevelLayer {
class EndLevelLayer : cocos2d::CCLayer {
static EndLevelLayer* create() = mac 0x2787d0, win 0x94b50;
void customSetup() = win 0x94cb0;
const char* getCoinString(void* p0) = win 0x96270;
const char* getEndText() = win 0x964A0;
void onMenu(cocos2d::CCObject* sender) = mac 0x27a500, win 0x96c10;
void onEdit(cocos2d::CCObject* sender) = mac 0x27a640, win 0x96d30;
}
@ -4022,6 +4025,7 @@ class LevelInfoLayer : cocos2d::CCLayer, LevelDownloadDelegate, LevelUpdateDeleg
virtual void levelDownloadFinished(GJGameLevel*) = mac 0x164C00, win 0x1790C0;
virtual void levelUpdateFinished(GJGameLevel*, UpdateResponse) = mac 0x164E60, win 0x1792B0;
void showUpdateAlert(UpdateResponse) = mac 0x164ED0, win 0x179300;
void updateLabelValues() = mac 0x164090, win 0x17b170;
PAD = win 0x4, mac 0x8;
cocos2d::CCMenu* m_playBtnMenu;
@ -4031,13 +4035,13 @@ class LevelInfoLayer : cocos2d::CCLayer, LevelDownloadDelegate, LevelUpdateDeleg
CCMenuItemSpriteExtra* m_starRateBtn;
CCMenuItemSpriteExtra* m_demonRateBtn;
PAD = win 0x4, mac 0x8;
CCMenuItemToggler* m_toggler;
cocos2d::CCLabelBMFont* m_label0;
cocos2d::CCLabelBMFont* m_label1;
cocos2d::CCLabelBMFont* m_label2;
cocos2d::CCLabelBMFont* m_label3;
cocos2d::CCLabelBMFont* m_label4;
cocos2d::CCLabelBMFont* m_label5;
CCMenuItemToggler* m_ldmToggler;
cocos2d::CCLabelBMFont* m_ldmLabel;
cocos2d::CCLabelBMFont* m_lengthLabel;
cocos2d::CCLabelBMFont* m_downloadsLabel;
cocos2d::CCLabelBMFont* m_likesLabel;
cocos2d::CCLabelBMFont* m_orbsLabel;
cocos2d::CCLabelBMFont* m_folderLabel;
CCMenuItemSpriteExtra* m_cloneBtn;
PAD = win 0x4, mac 0x8;
}
@ -4089,6 +4093,15 @@ class LevelSettingsDelegate {
virtual void levelSettingsUpdated() {}
}
class SecretLayer2 : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol, DialogDelegate {
static SecretLayer2* create() = win 0x21FD70;
bool init() = win 0x21FE10;
bool onSubmit(cocos2d::CCObject*) = win 0x221ac0;
void updateSearchLabel(const char* text) = win 0x222FC0;
void showCompletedLevel() = win 0x220C10;
}
class SecretLayer4 : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol, DialogDelegate {
static SecretLayer4* create() = mac 0x1ed500;
static cocos2d::CCScene* scene() = mac 0x1ed4c0;
@ -5542,6 +5555,8 @@ class SpeedObject : cocos2d::CCNode {
float m_somethingToCompare;
float m_idk3;
float m_idk4;
static SpeedObject* create(GameObject*, int, float) = win 0x20DE70;
}
class SpritePartDelegate {}

View file

@ -96,6 +96,11 @@ namespace geode {
*/
std::optional<std::string> match;
/**
* The CCTextInputNode's allowed character filter
*/
std::optional<std::string> filter;
static Result<StringSetting> parse(JsonMaybeObject& obj);
};

View file

@ -953,7 +953,7 @@ namespace geode::cocos {
return m_arr ? m_arr->count() : 0;
}
T operator[](size_t index) {
T* operator[](size_t index) {
return static_cast<T*>(m_arr->objectAtIndex(index));
}

View file

@ -62,6 +62,7 @@ Result<StringSetting> StringSetting::parse(JsonMaybeObject& obj) {
StringSetting sett;
parseCommon(sett, obj);
obj.has("match").into(sett.match);
obj.has("filter").into(sett.filter);
return Ok(sett);
}

View file

@ -324,6 +324,11 @@ bool StringSettingNode::setup(StringSettingValue* setting, float width) {
m_input = InputNode::create(width / 2 - 10.f, "Text", "chatFont.fnt");
m_input->setPosition({ -(width / 2 - 70.f) / 2, .0f });
m_input->setScale(.65f);
if (setting->castDefinition().filter.has_value()) {
m_input->getInput()->setAllowedChars(setting->castDefinition().filter.value());
}
m_input->getInput()->setDelegate(this);
m_menu->addChild(m_input);