Skip to content

Commit

Permalink
docs: Add SFH to credits and instruct how to add Nongs
Browse files Browse the repository at this point in the history
  • Loading branch information
FlafyDev committed May 28, 2024
1 parent 0dcafdd commit 4e8ceb2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
11 changes: 9 additions & 2 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Upon entering a level, a message will appear, offering the option to download th

Furthermore, a new button will be integrated into levels featuring NONG songs. By clicking this button, a list of available NONG songs for the respective level will be displayed, allowing you to download them conveniently without leaving the game.

## How to add Nongs to the mod
There are multiple ways to add Nongs to the mod and make them appear in game:
- Fill the form on GitHub [here](https://github.com/FlafyDev/auto-nong-indexes/issues/new?assignees=&labels=nong-addition%2Cofficial-addition&projects=&template=add-nong-song.yml&title=Add+Nong+Song%3A+).
- Or get the nong added to [SFH (SongFileHub)](https://songfilehub.com/).

## Indexes
The mod knows which levels have NONG songs from "indexes".
Expand All @@ -18,6 +22,9 @@ You can add/remove indexes in the settings of the mod.
Without these the mod wouldn't be possible.

- [Geode](https://github.com/geode-sdk/geode)
- [Jukebox](https://github.com/Fleeym/jukebox)
- This mod intergrates with Jukebox for swapping songs for levels.
- [Jukebox](https://github.com/Fleeym/jukebox)
- This mod intergrates with Jukebox for swapping songs for levels.
- Additionally, Jukebox's code was helpful to figuring out how to make this mod.
- [SFH (SongFileHub)](https://songfilehub.com/) - Auto Nong gets information about many of its Nongs from SFH.
- SFH mirrors(like `sfh-rooot` and `sfh-pingusmc`) - Auto Nong downloads SFH Nongs from these mirrors.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
owner = "Fleeym";
repo = "sapphire-bindings";
rev = "nongd";
hash = "sha256-gc9GQxIYrlvr3Qnf1gKzOYSFxBB+A+eZFh1gvRz2q/A=";
hash = "sha256-/UAugKml1iixIQ/JRVTO5Nic8lYV2P87/PregG+/4jQ=";
};
in pkgs.writeShellScript "fhs-script" ''
export GEODE_SDK="$HOME/Documents/Geode/"
Expand Down
13 changes: 9 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
->json->get<std::vector<std::string>>("default"));
Mod::get()->addCustomSetting<ANClearPPBlacklistSettingValue>("_blacklistPPClear", 0);

AutoNongManager::get()->loadIndexes();
// AutoNongManager::get()->loadIndexes();
// Reload the indexes every hour
AutoNongManager::get()->schedule(schedule_selector(AutoNongManager::loadIndexesSchedule), 60 * 60,
kCCRepeatForever, 0);
// AutoNongManager::get()->scheduleOnce(schedule_selector(AutoNongManager::loadIndexesSchedule), 2);
// AutoNongManager::get()->schedule(schedule_selector(AutoNongManager::loadIndexesSchedule), 10, kCCRepeatForever, 0);
// Reload the indexes on change
listenForSettingChanges(
"indexes", +[](MultiStringSettingStruct value) { AutoNongManager::get()->loadIndexes(); });
"indexes", +[](MultiStringSettingStruct value) {
log::info("changed");
AutoNongManager::get()->scheduleOnce(schedule_selector(AutoNongManager::loadIndexesSchedule), 2);
// AutoNongManager::get()->loadIndexes();

});
}
8 changes: 7 additions & 1 deletion src/managers/auto_nong_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ bool AutoNongManager::anySongExists(std::set<int> songIDs) {
return false;
}

void AutoNongManager::loadIndexesSchedule(float) { loadIndexes(); }
void AutoNongManager::loadIndexesSchedule(float dt) {
Loader::get()->queueInMainThread([]() {
Notification::create("AAAAAAAAAAAAA", NotificationIcon::Error)->show();
log::info("Loading indexes.......?");
});
// loadIndexes();
}

void AutoNongManager::loadIndexes() {
std::vector<std::string> indexes =
Expand Down
2 changes: 1 addition & 1 deletion src/managers/auto_nong_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AutoNongManager : public CCNode {
void loadIndexes();
int getCurrentLevelID();
void setCurrentLevelID(int levelID);
void loadIndexesSchedule(float);
void loadIndexesSchedule(float dt);

static AutoNongManager *get() {
if (m_instance == nullptr) {
Expand Down

0 comments on commit 4e8ceb2

Please sign in to comment.