-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved time zone to different setting
Added UTC Time zone Added UTC time offset slider Added translation in stringtable
- Loading branch information
1 parent
1537255
commit 9b5ee1b
Showing
3 changed files
with
211 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,81 @@ | ||
#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 | ||
* 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 { | ||
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 | ||
]; | ||
}; |
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 |
---|---|---|
@@ -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; |
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