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 - Persistent Language Hint for non-primary language #1324

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion addons/sys_core/fnc_cycleLanguage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@ if (_numSpokenLanguages > 1) then {
if (_nextId > _numSpokenLanguages - 1) then {
_nextId = 0;
};

// Set hint duration to infinite when you're not speaking your first language (setting dependent)
private _hintTime = 1;
if (EGVAR(sys_list,LanguageHintPersist) && {_nextId > 0}) then {
_hintTime = -1;
};

private _languageId = ACRE_SPOKEN_LANGUAGES select _nextId;
private _language = GVAR(languages) select _languageId;
_language params ["_languageKey","_languageName"];
[_languageKey] call FUNC(setSpeakingLanguage);
["acre_cycleLanguage", _languageName, "Now speaking", "", 1, EGVAR(sys_list,LanguageColor)] call EFUNC(sys_list,displayHint);
["acre_cycleLanguage", _languageName, "Now speaking", "", _hintTime, EGVAR(sys_list,LanguageColor)] call EFUNC(sys_list,displayHint);
[] call FUNC(updateSelf);
if (ACRE_LOCAL_SPEAKING) then {
//@TODO: This is an uber hack, should probably be set up as a TS event.
Expand Down
9 changes: 9 additions & 0 deletions addons/sys_list/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ private _fonts = ["EtelkaMonospacePro", "EtelkaMonospaceProBold", "LCD14", "Puri
{}
] call CBA_fnc_addSetting;

// Babel Language Hint Persistence
[
QGVAR(LanguageHintPersist),
"CHECKBOX",
[localize LSTRING(LanguageHintPersist_DisplayName), localize LSTRING(LanguageHintPersist_Description)],
ELSTRING(sys_core,CategoryUI),
true
] call CBA_fnc_addSetting;

// PTT1 Color
[
QGVAR(PTT1Color),
Expand Down
10 changes: 10 additions & 0 deletions addons/sys_list/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@
<Portuguese>Cor: Alternar Idiomas do Babel</Portuguese>
<Turkish>Babel Dil Değiştirme Rengi</Turkish>
</Key>
<Key ID="STR_ACRE_sys_list_LanguageHintPersist_DisplayName">
<English>Persist Babel Language Indicator</English>
<German>Babel Sprachanzeige bleibt sichtbar</German>
<Italian>Indicatore di lingua persistente</Italian>
</Key>
<Key ID="STR_ACRE_sys_list_LanguageHintPersist_Description">
<English>Prevent the Babel Language Indicator in the bottom right from fading out if a language other than the "main language" (the first assigned spoken language) is selected.</English>
<German>Verhindert, wenn eingeschaltet, dass die Babel Sprachanzeige unten-rechts verschwindet während eine andere Sprache als die "Muttersprache" (die erste zugewiesene Sprache) gesprochen wird.</German>
<Italian>Se attivato, l'indicatore della lingua selezionata in basso a destra non scomparirà mentre si parla una lingua diversa da quella "madre" (la prima lingua assegnata).</Italian>
</Key>
<Key ID="STR_ACRE_sys_list_SwitchChannelColor_DisplayName">
<English>Switch Channel Color</English>
<German>Farbe bei Funkkanalwechsel</German>
Expand Down