Skip to content

Commit

Permalink
formatting?
Browse files Browse the repository at this point in the history
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <[email protected]>
  • Loading branch information
RayDeeUx committed Aug 15, 2024
1 parent 7886078 commit ed72dbe
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 32 deletions.
61 changes: 35 additions & 26 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
# v1.4.0
- Added setting to choose font for "Now Playing" notifications
- Added an extra child folder in the mod's config directory for enabling/disabling menuloops easily
- Hopefully fix the mistake where macOS ARM support wasn't added the first time in v1.3.0
- Fix arrow steps in settings being wonky
- Added setting to choose font for "Now Playing" notifications.
- Added an extra child folder in the mod's config directory for enabling/disabling menuloops easily. The mod itself doesn't do anything to it beyond creating the child folder.
- Hopefully fix the mistake where macOS ARM support wasn't added the first time in v1.3.0.
- Fix that one godforsaken Android crash. (It was caused by ninxout being a bit silly and failing to check if certain directories existed on Android.)
- Incidentally, this also fixes potential issues where songs from RobTop's Music Library *could* be added twice on certain platforms, skewing the probability distribution.
- Fix arrow steps in settings being wonky. (Geode has yet to support floating point increments in arrow steps.)
- Notifications now move off-screen when switching menus to minimize chances of the song title in the "Now Playing" notification from being incorrect.
- Add text formatting options for songs from Newgrounds or RobTop's Music Library.
- Song Name
- Song Name + Artist
- Song Name + Song ID
- Song Name, Artist, Song ID
- Added punctuation to the changelog.
# v1.3.0
- Added macOS support (thx [ninxout](https://github.com/ninXout), [raydeeux](https://github.com/RayDeeUx), and [hiimjustin000](https://github.com/hiimjustin000))
- Added support for `.wav`, `.ogg`/`.oga`, and `.flac` files for custom songs
- Included artist name for all "Now Playing" notifications
- Set Z order of the "Now Playing" notification to 200 for easier readability against most MenuLayer mods (such as Overcharged Main Menu)
- Shuffling the song now generates a new "Now Playing" notification
- Increase "Now Playing" notification maximum duration to 5 seconds
- Add better slider control for adjusting notification duration
- Added Node IDs to nodes added by this mod
- Squash a few bugs, optimize a few things, minimize likelihood of potential crashes
- Added macOS support (thx [ninxout](https://github.com/ninXout), [raydeeux](https://github.com/RayDeeUx), and [hiimjustin000](https://github.com/hiimjustin000)).
- Added support for `.wav`, `.ogg`/`.oga`, and `.flac` files for custom songs.
- Included artist name for all "Now Playing" notifications.
- Set Z order of the "Now Playing" notification to 200 for easier readability against most MenuLayer mods (such as Overcharged Main Menu).
- Shuffling the song now generates a new "Now Playing" notification.
- Increase "Now Playing" notification maximum duration to 5 seconds.
- Add better slider control for adjusting notification duration.
- Added Node IDs to nodes added by this mod.
- Squash a few bugs, optimize a few things, minimize likelihood of potential crashes.
# v1.2.2
- Added an option to enable the shuffle button (thx [reinmar](https://github.com/Reinmmar))
- Added an option to enable the shuffle button (thx [reinmar](https://github.com/Reinmmar)).
# v1.2.1
- Fixed crash caused by Newgrounds manager trying to gather info of default menuLoop.mp3
- Fixed crash caused by Newgrounds manager trying to gather info of default menuLoop.mp3.
# v1.2.0
- Added `Randomize on editor exit` setting.
- Added `Notification time` setting.
- Added `Use custom songs path` setting.
- Added `SongManager.hpp`
- Added `SongManager.hpp`.
- Added custom songs support.
- Added `stoi` to `Utils` (prolly it crashed because of Autonong)
- Added a button to add custom songs (present in the settings tab)
- Added `stoi` to `Utils` (prolly it crashed because of Autonong).
- Added a button to add custom songs (present in the settings tab).
- Added a button for randomizing the song manually.
- Most of the functions related to the `m_songs` vector are now in `SongManager`
- Fixed crash when there are no songs (original menuLoop plays instead)
- Most of the functions related to the `m_songs` vector are now in `SongManager`.
- Fixed crash when there are no songs (original menuLoop plays instead).
- Fixed crash caused by switching the songs location.
- Modified `PlayingCard` to fit the new system.
- Now the song randomizes every time you change `Use custom songs path`
- Now the song randomizes every time you change `Use custom songs path`.
# v1.1.0
- Fixed crash when opening the game (missing textures crash)
- Fixed crash when opening the game (missing textures crash).
- Fixed random song picker being on a loop for every song downloaded.
- Moved song class to its own file.
- The mod should now check for the songs path when loaded, not when executed.
- Added setting to randomize song on level exit.
- Fixed Android crash caused by not able to access the memory (f*** pointers)
- Fixed Android crash caused by not able to access the memory (f*** pointers).
- Added `Utils.hpp`
# v1.1.0-alpha.5
- Updated Geode target version to `v3.0.0-beta.1`
- Updated Geode target version to `v3.0.0-beta.1`.
# v1.1.0-alpha.4
- Updated notification card & position.
- Added the property `name` to the `Song` class.
Expand All @@ -50,9 +59,9 @@
# v1.1.0-alpha.2
- Fixed crash on startup caused by a missing dependency.
# v1.1.0-alpha.1
- Added a card showing which song is playing (you can disable it in settings)
- Added a card showing which song is playing. (you can disable it in settings.)
- Changed a little bit how songs are stored in the vector.
- Removed MacOS support (sorry, i don't wanna deal with MacOS bindings.)
- Removed MacOS support. (sorry, i don't wanna deal with MacOS bindings.)
### Notes
- This version is for `Geode v3.0.0-alpha.2` only.
# v1.0.0
Expand Down
14 changes: 13 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,21 @@
"type": "bool",
"default": true
},
"songFormatNGML": {
"name": "Song Notification Format",
"description": "Choose the format you prefer for the \"Now Playing\" notification here.\n<cy>Only applies when using Newgrounds/Music Library songs as the menu loop.</c>",
"type": "string",
"default": "Song Name, Artist, Song ID",
"one-of": [
"Song Name",
"Song Name + Artist",
"Song Name + Song ID",
"Song Name, Artist, Song ID"
]
},
"customPrefix": {
"name": "Notification Prefix",
"description": "Set your prefix for the \"Now Playing\" notification here.\n\n<cyTo disable the prefix, set it to </c><cc>\"[Empty]\"</c><cy>.</c>",
"description": "Set your prefix for the \"Now Playing\" notification here.\n\n<cy>To disable the prefix, set it to </c><cl>\"[Empty]\"</c><cy>.</c>",
"type": "string",
"default": "Now Playing",
"one-of": [
Expand Down
4 changes: 2 additions & 2 deletions src/CCDirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class $modify(MenuLoopCCDHook, CCDirector) {
void fadeOutCardRemotely() {
if (const auto card = Utils::findCardRemotely()) {
card->stopAllActions();
CCAction* remoteCardRemoval = cocos2d::CCSequence::create(
CCEaseOut::create(CCMoveBy::create(.25f, {0, 12}), 1.f),
CCAction* remoteCardRemoval = CCSequence::create(
CCEaseOut::create(CCMoveBy::create(.25f, {0, 24}), 1.f),
CCCallFunc::create(this, callfunc_selector(MenuLoopCCDHook::removeCardRemotely)),
nullptr
);
Expand Down
21 changes: 18 additions & 3 deletions src/MenuLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,25 @@ class $modify(MenuLoopMLHook, MenuLayer) {
auto songInfo = MusicDownloadManager::sharedState()->getSongInfoObject(Utils::stoi(songFileName.string()));

// sometimes songInfo is nullptr, so improvise
if (songInfo)
notifString = notifString.append(fmt::format("{} by {} ({})", songInfo->m_songName, songInfo->m_artistName, songInfo->m_songID));
else
if (songInfo) {
// default: "Song Name, Artist, Song ID"
// fmt::format("{} by {} ({})", songInfo->m_songName, songInfo->m_artistName, songInfo->m_songID);
std::string resultString = "";
auto formatSetting = Mod::get()->getSettingValue<std::string>("songFormatNGML");
if (formatSetting == "Song Name, Artist, Song ID") {
resultString = fmt::format("{} by {} ({})", songInfo->m_songName, songInfo->m_artistName, songInfo->m_songID);
} else if (formatSetting == "Song Name + Artist") {
resultString = fmt::format("{} by {}", songInfo->m_songName, songInfo->m_artistName);
} else if (formatSetting == "Song Name + Song ID") {
resultString = fmt::format("{} ({})", songInfo->m_songName, songInfo->m_songID);
} else {
resultString = fmt::format("{}", songInfo->m_songName);
}
notifString = notifString.append(resultString);
}
else {
notifString = notifString.append(songFileName.string());
}
}
}
}
Expand Down

0 comments on commit ed72dbe

Please sign in to comment.