2015-08-08 11:07:22 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Parse the string for quotation marks, so it can be used for config export.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: string <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* parsed string <STRING>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ACE_optionsmenu_fnc_stringEscape
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-10 22:19:30 +00:00
|
|
|
private ["_str", "_array", "_maxIndex", "_isEven"];
|
2015-08-08 11:07:22 +00:00
|
|
|
_str = _this;
|
|
|
|
|
|
|
|
_isEven = {
|
|
|
|
params ["_array", "_index"];
|
|
|
|
private [ "_count"];
|
|
|
|
_count = 0;
|
|
|
|
{
|
|
|
|
if (_forEachIndex <= _index && {_x == 39}) then {
|
|
|
|
_count = _count + 1;
|
|
|
|
};
|
2015-11-30 16:23:48 +00:00
|
|
|
}forEach _array;
|
2015-08-08 11:07:22 +00:00
|
|
|
|
|
|
|
_count %2 == 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
// reg: 34
|
|
|
|
// single: 39
|
|
|
|
_array = toArray _str;
|
|
|
|
{
|
|
|
|
if (_x == 34) then {
|
2015-11-30 16:23:48 +00:00
|
|
|
_array set [_forEachIndex, 39];
|
2015-08-08 11:07:22 +00:00
|
|
|
};
|
2015-11-30 16:23:48 +00:00
|
|
|
}forEach _array;
|
2015-08-08 11:07:22 +00:00
|
|
|
|
|
|
|
_maxIndex = count _array;
|
|
|
|
for "_i" from 0 to _maxIndex /* step +1 */ do {
|
|
|
|
if (((_i + 1) < _maxIndex - 1) && {_array select _i == 39 && (_array select (_i + 1)) == 39}) then {
|
|
|
|
if ([_array, _i] call _isEven) then {
|
|
|
|
_array deleteAt _i;
|
|
|
|
_i = _i - 1;
|
|
|
|
_maxIndex = _maxIndex - 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
if (_x == 34) then {
|
2015-11-30 16:23:48 +00:00
|
|
|
_array set [_forEachIndex, 39];
|
2015-08-08 11:07:22 +00:00
|
|
|
};
|
2015-11-30 16:23:48 +00:00
|
|
|
}forEach _array;
|
2015-08-08 11:07:22 +00:00
|
|
|
|
|
|
|
toString _array;
|