-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* function declaration for #887 * Revert "function declaration for #887" This reverts commit 7b24165. * function definition for #887 * functions code for #887 * keybind definitions and constants for #887 * scancode definitions for new keybinds in #887 * didn't need to maintain pressed state after all Former-commit-id: cdc79969b9f492a608da54e2d37be40eda80555e [formerly 51e3f7df4bdd82e5458cdafa1227a4a2293cba1e] [formerly ea6a968a14463b41b6799a25d4cfc03644b927cf [formerly 2269f41c4a0a126ef9eb1300d7a25b327992c9e4]] [formerly 1ead95ae89c6bb52492096c377e0d49e9c45f6d8 [formerly 09bacff7e72dfc248892b7af55fb1f8fa4b5de98] [formerly eb8bbbf5d27d4744010423a337b0932c30424d41 [formerly e1ff1a16053dbd9d83ac9a2cbddc92e7fa512f0e]]] Former-commit-id: ea7a04203adcf3d7811b18f23ef6dcfe12ecca52 [formerly e115af6322f0dbc73468842ef7f670b610372268] [formerly 89c65d3937eb8951baf0bab33336ae49bb8db9ab [formerly bee8d8e30a089553b692a2a0c9028a6c45f2fb66]] Former-commit-id: 23c15924c4fcc58df2e329ac16ce94f9be9d6f93 [formerly ca51a2b38bce86db092520d5e765d5c119a57cf2] Former-commit-id: 48abf138c26b670e0aab1fa453a3ad9a251995e1
- Loading branch information
Showing
5 changed files
with
84 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