Skip to content

Commit b58e513

Browse files
committed
2.208 update
1 parent 3c40e3b commit b58e513

File tree

10 files changed

+40
-29
lines changed

10 files changed

+40
-29
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ endif()
99
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
1010
set(GEODE_DISABLE_PRECOMPILED_HEADERS ON)
1111

12-
project(SearchHistory VERSION 1.2.0)
12+
project(SearchHistory VERSION 1.2.1)
1313

1414
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.cpp)
1515

@@ -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.0.1")
26+
CPMAddPackage("gh:hiimjasmine00/jasmine-tools@1.4.0")
2727
target_link_libraries(${PROJECT_NAME} jasmine-tools)
2828

2929
setup_geode_mod(${PROJECT_NAME})

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Search History Changelog
2+
## v1.2.1 (2026-02-04)
3+
- Ported to Geometry Dash v2.208 / Geode SDK v5.0.0
4+
25
## v1.2.0 (2025-10-26)
36
- Added advanced filtering options
47

mod.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"geode": "4.9.0",
2+
"geode": "5.0.0-alpha.1",
33
"gd": {
4-
"android": "2.2074",
5-
"win": "2.2074",
6-
"mac": "2.2074",
7-
"ios": "2.2074"
4+
"android": "2.2081",
5+
"win": "2.2081",
6+
"mac": "2.2081",
7+
"ios": "2.2081"
88
},
9-
"version": "v1.2.0",
9+
"version": "v1.2.1-beta.1",
1010
"id": "hiimjustin000.search_history",
1111
"name": "Search History",
1212
"developer": "hiimjasmine00",

src/classes/SearchFilterPopup.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using namespace geode::prelude;
99

