-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ACyprus
committed
Aug 8, 2015
1 parent
6e89a6e
commit 7b24165
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...3/@task_force_radio/addons/task_force_radio/functions/fn_onSpeakVolumeModifierPressed.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
Name: TFAR_fnc_onSpeakVolumeModifierPressed | ||
Author(s): | ||
ACyprus | ||
Description: | ||
Transiently changes the volume for the player's voice in game to either Yelling or Whisper | ||
Parameters: | ||
0: STRING - Volume level : VALUES ("yelling" or "whispering") | ||
Returns: | ||
BOOLEAN - Whether or not the event was handled | ||
Example: | ||
["yelling"] call TFAR_fnc_onSpeakVolumeModifierPressed; | ||
*/ | ||
private ["_modifierMode", "_allowedModes", "_localName", "_hintText"]; | ||
|
||
_modifierMode = _this select 0; | ||
_allowedModes = ["yelling", "whispering"]; | ||
|
||
if(!alive TFAR_currentUnit || TF_tangent_sw_pressed || TF_tangent_lr_pressed || TF_tangent_dd_pressed) exitWith {false}; | ||
if!(_modifierMode in _allowedModes) exitWith {false}; | ||
|
||
TF_last_speak_volume_level = TF_speak_volume_level; | ||
TF_last_speak_volume_meters = TF_speak_volume_meters; | ||
|
||
TF_speak_volume_level = _modifierMode; | ||
if(_modifierMode == "yelling") then { | ||
TF_speak_volume_meters = TF_max_voice_volume; | ||
} else { | ||
TF_speak_volume_meters = TF_min_voice_volume; | ||
}; | ||
|
||
_localName = localize format["STR_voice_%1", _modifierMode]; | ||
_hintText = format[localize "STR_voice_volume", _localName]; | ||
[parseText (_hintText), -1] call TFAR_fnc_showHint; | ||
|
||
["OnSpeakVolumeModifierPressed", TFAR_currentUnit, [TFAR_currentUnit, TF_speak_volume_level, TF_speak_volume_meters]] call TFAR_fnc_fireEventHandlers; | ||
|
||
true |
26 changes: 26 additions & 0 deletions
26
.../@task_force_radio/addons/task_force_radio/functions/fn_onSpeakVolumeModifierReleased.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Name: TFAR_fnc_onSpeakVolumeModifierReleased | ||
Author(s): | ||
ACyprus | ||
Description: | ||
Restores any transient volume changes for the player's voice in game | ||
Parameters: | ||
NONE | ||
Returns: | ||
BOOLEAN - Whether or not the event was handled | ||
Example: | ||
call TFAR_fnc_onSpeakVolumeModifierReleased; | ||
*/ | ||
TF_speak_volume_level = TF_last_speak_volume_level; | ||
TF_speak_volume_meters = TF_last_speak_volume_meters; | ||
|
||
call TFAR_fnc_HideHint; | ||
|
||
["OnSpeakVolumeModifierReleased", TFAR_currentUnit, [TFAR_currentUnit, TF_speak_volume_level, TF_speak_volume_meters]] call TFAR_fnc_fireEventHandlers; | ||
|
||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters