Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babel Notifications #689

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions addons/sys_core/fnc_remoteStartSpeaking.sqf
Expand Up @@ -83,6 +83,7 @@ private _result = false;

_unit setVariable [QGVAR(ts3id), _speakingId];
_unit setVariable [QGVAR(languageId), _languageId];

TRACE_1("unit pos", getPosASL _unit);
private _isMuted = IS_MUTED(_unit);
_unit setRandomLip true;
Expand Down Expand Up @@ -139,6 +140,26 @@ private _result = false;
} else {
if (_unit call FUNC(inRange)) then {
GVAR(speakers) pushBack _unit;

if (!(_unit isEqualTo acre_player) && {_languageId in ACRE_SPOKEN_LANGUAGES}) then {
private _previousLanguage = _unit getVariable [QGVAR(lastLanguage), -1];
if (_previousLanguage == -1) then {
if (ACRE_CURRENT_LANGUAGE_ID != _languageId) then {
// notify if a person is speaking a different language than the player on first encounter
private _language = GVAR(languages) select _languageId;
_language params ["","_languageName"];
[_languageName, name _unit, "Speaking", 1, [ACRE_NOTIFICATION_RED]] call EFUNC(sys_list,displayHint);
};
} else {
if (_languageId != _previousLanguage) then {
// notify if a person is speaking a different language than previously heard
private _language = GVAR(languages) select _languageId;
_language params ["","_languageName"];
[_languageName, name _unit, "Speaking", 1, [ACRE_NOTIFICATION_RED]] call EFUNC(sys_list,displayHint);
};
};
_unit setVariable [QGVAR(lastLanguage), _languageId];
};
};
TRACE_1("REMOVING FROM RADIO MICS LIST",GVAR(keyedMicRadios));
REM(GVAR(keyedMicRadios),_unit);
Expand Down