Skip to content

Commit

Permalink
start 2.206 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jun 4, 2024
1 parent 49dd80d commit f798294
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 29 deletions.
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"geode": "2.0.0-beta.26",
"geode": "2.0.0-beta.27",
"version": "v4.1.13",
"gd": {
"win": "2.204",
"win": "2.206",
"android": "2.205",
"mac": "2.200"
},
Expand Down
14 changes: 8 additions & 6 deletions src/hooks/ChallengesPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
using namespace geode::prelude;

class BI_DLL $modify(BIChallengesPage, ChallengesPage) {
CCMenuItemSpriteExtra* m_nextArrowBtn;
CCMenuItemSpriteExtra* m_prevArrowBtn;
std::vector<ChallengeNode*> m_queuedNodes;
std::vector<CCNode*> m_queuedDots;
size_t m_page = 0;
struct Fields {
CCMenuItemSpriteExtra* m_nextArrowBtn;
CCMenuItemSpriteExtra* m_prevArrowBtn;
std::vector<ChallengeNode*> m_queuedNodes;
std::vector<CCNode*> m_queuedDots;
size_t m_page = 0;
};

/*
* Callbacks
Expand Down Expand Up @@ -196,7 +198,7 @@ class BI_DLL $modify(BIChallengesPage, ChallengesPage) {
double time = GameStatsManager::sharedState()->m_challengeTime;
bool useRobTopTime = time < 1048576;
if(!GameStatsManager::sharedState()->getChallenge(i)) time += 28800; // GDPS incompatible assumption
countdownLabel->setString(GameToolbox::getTimeString(time - (useRobTopTime ? TimeUtils::getRobTopTime() : TimeUtils::getFullDoubleTime())).c_str());
countdownLabel->setString(GameToolbox::getTimeString(time - (useRobTopTime ? TimeUtils::getRobTopTime() : TimeUtils::getFullDoubleTime()), false).c_str());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/CreatorLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class BI_DLL $modify(BICreatorLayer, CreatorLayer) {
updatePopup->show();
}

Mod::get()->setSavedValue<std::string>("last_launch_version", Mod::get()->getVersion().toString());
Mod::get()->setSavedValue<std::string>("last_launch_version", Mod::get()->getVersion().toVString());

//showQuestExclamationMark();

Expand Down
8 changes: 5 additions & 3 deletions src/hooks/GameLevelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
using namespace geode::prelude;

class BI_DLL $modify(GameLevelManager) {
bool skipSavedFilter = false;
Ref<CCArray> filteredLevels = nullptr;
struct Fields {
bool skipSavedFilter = false;
Ref<CCArray> filteredLevels = nullptr;
};

/*
* Helpers
Expand Down Expand Up @@ -235,7 +237,7 @@ class BI_DLL $modify(GameLevelManager) {
auto value = header.substr(13);
auto seconds = BetterInfo::stoi(value);

Notification::create(fmt::format(" Rate limited by RobTop's server\n Try again in {}", GameToolbox::getTimeString(seconds)), NotificationIcon::Warning, 5.f)->show();
Notification::create(fmt::format(" Rate limited by RobTop's server\n Try again in {}", GameToolbox::getTimeString(seconds, false)), NotificationIcon::Warning, 5.f)->show();
return;
}

Expand Down
4 changes: 3 additions & 1 deletion src/hooks/InfoLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
using namespace geode::prelude;

class BI_DLL $modify(BIInfoLayer, InfoLayer) {
ButtonSprite* m_pageBtn = nullptr;
struct Fields {
ButtonSprite* m_pageBtn = nullptr;
};

static void onModify(auto& self) {
auto res = self.setHookPriority("InfoLayer::onMore", 99999);
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/LevelAreaInnerLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
using namespace geode::prelude;

class BI_DLL $modify(BILevelAreaInnerLayer, LevelAreaInnerLayer) {
CCMenu* m_menu = nullptr;
struct Fields {
CCMenu* m_menu = nullptr;
};

/*
* Callbacks
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/LevelBrowserLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ using namespace geode::prelude;

class BI_DLL
$modify(BILevelBrowserLayer, LevelBrowserLayer) {
CCMenuItemSpriteExtra* m_biLastPageBtn = nullptr;
DoubleArrow* m_biLastPageBtnArrow = nullptr;
struct Fields {
CCMenuItemSpriteExtra* m_biLastPageBtn = nullptr;
DoubleArrow* m_biLastPageBtnArrow = nullptr;
};

static void onModify(auto& self) {
(void) self.setHookPriority("LevelBrowserLayer::onGoToPage", 99999);
Expand Down
8 changes: 5 additions & 3 deletions src/hooks/LevelCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
using namespace geode::prelude;

class BI_DLL $modify(BILevelCell, LevelCell) {
int m_hoverCount = 0;
CCPoint m_lastMousePos = {0,0};
CCNode* m_levelDesc = nullptr;
struct Fields {
int m_hoverCount = 0;
CCPoint m_lastMousePos = {0,0};
CCNode* m_levelDesc = nullptr;
};

static void onModify(auto& self) {
auto res = self.setHookPriority("LevelCell::onViewProfile", 99999);
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/MoreSearchLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ class BI_DLL DropDownDelegateHelper : public GJDropDownLayerDelegate {
};

class BI_DLL $modify(BIMoreSearchLayer, MoreSearchLayer) {
CCMenuItemSpriteExtra* m_savedBtn = nullptr;
int m_songID = 0;
struct Fields {
CCMenuItemSpriteExtra* m_savedBtn = nullptr;
int m_songID = 0;
};

bool shouldSavedBtnBeVisible(){
return GameLevelManager::sharedState()->getBoolForKey("customsong_filter") && GameLevelManager::sharedState()->getBoolForKey("enable_songFilter");
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/RewardsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using namespace geode::prelude;

class BI_DLL $modify(BIRewardsPage, RewardsPage) {
CCLabelBMFont* m_timeLabel = nullptr;
struct Fields {
CCLabelBMFont* m_timeLabel = nullptr;
};

/*
* Callbacks
Expand All @@ -21,7 +23,7 @@ class BI_DLL $modify(BIRewardsPage, RewardsPage) {

double time = 0xFFFFF - TimeUtils::getRobTopTime();
m_fields->m_timeLabel->setString(
fmt::format("Time until timer bug: {}", GameToolbox::getTimeString(time)).c_str()
fmt::format("Time until timer bug: {}", GameToolbox::getTimeString(time, false)).c_str()
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/managers/BaseJsonManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Result<> BaseJsonManager::load() {
std::unique_lock guard(m_jsonMutex);

auto savedPath = Mod::get()->getSaveDir() / m_filename;
if (ghc::filesystem::exists(savedPath)) {
if (std::filesystem::exists(savedPath)) {
auto result = utils::file::readString(savedPath);
if (!result) {
return Err(result.unwrapErr());
Expand Down
4 changes: 2 additions & 2 deletions src/managers/BetterInfoStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ void BetterInfoStats::migrateSaveData() {
auto oldPath = dirs::getSaveDir() / "CCBetterInfoStats.dat";
auto newPath = dirs::getSaveDir() / std::string(this->m_fileName); //it would be better to utilize Mod::get()->getSaveDir, however that can result in future issues

if(ghc::filesystem::exists(oldPath) && !ghc::filesystem::exists(newPath)) {
if(std::filesystem::exists(oldPath) && !std::filesystem::exists(newPath)) {
log::info("CCBetterInfoStats exists in main GD folder but not in mod folder, migrating");
ghc::filesystem::rename(oldPath, newPath);
std::filesystem::rename(oldPath, newPath);

this->getScheduler()->scheduleSelector(schedule_selector(BetterInfoStats::migrationPopup), this, 1, 0, 3, false);
}
Expand Down
2 changes: 2 additions & 0 deletions src/utils/LevelUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <Geode/Geode.hpp>
#include "../utils.hpp"

#include <deque>

using namespace geode::prelude;

namespace LevelUtils {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/ServerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ std::string ServerUtils::getBaseURL() {
// in the main game executable
char* originalUrl = nullptr;
#ifdef GEODE_IS_WINDOWS
static_assert(GEODE_COMP_GD_VERSION == 22040, "Unsupported GD version");
originalUrl = (char*)(base::get() + 0x410a74); //not a mistake
static_assert(GEODE_COMP_GD_VERSION == 22060, "Unsupported GD version");
originalUrl = (char*)(base::get() + 0x5251d0);
#elif defined(GEODE_IS_MACOS)
static_assert(GEODE_COMP_GD_VERSION == 22000, "Unsupported GD version");
originalUrl = (char*)(base::get() + 0x83c079);
Expand Down Expand Up @@ -138,7 +138,7 @@ void ServerUtils::getOnlineLevels(GJSearchObject* searchObject, std::function<vo
getline(responseStream, songData, '#');
getline(responseStream, pageData, '#');

MusicDownloadManager::sharedState()->createSongsInfo(songData);
MusicDownloadManager::sharedState()->createSongsInfo(songData, "");

std::stringstream userStream(userData);
std::string currentUser;
Expand Down

0 comments on commit f798294

Please sign in to comment.