diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c7e932..e603fb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_CXX_VISIBILITY_PRESET hidden) -project(SearchHistory VERSION 1.0.0) +project(SearchHistory VERSION 1.0.1) add_library(${PROJECT_NAME} SHARED src/main.cpp diff --git a/changelog.md b/changelog.md index e80a1cc..2c81799 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ # Search History Changelog +## v1.0.1 (2024-08-07) +- Added page counter to the search history popup +- Fixed a layering issue in the mod's logo + ## v1.0.0 (2024-08-07) - Initial release \ No newline at end of file diff --git a/logo.png b/logo.png index 33272af..0fc387f 100644 Binary files a/logo.png and b/logo.png differ diff --git a/mod.json b/mod.json index f5dfe8e..e9e26e9 100644 --- a/mod.json +++ b/mod.json @@ -5,7 +5,7 @@ "win": "2.206", "mac": "2.206" }, - "version": "v1.0.0", + "version": "v1.0.1", "id": "hiimjustin000.search_history", "name": "Search History", "developer": "hiimjustin000", diff --git a/resources/image1.png b/resources/image1.png index 12e4cae..5acb14e 100644 Binary files a/resources/image1.png and b/resources/image1.png differ diff --git a/resources/image2.png b/resources/image2.png index 49d7aeb..997c0b6 100644 Binary files a/resources/image2.png and b/resources/image2.png differ diff --git a/src/SearchHistoryNode.cpp b/src/SearchHistoryNode.cpp index 75b72fa..b20988b 100644 --- a/src/SearchHistoryNode.cpp +++ b/src/SearchHistoryNode.cpp @@ -19,7 +19,7 @@ bool SearchHistoryNode::init(SearchHistoryObject const& object, int index, Searc m_searchCallback = search; m_removeCallback = remove; m_index = index; - + auto background = CCScale9Sprite::create("GJ_square01.png", { 0, 0, 80, 80 }); background->setContentSize({ 400.0f, 100.0f }); background->setPosition(200.0f, 50.0f); @@ -144,7 +144,7 @@ bool SearchHistoryNode::init(SearchHistoryObject const& object, int index, Searc demonFilterSprite->setScale(0.5f); difficultiesNode->addChild(demonFilterSprite); } - + if (type < 1) for (auto time : object.lengths) { auto length = std::string(); switch (time) { @@ -204,7 +204,7 @@ bool SearchHistoryNode::init(SearchHistoryObject const& object, int index, Searc std::stringstream ss; auto time = (time_t)object.time; ss << std::put_time(std::localtime(&time), h12 ? "%Y-%m-%d %I:%M:%S %p" : "%Y-%m-%d %H:%M:%S"); - + auto timeLabel = CCLabelBMFont::create(ss.str().c_str(), "chatFont.fnt"); timeLabel->setColor(white ? ccColor3B { 255, 255, 255 } : ccColor3B { 51, 51, 51 }); timeLabel->setOpacity(white ? 200 : 152); diff --git a/src/SearchHistoryPopup.cpp b/src/SearchHistoryPopup.cpp index 91932df..1309ea7 100644 --- a/src/SearchHistoryPopup.cpp +++ b/src/SearchHistoryPopup.cpp @@ -57,6 +57,12 @@ bool SearchHistoryPopup::setup(SearchHistoryCallback callback) { clearButton->setPosition(420.0f, 270.0f); m_buttonMenu->addChild(clearButton); + m_countLabel = CCLabelBMFont::create("", "goldFont.fnt"); + m_countLabel->setAnchorPoint({ 1.0f, 0.0f }); + m_countLabel->setScale(0.5f); + m_countLabel->setPosition(435.0f, 7.0f); + m_mainLayer->addChild(m_countLabel); + m_searchInput = TextInput::create(400.0f, "Search History..."); m_searchInput->setCommonFilter(CommonFilter::Any); m_searchInput->setTextAlign(TextInputAlign::Left); @@ -97,5 +103,7 @@ void SearchHistoryPopup::page(int p) { m_scrollLayer->m_contentLayer->updateLayout(); m_scrollLayer->scrollToTop(); + m_countLabel->setString(fmt::format("{} to {} of {}", count > 0 ? p * 5 + 1 : 0, std::min((p + 1) * 5, (int)count), count).c_str()); + m_page = p; } diff --git a/src/SearchHistoryPopup.hpp b/src/SearchHistoryPopup.hpp index e1e2c7a..e13c35e 100644 --- a/src/SearchHistoryPopup.hpp +++ b/src/SearchHistoryPopup.hpp @@ -9,6 +9,7 @@ class SearchHistoryPopup : public geode::Popup<SearchHistoryCallback> { TextInput* m_searchInput; CCMenuItemSpriteExtra* m_prevButton; CCMenuItemSpriteExtra* m_nextButton; + CCLabelBMFont* m_countLabel; int m_page; bool setup(SearchHistoryCallback) override;