-
Notifications
You must be signed in to change notification settings - Fork 745
Markers - Allow placing quick number markers #11019
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
base: master
Are you sure you want to change the base?
Conversation
| if (GVAR(quickNumberMarks) == 0) exitWith {}; | ||
| if (!cba_events_alt) exitWith {}; // not available before mission start | ||
| if (_marker != "") exitWith {}; // editing an existing marker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (GVAR(quickNumberMarks) == 0) exitWith {}; | |
| if (!cba_events_alt) exitWith {}; // not available before mission start | |
| if (_marker != "") exitWith {}; // editing an existing marker | |
| if (!cba_events_alt) exitWith {}; // not available before mission start | |
| if (GVAR(quickNumberMarks) isEqualTo 0) exitWith {}; | |
| if (_marker isNotEqualTo "") exitWith {}; // editing an existing marker |
| if (_marker != "") exitWith {}; // editing an existing marker | ||
|
|
||
| private _description = _display displayCtrl IDC_INSERT_MARKER; | ||
| private _number = if ((GVAR(quickNumberMarks) == 1) || {currentChannel != 1}) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private _number = if ((GVAR(quickNumberMarks) == 1) || {currentChannel != 1}) then { | |
| private _number = if ((GVAR(quickNumberMarks) isEqualTo 1) || {currentChannel isNotEqualTo 1}) then { |
| GVAR(currentMarkerConfigName) = QGVAR(textOnly); | ||
| } else { | ||
| // try to update our local marker index when placing a text-only marker with a number | ||
| if ((GVAR(quickNumberMarks) == 2) && {currentChannel == 1}) exitWith {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ((GVAR(quickNumberMarks) == 2) && {currentChannel == 1}) exitWith {}; | |
| if ((GVAR(quickNumberMarks) isEqualTo 2) && {currentChannel isEqualTo 1}) exitWith {}; |
| } else { | ||
| // try to update our local marker index when placing a text-only marker with a number | ||
| if ((GVAR(quickNumberMarks) == 2) && {currentChannel == 1}) exitWith {}; | ||
| if ((markerType _newestMarker) != QGVAR(textOnly)) exitWith {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ((markerType _newestMarker) != QGVAR(textOnly)) exitWith {}; | |
| if ((markerType _newestMarker) isNotEqualTo QGVAR(textOnly)) exitWith {}; |
| private _count = count _text; | ||
| private _isNumber = true; | ||
| if (_count > 6) exitWith {}; | ||
| for "_i" from 0 to (_count - 1) do { | ||
| if !((_text select [_i, 1]) in "0123456789") exitWith { _isNumber = false; }; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private _count = count _text; | |
| private _isNumber = true; | |
| if (_count > 6) exitWith {}; | |
| for "_i" from 0 to (_count - 1) do { | |
| if !((_text select [_i, 1]) in "0123456789") exitWith { _isNumber = false; }; | |
| }; | |
| if (_count > 6) exitWith {}; | |
| private _isNumber = _text regexMatch ".*?[0-9].*+/o"; |
Whether the /o part, meaning "optimize", is faster or slower, has to be tested.
Co-authored-by: Jouni Järvinen <[email protected]>
Co-authored-by: Jouni Järvinen <[email protected]>
Co-authored-by: Jouni Järvinen <[email protected]>
Allows quick numbering by holding alt when placing a marker
no dialog, just get a incrementally numbered mark