Skip to content

Commit aea0b29

Browse files
committed
bug fix updates
1 parent 22c9bd1 commit aea0b29

File tree

6 files changed

+35
-31
lines changed

6 files changed

+35
-31
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# v1.3.2
2+
- Removed Dear ImGui :(
3+
- Removed Menu Style.
4+
- Fixed performance issues.
5+
- Fixed text centering issues with info popup.
16
# v1.3.1
27
- Prevented users from being softlocked via speedhack.
38
- Fixed text scaling issue with other languages.

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"geode": "2.0.0",
3-
"version": "v1.3.1",
3+
"version": "v1.3.2",
44
"gd": {
55
"win": "2.204",
66
"mac": "2.200",

resources/hacks/settings.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,5 @@
101101
"opcodes": [],
102102
"type": "button",
103103
"default": "button"
104-
},
105-
{
106-
"name": "Menu Style",
107-
"desc": "",
108-
"opcodes": [],
109-
"type": "dropdown",
110-
"default": 1,
111-
"values": ["ImGui", "Geometry Dash"]
112104
}
113105
]

src/PrismUI.cpp

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
int currentMenuIndexGD = 0;
1111

12+
matjson::Array currentThemeApplied;
13+
1214
int calcLimit(int n) {
1315
return static_cast<int>(std::floor(std::log10(n)) + 1);
1416
}
@@ -107,7 +109,6 @@ float calculateScale(const std::string& input, int charsBeforeShrink, float minS
107109
}
108110

