Skip to content

Commit 59d5e8f

Browse files
committed
Alpha 2 update
1 parent afb8c05 commit 59d5e8f

File tree

10 files changed

+265
-169
lines changed

10 files changed

+265
-169
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
- name: Build the mod
4242
uses: hiimjasmine00/build-geode-mod@xwin
4343
with:
44-
sdk: nightly
4544
build-config: ${{ matrix.config.build-config || 'Release' }}
4645
export-pdb: true
4746
export-symbols: true

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ endif()
2323

2424
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
2525

26-
CPMAddPackage("gh:hiimjasmine00/jasmine-tools@1.4.0")
26+
CPMAddPackage("gh:hiimjasmine00/jasmine-tools@1.5.0")
2727
target_link_libraries(${PROJECT_NAME} jasmine-tools)
2828

2929
setup_geode_mod(${PROJECT_NAME})

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Search History Changelog
2-
## v1.2.1 (2026-02-07)
2+
## v1.2.1 (2026-02-10)
33
- Ported to Geometry Dash v2.208 / Geode SDK v5.0.0
44

55
## v1.2.0 (2025-10-26)

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "5.0.0-alpha.1",
2+
"geode": "5.0.0-alpha.2",
33
"gd": {
44
"android": "2.2081",
55
"win": "2.2081",

src/classes/SearchFilterPopup.cpp

Lines changed: 164 additions & 117 deletions
Large diffs are not rendered by default.

src/classes/SearchFilterPopup.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
typedef geode::Function<void(SearchHistoryObject)> SearchFilterCallback;
77

8-
class SearchFilterPopup : public geode::Popup, public DemonFilterDelegate {
8+
class SearchFilterPopup : public geode::Popup, public TextInputDelegate, public DemonFilterDelegate {
99
protected:
1010
SearchHistoryObject m_searchFilter;
1111
SearchFilterCallback m_searchCallback;
@@ -21,6 +21,20 @@ class SearchFilterPopup : public geode::Popup, public DemonFilterDelegate {
2121
geode::TextInput* m_songInput;
2222

2323
bool init(const SearchHistoryObject&, SearchFilterCallback);
24+
void onType(cocos2d::CCObject*);
25+
void onFilter(cocos2d::CCObject*);
26+
void onSongFilter(cocos2d::CCObject*);
27+
void onNormalSong(cocos2d::CCObject*);
28+
void onCustomSong(cocos2d::CCObject*);
29+
void onPrevSong(cocos2d::CCObject*);
30+
void onNextSong(cocos2d::CCObject*);
31+
void textChanged(CCTextInputNode*) override;
32+
void onDemonFilter(cocos2d::CCObject*);
33+
void onDifficulty(cocos2d::CCObject*);
34+
void onSpecialDifficulty(cocos2d::CCObject*);
35+
void onLength(cocos2d::CCObject*);
36+
void onStar(cocos2d::CCObject*);
37+
void onConfirm(cocos2d::CCObject*);
2438
void updateTypes();
2539
void updateDifficulties();
2640
void updateLengths();

src/classes/SearchHistoryNode.cpp

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ bool SearchHistoryNode::init(
2929

3030
m_index = index;
3131
m_count = count;
32+
m_searchCallback = std::move(search);
33+
m_removeCallback = std::move(remove);
3234

3335
auto background = NineSlice::create(
3436
index % 10 == 0 ? "square-top.png"_spr :
@@ -89,28 +91,16 @@ bool SearchHistoryNode::init(
8991
buttonMenu->setID("button-menu");
9092
addChild(buttonMenu);
9193

92-
auto removeButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_deleteBtn_001.png", 0.5f, [
93-
this, remove = std::move(remove)
94-
](auto) mutable {
95-
createQuickPopup(
96-
"Remove Search",
97-
"Are you sure you want to remove this search history entry?",
98-
"No",
99-
"Yes",
100-
[this, remove = std::move(remove)](auto, bool btn2) mutable {
101-
if (btn2) remove();
102-
}
103-
);
104-
});
94+
auto removeSprite = CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
95+
removeSprite->setScale(0.5f);
96+
auto removeButton = CCMenuItemSpriteExtra::create(removeSprite, this, menu_selector(SearchHistoryNode::onRemove));
10597
removeButton->setPosition({ 380.0f, 25.0f });
10698
removeButton->setID("remove-button");
10799
buttonMenu->addChild(removeButton);
108100

109-
auto searchButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_undoBtn_001.png", 0.6f, [
110-
this, search = std::move(search)
111-
](auto) mutable {
112-
search();
113-
});
101+
auto searchSprite = CCSprite::createWithSpriteFrameName("GJ_undoBtn_001.png");
102+
searchSprite->setScale(0.6f);
103+
auto searchButton = CCMenuItemSpriteExtra::create(searchSprite, this, menu_selector(SearchHistoryNode::onSearch));
114104
searchButton->setPosition({ 350.0f, 25.0f });
115105
searchButton->setID("search-button");
116106
buttonMenu->addChild(searchButton);
@@ -308,6 +298,25 @@ bool SearchHistoryNode::init(
308298
return true;
309299
}
310300

301+
void SearchHistoryNode::onRemove(CCObject* sender) {
302+
FLAlertLayer::create(
303+
this,
304+
"Remove Search",
305+
"Are you sure you want to remove this search history entry?",
306+
"No",
307+
"Yes",
308+
350.0f
309+
)->show();
310+
}
311+
312+
void SearchHistoryNode::onSearch(CCObject* sender) {
313+
m_searchCallback();
314+
}
315+
316+
void SearchHistoryNode::FLAlert_Clicked(FLAlertLayer* layer, bool btn2) {
317+
if (btn2) m_removeCallback();
318+
}
319+
311320
void SearchHistoryNode::draw() {
312321
ccDrawColor4B(0, 0, 0, 75);
313322
glLineWidth(2.0f);

src/classes/SearchHistoryNode.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#include "../SearchHistory.hpp"
22
#include <cocos2d.h>
3+
#include <Geode/binding/FLAlertLayerProtocol.hpp>
34

45
typedef geode::Function<void()> SearchCallback;
56
typedef geode::Function<void()> RemoveCallback;
67

7-
class SearchHistoryNode : public cocos2d::CCLayer {
8+
class SearchHistoryNode : public cocos2d::CCLayer, public FLAlertLayerProtocol {
89
protected:
10+
SearchCallback m_searchCallback;
11+
RemoveCallback m_removeCallback;
912
int m_index;
1013
int m_count;
1114
public:
1215
static SearchHistoryNode* create(const SearchHistoryObject&, int, int, SearchCallback, RemoveCallback, bool, bool, bool);
1316

1417
bool init(const SearchHistoryObject&, int, int, SearchCallback, RemoveCallback, bool, bool, bool);
18+
void onRemove(cocos2d::CCObject*);
19+
void onSearch(cocos2d::CCObject*);
20+
void FLAlert_Clicked(FLAlertLayer*, bool) override;
1521
void draw() override;
1622
};

src/classes/SearchHistoryPopup.cpp

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,22 @@ bool SearchHistoryPopup::init(SearchHistoryCallback callback) {
4949
m_scrollLayer->setID("scroll-layer");
5050
m_mainLayer->addChild(m_scrollLayer);
5151

52-
m_prevButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_arrow_01_001.png", 1.0f, [this](auto) {
53-
page(m_page - 1);
54-
});
52+
auto prevButtonSprite = CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
53+
m_prevButton = CCMenuItemSpriteExtra::create(prevButtonSprite, this, menu_selector(SearchHistoryPopup::onPrevPage));
5554
m_prevButton->setPosition({ -34.5f, 145.0f });
5655
m_prevButton->setID("prev-button");
5756
m_buttonMenu->addChild(m_prevButton);
5857

5958
auto nextButtonSprite = CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
6059
nextButtonSprite->setFlipX(true);
61-
m_nextButton = CCMenuItemExt::createSpriteExtra(nextButtonSprite, [this](auto) {
62-
page(m_page + 1);
63-
});
60+
m_nextButton = CCMenuItemSpriteExtra::create(nextButtonSprite, this, menu_selector(SearchHistoryPopup::onNextPage));
6461
m_nextButton->setPosition({ 474.5f, 145.0f });
6562
m_nextButton->setID("next-button");
6663
m_buttonMenu->addChild(m_nextButton);
6764

68-
auto clearButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_deleteBtn_001.png", 0.6f, [this](auto) {
69-
createQuickPopup(
70-
"Clear History",
71-
"Are you sure you want to clear your search history?",
72-
"No",
73-
"Yes",
74-
[this](auto, bool btn2) {
75-
if (btn2) {
76-
SearchHistory::history.clear();
77-
page(0);
78-
}
79-
}
80-
);
81-
});
65+
auto clearSprite = CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
66+
clearSprite->setScale(0.6f);
67+
auto clearButton = CCMenuItemSpriteExtra::create(clearSprite, this, menu_selector(SearchHistoryPopup::onClear));
8268
clearButton->setPosition({ 420.0f, 270.0f });
8369
clearButton->setID("clear-button");
8470
m_buttonMenu->addChild(clearButton);
@@ -103,13 +89,7 @@ bool SearchHistoryPopup::init(SearchHistoryCallback callback) {
10389
auto filterSprite = ButtonSprite::create(
10490
CCSprite::createWithSpriteFrameName("GJ_filterIcon_001.png"), 32, false, 32.0f, "GJ_button_01.png", 1.0f);
10591
filterSprite->setScale(0.7f);
106-
m_filterButton = CCMenuItemExt::createSpriteExtra(filterSprite, [this, filterSprite](auto) {
107-
SearchFilterPopup::create(m_searchFilter, [this, filterSprite](SearchHistoryObject filter) {
108-
m_searchFilter = std::move(filter);
109-
filterSprite->updateBGImage(m_searchFilter.empty() ? "GJ_button_01.png" : "GJ_button_02.png");
110-
page(0);
111-
})->show();
112-
});
92+
m_filterButton = CCMenuItemSpriteExtra::create(filterSprite, this, menu_selector(SearchHistoryPopup::onFilter));
11393
m_filterButton->setPosition({ 405.0f, 235.0f });
11494
m_filterButton->setID("filter-button");
11595
m_buttonMenu->addChild(m_filterButton);
@@ -119,6 +99,41 @@ bool SearchHistoryPopup::init(SearchHistoryCallback callback) {
11999
return true;
120100
}
121101

102+
void SearchHistoryPopup::onPrevPage(CCObject* sender) {
103+
page(m_page - 1);
104+
}
105+
106+
void SearchHistoryPopup::onNextPage(CCObject* sender) {
107+
page(m_page + 1);
108+
}
109+
110+
void SearchHistoryPopup::onClear(CCObject* sender) {
111+
FLAlertLayer::create(
112+
this,
113+
"Clear History",
114+
"Are you sure you want to clear your search history?",
115+
"No",
116+
"Yes",
117+
350.0f
118+
)->show();
119+
}
120+
121+
void SearchHistoryPopup::FLAlert_Clicked(FLAlertLayer* layer, bool btn2) {
122+
if (btn2) {
123+
SearchHistory::history.clear();
124+
page(0);
125+
}
126+
}
127+
128+
void SearchHistoryPopup::onFilter(CCObject* sender) {
129+
SearchFilterPopup::create(m_searchFilter, [this](SearchHistoryObject filter) {
130+
m_searchFilter = std::move(filter);
131+
static_cast<ButtonSprite*>(m_filterButton->getNormalImage())->updateBGImage(
132+
m_searchFilter.empty() ? "GJ_button_01.png" : "GJ_button_02.png");
133+
page(0);
134+
})->show();
135+
}
136+
122137
void SearchHistoryPopup::page(int p) {
123138
m_scrollLayer->m_contentLayer->removeAllChildren();
124139

src/classes/SearchHistoryPopup.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#include "../SearchHistory.hpp"
2+
#include <Geode/binding/FLAlertLayerProtocol.hpp>
23
#include <Geode/ui/Popup.hpp>
34
#include <Geode/ui/ScrollLayer.hpp>
45
#include <Geode/ui/TextInput.hpp>
56

67
typedef geode::Function<void(int)> SearchHistoryCallback;
78

8-
class SearchHistoryPopup : public geode::Popup {
9+
class SearchHistoryPopup : public geode::Popup, public FLAlertLayerProtocol {
910
protected:
1011
SearchHistoryObject m_searchFilter;
1112
geode::ScrollLayer* m_scrollLayer;
@@ -18,6 +19,11 @@ class SearchHistoryPopup : public geode::Popup {
1819
int m_page;
1920

2021
bool init(SearchHistoryCallback);
22+
void onPrevPage(cocos2d::CCObject*);
23+
void onNextPage(cocos2d::CCObject*);
24+
void onClear(cocos2d::CCObject*);
25+
void FLAlert_Clicked(FLAlertLayer*, bool) override;
26+
void onFilter(cocos2d::CCObject*);
2127
public:
2228
static SearchHistoryPopup* create(SearchHistoryCallback);
2329

0 commit comments

Comments
 (0)