2017-06-02 15:14:52 +00:00
|
|
|
/**
|
|
|
|
NamedParams.c
|
|
|
|
Adapts some functions with lots of optional parameters to take a proplist instead.
|
2016-02-10 12:14:06 +00:00
|
|
|
|
2017-06-02 15:14:52 +00:00
|
|
|
@author Marky
|
|
|
|
*/
|
2016-02-10 12:14:06 +00:00
|
|
|
|
2017-10-20 22:10:42 +00:00
|
|
|
// documented in /docs/sdk/script/fn
|
2016-02-10 12:14:06 +00:00
|
|
|
global func Sound(string name, opts, ...)
|
|
|
|
{
|
|
|
|
if (GetType(opts) == C4V_PropList)
|
|
|
|
return inherited(name, opts.global, opts.volume, opts.player, opts.loop_count, opts.custom_falloff_distance, opts.pitch, opts.modifier);
|
2017-06-02 15:14:52 +00:00
|
|
|
return inherited(name, opts, ...);
|
2016-02-10 12:14:06 +00:00
|
|
|
}
|
|
|
|
|
2017-10-20 22:10:42 +00:00
|
|
|
// documented in /docs/sdk/script/fn
|
2016-02-10 12:14:06 +00:00
|
|
|
global func SoundAt(string name, int x, int y, opts, ...)
|
|
|
|
{
|
|
|
|
if (GetType(opts) == C4V_PropList)
|
|
|
|
return inherited(name, x, y, opts.volume, opts.player, opts.custom_falloff_distance, opts.pitch, opts.modifier);
|
2017-06-02 15:14:52 +00:00
|
|
|
return inherited(name, x, y, opts, ...);
|
2016-02-10 12:14:06 +00:00
|
|
|
}
|