1010
SearchFilterPopup* SearchFilterPopup::create(const SearchHistoryObject& filter, SearchFilterCallback callback) {
1111
auto ret = new SearchFilterPopup();
12-
if (ret->initAnchored(300.0f, 250.0f, filter, std::move(callback), "GJ_square02.png")) {
12+
if (ret->init(filter, std::move(callback))) {
1313
ret->autorelease();
1414
return ret;
1515
}
@@ -22,7 +22,9 @@ void updateButton(CCMenuItemSpriteExtra* button, bool enabled, bool clickable) {
2222
button->setEnabled(clickable || enabled);
2323
}
2424

25-
bool SearchFilterPopup::setup(const SearchHistoryObject& filter, SearchFilterCallback callback) {
25+
bool SearchFilterPopup::init(const SearchHistoryObject& filter, SearchFilterCallback callback) {
26+
if (!Popup::init(300.0f, 250.0f, "GJ_square02.png")) return false;
27+
2628
setID("SearchFilterPopup");
2729
setTitle("Search Filter", "bigFont.fnt", 0.53f, 15.0f);
2830
m_title->setID("search-filter-title");
@@ -207,7 +209,7 @@ bool SearchFilterPopup::setup(const SearchHistoryObject& filter, SearchFilterCal
207209
m_songInput->setCommonFilter(CommonFilter::Uint);
208210
m_songInput->setTextAlign(TextInputAlign::Center);
209211
m_songInput->setCallback([this](const std::string& text) {
210-
jasmine::convert::toInt(text, m_searchFilter.songID);
212+
jasmine::convert::to(text, m_searchFilter.songID);
211213
m_searchFilter.songID = std::max(m_searchFilter.songID, 0);
212214
});
213215
if (m_searchFilter.song && m_searchFilter.customSong) {

src/classes/SearchFilterPopup.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <Geode/ui/Popup.hpp>
44
#include <Geode/ui/TextInput.hpp>
55

6-
typedef std::function<void(SearchHistoryObject)> SearchFilterCallback;
6+
typedef geode::Function<void(SearchHistoryObject)> SearchFilterCallback;
77

8-
class SearchFilterPopup : public geode::Popup<const SearchHistoryObject&, SearchFilterCallback>, public DemonFilterDelegate {
8+
class SearchFilterPopup : public geode::Popup, public DemonFilterDelegate {
99
protected:
1010
SearchHistoryObject m_searchFilter;
1111
SearchFilterCallback m_searchCallback;
@@ -20,7 +20,7 @@ class SearchFilterPopup : public geode::Popup<const SearchHistoryObject&, Search
2020
cocos2d::CCLabelBMFont* m_songLabel;
2121
geode::TextInput* m_songInput;
2222

23-
bool setup(const SearchHistoryObject&, SearchFilterCallback) override;
23+
bool init(const SearchHistoryObject&, SearchFilterCallback);
2424
void updateTypes();
2525
void updateDifficulties();
2626
void updateLengths();

src/classes/SearchHistoryNode.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,15 @@ bool SearchHistoryNode::init(
8989
buttonMenu->setID("button-menu");
9090
addChild(buttonMenu);
9191

92-
auto removeButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_deleteBtn_001.png", 0.5f, [this, remove = std::move(remove)](auto) {
92+
auto removeButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_deleteBtn_001.png", 0.5f, [
93+
this, remove = std::move(remove)
94+
](auto) mutable {
9395
createQuickPopup(
9496
"Remove Search",
9597
"Are you sure you want to remove this search history entry?",
9698
"No",
9799
"Yes",
98-
[this, remove = std::move(remove)](auto, bool btn2) {
100+
[this, remove = std::move(remove)](auto, bool btn2) mutable {
99101
if (btn2) remove();
100102
}
101103
);
@@ -104,7 +106,9 @@ bool SearchHistoryNode::init(
104106
removeButton->setID("remove-button");
105107
buttonMenu->addChild(removeButton);
106108

107-
auto searchButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_undoBtn_001.png", 0.6f, [this, search = std::move(search)](auto) {
109+
auto searchButton = CCMenuItemExt::createSpriteExtraWithFrameName("GJ_undoBtn_001.png", 0.6f, [
110+
this, search = std::move(search)
111+
](auto) mutable {
108112
search();
109113
});
110114
searchButton->setPosition({ 350.0f, 25.0f });
@@ -290,7 +294,7 @@ bool SearchHistoryNode::init(
290294
}
291295
}
292296

293-
auto tm = fmt::localtime(object.time);
297+
auto tm = localtime(object.time);
294298
auto timeLabel = CCLabelBMFont::create(
295299
(h12 ? fmt::format("{:%Y-%m-%d %I:%M:%S %p}", tm) : fmt::format("{:%Y-%m-%d %H:%M:%S}", tm)).c_str(), "chatFont.fnt");
296300
timeLabel->setColor(white ? ccColor3B { 255, 255, 255 } : ccColor3B { 51, 51, 51 });

src/classes/SearchHistoryNode.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "../SearchHistory.hpp"
22
#include <cocos2d.h>
33

4-
typedef std::function<void()> SearchCallback;
5-
typedef std::function<void()> RemoveCallback;
4+
typedef geode::Function<void()> SearchCallback;
5+
typedef geode::Function<void()> RemoveCallback;
66

77
class SearchHistoryNode : public cocos2d::CCLayer {
88
protected:

src/classes/SearchHistoryPopup.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ using namespace geode::prelude;
88

99
SearchHistoryPopup* SearchHistoryPopup::create(SearchHistoryCallback callback) {
1010
auto ret = new SearchHistoryPopup();
11-
if (ret->initAnchored(440.0f, 290.0f, std::move(callback), "GJ_square02.png")) {
11+
if (ret->init(std::move(callback))) {
1212
ret->autorelease();
1313
return ret;
1414
}
1515
delete ret;
1616
return nullptr;
1717
}
1818

19-
bool SearchHistoryPopup::setup(SearchHistoryCallback callback) {
19+
bool SearchHistoryPopup::init(SearchHistoryCallback callback) {
20+
if (!Popup::init(440.0f, 290.0f, "GJ_square02.png")) return false;
21+
2022
setID("SearchHistoryPopup");
2123
setTitle("Search History", "bigFont.fnt", 0.53f);
2224
m_title->setID("search-history-title");

src/classes/SearchHistoryPopup.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <Geode/ui/ScrollLayer.hpp>
44
#include <Geode/ui/TextInput.hpp>
55

6-
typedef std::function<void(int)> SearchHistoryCallback;
6+
typedef geode::Function<void(int)> SearchHistoryCallback;
77

8-
class SearchHistoryPopup : public geode::Popup<SearchHistoryCallback> {
8+
class SearchHistoryPopup : public geode::Popup {
99
protected:
1010
SearchHistoryObject m_searchFilter;
1111
geode::ScrollLayer* m_scrollLayer;
@@ -17,7 +17,7 @@ class SearchHistoryPopup : public geode::Popup<SearchHistoryCallback> {
1717
cocos2d::CCLabelBMFont* m_countLabel;
1818
int m_page;
1919

20-
bool setup(SearchHistoryCallback) override;
20+
bool init(SearchHistoryCallback);
2121
public:
2222
static SearchHistoryPopup* create(SearchHistoryCallback);
2323

src/hooks/LevelSearchLayer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class $modify(SHLevelSearchLayer, LevelSearchLayer) {
1313
auto onSearchHook = jasmine::hook::get(self.m_hooks, "LevelSearchLayer::onSearch", !incognitoMode);
1414
auto onSearchUserHook = jasmine::hook::get(self.m_hooks, "LevelSearchLayer::onSearchUser", !incognitoMode);
1515

16-
new EventListener([onSearchHook, onSearchUserHook](std::shared_ptr<SettingV3> setting) {
16+
SettingChangedEventV3(GEODE_MOD_ID, "incognito-mode").listen([onSearchHook, onSearchUserHook](std::shared_ptr<SettingV3> setting) {
1717
auto value = !std::static_pointer_cast<BoolSettingV3>(std::move(setting))->getValue();
1818
jasmine::hook::toggle(onSearchHook, value);
1919
jasmine::hook::toggle(onSearchUserHook, value);
20-
}, SettingChangedFilterV3(GEODE_MOD_ID, "incognito-mode"));
20+
}).leak();
2121
}
2222

2323
bool init(int type) {
@@ -52,8 +52,8 @@ class $modify(SHLevelSearchLayer, LevelSearchLayer) {
5252
glm->setBoolForKey(object.noStar, "nostar_filter");
5353
glm->setBoolForKey(object.featured, "featured_filter");
5454
glm->setBoolForKey(object.epic, "epic_filter");
55-
glm->setBoolForKey(object.mythic, "legendary_filter"); // Nice job RobTop
56-
glm->setBoolForKey(object.legendary, "mythic_filter"); // Nice job RobTop
55+
glm->setBoolForKey(object.mythic, "legendary_filter");
56+
glm->setBoolForKey(object.legendary, "mythic_filter");
5757
glm->setBoolForKey(object.customSong, "customsong_filter");
5858
glm->setIntForKey(object.songID, "song_filter");
5959
}

0 commit comments

Comments
 (0)