Skip to content

Commit

Permalink
it's pack time
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed Sep 2, 2024
1 parent a88c498 commit 6a0aa11
Show file tree
Hide file tree
Showing 15 changed files with 561 additions and 59 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(IntegratedDemonlist VERSION 1.5.10)
project(IntegratedDemonlist VERSION 1.6.0)

add_library(${PROJECT_NAME} SHARED
src/IDListLayer.cpp
src/IDPackCell.cpp
src/IDPackLayer.cpp
src/IntegratedDemonlist.cpp
src/main.cpp
)
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
A mod that integrates [aredl.net](https://aredl.net) and [pemonlist.com](https://pemonlist.com) into Geometry Dash.

# Features
- 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.
- Buttons that allow you to switch between the AREDL (For classic demons) and the Pemonlist (For platformer demons).
- If on the list, and if enabled, there will be text on the demon's search box that states its position on the list.
- A new button in the level 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
- Buttons that allow you to switch between the AREDL (For classic demons) and the Pemonlist (For platformer demons)
- A button in the map pack menu that opens the AREDL pack list
- Text on a demon's search box that states its position on the list (If on the list and the text is enabled in the mod settings)

# Gallery
![AREDL](./resources/aredl.png)\
![Pemonlist](./resources/pemonlist.png)
![Pemonlist](./resources/pemonlist.png)\
![AREDL Packs](./resources/aredl-packs.png)

# License
This mod is licensed under the [MIT License](./LICENSE).
14 changes: 8 additions & 6 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
A mod that integrates [aredl.net](https://aredl.net) and [pemonlist.com](https://pemonlist.com) into Geometry Dash.

# Features
- 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.
- Buttons that allow you to switch between the AREDL (For classic demons) and the Pemonlist (For platformer demons).
- If on the list, and if enabled, there will be text on the demon's search box that states its position on the list.
- A new button in the level 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
- Buttons that allow you to switch between the AREDL (For classic demons) and the Pemonlist (For platformer demons)
- A button in the map pack menu that opens the AREDL pack list
- Text on a demon's search box that states its position on the list (If on the list and the text is enabled in the mod settings)

# Gallery
![AREDL](hiimjustin000.integrated_demonlist/aredl.png?scale=0.625)\
![Pemonlist](hiimjustin000.integrated_demonlist/pemonlist.png?scale=0.625)
![Pemonlist](hiimjustin000.integrated_demonlist/pemonlist.png?scale=0.625)\
![AREDL Packs](hiimjustin000.integrated_demonlist/aredl-packs.png?scale=0.625)
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Integrated Demonlist Changelog
## v1.6.0 (2024-09-01)
- Added AREDL pack support
- Fixed a bug where the AREDL would not load at the start of the game

## v1.5.10 (2024-08-31)
- Fixed a bug where the game would crash if the Pemonlist or AREDL button was clicked when the search results were empty

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.206",
"mac": "2.206"
},
"version": "v1.5.10",
"version": "v1.6.0",
"id": "hiimjustin000.integrated_demonlist",
"name": "Integrated Demonlist",
"developer": "hiimjustin000",
Expand Down
Binary file added resources/aredl-packs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions src/IDListLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

IDListLayer* IDListLayer::create() {
auto ret = new IDListLayer();
if (ret && ret->init()) {
if (ret->init()) {
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
delete ret;
return nullptr;
}

Expand Down Expand Up @@ -49,8 +49,8 @@ bool IDListLayer::init() {
m_countLabel->setPosition(winSize.width - 7.0f, winSize.height - 3.0f);
addChild(m_countLabel);

m_list = GJListLayer::create(CustomListView::create(CCArray::create(), BoomListType::Level, 190.0f, 358.0f),
PEMONLIST ? "Pemonlist" : "All Rated Extreme Demons List", { 0, 0, 0, 180 }, 358.0f, 220.0f, 0);
m_list = GJListLayer::create(CustomListView::create(CCArray::create(), BoomListType::Level, 190.0f, 356.0f),
PEMONLIST ? "Pemonlist" : "All Rated Extreme Demons List", { 0, 0, 0, 180 }, 356.0f, 220.0f, 0);
m_list->setZOrder(2);
m_list->setPosition(winSize / 2 - m_list->getContentSize() / 2);
addChild(m_list);
Expand Down Expand Up @@ -147,7 +147,7 @@ bool IDListLayer::init() {
static std::mt19937 mt(std::random_device{}());
page(std::uniform_int_distribution<int>(0, (m_fullSearchResults.size() - 1) / 10)(mt));
});
m_randomButton->setPositionY(m_pageButton->getPositionY() - m_pageButton->getContentSize().height / 2 - m_randomButton->getContentSize().height / 2 - 5.0f);
m_randomButton->setPositionY(m_pageButton->getPositionY() - m_pageButton->getContentHeight() / 2 - m_randomButton->getContentHeight() / 2 - 5.0f);
menu->addChild(m_randomButton);

auto lastArrow = CCSprite::createWithSpriteFrameName("GJ_arrow_02_001.png");
Expand All @@ -158,9 +158,9 @@ bool IDListLayer::init() {
lastArrow->addChild(otherLastArrow);
lastArrow->setScale(0.4f);
m_lastButton = CCMenuItemExt::createSpriteExtra(lastArrow, [this](auto) { page((m_fullSearchResults.size() - 1) / 10); });
m_lastButton->setPositionY(m_randomButton->getPositionY() - m_randomButton->getContentSize().height / 2 - m_lastButton->getContentSize().height / 2 - 5.0f);
m_lastButton->setPositionY(m_randomButton->getPositionY() - m_randomButton->getContentHeight() / 2 - m_lastButton->getContentHeight() / 2 - 5.0f);
menu->addChild(m_lastButton);
auto x = winSize.width - m_randomButton->getContentSize().width / 2 - 3.0f;
auto x = winSize.width - m_randomButton->getContentWidth() / 2 - 3.0f;
m_pageButton->setPositionX(x);
m_randomButton->setPositionX(x);
m_lastButton->setPositionX(x - 4.0f);
Expand Down Expand Up @@ -196,11 +196,11 @@ void IDListLayer::addSearchBar() {
auto winSize = CCDirector::sharedDirector()->getWinSize();

m_searchBarMenu = CCMenu::create();
m_searchBarMenu->setContentSize({ 358.0f, 30.0f });
m_searchBarMenu->setContentSize({ 356.0f, 30.0f });
m_searchBarMenu->setPosition(0.0f, 190.0f);
m_list->addChild(m_searchBarMenu);

m_searchBarMenu->addChild(CCLayerColor::create({ 194, 114, 62, 255 }, 358.0f, 30.0f));
m_searchBarMenu->addChild(CCLayerColor::create({ 194, 114, 62, 255 }, 356.0f, 30.0f));

if (!m_query.empty()) {
auto searchButton = CCMenuItemExt::createSpriteExtraWithFilename("ID_findBtnOn_001.png"_spr, 0.7f, [this](auto) { search(); });
Expand Down Expand Up @@ -276,8 +276,8 @@ void IDListLayer::populateList(std::string query) {
void IDListLayer::loadLevelsFinished(CCArray* levels, const char*) {
auto winSize = CCDirector::sharedDirector()->getWinSize();
if (m_list->getParent() == this) removeChild(m_list);
m_list = GJListLayer::create(CustomListView::create(levels, BoomListType::Level, 190.0f, 358.0f),
PEMONLIST ? "Pemonlist" : "All Rated Extreme Demons List", { 0, 0, 0, 180 }, 358.0f, 220.0f, 0);
m_list = GJListLayer::create(CustomListView::create(levels, BoomListType::Level, 190.0f, 356.0f),
PEMONLIST ? "Pemonlist" : "All Rated Extreme Demons List", { 0, 0, 0, 180 }, 356.0f, 220.0f, 0);
m_list->setZOrder(2);
m_list->setPosition(winSize / 2 - m_list->getContentSize() / 2);
addChild(m_list);
Expand Down
4 changes: 2 additions & 2 deletions src/IDListLayer.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "IntegratedDemonlist.hpp"
#include "IDPackLayer.hpp"

class IDListLayer : public CCLayer, SetIDPopupDelegate, LevelManagerDelegate {
private:
Expand All @@ -8,7 +8,7 @@ class IDListLayer : public CCLayer, SetIDPopupDelegate, LevelManagerDelegate {
"It is managed by <cy>Kuro</c> and <cy>Padahk</c>.";
inline static const char* PEMONLIST_INFO =
"The <cg>Pemonlist</c> is an <cp>unofficial ranking</c> of all rated <cj>platformer mode</c> <cr>demons</c> in Geometry Dash.\n"
"It is managed by <cy>camila314</c>, <cy>Extatica</c>, and <cy>mariokirby1703</c>.";
"It is managed by <cy>camila314</c>, <cy>Extatica</c>, <cy>IvanCrafter026</c>, and <cy>Voiddle</c>.";
public:
static IDListLayer* create();
static CCScene* scene();
Expand Down
76 changes: 76 additions & 0 deletions src/IDPackCell.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#include "IDPackCell.hpp"

IDPackCell* IDPackCell::create(IDDemonPack pack) {
auto ret = new IDPackCell();
if (ret->init(pack)) {
ret->autorelease();
return ret;
}
delete ret;
return nullptr;
}

bool IDPackCell::init(IDDemonPack pack) {
if (!CCLayer::init()) return false;

auto winSize = CCDirector::sharedDirector()->getWinSize();

auto difficultySprite = CCSprite::createWithSpriteFrameName("difficulty_10_btn_001.png");
difficultySprite->setPosition({ 31.0f, 50.0f });
difficultySprite->setScale(1.1f);
addChild(difficultySprite, 2);

auto nameLabel = CCLabelBMFont::create(pack.name.c_str(), "bigFont.fnt");
nameLabel->setPosition(162.0f, 80.0f);
nameLabel->limitLabelWidth(205.0f, 0.9f, 0.0f);
addChild(nameLabel);

auto viewSprite = ButtonSprite::create("View", 50, 0, 0.6f, false, "bigFont.fnt", "GJ_button_01.png", 50.0f);
auto viewMenu = CCMenu::create(CCMenuItemExt::createSpriteExtra(viewSprite, [this, pack](auto) {
std::vector<std::string> levels;
for (auto level : pack.levels) levels.push_back(std::to_string(level));
CCDirector::sharedDirector()->pushScene(CCTransitionFade::create(0.5f,
LevelBrowserLayer::scene(GJSearchObject::create(SearchType::MapPackOnClick, string::join(levels, ",")))));
}), nullptr);
viewMenu->setPosition(347.0f - viewSprite->getContentWidth() / 2, 50.0f);
addChild(viewMenu);

auto progressBackground = CCSprite::create("GJ_progressBar_001.png");
progressBackground->setColor({ 0, 0, 0 });
progressBackground->setOpacity(125);
progressBackground->setScaleX(0.6f);
progressBackground->setScaleY(0.8f);
progressBackground->setPosition({ 164.0f, 48.0f });
addChild(progressBackground, 3);

auto progressBar = CCSprite::create("GJ_progressBar_001.png");
progressBar->setColor({ 184, 0, 0 });
progressBar->setScaleX(0.985f);
progressBar->setScaleY(0.83f);
progressBar->setAnchorPoint({ 0.0f, 0.5f });
auto rect = progressBar->getTextureRect();
progressBar->setPosition({ rect.size.width * 0.0075f, progressBackground->getContentHeight() / 2 });
auto gsm = GameStatsManager::sharedState();
auto completed = std::count_if(pack.levels.begin(), pack.levels.end(), [gsm](auto& level) { return gsm->hasCompletedOnlineLevel(level); });
progressBar->setTextureRect({ rect.origin.x, rect.origin.y, rect.size.width * (completed / (float)pack.levels.size()), rect.size.height });
progressBackground->addChild(progressBar, 1);

auto progressLabel = CCLabelBMFont::create(fmt::format("{}/{}", completed, pack.levels.size()).c_str(), "bigFont.fnt");
progressLabel->setPosition({ 164.0f, 48.0f });
progressLabel->setScale(0.5f);
addChild(progressLabel, 4);

auto pointsLabel = CCLabelBMFont::create(fmt::format("{} Points", pack.points).c_str(), "bigFont.fnt");
pointsLabel->setPosition(164.0f, 20.0f);
pointsLabel->setScale(0.7f);
pointsLabel->setColor({ 255, 255, (unsigned char)(completed >= pack.levels.size() ? 50 : 255) });
addChild(pointsLabel, 1);

if (completed >= pack.levels.size()) {
auto completedSprite = CCSprite::createWithSpriteFrameName("GJ_completesIcon_001.png");
completedSprite->setPosition({ 250.0f, 49.0f });
addChild(completedSprite, 5);
}

return true;
}
8 changes: 8 additions & 0 deletions src/IDPackCell.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "IntegratedDemonlist.hpp"

class IDPackCell : public CCLayer {
public:
static IDPackCell* create(IDDemonPack);
protected:
bool init(IDDemonPack);
};
Loading

0 comments on commit 6a0aa11

Please sign in to comment.