diff --git a/about.md b/about.md index 6cbdb29..23df5e8 100644 --- a/about.md +++ b/about.md @@ -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". @@ -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. diff --git a/flake.nix b/flake.nix index 05352be..8372c07 100644 --- a/flake.nix +++ b/flake.nix @@ -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/" diff --git a/src/main.cpp b/src/main.cpp index 808a12e..9b867e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,11 +12,16 @@ ->json->get>("default")); Mod::get()->addCustomSetting("_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(); + + }); } diff --git a/src/managers/auto_nong_manager.cpp b/src/managers/auto_nong_manager.cpp index dca20bc..1d0a0f1 100644 --- a/src/managers/auto_nong_manager.cpp +++ b/src/managers/auto_nong_manager.cpp @@ -16,7 +16,13 @@ bool AutoNongManager::anySongExists(std::set 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 indexes = diff --git a/src/managers/auto_nong_manager.hpp b/src/managers/auto_nong_manager.hpp index 720b2d5..08579e2 100644 --- a/src/managers/auto_nong_manager.hpp +++ b/src/managers/auto_nong_manager.hpp @@ -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) {