Skip to content

Commit e5c9162

Browse files
committed
fix: fix the compilation errors (hopefully)
1 parent 2ea5e36 commit e5c9162

25 files changed

+165
-155
lines changed

jukebox/jukebox/hooks/custom_song_widget.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class $modify(JBSongWidget, CustomSongWidget) {
4242
bool searching = false;
4343
std::unordered_map<int, Nongs*> assetNongData;
4444
EventListener<NongManager::MultiAssetSizeTask> m_multiAssetListener;
45-
std::unique_ptr<EventListener<EventFilter<event::SongStateChanged>>>
45+
std::unique_ptr<
46+
EventListener<EventFilter<jukebox::event::SongStateChanged>>>
4647
m_songStateListener;
4748
};
4849

@@ -69,8 +70,8 @@ class $modify(JBSongWidget, CustomSongWidget) {
6970
m_fields->firstRun = false;
7071

7172
m_fields->m_songStateListener = std::make_unique<
72-
EventListener<EventFilter<event::SongStateChanged>>>(
73-
([this](event::SongStateChanged* event) {
73+
EventListener<EventFilter<jukebox::event::SongStateChanged>>>(
74+
([this](jukebox::event::SongStateChanged* event) {
7475
if (!m_songInfoObject) {
7576
return ListenerResult::Propagate;
7677
}

jukebox/jukebox/hooks/music_download_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void JBMusicDownloadManager::onGetSongInfoCompleted(gd::string p1,
4646
return;
4747
}
4848

49-
event::GetSongInfo(obj->m_songName, obj->m_artistName, songID)
49+
jukebox::event::GetSongInfo(obj->m_songName, obj->m_artistName, songID)
5050
.post();
5151
}
5252

jukebox/jukebox/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <jukebox/managers/nong_manager.hpp>
88
#include <jukebox/ui/indexes_setting.hpp>
99

10+
using namespace geode::prelude;
11+
1012
$execute {
1113
(void)Mod::get()->registerCustomSettingType("indexes",
1214
&jukebox::IndexSetting::parse);

jukebox/jukebox/managers/index_manager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
#include <jukebox/nong/nong.hpp>
3636
#include <jukebox/ui/indexes_setting.hpp>
3737

38-
namespace jukebox {
39-
38+
using namespace geode::prelude;
4039
using namespace jukebox::index;
4140

41+
namespace jukebox {
42+
4243
bool IndexManager::init() {
4344
if (m_initialized) {
4445
return true;

jukebox/jukebox/managers/index_manager.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@
66
#include <unordered_map>
77
#include <variant>
88

9-
#include <matjson.hpp>
109
#include <Geode/Result.hpp>
1110
#include <Geode/loader/Event.hpp>
1211
#include <Geode/utils/Task.hpp>
1312
#include <Geode/utils/general.hpp>
13+
#include <matjson.hpp>
1414

1515
#include <jukebox/events/start_download.hpp>
1616
#include <jukebox/nong/index.hpp>
1717
#include <jukebox/nong/nong.hpp>
1818

19-
using namespace geode::prelude;
20-
2119
namespace jukebox {
2220

2321
class IndexManager {
2422
protected:
2523
bool m_initialized = false;
2624

27-
using FetchIndexTask = Task<Result<>, float>;
28-
using DownloadSongTask = Task<Result<ByteVector>, float>;
25+
using FetchIndexTask = geode::Task<geode::Result<>, float>;
26+
using DownloadSongTask =
27+
geode::Task<geode::Result<geode::ByteVector>, float>;
2928

3029
IndexManager() = default;
3130

@@ -36,30 +35,31 @@ class IndexManager {
3635
IndexManager& operator=(IndexManager&&) = delete;
3736

3837
// index url -> task listener
39-
std::unordered_map<std::string, EventListener<FetchIndexTask>>
38+
std::unordered_map<std::string, geode::EventListener<FetchIndexTask>>
4039
m_indexListeners;
4140

4241
std::unordered_map<int, std::vector<index::IndexSongMetadata*>>
4342
m_nongsForId;
4443
// song id -> download song task
45-
std::unordered_map<std::string, EventListener<DownloadSongTask>>
44+
std::unordered_map<std::string, geode::EventListener<DownloadSongTask>>
4645
m_downloadSongListeners;
4746
// song id -> current download progress (used when opening NongDropdownLayer
4847
// while a song is being downloaded)
4948
std::unordered_map<std::string, float> m_downloadProgress;
5049

51-
EventListener<EventFilter<event::StartDownload>> m_downloadSignalListener{
52-
this, &IndexManager::onDownloadStart};
50+
geode::EventListener<geode::EventFilter<jukebox::event::StartDownload>>
51+
m_downloadSignalListener{this, &IndexManager::onDownloadStart};
5352

54-
geode::ListenerResult onDownloadStart(event::StartDownload* e);
53+
geode::ListenerResult onDownloadStart(jukebox::event::StartDownload* e);
5554
void onDownloadProgress(int gdSongID, const std::string& uniqueId,
5655
float progress);
5756
void onDownloadFinish(
5857
std::variant<index::IndexSongMetadata*, Song*>&& source,
59-
Nongs* destination, ByteVector&& data);
60-
Task<Result<matjson::Value>, float> fetchIndex(
58+
Nongs* destination, geode::ByteVector&& data);
59+
geode::Task<geode::Result<matjson::Value>, float> fetchIndex(
6160
const index::IndexSource& index);
62-
void onIndexFetched(const std::string& url, Result<matjson::Value>* r);
61+
void onIndexFetched(const std::string& url,
62+
geode::Result<matjson::Value>* r);
6363

6464
public:
6565
bool init();
@@ -69,12 +69,12 @@ class IndexManager {
6969

7070
bool initialized() const { return m_initialized; }
7171

72-
Result<> fetchIndexes();
72+
geode::Result<> fetchIndexes();
7373

74-
Result<> loadIndex(std::filesystem::path path);
75-
Result<> loadIndex(matjson::Value&& jsonObj);
74+
geode::Result<> loadIndex(std::filesystem::path path);
75+
geode::Result<> loadIndex(matjson::Value&& jsonObj);
7676

77-
Result<std::vector<index::IndexSource>> getIndexes();
77+
geode::Result<std::vector<index::IndexSource>> getIndexes();
7878

7979
std::optional<float> getSongDownloadProgress(const std::string& uniqueID);
8080
std::optional<std::string> getIndexName(const std::string& indexID);
@@ -83,7 +83,7 @@ class IndexManager {
8383

8484
std::filesystem::path baseIndexesPath();
8585

86-
Result<> downloadSong(int gdSongID, const std::string& uniqueID);
86+
geode::Result<> downloadSong(int gdSongID, const std::string& uniqueID);
8787

8888
void registerIndexNongs(Nongs* destination);
8989

jukebox/jukebox/managers/nong_manager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <jukebox/nong/nong_serialize.hpp>
2525
#include <jukebox/utils/random_string.hpp>
2626

27+
using namespace geode::prelude;
28+
2729
namespace jukebox {
2830

2931
std::optional<Nongs*> NongManager::getNongs(int songID) {

jukebox/jukebox/managers/nong_manager.hpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include <jukebox/events/song_error.hpp>
1515
#include <jukebox/nong/nong.hpp>
1616

17-
using namespace geode::prelude;
18-
1917
namespace jukebox {
2018

2119
class NongManager {
@@ -37,16 +35,18 @@ class NongManager {
3735
}
3836
}
3937

40-
Result<> saveNongs(std::optional<int> saveId = std::nullopt);
41-
EventListener<EventFilter<jukebox::event::SongError>> m_songErrorListener;
42-
EventListener<EventFilter<jukebox::event::GetSongInfo>> m_songInfoListener;
43-
Result<std::unique_ptr<Nongs>> loadNongsFromPath(
38+
geode::Result<> saveNongs(std::optional<int> saveId = std::nullopt);
39+
geode::EventListener<geode::EventFilter<jukebox::event::SongError>>
40+
m_songErrorListener;
41+
geode::EventListener<geode::EventFilter<jukebox::event::GetSongInfo>>
42+
m_songInfoListener;
43+
geode::Result<std::unique_ptr<Nongs>> loadNongsFromPath(
4444
const std::filesystem::path& path);
4545

46-
Result<> migrateV2();
46+
geode::Result<> migrateV2();
4747

4848
public:
49-
using MultiAssetSizeTask = Task<std::string>;
49+
using MultiAssetSizeTask = geode::Task<std::string>;
5050
std::optional<Nongs*> m_currentlyPreparingNong;
5151

5252
bool init();
@@ -55,12 +55,13 @@ class NongManager {
5555

5656
std::filesystem::path baseManifestPath() {
5757
static std::filesystem::path path =
58-
Mod::get()->getSaveDir() / "manifest";
58+
geode::Mod::get()->getSaveDir() / "manifest";
5959
return path;
6060
}
6161

6262
std::filesystem::path baseNongsPath() {
63-
static std::filesystem::path path = Mod::get()->getSaveDir() / "nongs";
63+
static std::filesystem::path path =
64+
geode::Mod::get()->getSaveDir() / "nongs";
6465
return path;
6566
}
6667

@@ -125,34 +126,34 @@ class NongManager {
125126
* Add NONGs
126127
* @param nong NONG to add
127128
*/
128-
Result<> addNongs(Nongs&& nong);
129+
geode::Result<> addNongs(Nongs&& nong);
129130

130131
/**
131132
* Set active song
132133
* @param gdSongID the id of the song in GD
133134
* @param uniqueID the unique id of the song in Jukebox
134135
*/
135-
Result<> setActiveSong(int gdSongID, std::string uniqueID);
136+
geode::Result<> setActiveSong(int gdSongID, std::string uniqueID);
136137

137138
/**
138139
* Delete a song
139140
* @param gdSongID the id of the song in GD
140141
* @param uniqueID the unique id of the song in Jukebox
141142
*/
142-
Result<> deleteSong(int gdSongID, std::string uniqueID);
143+
geode::Result<> deleteSong(int gdSongID, std::string uniqueID);
143144

144145
/**
145146
* Delete a song's audio file
146147
* @param gdSongID the id of the song in GD
147148
* @param uniqueID the unique id of the song in Jukebox
148149
*/
149-
Result<> deleteSongAudio(int gdSongID, std::string uniqueID);
150+
geode::Result<> deleteSongAudio(int gdSongID, std::string uniqueID);
150151

151152
/**
152153
* Delete all NONGs for a song ID
153154
* @param gdSongID id of the song
154155
*/
155-
Result<> deleteAllSongs(int gdSongID);
156+
geode::Result<> deleteAllSongs(int gdSongID);
156157

157158
/**
158159
* Get a path to a song file

jukebox/jukebox/ui/index_choose_popup.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include <jukebox/managers/index_manager.hpp>
1919

20+
using namespace geode::prelude;
21+
2022
namespace jukebox {
2123

2224
bool IndexChoosePopup::setup(

jukebox/jukebox/ui/index_choose_popup.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@
88
#include <Geode/cocos/label_nodes/CCLabelBMFont.h>
99
#include <Geode/ui/Popup.hpp>
1010

11-
using namespace geode::prelude;
12-
1311
namespace jukebox {
1412

1513
class IndexChoosePopup
16-
: public Popup<std::vector<std::string>,
17-
std::function<void(const std::string& indexID)>> {
14+
: public geode::Popup<std::vector<std::string>,
15+
std::function<void(const std::string& indexID)>> {
1816
protected:
1917
std::vector<std::string> m_indexIDs;
2018
std::function<void(const std::string& indexID)> m_chooseIndex;
21-
CCLabelBMFont* m_label = nullptr;
19+
cocos2d::CCLabelBMFont* m_label = nullptr;
2220
int m_currentIndex = 0;
2321

2422
bool setup(

jukebox/jukebox/ui/indexes_popup.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <jukebox/nong/index.hpp>
1414
#include <jukebox/ui/list/index_cell.hpp>
1515

16+
using namespace geode::prelude;
17+
1618
namespace jukebox {
1719

1820
using namespace jukebox::index;

0 commit comments

Comments
 (0)