View Issue Details

IDProjectCategoryView StatusLast Update
0000541Spring engineGeneralpublic2007-05-30 16:02
ReporterKloot Assigned Totvo  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Summary0000541: [patch] multiple unit sounds
DescriptionEnables units to have multiple sound-acks. For the "ok", "select",
and "arrived" categories the new limit is 8, the others default to
1 but this would be trivial to change (see the LoadSounds() calls
in UnitDefHandler.cpp). If more than one sound is available for a
category then the sample that gets played is chosen randomly.

(Note that because the GuiSound structure is also used for weapon
fire- and hit-sounds, weapons could have multiple sounds tied to
them if the LoadSound() function in CWeaponDefHandler were modified
along the same lines as CUnitDefHandler::LoadSound()).

Final remark: this patch modifies two Lua binding functions
(LuaUnitDefs::PushGuiSound() and LuaWeaponDefs::GuiSoundTable()),
so it might be a good idea if someone more knowledgeable on that
part of Spring (trepan ;)) double-checks my changes there, in
particular to the former.
TagsNo tags attached.
Attached Files
MultipleUnitSounds.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

tvo

2007-05-30 16:02

reporter   ~0000919

Committed, thanks! (r3799)

Btw, I think it's fine if you just commit yourself in the future, the code looks good enough ;-)

I changed the GetRandomIdx function to just 'return rand() % blah.size()' instead of casting to float and casting back to int etc.

Issue History

Date Modified Username Field Change
2007-05-29 22:31 Kloot New Issue
2007-05-29 22:31 Kloot File Added: MultipleUnitSounds.patch
2007-05-30 16:00 tvo Status new => assigned
2007-05-30 16:00 tvo Assigned To => tvo
2007-05-30 16:02 tvo Status assigned => resolved
2007-05-30 16:02 tvo Resolution open => fixed
2007-05-30 16:02 tvo Note Added: 0000919