109111
bool PrismUIButton::init(HackItem* hack) {
110-
auto currentLanguage = Lang::getLanguage();
111112
menu = CCMenu::create();
112113
const auto& obj = hack->data;
113114
std::string name = hack->name;
@@ -386,17 +387,19 @@ void PrismUIButton::onDropdownBtn(CCObject* sender) {
386387
if (hack->name == "Menu Style") {
387388
auto obj = static_cast<PrismUI*>(CCScene::get()->getChildByID("prism-menu"));
388389
obj->onClose(sender);
390+
} else if (hack->name == "Theme") {
391+
currentThemeApplied = matjson::Array {};
389392
}
390393
}
391394

392-
void PrismUI::CreateHackItem(HackItem* hack, bool isSettings) {
395+
void PrismUI::CreateHackItem(HackItem* hack) {
393396
const auto& obj = hack->data;
394397
std::string name = hack->name;
395398
std::string desc = hack->desc;
396399
auto opcodes = obj.get<matjson::Array>("opcodes");
397400
if (!((Hacks::isHackEnabled("Enable Patching") && obj.contains("winOnly")) || !obj.contains("winOnly") || name == "Enable Patching")) return;
398-
auto btn = PrismUIButton::create(hack);
399-
float indexY = (isSettings) ? ((currentI - 1)* 28) + 100 : (currentI * 28) + 100;
401+
auto btn = PrismUIButton::create(hack, m_currentLang.get());
402+
float indexY = (currentI * 28) + 100;
400403
// TODO: create custom sprite so people dont complain
401404
auto infoSpr = CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
402405
//infoSpr->setScale(.5F);
@@ -562,8 +565,7 @@ void PrismUI::RegenCategory() {
562565
break;
563566
case 5: { // Settings
564567
jsonArray = matjson::parse(Hacks::getSettings()).as_array();
565-
auto currentLanguage = Lang::getLanguage();
566-
auto createdByLabel = CCLabelBMFont::create(currentLanguage->name("Prism Menu by Firee").c_str(), "PrismMenu.fnt"_spr);
568+
auto createdByLabel = CCLabelBMFont::create(m_currentLang->name("Prism Menu by Firee").c_str(), "PrismMenu.fnt"_spr);
567569
auto versionLabel = CCLabelBMFont::create("Unknown.", "PrismMenu.fnt"_spr);
568570
createdByLabel->limitLabelWidth(150, 1.0F, .2F);
569571
createdByLabel->setPosition({63, 470});
@@ -602,7 +604,7 @@ void PrismUI::RegenCategory() {
602604
std::string name = obj.get<std::string>("name");
603605
HackItem* hack = Hacks::getHack(name);
604606
if (hack != nullptr) {
605-
CreateHackItem(hack, currentMenuIndexGD == 5);
607+
CreateHackItem(hack);
606608
}
607609
}
608610
}
@@ -701,7 +703,8 @@ void PrismUIButton::onInfoBtn(CCObject* ret) {
701703
->setAxisAlignment(AxisAlignment::Center)
702704
->setAxisReverse(true)
703705
);
704-
newLines->setPosition({282, (cocos2d::CCDirector::sharedDirector()->getWinSize().height / 2) + 10}); // 160 - 220
706+
auto winSize = cocos2d::CCDirector::sharedDirector()->getWinSize();
707+
newLines->setPosition({(winSize.width / 2), (winSize.height / 2) + 10}); // 160 - 220
705708
newLines->setZOrder(lines->getZOrder());
706709
lines->removeFromParentAndCleanup(true);
707710
flAlert->m_mainLayer->addChild(newLines);
@@ -712,12 +715,16 @@ void PrismUIButton::onInfoBtn(CCObject* ret) {
712715
}
713716

714717
matjson::Object PrismUI::GetTheme() {
715-
return Themes::getCurrentTheme();
718+
if (currentThemeApplied.empty()) {
719+
log::debug("Getting current theme...");
720+
currentThemeApplied.push_back(Themes::getCurrentTheme());
721+
}
722+
return currentThemeApplied[0].as_object();
716723
}
717724

718725
bool PrismUI::init(float _w, float _h) {
719726
auto winSize = cocos2d::CCDirector::sharedDirector()->getWinSize();
720-
auto currentLanguage = Lang::getLanguage();
727+
m_currentLang = Lang::getLanguage();
721728

722729
float menuScale = Hacks::getHack("Menu Scale")->value.floatValue;
723730
this->m_pLrSize = cocos2d::CCSize { _w, _h };
@@ -774,12 +781,12 @@ bool PrismUI::init(float _w, float _h) {
774781

775782
bg->addChild(sideBar);
776783
bg->addChild(buttonBG);
777-
CreateButton(currentLanguage->name("§ Global").c_str(), 0);
778-
CreateButton(currentLanguage->name("¬ Player").c_str(), 1);
779-
CreateButton(currentLanguage->name("ª Bypass").c_str(), 2);
780-
CreateButton(currentLanguage->name("« Creator").c_str(), 3);
781-
CreateButton(currentLanguage->name("··· Misc").c_str(), 4);
782-
CreateButton(currentLanguage->name("¶ Settings").c_str(), 5);
784+
CreateButton(m_currentLang->name("§ Global").c_str(), 0);
785+
CreateButton(m_currentLang->name("¬ Player").c_str(), 1);
786+
CreateButton(m_currentLang->name("ª Bypass").c_str(), 2);
787+
CreateButton(m_currentLang->name("« Creator").c_str(), 3);
788+
CreateButton(m_currentLang->name("··· Misc").c_str(), 4);
789+
CreateButton(m_currentLang->name("¶ Settings").c_str(), 5);
783790
Themes::RGBAToCC(GetTheme()["BG"], bg);
784791
Themes::RGBAToCC(GetTheme()["BG"], bgBehind);
785792
bgBehind->setColor({255, 255, 255});
@@ -838,9 +845,10 @@ PrismUI* PrismUI::create() {
838845
return nullptr;
839846
};
840847

841-
PrismUIButton* PrismUIButton::create(HackItem* hack) {
848+
PrismUIButton* PrismUIButton::create(HackItem* hack, Lang* lang) {
842849
auto pRet = new PrismUIButton();
843850
if (pRet) {
851+
pRet->currentLanguage = lang;
844852
if (pRet->init(hack)) {
845853
pRet->autorelease();
846854
return pRet;

src/PrismUI.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class PrismUIButton : public CCNode, public TextInputDelegate {
1212
HackItem* m_hack;
1313
Slider* m_slider;
1414
InputNode* m_input;
15+
Lang* currentLanguage;
1516
bool editedInputNode = false;
1617
virtual bool init(HackItem* hack);
1718
void onBoolBtn(CCObject*);
@@ -32,7 +33,7 @@ class PrismUIButton : public CCNode, public TextInputDelegate {
3233
HackItem* getHack() { return m_hack; }
3334

3435
void onInfoBtn(CCObject*);
35-
static PrismUIButton* create(HackItem* hack);
36+
static PrismUIButton* create(HackItem* hack, Lang* lang);
3637
};
3738

3839
class PrismUI : public FLAlertLayer {
@@ -45,6 +46,7 @@ class PrismUI : public FLAlertLayer {
4546
std::vector<cocos2d::extension::CCScale9Sprite*> m_pNavButtons;
4647
CCScrollLayerExt* m_scrollLayer;
4748
CCMenu* m_content;
49+
std::unique_ptr<Lang> m_currentLang;
4850
float m_fWidth;
4951
float m_fHeight;
5052

@@ -53,7 +55,7 @@ class PrismUI : public FLAlertLayer {
5355
float height
5456
);
5557
virtual void keyDown(cocos2d::enumKeyCodes) override;
56-
void CreateHackItem(HackItem* item, bool);
58+
void CreateHackItem(HackItem*);
5759
void RegenCategory();
5860
void CreateButton(const char* name, int menuIndex);
5961
void ButtonState(int id, bool activated);

src/main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ class PrismButton : public CCMenu {
7474
//this->scheduleUpdate();
7575
return true;
7676
}
77-
void registerWithTouchDispatcher() override { // is this even needed anymore
78-
CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, -500, true);
79-
}
8077
public:
8178
// chat jippity
8279
#if 0 // fixing later, because chatgpt is givin gme bad results

0 commit comments

Comments
 (0)