-
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?
Proposal to turn off/on bird sounds #1817
Conversation
Additionally switch the effects and music option to groups the elements together.
Flamefire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work thanks! Just a few small remarks.
I don't find a possibility to translate the new UI text into another language, maybe someone can tell me pls, how to do it, if needed.
This is done in the https://github.com/Return-To-The-Roots/languages repo but needs updating the language files after the code changes which is a bit involved. I did that update based on the current state of the PR, so you can create a PR in that repo with translations inside the respective files if you want. After the merge of that you need to update the submodule here:
cd external/languages
git checkout master
git pull
cd ..
git commit languages
If the new switch buttons are used in the main settings, the new state isn't reflected in the in-game settings menu, but it actually works. Other way around, a state change in the in-game settings are reflected in the main settings. I don't know why and how to fix it.
You forgot to set the state of that checkbox, see inline comment for fix.
Don't be surprised by my 1st commit, I had to fix the "NotificationManager.h" with a oneliner first, so I was able to build the project successfully.
Using GCC 15? We merged a fix for that same thing with #1814, so no issue with that. :-)
|
|
||
| // Musiklautstärke | ||
| AddProgress(ID_pgMusicVol, DrawPoint(100, 346), Extent(160, 22), TextureColor::Green2, 139, 138, 100) | ||
| AddProgress(ID_pgMusicVol, DrawPoint(100, 377), Extent(160, 22), TextureColor::Green2, 139, 138, 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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: constexpr Extent ctrlSize(160, 22);, DrawPoint pos = ..., and pos.y += ctrlSize.y + spacingY and the use pos for the position?
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".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 libs/s25main/desktops/dskOptions.cpp? This would be really better indeed, due it was way easier for me to add my changes there then in the in-game menu.
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. 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thx, I will try, yes pls wait, I let you know 💪
- Translate german comments to english on touched files - Re-align off placed UI element code
- Make the "bird_sounds" setting optional, that avoids resetting the whole config file - Set the initial state of the "bird sounds" checkbox in the in-game settings menu correctly
|
Hi @Flamefire, many thanks for your answers and explanations.
aah sry, I didn't checked the other repos for that. Thx for updating the base. I will add the german translation soon. I could add it for more languages, but only translator assisted. Do I have something to re-generate at the languages repo to reflect my new changes, before I can start with my translation?
yes GCC 15. Ah I see the commit now. My local master branch wasn't up-to-date during branching. Additionally I found outdated current years at the licence header at the files I touched. Should I correct this as well? Would it be an idea to sort the include lines in alphabetical order, at least at my touched files? |
Flamefire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes GCC 15. Ah I see the commit now. My local master branch wasn't up-to-date during branching.
No worries, it was very recent indeed.
Additionally I found outdated current years at the licence header at the files I touched. Should I correct this as well?
vvvv// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
You can do that for the files you changed, yes
Would it be an idea to sort the include lines in alphabetical order, at least at my touched files?
This is actually already the case and the linter (clang-format based) enforces this. See the failed check:
--- libs/s25main/ingameWindows/iwOptionsWindow.cpp (original)
+++ libs/s25main/ingameWindows/iwOptionsWindow.cpp (reformatted)
@@ -9,6 +9,7 @@
#include "Settings.h"
#include "SoundManager.h"
#include "WindowManager.h"
+#include "controls/ctrlCheck.h"
#include "controls/ctrlImageButton.h"
#include "controls/ctrlProgress.h"
#include "drivers/AudioDriverWrapper.h"
@@ -20,7 +21,6 @@
#include "iwTextfile.h"
#include "ogl/FontStyle.h"
#include "gameData/const_gui_ids.h"
-#include "controls/ctrlCheck.h"However the order follows a certain pattern: 1. own includes, 2. third-party includes, 3. stdlib includes. And they are sorted within each group.
You can run the "clangFormat" target (make clangFormat if I remember the spelling correctly) if you have clang-format-10 installed locally to automatically format sources including the sorting.
Do I have something to re-generate at the languages repo to reflect my new changes, before I can start with my translation?
After adding/removing translatables from the source the template (*.pot file) needs to be regenerated using poedit and that reflected in the individual translation files (*.po) which I did.
With that done you can now pull the new branch, add translations and open a PR for that repo similar to this one. When this is merged the submodule update can be added in this repo to include it.
Only add translations where you are reasonably sure they are correct. Untranslated strings show up in several tools so they are easy to find and English strings are still readable for most. So if in doubt rather leave that.
|
|
||
| // Musiklautstärke | ||
| AddProgress(ID_pgMusicVol, DrawPoint(100, 346), Extent(160, 22), TextureColor::Green2, 139, 138, 100) | ||
| AddProgress(ID_pgMusicVol, DrawPoint(100, 377), Extent(160, 22), TextureColor::Green2, 139, 138, 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
Hi there,
here is a proposal to turn on/off the birds sounds from the game settings menus (in-game & main settings). The new setting is also reflected in the config file as boolean with the name
bird_sounds. This PR should resolve issue #1806. 💪I tried to fit in my changes as good as possible in the UI and code as well.
Here are some screenshots of the changed UI windows in 800x600 with 100% UI scaling:
In-Game Settings:
I placed the new bird toggle button between the effects and the music buttons/sliders. I had to grow the settings window slightly to fit in the new button. I couldn't use the existing free space, because this space is reserved for a future Load button according to the code.

Main Settings:
I reversed the effects and music buttons/sliders and placed the new bird switch buttons between the effects and music buttons.

I tested it also with my full resolution at 3440x1440 with 200% UI scaling and it works fine.
Issues:
Don't be surprised by my 1st commit, I had to fix the "NotificationManager.h" with a oneliner first, so I was able to build the project successfully.
Pls let me now, if I missed something. 😊