@@ -23,12 +23,12 @@ void ResetAudioModule::load()
23
23
void ResetAudioModule::makeAndroid (CCNode* menu, CCPoint pos)
24
24
{
25
25
const auto spr = CCScale9Sprite::create (" geode.loader/GE_button_04.png" );
26
- spr->setScale (1 . f );
26
+ spr->setScale (0 . 7f );
27
27
28
28
const auto label = TransLabelBMFont::create (" Reset Audio Sliders" , " bigFont.fnt" );
29
29
label->setScale (0 .75f );
30
30
31
- spr->setContentSize ({ label->getScaledContentWidth () + 20 .0f , 40 .0f }); // magical numbers
31
+ spr->setContentSize ({ label->getScaledContentWidth () + 20 .0f , 40 .0f }); // magical numbers\
32
32
33
33
label->setAnchorPoint ({0 .5f , 0 .5f });
34
34
label->setPosition (spr->getContentSize () / 2 );
@@ -38,12 +38,36 @@ void ResetAudioModule::makeAndroid(CCNode* menu, CCPoint pos)
38
38
const auto btn = CCMenuItemSpriteExtra::create (spr, this , menu_selector (ResetAudioModule::onResetAudio));
39
39
btn->setPosition ({ menu->getContentWidth ()/2 , menu->getContentHeight ()/2 });
40
40
41
+ auto info = InfoAlertButton::create (" Reset Audio Sliders" , " Resets the audio sliders to 100% incase it went off screen and you can't get it back." , 0 .6f );
42
+ info->setPosition (btn->getPosition () + ccp (105 , 20 ));
43
+
41
44
menu->addChild (btn);
45
+ menu->addChild (info);
42
46
}
43
- // ReSharper disable once CppMemberFunctionMayBeStatic
47
+
44
48
void ResetAudioModule::onResetAudio (CCObject* sender)
45
49
{
46
- // what it says on the tin
47
- FMODAudioEngine::sharedEngine ()->setBackgroundMusicVolume (1 .f );
48
- FMODAudioEngine::sharedEngine ()->setEffectsVolume (1 .f );
50
+ FMODAudioEngine::sharedEngine ()->setBackgroundMusicVolume (1 .0f );
51
+ FMODAudioEngine::sharedEngine ()->setEffectsVolume (1 .0f );
52
+
53
+ if (auto menu = CCScene::get ()->getChildByType <MenuLayer>(0 ))
54
+ {
55
+ if (auto options = menu->getChildByType <OptionsLayer>(0 ))
56
+ {
57
+ if (auto layer = options->getChildByType <CCLayer>(0 ))
58
+ {
59
+ if (auto slider = layer->getChildByType <Slider>(0 ))
60
+ {
61
+ slider->setValue (1 );
62
+ slider->updateBar ();
63
+ }
64
+
65
+ if (auto slider = layer->getChildByType <Slider>(-1 ))
66
+ {
67
+ slider->setValue (1 );
68
+ slider->updateBar ();
69
+ }
70
+ }
71
+ }
72
+ }
49
73
}
0 commit comments