-
Notifications
You must be signed in to change notification settings - Fork 87
Proposal to turn off/on bird sounds #1817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
2d3780c
8f04384
736bca3
82ee3db
a147ee5
d20bb19
2b93eb6
0a33748
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| #include "iwTextfile.h" | ||
| #include "ogl/FontStyle.h" | ||
| #include "gameData/const_gui_ids.h" | ||
| #include "controls/ctrlCheck.h" | ||
|
|
||
| namespace { | ||
| enum | ||
|
|
@@ -41,16 +42,17 @@ enum | |
| ID_btMusicPlayer, | ||
| ID_btAdvanced, | ||
| ID_btSurrender, | ||
| ID_btEndGame | ||
| ID_btEndGame, | ||
| ID_cpBirdSounds | ||
| }; | ||
| } | ||
|
|
||
| iwOptionsWindow::iwOptionsWindow(SoundManager& soundManager) | ||
| : IngameWindow(CGI_OPTIONSWINDOW, IngameWindow::posLastOrCenter, Extent(300, 515), _("Game menu"), | ||
| : IngameWindow(CGI_OPTIONSWINDOW, IngameWindow::posLastOrCenter, Extent(300, 545), _("Game menu"), | ||
| LOADER.GetImageN("resource", 41)), | ||
| soundManager(soundManager) | ||
| { | ||
| // Der Soldat oben | ||
| // The soldier on top | ||
| AddImage(ID_imgSoldier, DrawPoint(150, 36), LOADER.GetImageN("io", 30)); | ||
|
|
||
| AddText(ID_txtRttr, DrawPoint(150, 60), "Return To The Roots", COLOR_YELLOW, FontStyle::CENTER, NormalFont); | ||
|
|
@@ -69,37 +71,40 @@ iwOptionsWindow::iwOptionsWindow(SoundManager& soundManager) | |
| AddImageButton(ID_btReadme, DrawPoint(35, 160), Extent(35, 35), TextureColor::Green2, LOADER.GetImageN("io", 79)); | ||
| AddText(ID_txtReadme, DrawPoint(85, 180), _("Load 'ReadMe' file"), COLOR_YELLOW, FontStyle::BOTTOM, NormalFont); | ||
|
|
||
| // "Spiel laden!" | ||
| // "Load game!" | ||
| // TODO: Implement | ||
| // AddImageButton( 8, DrawPoint(35, 210), Extent(35, 35), TextureColor::Green2, LOADER.GetImageN("io", 48)); | ||
| // AddText(9, DrawPoint(85, 230), _("Load game!"), COLOR_YELLOW, 0 | FontStyle::BOTTOM, NormalFont); | ||
|
|
||
| // "Spiel speichern!" | ||
| // "Save game!" | ||
| // TODO: Move back down to y=250 (Button) 270 (Text) after Load button is implemented | ||
| AddImageButton(ID_btSave, DrawPoint(35, 230), Extent(35, 35), TextureColor::Green2, LOADER.GetImageN("io", 47)); | ||
| AddText(ID_txtSave, DrawPoint(85, 255), _("Save game!"), COLOR_YELLOW, FontStyle::BOTTOM, NormalFont); | ||
|
|
||
| // Geräusche an/aus | ||
| // Sound on/off | ||
| AddImageButton(ID_btSoundEffects, DrawPoint(35, 300), Extent(35, 35), TextureColor::Green2, | ||
| LOADER.GetImageN("io", 114 + !SETTINGS.sound.effectsEnabled)); //-V807 | ||
|
|
||
| // Musik an/aus | ||
| AddImageButton(ID_btMusic, DrawPoint(35, 340), Extent(35, 35), TextureColor::Green2, | ||
| LOADER.GetImageN("io", 116 + !SETTINGS.sound.musicEnabled)); | ||
|
|
||
| // Geräuschlautstärke | ||
| // Sound volume | ||
| AddProgress(ID_pgEffectVol, DrawPoint(100, 306), Extent(160, 22), TextureColor::Green2, 139, 138, 100) | ||
| ->SetPosition((SETTINGS.sound.effectsVolume * 100) / 255); | ||
|
|
||
| // Musiklautstärke | ||
| AddProgress(ID_pgMusicVol, DrawPoint(100, 346), Extent(160, 22), TextureColor::Green2, 139, 138, 100) | ||
| // Bird sounds on/off | ||
| AddCheckBox(ID_cpBirdSounds, DrawPoint(100, 342), Extent(160, 22), TextureColor::Green2, _("Bird sounds"), NormalFont, false) | ||
| ->setChecked(SETTINGS.sound.birdsEnabled); | ||
|
|
||
| // Music on/off | ||
| AddImageButton(ID_btMusic, DrawPoint(35, 371), Extent(35, 35), TextureColor::Green2, | ||
| LOADER.GetImageN("io", 116 + !SETTINGS.sound.musicEnabled)); | ||
|
|
||
| // Music volume | ||
| AddProgress(ID_pgMusicVol, DrawPoint(100, 377), Extent(160, 22), TextureColor::Green2, 139, 138, 100) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems the spacing of the progress bars, checkbox and button is even. Can you use a similar pattern to the desktop: The 2 buttons for enable/disable of music&effects would then need to be relative While the current approach works with more controls added it becomes harder to reason if they are all placed "correctly".
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With "the desktops" you mean the mechanism at for example my already touched I could try this, but I would need some time to implement the same principle to this menu. I'm not very familiar with C++ actually. 😁 I will let you know. 💪
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes exactly. And you were familiar enough to do this change, so don't worry! :-) You don't need to do this for this PR, just let me know if you are up to it and I'll wait before merging to avoid introducing this change just to change it again for a "better" solution. If you need any help feel free to ask here, show intermediate results if that helps you question.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok thx, I will try, yes pls wait, I let you know 💪 |
||
| ->SetPosition((SETTINGS.sound.musicVolume * 100) / 255); | ||
|
|
||
| AddTextButton(ID_btMusicPlayer, DrawPoint(100, 380), Extent(160, 22), TextureColor::Green2, _("Music player"), | ||
| NormalFont); | ||
| AddTextButton(ID_btAdvanced, DrawPoint(67, 412), Extent(168, 24), TextureColor::Green2, _("Advanced"), NormalFont); | ||
| AddTextButton(ID_btSurrender, DrawPoint(67, 443), Extent(168, 24), TextureColor::Red1, _("Surrender"), NormalFont); | ||
| AddTextButton(ID_btEndGame, DrawPoint(67, 474), Extent(168, 24), TextureColor::Red1, _("End game"), NormalFont); | ||
| AddTextButton(ID_btMusicPlayer, DrawPoint(100, 413), Extent(160, 22), TextureColor::Green2, _("Music player"), NormalFont); | ||
| AddTextButton(ID_btAdvanced, DrawPoint(67, 442), Extent(168, 24), TextureColor::Green2, _("Advanced"), NormalFont); | ||
| AddTextButton(ID_btSurrender, DrawPoint(67, 473), Extent(168, 24), TextureColor::Red1, _("Surrender"), NormalFont); | ||
| AddTextButton(ID_btEndGame, DrawPoint(67, 504), Extent(168, 24), TextureColor::Red1, _("End game"), NormalFont); | ||
| } | ||
|
|
||
| void iwOptionsWindow::Msg_ButtonClick(const unsigned ctrl_id) | ||
|
|
@@ -160,3 +165,15 @@ void iwOptionsWindow::Msg_ProgressChange(const unsigned ctrl_id, const unsigned | |
| break; | ||
| } | ||
| } | ||
|
|
||
| void iwOptionsWindow::Msg_CheckboxChange(const unsigned ctrl_id, const bool checked) | ||
| { | ||
| switch(ctrl_id) | ||
| { | ||
| case ID_cpBirdSounds: | ||
| { | ||
| SETTINGS.sound.birdsEnabled = checked; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.