Skip to content

Commit

Permalink
added notification time setting
Browse files Browse the repository at this point in the history
  • Loading branch information
pundang committed Jul 7, 2024
1 parent 541fdee commit f178fbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
"default": true,
"description": "Randomize the song when you exit a level (for example when exiting the editor)",
"name": "Randomize on level exit"
},
"notificationTime": {
"type": "float",
"default": 0.5,
"min": 0.1,
"max": 2,
"description": "Modify the time that the notification is on screen",
"name": "Notification time"
}
},
"resources": {
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct MenuLayerHook : Modify<MenuLayerHook, MenuLayer> {

auto screenSize = CCDirector::get()->getWinSize();
auto cardSettingValue = Mod::get()->getSettingValue<bool>("nowPlayingCard");
auto screenTime = Mod::get()->getSettingValue<double>("notificationTime");

if (cardSettingValue) {
if (auto songObject = downloadManager->getSongInfoObject(stoi(selectedSong.id))) {
Expand All @@ -79,7 +80,7 @@ struct MenuLayerHook : Modify<MenuLayerHook, MenuLayer> {

auto sequence = CCSequence::create(
CCEaseInOut::create(CCMoveTo::create(1.5f, {posx, posy - 25.0f}), 2.0f),
CCDelayTime::create(0.5f),
CCDelayTime::create(screenTime),
CCEaseInOut::create(CCMoveTo::create(1.5f, {posx, posy}), 2.0f),
nullptr
);
Expand Down

0 comments on commit f178fbc

Please sign in to comment.