Skip to content

Commit

Permalink
Merge branch 'geode-sdk:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
user95401 authored Oct 29, 2024
2 parents 99ed95c + faf7889 commit ed28852
Show file tree
Hide file tree
Showing 6 changed files with 2,433 additions and 2,028 deletions.
5 changes: 5 additions & 0 deletions bindings/1.920/Cocos2d.bro
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,14 @@ class DS_Dictionary {
void setArrayForKey(const char*, cocos2d::CCArray*);
cocos2d::CCObject* getObjectForKey(const char*);
void setObjectForKey(const char*, cocos2d::CCObject*);

bool loadRootSubDictFromFile(const char*);
bool loadRootSubDictFromString(gd::string);
bool loadRootSubDictFromCompressedFile(const char*);

bool saveRootSubDictToCompressedFile(const char*);
bool saveRootSubDictToFile(const char*);
gd::string saveRootSubDictToString();
}

[[link(win, android)]]
Expand Down
155 changes: 117 additions & 38 deletions bindings/1.920/GeometryDash.bro
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class AchievementManager : cocos2d::CCNode {
TodoReturn notifyAchievementWithID(char const*);
TodoReturn percentageForCount(int, int);
TodoReturn percentForAchievement(char const*);
TodoReturn reportAchievementWithID(char const*, int, bool);
void reportAchievementWithID(char const*, int, bool);
TodoReturn reportPlatformAchievementWithID(char const*, int);
TodoReturn resetAchievement(char const*);
TodoReturn resetAchievements();
Expand Down Expand Up @@ -801,14 +801,34 @@ class CCLightStrip {
[[link(android)]]
class CCMenuItemSpriteExtra : cocos2d::CCMenuItemSprite {
// virtual ~CCMenuItemSpriteExtra();
// CCMenuItemSpriteExtra();
CCMenuItemSpriteExtra() {
m_scaleMultiplier = 1.0f;
m_baseScale = 0.0f;
m_animationEnabled = false;
m_colorEnabled = false;
m_volume = 1.0f;
m_clickSound = "";
}

static CCMenuItemSpriteExtra* create(cocos2d::CCNode*, cocos2d::CCNode*, cocos2d::CCObject*, cocos2d::SEL_MenuHandler) = win 0xd1e0;

static CCMenuItemSpriteExtra* create(cocos2d::CCNode* sprite, cocos2d::CCObject* target, cocos2d::SEL_MenuHandler callback) {
return CCMenuItemSpriteExtra::create(sprite, nullptr, target, callback);
}

/// Update the sizing of this button's image
/// If you for example have a `ButtonSprite` on this button and change the
/// text, you need to call `updateSprite` afterwards to fix the button's
/// content size
/// @note Geode addition
void updateSprite() {
auto sprite = this->getNormalImage();
auto size = sprite->getScaledContentSize();
sprite->setPosition(size / 2);
sprite->setAnchorPoint({ .5f, .5f });
this->setContentSize(size);
}

bool init(cocos2d::CCNode*, cocos2d::CCNode*, cocos2d::CCObject*, cocos2d::SEL_MenuHandler);
void setSizeMult(float);

Expand Down Expand Up @@ -2181,7 +2201,7 @@ class GameLevelManager : cocos2d::CCNode {
void encodeDataTo(DS_Dictionary*);
TodoReturn firstSetup();
bool getBoolForKey(char const*);
TodoReturn getCommentKey(int, int);
const char* getCommentKey(int, int);
TodoReturn getCompletedLevels();
TodoReturn getDeleteCommentKey(int, long);
TodoReturn getDifficultyStr(bool, bool, bool, bool, bool, bool, bool, bool);
Expand All @@ -2202,7 +2222,7 @@ class GameLevelManager : cocos2d::CCNode {
TodoReturn getMapPacks(GJSearchObject*);
void getOnlineLevels(GJSearchObject*);
TodoReturn getPageInfo(char const*);
TodoReturn getPostCommentKey(int);
const char* getPostCommentKey(int);
TodoReturn getRateKey(int);
TodoReturn getRateStarsKey(int);
TodoReturn getReportKey(int);
Expand All @@ -2228,7 +2248,7 @@ class GameLevelManager : cocos2d::CCNode {
bool isTimeValid(char const*, float);
bool isUpdateValid(int);
TodoReturn itemIDFromLikeKey(char const*);
TodoReturn levelIDFromCommentKey(char const*);
int levelIDFromCommentKey(char const*);
TodoReturn likeFromLikeKey(char const*);
TodoReturn likeItem(LikeItemType, int, bool);
TodoReturn limitSavedLevels();
Expand Down Expand Up @@ -2256,8 +2276,8 @@ class GameLevelManager : cocos2d::CCNode {
TodoReturn onSetLevelStarsCompleted(gd::string, gd::string);
TodoReturn onSubmitUserInfoCompleted(gd::string, gd::string);
TodoReturn onUpdateLevelCompleted(gd::string, gd::string);
TodoReturn onUpdateUserScoreCompleted(gd::string, gd::string);
TodoReturn onUploadCommentCompleted(gd::string, gd::string);
void onUpdateUserScoreCompleted(gd::string, gd::string);
void onUploadCommentCompleted(gd::string, gd::string);
TodoReturn onUploadLevelCompleted(gd::string, gd::string);
TodoReturn pageFromCommentKey(char const*);
TodoReturn parseRestoreData(gd::string);
Expand Down Expand Up @@ -2328,6 +2348,33 @@ class GameLevelManager : cocos2d::CCNode {
virtual void setLastMapPackID(int);
virtual gd::string getTempSave() const;
virtual void setTempSave(gd::string);

cocos2d::CCDictionary* m_mainLevels;
cocos2d::CCDictionary* m_valueDict;
cocos2d::CCDictionary* m_savedLevelsDict;
cocos2d::CCDictionary* m_timerDict;
cocos2d::CCDictionary* m_userValues;
cocos2d::CCDictionary* m_storedLevels;
cocos2d::CCDictionary* m_pageInfo;
cocos2d::CCDictionary* m_unknownDict;
cocos2d::CCDictionary* m_savedPacks;
cocos2d::CCDictionary* m_activeDownloads;
cocos2d::CCDictionary* m_activeUploads;
gd::string m_lastSearchKey;
gd::string m_lastSearchKey2;
int m_lastLeaderboard;
bool m_createdNewLevel;
LevelManagerDelegate* m_levelManagerDelegate; // m_delegate
LevelDownloadDelegate* m_levelDownloadDelegate; // m_dlDelegate
LevelCommentDelegate* m_levelCommentDelegate; // m_commentDelegate
CommentUploadDelegate* m_commentUploadDelegate; // m_commentUpDelegate
LevelUploadDelegate* m_levelUploadDelegate; // m_upDelegate
LevelUpdateDelegate* m_levelUpdateDelegate; // m_updateDelegate
LeaderboardManagerDelegate* m_leaderboardDelegate;
LevelDeleteDelegate* m_levelDeleteDelegate; // m_lvlDelDelegate
SearchType m_lastSearchType;
int m_lastMapPackID;
gd::string m_tempSave;
}

[[link(android)]]
Expand All @@ -2346,7 +2393,7 @@ class GameManager : GManager {
TodoReturn checkSteamAchievementUnlock();
TodoReturn claimItemsResponse(gd::string);
cocos2d::ccColor3B colorForIdx(int) = win 0x6a410;
TodoReturn colorForPos(int);
int colorForPos(int);
const char* colorKey(int, bool);
TodoReturn completedAchievement(char const*);
TodoReturn didExitPlayscene();
Expand Down Expand Up @@ -2996,7 +3043,7 @@ class GameStatsManager {

void checkAchievement(char const*);
TodoReturn completedDemonLevel(GJGameLevel*);
TodoReturn completedLevel(GJGameLevel*);
void completedLevel(GJGameLevel*);
TodoReturn completedMapPack(GJMapPack*);
TodoReturn completedStarLevel(GJGameLevel*);
void dataLoaded(DS_Dictionary*);
Expand All @@ -3017,7 +3064,7 @@ class GameStatsManager {
TodoReturn hasCompletedMapPack(int);
TodoReturn hasCompletedOnlineLevel(int);
TodoReturn hasCompletedStarLevel(GJGameLevel*);
TodoReturn hasUniqueItem(char const*);
bool hasUniqueItem(char const*);
TodoReturn incrementStat(char const*, int);
TodoReturn incrementStat(char const*);
bool isLiteUnlockable(gd::string);
Expand Down Expand Up @@ -3099,16 +3146,23 @@ class GameToolbox {
}

[[link(android)]]
class GaragePage {
class GaragePage : cocos2d::CCLayer, ListButtonBarDelegate {
// virtual ~GaragePage();

static GaragePage* create(IconType, GJGarageLayer*, cocos2d::SEL_MenuHandler) = win 0x7fc90;

bool init(IconType, GJGarageLayer*, cocos2d::SEL_MenuHandler);
void onSelect(cocos2d::CCObject* sender);
TodoReturn updateSelect(cocos2d::CCNode*);
void updateSelect(cocos2d::CCNode*);

virtual TodoReturn listButtonBarSwitchedPage(ListButtonBar*, int);
virtual void listButtonBarSwitchedPage(ListButtonBar*, int);

GJGarageLayer* m_garageLayer;
cocos2d::SEL_MenuHandler m_callback;
cocos2d::CCSprite* m_selectSprite;
cocos2d::CCNode* m_selectedSprite;
IconType m_iconType;
int m_perPage;
}

class GhostTrailDelegate {
Expand Down Expand Up @@ -3354,7 +3408,7 @@ class GJGameLevel : cocos2d::CCNode {
void dataLoaded(DS_Dictionary*);
TodoReturn getAudioFileName();
TodoReturn getAverageDifficulty();
TodoReturn getCoinKey(int);
const char* getCoinKey(int);
TodoReturn getExtraString();
TodoReturn getLastBuildPageForTab(int);
TodoReturn getLengthKey(int);
Expand Down Expand Up @@ -3584,11 +3638,9 @@ class GJGarageLayer : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol,
TodoReturn checkColor(int, bool);
TodoReturn checkIcon(int);
TodoReturn checkShip(int);
TodoReturn checkSpecial(int);
bool checkSpecial(int);
TodoReturn descriptionForUnlock(int, UnlockType);
TodoReturn getDoSelect();
TodoReturn getLockFrame(int, UnlockType);
TodoReturn getRateSprite();
TodoReturn node();
void onBack(cocos2d::CCObject* sender);
void onBallIcon(cocos2d::CCObject* sender);
Expand All @@ -3600,12 +3652,12 @@ class GJGarageLayer : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol,
void onSelectTab(cocos2d::CCObject* sender);
void onShipIcon(cocos2d::CCObject* sender);
void onSpecialIcon(cocos2d::CCObject* sender);
TodoReturn playRainbowEffect();
TodoReturn playShadowEffect();
void playRainbowEffect();
void playShadowEffect();
TodoReturn scene();
TodoReturn selectPage(IconType);
TodoReturn setupColorSelect();
TodoReturn setupIconSelect() = win 0x7d790;
void setupColorSelect();
void setupIconSelect() = win 0x7d790;
TodoReturn showUnlockPopup(int, UnlockType);
TodoReturn updateColorSelect(cocos2d::CCNode*, bool);
TodoReturn updatePlayerColors();
Expand All @@ -3617,10 +3669,33 @@ class GJGarageLayer : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol,
virtual void textInputOpened(CCTextInputNode*);
virtual void textInputClosed(CCTextInputNode*);
virtual void textChanged(CCTextInputNode*);
virtual TodoReturn listButtonBarSwitchedPage(ListButtonBar*, int);
virtual void listButtonBarSwitchedPage(ListButtonBar*, int);
virtual TodoReturn updateRate();
virtual void FLAlert_Clicked(FLAlertLayer*, bool);
virtual cocos2d::CCSprite* getRateSprite() const;
virtual void setRateSprite(cocos2d::CCSprite*);
virtual bool getDoSelect() const;

CCTextInputNode* m_nameInput;
SimplePlayer* m_playerPreview;
cocos2d::CCNode* m_pUnknown1;
cocos2d::CCNode* m_pUnknown2;
cocos2d::CCSprite* m_colorSelector1;
cocos2d::CCSprite* m_colorSelector2;
CCMenuItemSpriteExtra* m_selectedColor;
CCMenuItemSpriteExtra* m_selectedColor2;
void* m_pUnused1;
void* m_pUnused2;
cocos2d::CCArray* m_pagesArray;
float m_colorMinX;
float m_colorMaxX;
CCMenuItemToggler* m_tabToggleCube;
CCMenuItemToggler* m_tabToggleShip;
CCMenuItemToggler* m_tabToggleBall;
CCMenuItemToggler* m_tabToggleUfo;
CCMenuItemToggler* m_tabToggleSpecial;
cocos2d::CCSprite* m_rateSprite;
bool m_doSelect;
}

[[link(android)]]
Expand Down Expand Up @@ -4033,7 +4108,7 @@ class InfoLayer : FLAlertLayer, LevelCommentDelegate, CommentUploadDelegate, FLA
TodoReturn setupLevelInfo();
TodoReturn toggleCommentMode(cocos2d::CCNode*);
TodoReturn updateCommentModeButtons();
TodoReturn updateLevelsLabel();
void updateLevelsLabel();

virtual void registerWithTouchDispatcher();
virtual void keyBackClicked();
Expand Down Expand Up @@ -4171,7 +4246,7 @@ class LevelBrowserLayer : cocos2d::CCLayer, LevelManagerDelegate, FLAlertLayerPr
void onPrevPage(cocos2d::CCObject* sender);
void setSearchObject(GJSearchObject*);
TodoReturn setupLevelBrowser(cocos2d::CCArray*);
TodoReturn updateLevelsLabel();
void updateLevelsLabel();

virtual void keyBackClicked();
virtual void keyDown(cocos2d::enumKeyCodes);
Expand Down Expand Up @@ -4774,24 +4849,28 @@ class LikeItemLayer {
}

[[link(android)]]
class ListButtonBar {
class ListButtonBar : cocos2d::CCNode {
// virtual ~ListButtonBar();

static ListButtonBar* create(cocos2d::CCArray*, cocos2d::CCPoint, int, int, float, float, float, float, int);

TodoReturn getDelegate();
TodoReturn getPage();
TodoReturn goToPage(int);
void goToPage(int);
bool init(cocos2d::CCArray*, cocos2d::CCPoint, int, int, float, float, float, float, int);
void onLeft(cocos2d::CCObject* sender);
void onRight(cocos2d::CCObject* sender);

virtual ListButtonBarDelegate* getDelegate() const;
virtual void setDelegate(ListButtonBarDelegate*);

BoomScrollLayer* m_scrollLayer;
cocos2d::CCArray* m_pages;
ListButtonBarDelegate* m_delegate;
}

[[link(android)]]
class ListButtonBarDelegate {
virtual TodoReturn listButtonBarSwitchedPage(ListButtonBar*, int);
virtual void listButtonBarSwitchedPage(ListButtonBar*, int);
}

[[link(android)]]
Expand Down Expand Up @@ -5389,7 +5468,7 @@ class PlatformToolbox {
TodoReturn openAppPage();
void platformShutdown();
TodoReturn refreshWindow();
TodoReturn reportAchievementWithID(char const*, int);
void reportAchievementWithID(char const*, int);
TodoReturn reportLoadingFinished();
TodoReturn resizeWindow(float, float);
TodoReturn saveAndEncryptStringToFile(gd::string, char const*, char const*);
Expand Down Expand Up @@ -5476,7 +5555,7 @@ class PlayerObject : GameObject {
TodoReturn convertToClosestRotation(float);
TodoReturn copyAttributes(PlayerObject*);
TodoReturn deactivateParticle();
TodoReturn deactivateStreak();
void deactivateStreak();
TodoReturn fadeOutStreak2(float);
void flipGravity(bool, bool);
TodoReturn flipMod();
Expand Down Expand Up @@ -5522,7 +5601,7 @@ class PlayerObject : GameObject {
TodoReturn runRotateAction(bool);
void saveToCheckpoint(PlayerCheckpoint*);
void setSecondColor(cocos2d::ccColor3B const&);
TodoReturn setupStreak() = win 0xd98f0;
void setupStreak() = win 0xd98f0;
TodoReturn spawnCircle();
TodoReturn spawnDualCircle();
TodoReturn spawnFromPlayer(PlayerObject*);
Expand All @@ -5549,13 +5628,13 @@ class PlayerObject : GameObject {
TodoReturn updateCollideTop(float, int);
void updateGlowColor() = win 0xdfc80;
TodoReturn updateJump(float);
TodoReturn updatePlayerBirdFrame(int);
TodoReturn updatePlayerDartFrame(int) = win 0xe0580;
TodoReturn updatePlayerFrame(int) = win 0xdfff0;
void updatePlayerBirdFrame(int);
void updatePlayerDartFrame(int) = win 0xe0580;
void updatePlayerFrame(int) = win 0xdfff0;
void updatePlayerGlow();
TodoReturn updatePlayerRollFrame(int) = win 0xe0430;
void updatePlayerRollFrame(int) = win 0xe0430;
TodoReturn updatePlayerScale();
TodoReturn updatePlayerShipFrame(int);
void updatePlayerShipFrame(int);
void updateRotation(float, float);
void updateRotation(float);
TodoReturn updateShipRotation(float);
Expand Down Expand Up @@ -6459,8 +6538,8 @@ class SimplePlayer : cocos2d::CCSprite {
bool init(int) = win 0x80810;
void setFrames(char const*, char const*, char const*, char const*);
void setSecondColor(cocos2d::ccColor3B const&);
TodoReturn updateColors();
TodoReturn updatePlayerFrame(int, IconType) = win 0x80c70;
void updateColors();
void updatePlayerFrame(int, IconType) = win 0x80c70;

virtual void setOpacity(unsigned char);
virtual void setColor(cocos2d::ccColor3B const&);
Expand Down
Loading

0 comments on commit ed28852

Please sign in to comment.