#948 closed enhancement (fixed)
[PATCH] Add buttonSound attribute to buttons
Reported by: | brian | Owned by: | historic_bruno |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 14 |
Component: | Core engine | Keywords: | patch simple |
Cc: | matt@… | Patch: |
Description (last modified by )
We want all buttons to sound the same. To avoid editing all the onPress functions scattered throughout, we should add an attribute that can reference the sound file. Ideally, this attribute would be included in the style so it would only have to be changed in one place.
It will probably involve adding another GUI property and making CButton detect it and do whatever PlaySound does.
Attachments (1)
Change History (13)
comment:1 by , 13 years ago
Description: | modified (diff) |
---|---|
Keywords: | simple added |
comment:2 by , 12 years ago
Owner: | removed |
---|
comment:3 by , 12 years ago
Component: | Music & Sound FX → Core engine |
---|
by , 12 years ago
Attachment: | 948_ButtonSoundAttribute.patch added |
---|
comment:4 by , 12 years ago
Cc: | added |
---|---|
Keywords: | review added |
Milestone: | Backlog → Alpha 10 |
Summary: | Add buttonSound attribute to buttons → [PATCH] Add buttonSound attribute to buttons |
comment:5 by , 12 years ago
948_ButtonSoundAttribute.patch and 948_ButtonSoundAttribute.2.patch are identical. I accidentally hit enter twice, and couldn't figure out how to remove one.
I tested the patch on Win7 by modifying the button_sound attribute via a new default_button style, the StoneButtonFancy style, and directly on the main menu single player button. Everything worked as expected.
comment:6 by , 12 years ago
Keywords: | patch added |
---|
comment:7 by , 12 years ago
Milestone: | Alpha 10 → Alpha 11 |
---|
Hey mattlott. Thanks for your patch. We currently have someone working on a rewritten sound engine, at which point, your patch might not apply anymore.
So I'm going to push this to the next release, when the sound engine should hopefully be done in some basic form, and we'll reevaluate your work then.
Meantime, please feel free to take up another ticket and have a crack at completing it.
comment:8 by , 12 years ago
Keywords: | review removed |
---|---|
Milestone: | Alpha 11 → Alpha 12 |
I don't like the "default_button" style hack in CGUI.cpp
, or at least I don't like it being hard coded that way, because then we have to potentially consider a default style for every other type of control, it would get messy in a hurry :) It's no big deal to leave "button_sound" as an optional property and make each button style set it - we don't have many button styles. Maybe we need style inheritance...
GUIM_PRESSED
seems to be the wrong event handler for the sound, because it's confusingly sent after the button is released or activated in some other way. It seems like normally a button plays one sound when it's pressed and a different sound when it's released. It would be handy to have a few sound types with clear property names like "sound_pressed", "sound_released", "sound_pressed_disabled", to have symmetry with the other properties.
comment:9 by , 11 years ago
Milestone: | Alpha 12 → Backlog |
---|
Backlogged until the additional work is completed.
comment:10 by , 11 years ago
Milestone: | Backlog → Alpha 14 |
---|---|
Owner: | set to |
Status: | new → assigned |
This adds a button_sound attribute to buttons.