From 9b5ee1bf7041bd72eec93cd9e2bd636b9efa41fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl?= Date: Mon, 9 Jan 2023 20:01:16 +0100 Subject: [PATCH] Moved time zone to different setting Added UTC Time zone Added UTC time offset slider Added translation in stringtable --- .../functions/fnc_onButtonClickConfirm.sqf | 113 ++++++++++------- addons/markers/initSettings.sqf | 114 ++++++++++-------- addons/markers/stringtable.xml | 77 ++++++++++++ 3 files changed, 211 insertions(+), 93 deletions(-) diff --git a/addons/markers/functions/fnc_onButtonClickConfirm.sqf b/addons/markers/functions/fnc_onButtonClickConfirm.sqf index f70c43f2e1..280fc11a34 100644 --- a/addons/markers/functions/fnc_onButtonClickConfirm.sqf +++ b/addons/markers/functions/fnc_onButtonClickConfirm.sqf @@ -1,58 +1,81 @@ #include "script_component.hpp" /* - * Author: Freddo - * When the confirm button is pressed. - * - * Arguments: - * 0: Confirm button - * - * Return Value: - * None - * - * Example: - * [_buttonOk] call ACE_markers_fnc_onButtonClickConfirm - * - * Public: No + * Author: Freddo + * When the confirm button is pressed. + * + * Arguments: + * 0: Confirm button + * + * Return Value: + * None + * + * Example: + * [_buttonOk] call ACE_markers_fnc_onButtonClickConfirm + * + * Public: No */ params ["_buttonOk"]; private _display = ctrlParent _buttonOk; -private _description = _display displayctrl IDC_INSERT_MARKER; +private _description = _display displayCtrl IDC_INSERT_MARKER; private _aceTimestamp = _display displayCtrl IDC_ACE_INSERT_MARKER_TIMESTAMP; // handle timestamp -if (cbChecked _aceTimestamp && {ACE_player call FUNC(canTimestamp)}) then { - private _time = daytime; +if (cbChecked _aceTimestamp && { + ACE_player call FUNC(canTimestamp) +}) then { + private _time = []; - // add timestamp suffix - private _periodPostfix = ""; - if (GVAR(timestampHourFormat) == 12) then { - if (floor _time == 0) exitWith { - _time = _time + 12; - _periodPostfix = " am"; - }; + switch (GVAR(timestampTimezone)) do + { + default + { + _time = dayTime; + }; + case 1: + { + systemTime params ["", "", "", "_hour", "_min", "_sec"]; + _time = _hour + _min/60 + _sec/3600; + }; + case 2: + { + _offset = GVAR(timestampUTCOffset); + systemTimeUTC params["", "", "", "_hour", "_min", "_sec"]; + _hour = _hour + _offset; + if (_hour < 0) then { + _hour= 24 - (_hour + _offset); + }; + if (_hour > 24) then { + _hour = 0 + ((_hour + _offset) - 24); + }; + _time = _hour + _min/60 + _sec/3600; + }; + }; - if (floor _time == 12) exitWith { - _periodPostfix = " pm"; - }; + // add timestamp suffix + private _periodPostfix = ""; + if (GVAR(timestampHourFormat) == 12) then { + if (floor _time == 0) exitWith { + _time = _time + 12; + _periodPostfix = " am"; + }; - if (_time < 12) then { - _periodPostfix = " am"; - } else { - _time = _time - 12; - _periodPostfix = " pm"; - }; - } else { - if (GVAR(timestampHourFormat) == 0) then { - systemTime params ["", "", "", "_hour", "_min", "_sec"]; - _time = _hour + _min/60 + _sec/3600; - }; - }; + if (floor _time == 12) exitWith { + _periodPostfix = " pm"; + }; - _description ctrlSetText format [ - "%1 [%2%3]", - ctrlText _description, - [_time, GVAR(timestampFormat)] call BIS_fnc_timeToString, - _periodPostfix - ]; -}; + if (_time < 12) then { + _periodPostfix = " am"; + } else { + _time = _time - 12; + _periodPostfix = " pm"; + }; + }; + + _description ctrlSetText format [ + "%1 [%2%3]", + ctrlText _description, + [_time, GVAR(timestampFormat)] call BIS_fnc_timeToString, + _periodPostfix + ]; +}; \ No newline at end of file diff --git a/addons/markers/initSettings.sqf b/addons/markers/initSettings.sqf index 0e7ec2bcb0..793d992e0b 100644 --- a/addons/markers/initSettings.sqf +++ b/addons/markers/initSettings.sqf @@ -1,63 +1,81 @@ private _categoryName = format ["ACE %1", localize ELSTRING(map,Module_DisplayName)]; [ - QGVAR(moveRestriction), "LIST", - [LSTRING(MoveRestriction), LSTRING(MoveRestriction_Description)], - [_categoryName, LLSTRING(Module_DisplayName)], - [ - [ - MOVE_RESTRICTION_NOBODY, - MOVE_RESTRICTION_ALL, - MOVE_RESTRICTION_ADMINS, - MOVE_RESTRICTION_GROUP_LEADERS, - MOVE_RESTRICTION_GROUP_LEADERS_ADMINS, - MOVE_RESTRICTION_OWNER - ], - [ - LSTRING(MoveRestriction_Nobody), - LSTRING(MoveRestriction_All), - LSTRING(MoveRestriction_Admins), - LSTRING(MoveRestriction_GroupLeaders), - LSTRING(MoveRestriction_GroupLeadersAndAdmins), - LSTRING(MoveRestriction_Owner) - ], - 1 - ] + QGVAR(moveRestriction), "LIST", + [LSTRING(MoveRestriction), LSTRING(MoveRestriction_Description)], + [_categoryName, LLSTRING(Module_DisplayName)], + [ + [ + MOVE_RESTRICTION_NOBODY, + MOVE_RESTRICTION_ALL, + MOVE_RESTRICTION_ADMINS, + MOVE_RESTRICTION_GROUP_LEADERS, + MOVE_RESTRICTION_GROUP_LEADERS_ADMINS, + MOVE_RESTRICTION_OWNER + ], + [ + LSTRING(MoveRestriction_Nobody), + LSTRING(MoveRestriction_All), + LSTRING(MoveRestriction_Admins), + LSTRING(MoveRestriction_GroupLeaders), + LSTRING(MoveRestriction_GroupLeadersAndAdmins), + LSTRING(MoveRestriction_Owner) + ], + 1 + ] ] call CBA_fnc_addSetting; [ - QGVAR(timestampEnabled), "CHECKBOX", - [LSTRING(TimestampEnabled), LSTRING(TimestampEnabledDescription)], - [_categoryName, LLSTRING(Module_DisplayName)], - true + QGVAR(timestampEnabled), "CHECKBOX", + [LSTRING(TimestampEnabled), LSTRING(TimestampEnabledDescription)], + [_categoryName, LLSTRING(Module_DisplayName)], + true ] call CBA_fnc_addSetting; [ - QGVAR(timestampHourFormat), "LIST", - [LSTRING(TimestampHourFormat), LSTRING(TimestampHourFormatDescription)], - [_categoryName, LLSTRING(Module_DisplayName)], - [ - [24, 12, 0], - [LSTRING(TimestampHourFormat24), LSTRING(TimestampHourFormat12), "System"], - 0 - ] + QGVAR(timestampTimezone), "LIST", + [LSTRING(TimestampTimezone), LSTRING(TimestampTimezoneDescription)], + [_categoryName, LLSTRING(Module_DisplayName)], + [ + [0, 1, 2], + [LSTRING(TimestampTimezoneIngameTime), LSTRING(TimestampTimezoneSystemTime), LSTRING(TimestampTimezoneUTCTime)], + 0 + ] +] call CBA_fnc_addSetting; + +[ + QGVAR(timestampUTCOffset), "SLIDER", + [LSTRING(TimestampUTCOffset), LSTRING(TimestampUTCOffsetDescription)], + [_categoryName, LLSTRING(Module_DisplayName)], + [-12, 12, 0, 0] +] call CBA_fnc_addSetting; + +[ + QGVAR(timestampHourFormat), "LIST", + [LSTRING(TimestampHourFormat), LSTRING(TimestampHourFormatDescription)], + [_categoryName, LLSTRING(Module_DisplayName)], + [ + [24, 12], + [LSTRING(TimestampHourFormat24), LSTRING(TimestampHourFormat12)], + 0 + ] ] call CBA_fnc_addSetting; private _formatDescription = [ - LLSTRING(TimestampFormatDescription0), - LLSTRING(TimestampFormatDescription1), - LLSTRING(TimestampFormatDescription2), - LLSTRING(TimestampFormatDescription3), - LLSTRING(TimestampFormatDescription4) + LLSTRING(TimestampFormatDescription0), + LLSTRING(TimestampFormatDescription1), + LLSTRING(TimestampFormatDescription2), + LLSTRING(TimestampFormatDescription3), + LLSTRING(TimestampFormatDescription4) ] joinString endl; [ - QGVAR(timestampFormat), "LIST", - [LSTRING(timestampFormat), _formatDescription], - [_categoryName, LLSTRING(Module_DisplayName)], - [ - ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM"], - ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM"], - 1 - ] -] call CBA_fnc_addSetting; + QGVAR(timestampFormat), "LIST", + [LSTRING(timestampFormat), _formatDescription], + [_categoryName, LLSTRING(Module_DisplayName)], + [ + ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM"], + ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM"], + 1 + ] +] call CBA_fnc_addSetting; \ No newline at end of file diff --git a/addons/markers/stringtable.xml b/addons/markers/stringtable.xml index 228b64a0be..05209761f9 100644 --- a/addons/markers/stringtable.xml +++ b/addons/markers/stringtable.xml @@ -226,6 +226,83 @@ 需要手表 시계 필요함 + + Time Zone + Часовой пояс + Fuseau horaire + 時間帯 + Zona horaria + Strefa czasowa + Zeitzone + 时区 + 시간대 + + + Change the time zone for the timestamp + Измените часовой пояс для метки времени + Modifiez le fuseau horaire pour l'horodatage + タイムスタンプの時間帯を変更します + Cambie la zona horaria para la marca de tiempo + Zmień strefę czasową dla znaczników czasu + Ändern Sie die Zeitzone für den Zeitstempel + 更改时间戳的时区 + 타임스탬프의 시간대를 변경하십시오 + + + In-game Time + Время в игре + Heure de jeu + ゲーム内時刻 + Hora del juego + Czas gry + Ingame-Zeit + 游戏内时间 + 게임 시간 + + + System Time + Системное время + Heure système + システム時刻 + Hora del sistema + Czas systemowy + Systemzeit + 系统时间 + 시스템 시간 + + + UTC Time + Время UTC + Heure UTC + UTC時刻 + Hora UTC + Czas UTC + UTC-Zeit + UTC时间 + UTC 시간 + + + UTC Offset + Смещение UTC + Décalage UTC + UTCオフセット + Desplazamiento UTC + Przesunięcie UTC + UTC-Verschiebung + UTC偏移量 + UTC 오프셋 + + + Change the time offset for the UTC timestamp + Измените смещение времени для метки времени UTC + Modifier le décalage horaire pour l'horodatage UTC + UTCタイムスタンプの時差を変更する + Cambiar el desplazamiento horario para la marca de tiempo UTC + Zmień przesunięcie czasu dla sygnatury czasowej UTC + Ändere die Zeitverschiebung für den UTC-Zeitstempel + 更改UTC时间戳的时间偏移量 + UTC 타임 스탬프의 시간 오프셋을 변경하십시오 + Timestamp Format Формат времени