Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 |
/** * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved. */ class UISoundTheme extends Object native(UserInterface); /** Maps an event name to a sound. When an event comes in to the UISceneTheme, if it can be found in the bindings array, then the corresponding SoundCue will be played */ struct native SoundEventMapping { /** Name of the event that corresponds to the sound cue below. */ var() name SoundEventName; /** Sound cue to play when the the above event is received. */ var() SoundCue SoundToPlay; }; /** List of the event bindings for this sound theme. Usually, these will be specified by a designer in an archetype in the editor, or in the defaultproperties */ var() array<SoundEventMapping> SoundEventBindings; /** Called when an event (focus change, click, etc) is fired from the UI */ event ProcessSoundEvent(name SoundEventName, optional PlayerController SoundOwner) { local int EventIndex; // Find an entry in the bindings array to match this sound event, or warn if we can't find one. EventIndex = SoundEventBindings.Find('SoundEventName', SoundEventName); if( EventIndex != INDEX_NONE ) { `log("ProcessSoundEvent - Sound Event: "$SoundEventName$", Sound Theme: "$self$", Sound: "$SoundEventBindings[EventIndex].SoundToPlay,, 'DevGFxUI'); if( SoundOwner != None ) { // If there's a specific PlayerOwner, use it to play the sound SoundOwner.PlaySound( SoundEventBindings[EventIndex].SoundToPlay, TRUE, TRUE, TRUE ); } else { // Default implementation: Play the sound via the WorldInfo, which assumes the sound is not attenuated / spatialised class'WorldInfo'.static.GetWorldInfo().PlaySound( SoundEventBindings[EventIndex].SoundToPlay, TRUE, TRUE, TRUE ); } } } defaultproperties { } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |