Closed TechStudent10 closed 1 year ago
@poweredbypie sorry for ping, but I really want to know why my game is crashing and more specifically, how can I fix it?
Full code (where I think the bug appeared):
bool MainPopup::setup() {
m_noElasticity = true;
auto winSize = CCDirector::sharedDirector()->getWinSize();
// convenience function provided by Popup
// for adding/setting a title to the popup
this->setTitle("GDTools");
auto toggleOn = CCSprite::create("GD_checkOn_001.png");
auto toggleOff = CCSprite::create("GD_checkOff_001.png");
auto noclipBtn = CCMenuItemToggler::create(testNoclip(toggleOn, toggleOff), testNoclip(toggleOff, toggleOn), this, menu_selector(MainPopup::toggleNoclip));
auto label = CCLabelBMFont::create("NoClip", "goldfont.fnt");
noclipBtn->setScale(0.5F);
label->setScale(0.5F);
label->setPositionX(45);
auto menu = CCMenu::create();
menu->addChild(noclipBtn);
menu->addChild(label);
this->addChild(menu);
auto label = CCLabelBMFont::create("testing lol", "bigFont.fnt");
label->setPosition(winSize / 2);
this->addChild(label);
return true;
};
I've tracked down the bug to these two lines:
auto noclipBtn = CCMenuItemToggler::create(testNoclip(toggleOn, toggleOff), testNoclip(toggleOff, toggleOn), this, menu_selector(MainPopup::toggleNoclip));
auto label = CCLabelBMFont::create("NoClip", "goldfont.fnt");
Doing some more testing brings it down to this line of code:
auto noclipBtn = CCMenuItemToggler::create(testNoclip(toggleOn, toggleOff), testNoclip(toggleOff, toggleOn), this, menu_selector(MainPopup::toggleNoclip));
Found it. I forgot that all of GD's sprite names are prefixed with GJ_
but I'm too used to writing GD. The sprite definition should be:
auto toggleOn = CCSprite::create("GJ_checkOn_001.png");
auto toggleOff = CCSprite::create("GJ_checkOff_001.png");
Platform
Windows
Geode Version
0.6.9999999 (apparently)
Mods Installed
Taken directly from crash log hjfod.devtools | HJfod | v0.0.5 | Enabled | Loaded | mat.practice-music | mat | v1.0.1 | Enabled | Loaded | com.mat.fps-bypass | mat | v1.0.0 | Enabled | Loaded | techstudent10.gdtools | TechStudent10 | v1.0.0 | Enabled | Loaded | techstudent10.lightning | TechStudent10 | v0.0.1 | Disabled | Loaded |
Steps to Reproduce
I created a popup using
geode::Popup
and after adding in some content. I don't know why.Crash Report
Crash report: https://gist.github.com/TechStudent10/261de74f97f429a769e5b3861ca5ef85 Logs: https://gist.github.com/TechStudent10/d822cae1a5db7d383379beb7a40badfa
Additional Information
I initially through it was me using
CCSprite::createWithSpriteFrameName
, but after switching toCCSprite::create
, nothing changed.