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

Markers - Add the option for UTC/System time timestamps #9121

Merged
merged 42 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1537255
Markers - Add setting for system timestamps
PabstMirror Jan 8, 2023
9b5ee1b
Moved time zone to different setting
Daniel-H123 Jan 9, 2023
9ee9c62
Update fnc_onButtonClickConfirm.sqf
Daniel-H123 Jan 9, 2023
e44246b
- Removed tabs
Daniel-H123 Jan 9, 2023
d13071b
- Fixed tab problem
Daniel-H123 Jan 9, 2023
1ea45e0
- Changed tabs to spaces (Finaly)
Daniel-H123 Jan 10, 2023
58b3627
Delete build/_deps directory
Daniel-H123 Jan 10, 2023
35472bb
Update fnc_onButtonClickConfirm.sqf
Daniel-H123 Jan 31, 2023
90be4ae
Update addons/markers/functions/fnc_onButtonClickConfirm.sqf
Daniel-H123 Aug 9, 2023
38c18f8
Update addons/markers/functions/fnc_onButtonClickConfirm.sqf
Daniel-H123 Aug 9, 2023
55fab6f
Update initSettings.sqf
Daniel-H123 Aug 10, 2023
89bc582
Update fnc_onButtonClickConfirm.sqf
Daniel-H123 Aug 10, 2023
cf4324b
Update addons/markers/functions/fnc_onButtonClickConfirm.sqf
Daniel-H123 Aug 11, 2023
4a2dfdd
Update fnc_onButtonClickConfirm.sqf
Daniel-H123 Aug 11, 2023
d6b009c
Merge branch 'master' into pr/9121
johnb432 Nov 12, 2023
3596b6a
Implemented review changes
Daniel-H123 Nov 12, 2023
52c1de7
Review suggestion
Daniel-H123 Nov 12, 2023
9cc7fdc
Bugfix return absolute positive number with modulo
Daniel-H123 Nov 13, 2023
ba26991
Updated script to allow offset to exeed midnight in the past
Daniel-H123 Nov 13, 2023
18f465b
Updated script to allow offset to exeed midnight in the past
Daniel-H123 Nov 13, 2023
8982994
Updated script to allow offset to exeed midnight in the past
Daniel-H123 Nov 13, 2023
42f3f48
Fixed merge conflict
Daniel-H123 Nov 13, 2023
b7a82da
Updated hour offset calculation
Daniel-H123 Nov 13, 2023
5128345
Add support for UTC+13 and +14 timezone
Daniel-H123 Nov 14, 2023
3d3d973
Add minutes UTC offset to timestamp
Daniel-H123 Nov 14, 2023
f98c5a5
Add UTC minutes offset setting
Daniel-H123 Nov 14, 2023
ee9871a
Add translation for UTC minute offset setting
Daniel-H123 Nov 14, 2023
256623e
Prevent timestamp going over 24 after adding minutes offset
Daniel-H123 Nov 14, 2023
991a2fb
Modify english description for offset settings
Daniel-H123 Nov 14, 2023
aa5208d
Merge pull request #1 from Daniel-H123/markerUtcSysTime
Daniel-H123 Nov 14, 2023
ee9162b
Update addons/markers/initSettings.sqf
johnb432 Nov 14, 2023
ccbc322
Properly handle minute offset with negative timezone
Daniel-H123 Nov 14, 2023
d2599bd
Implemented better solution to handle negative timestamp seconds offset
Daniel-H123 Nov 14, 2023
6c2d65e
reverted 'Implemented better solution to handle negative timestamp se…
Daniel-H123 Nov 14, 2023
eb31958
Merge branch 'markerSysTime' of https://github.com/Daniel-H123/ACE3 i…
Daniel-H123 Nov 14, 2023
c0f25bb
Revert "Implemented better solution to handle negative timestamp seco…
Daniel-H123 Nov 14, 2023
328bc0a
Update timestamp calculation comments
Daniel-H123 Nov 15, 2023
79b8752
Update timestamp calculation comments
Daniel-H123 Nov 15, 2023
07ae2b0
Update documentation in UTC timestamp calculation
Daniel-H123 Nov 16, 2023
39d1ea2
Merge branch 'acemod:master' into markerSysTime
Daniel-H123 Dec 1, 2023
430b8d3
Merge branch 'acemod:master' into markerSysTime
Daniel-H123 Dec 1, 2023
b75de46
Merge branch 'master' into pr/9121
johnb432 Dec 20, 2023
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
62 changes: 45 additions & 17 deletions addons/markers/functions/fnc_onButtonClickConfirm.sqf
Original file line number Diff line number Diff line change
@@ -1,28 +1,56 @@
#include "script_component.hpp"
/*
* Author: Freddo
* When the confirm button is pressed.
*
* Arguments:
* 0: Confirm button <CONTROL>
*
* Return Value:
* None
*
* Example:
* [_buttonOk] call ACE_markers_fnc_onButtonClickConfirm
*
* Public: No
*/
* Author: Freddo, Daniël H.
* When the confirm button is pressed.
*
* Arguments:
* 0: Confirm button <CONTROL>
*
* 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 {
Daniel-H123 marked this conversation as resolved.
Show resolved Hide resolved
private _time = [];

switch (GVAR(timestampTimezone)) do
{
Daniel-H123 marked this conversation as resolved.
Show resolved Hide resolved
default
{
Daniel-H123 marked this conversation as resolved.
Show resolved Hide resolved
_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 + round(_offset);
if (_hour < 0) then {
_hour = 24 + _hour;
};
if (_hour > 24) then {
_hour = _hour - 24;
};
Daniel-H123 marked this conversation as resolved.
Show resolved Hide resolved
_time = _hour + _min/60 + _sec/3600;
};
};

// add timestamp suffix
private _periodPostfix = "";
Expand Down
22 changes: 21 additions & 1 deletion addons/markers/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ private _categoryName = format ["ACE %1", localize ELSTRING(map,Module_DisplayNa
true
] call CBA_fnc_addSetting;

[
QGVAR(timestampTimezone), "LIST",
[LSTRING(TimestampTimezone), LSTRING(TimestampTimezoneDescription)],
[_categoryName, LLSTRING(Module_DisplayName)],
[
[0, 1, 2],
[LSTRING(TimestampTimezoneIngameTime), LSTRING(TimestampTimezoneSystemTime), LSTRING(TimestampTimezoneUTCTime)],
0
],
true
] call CBA_fnc_addSetting;

[
QGVAR(timestampUTCOffset), "SLIDER",
[LSTRING(TimestampUTCOffset), LSTRING(TimestampUTCOffsetDescription)],
[_categoryName, LLSTRING(Module_DisplayName)],
[-12, 12, 0, 0],
true
] call CBA_fnc_addSetting;

[
QGVAR(timestampHourFormat), "LIST",
[LSTRING(TimestampHourFormat), LSTRING(TimestampHourFormatDescription)],
Expand Down Expand Up @@ -60,4 +80,4 @@ private _formatDescription = [
["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM"],
1
]
] call CBA_fnc_addSetting;
] call CBA_fnc_addSetting;
Daniel-H123 marked this conversation as resolved.
Show resolved Hide resolved
77 changes: 77 additions & 0 deletions addons/markers/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,83 @@
<Chinesesimp>需要手表</Chinesesimp>
<Korean>시계 필요함</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampTimezone">
<English>Time Zone</English>
<Russian>Часовой пояс</Russian>
<French>Fuseau horaire</French>
<Japanese>時間帯</Japanese>
<Spanish>Zona horaria</Spanish>
<Polish>Strefa czasowa</Polish>
<German>Zeitzone</German>
<Chinesesimp>时区</Chinesesimp>
<Korean>시간대</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampTimezoneDescription">
<English>Change the time zone for the timestamp</English>
<Russian>Измените часовой пояс для метки времени</Russian>
<French>Modifiez le fuseau horaire pour l'horodatage</French>
<Japanese>タイムスタンプの時間帯を変更します</Japanese>
<Spanish>Cambie la zona horaria para la marca de tiempo</Spanish>
<Polish>Zmień strefę czasową dla znaczników czasu</Polish>
<German>Ändern Sie die Zeitzone für den Zeitstempel</German>
<Chinesesimp>更改时间戳的时区</Chinesesimp>
<Korean>타임스탬프의 시간대를 변경하십시오</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampTimezoneIngameTime">
<English>In-game Time</English>
<Russian>Время в игре</Russian>
<French>Heure de jeu</French>
<Japanese>ゲーム内時刻</Japanese>
<Spanish>Hora del juego</Spanish>
<Polish>Czas gry</Polish>
<German>Ingame-Zeit</German>
<Chinesesimp>游戏内时间</Chinesesimp>
<Korean>게임 시간</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampTimezoneSystemTime">
<English>System Time</English>
<Russian>Системное время</Russian>
<French>Heure système</French>
<Japanese>システム時刻</Japanese>
<Spanish>Hora del sistema</Spanish>
<Polish>Czas systemowy</Polish>
<German>Systemzeit</German>
<Chinesesimp>系统时间</Chinesesimp>
<Korean>시스템 시간</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampTimezoneUTCTime">
<English>UTC Time</English>
<Russian>Время UTC</Russian>
<French>Heure UTC</French>
<Japanese>UTC時刻</Japanese>
<Spanish>Hora UTC</Spanish>
<Polish>Czas UTC</Polish>
<German>UTC-Zeit</German>
<Chinesesimp>UTC时间</Chinesesimp>
<Korean>UTC 시간</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampUTCOffset">
<English>UTC Offset</English>
<Russian>Смещение UTC</Russian>
<French>Décalage UTC</French>
<Japanese>UTCオフセット</Japanese>
<Spanish>Desplazamiento UTC</Spanish>
<Polish>Przesunięcie UTC</Polish>
<German>UTC-Verschiebung</German>
<Chinesesimp>UTC偏移量</Chinesesimp>
<Korean>UTC 오프셋</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampUTCOffsetDescription">
<English>Change the time offset for the UTC timestamp</English>
<Russian>Измените смещение времени для метки времени UTC</Russian>
<French>Modifier le décalage horaire pour l'horodatage UTC</French>
<Japanese>UTCタイムスタンプの時差を変更する</Japanese>
<Spanish>Cambiar el desplazamiento horario para la marca de tiempo UTC</Spanish>
<Polish>Zmień przesunięcie czasu dla sygnatury czasowej UTC</Polish>
<German>Ändere die Zeitverschiebung für den UTC-Zeitstempel</German>
<Chinesesimp>更改UTC时间戳的时间偏移量</Chinesesimp>
<Korean>UTC 타임 스탬프의 시간 오프셋을 변경하십시오</Korean>
</Key>
<Key ID="STR_ACE_Markers_TimestampFormat">
<English>Timestamp Format</English>
<Russian>Формат времени</Russian>
Expand Down