Skip to content

Commit

Permalink
v1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjustin000 committed Mar 7, 2024
1 parent 035b645 commit 8d03cbc
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A mod that integrates a list of the top extreme demons, according to [aredl.net](https://aredl.net), into Geometry Dash.

# Features
- A new button in the level search screen that opens the demon list.
- A new button in the level/list search screen that opens the demon list.
- A search box that allows you to search for a demon in the list by name.
- Page navigation buttons that allow you to navigate through the list.
- If on the list, and if enabled, there will be text on the demon's search box that states its position on the list.
Expand Down
2 changes: 1 addition & 1 deletion about.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A mod that integrates a list of the top extreme demons, according to [aredl.net](https://aredl.net), into Geometry Dash.

# Features
- A new button in the level search screen that opens the demon list.
- A new button in the level/list search screen that opens the demon list.
- A search box that allows you to search for a demon in the list by name.
- Page navigation buttons that allow you to navigate through the list.
- If on the list, and if enabled, there will be text on the demon's search box that states its position on the list.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Integrated Demonlist Changelog
## v1.4.1 (2024-03-06)
- Added the demonlist to the list search menu

## v1.4.0 (2024-02-25)
- Added Enter as a keyboard shortcut to search for a demon in the demonlist page
- Disabled the page jump buttons when the demonlist is loading or when there is only one page
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"win": "2.204",
"mac": "2.200"
},
"version": "v1.4.0",
"version": "v1.4.1",
"id": "hiimjustin000.integrated_demonlist",
"name": "Integrated Demonlist",
"developer": "hiimjustin000",
Expand Down
15 changes: 14 additions & 1 deletion src/IDListLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,20 @@ void IDListLayer::loadLevelsFailed(const char*) {

void IDListLayer::onExit(CCObject*) {
auto scene = CCScene::create();
scene->addChild(LevelSearchLayer::create(0));
auto gm = GameManager::sharedState();
#ifdef GEODE_IS_WINDOWS
auto onlineType = *(int*)((uintptr_t)gm + 0x3d4);
#elif GEODE_IS_MACOS
auto onlineType = *(int*)((uintptr_t)gm + 0x4b8);
#elif GEODE_IS_ANDROID32
auto onlineType = *(int*)((uintptr_t)gm + 0x3bc);
#elif GEODE_IS_ANDROID64
auto onlineType = *(int*)((uintptr_t)gm + 0x4d8);
#else
auto onlineType = 0;
#endif

scene->addChild(LevelSearchLayer::create(onlineType));
CCDirector::sharedDirector()->replaceScene(CCTransitionFade::create(0.5f, scene));
}

Expand Down
25 changes: 12 additions & 13 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "IDListLayer.hpp"

#include <Geode/modify/LevelBrowserLayer.hpp>
#include <Geode/modify/LevelSearchLayer.hpp>
#include <Geode/modify/LevelCell.hpp>
#include <Geode/modify/MenuLayer.hpp>
Expand All @@ -17,18 +16,18 @@ class $modify(IDMenuLayer, MenuLayer) {
class $modify(IDLevelSearchLayer, LevelSearchLayer) {
bool init(int searchType) {
if (!LevelSearchLayer::init(searchType)) return false;
if (searchType == 0) {
auto demonlistButtonSprite = CCSprite::create("IDDemonlistButton.png"_spr);
demonlistButtonSprite->setScale(0.8f);
auto demonlistButton = CCMenuItemSpriteExtra::create(demonlistButtonSprite, this, menu_selector(IDLevelSearchLayer::onDemonList));
demonlistButton->setID("demonlist-button"_spr);
auto menu = static_cast<CCMenu*>(this->getChildByID("other-filter-menu"));
demonlistButton->setPosition(
(CCDirector::sharedDirector()->getScreenRight() - demonlistButtonSprite->getContentSize().width) / 2 - 2,
static_cast<CCMenuItemSpriteExtra*>(menu->getChildren()->lastObject())->getPositionY() - 50
);
menu->addChild(demonlistButton);
}

auto demonlistButtonSprite = CCSprite::create("IDDemonlistButton.png"_spr);
demonlistButtonSprite->setScale(0.8f);
auto demonlistButton = CCMenuItemSpriteExtra::create(demonlistButtonSprite, this, menu_selector(IDLevelSearchLayer::onDemonList));
demonlistButton->setID("demonlist-button"_spr);
auto menu = static_cast<CCMenu*>(this->getChildByID("other-filter-menu"));
demonlistButton->setPosition(
(CCDirector::sharedDirector()->getScreenRight() - demonlistButtonSprite->getContentSize().width) / 2 - 2,
static_cast<CCMenuItemSpriteExtra*>(menu->getChildren()->lastObject())->getPositionY() - 50
);
menu->addChild(demonlistButton);

return true;
}

Expand Down

0 comments on commit 8d03cbc

Please sign in to comment.