Skip to content

Commit

Permalink
Merge branch 'master' into clearWaypoints_emptyGroup_case
Browse files Browse the repository at this point in the history
  • Loading branch information
Vdauphin committed Jan 17, 2020
2 parents 0810060 + 5fda507 commit 4bd293c
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 22 deletions.
2 changes: 1 addition & 1 deletion addons/ai/fnc_addWaypoint.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Author:
params [
"_group",
"_position",
["_radius", 0, [0]],
["_radius", -1, [0]],
["_type", "MOVE", [""]],
["_behaviour", "UNCHANGED", [""]],
["_combat", "NO CHANGE", [""]],
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_clearWaypoints.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ private _waypoints = waypoints _group;

if !(units _group isEqualTo []) then {
// Create a self-deleting waypoint at the leader position to halt all planned movement (based on old waypoints)
private _wp = _group addWaypoint [getPosATL (leader _group), 0];
private _wp = _group addWaypoint [getPosATL (leader _group), -1];
_wp setWaypointStatements ["true", "deleteWaypoint [group this,currentWaypoint (group this)]"];
};
2 changes: 1 addition & 1 deletion addons/ai/fnc_searchNearby.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if ((leader _group) distanceSqr _building > 250e3) exitwith {};

// Add a waypoint to regroup after the search
_group lockWP true;
private _wp = _group addWaypoint [getPos _leader, 0, currentWaypoint _group];
private _wp = _group addWaypoint [getPos _leader, -1, currentWaypoint _group];
private _cond = "({unitReady _x || !(alive _x)} count thisList) == count thisList";
private _comp = format ["this setFormation '%1'; this setBehaviour '%2'; deleteWaypoint [group this, currentWaypoint (group this)];", formation _group, behaviour _leader];
_wp setWaypointStatements [_cond, _comp];
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_taskAttack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Author:
---------------------------------------------------------------------------- */

params ["_group", "_position", ["_radius", 0], ["_override", false]];
params ["_group", "_position", ["_radius", -1], ["_override", false]];

_group = _group call CBA_fnc_getGroup;
if !(local _group) exitWith {}; // Don't create waypoints on each machine
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_taskPatrol.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ _position = _position call CBA_fnc_getPos;

// Can pass parameters straight through to addWaypoint
_this =+ _this;
_this set [2,0];
_this set [2,-1];
if (count _this > 3) then {
_this deleteAt 3;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_taskSearchArea.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ _onComplete = _statements joinString ";";
[
_group,
_pos,
0,
-1,
"MOVE",
_behaviour,
_combat,
Expand Down
2 changes: 1 addition & 1 deletion addons/ai/fnc_waypointGarrison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Returns:
Examples:
(begin example)
_group addWaypoint [_position, 0] setWaypointScript "\x\cba\addons\ai\fnc_waypointGarrison.sqf []";
_group addWaypoint [_position, -1] setWaypointScript "\x\cba\addons\ai\fnc_waypointGarrison.sqf []";
[_group, _position] execVM "\x\cba\addons\ai\fnc_waypointGarrison.sqf";
(end)
Expand Down
17 changes: 10 additions & 7 deletions addons/arrays/fnc_sortNestedArray.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Function: CBA_fnc_sortNestedArray
Description:
Used to sort a nested array from lowest to highest using quick sort.
Sorts the given nested array in either ascending or descending order based on the
numerical value at specified index of sub arrays.
Sorting is based on the specified column, which must have numerical data.
Original array is modified.
Parameters:
Expand All @@ -22,20 +22,23 @@ Returns:
Sorted array <ARRAY>
Author:
commy2
commy2, mharis001
---------------------------------------------------------------------------- */
SCRIPT(sortNestedArray);

params [["_array", [], [[]]], ["_index", 0, [0]], ["_order", true, [false]]];

private _helperArray = _array apply {
[_x select _index, _x]
};
private _helperArray = [];
private _coefficient = [-1, 1] select _order;

{
_helperArray pushBack [_x select _index, _coefficient * _forEachIndex, _x];
} forEach _array;

_helperArray sort _order;

{
_array set [_forEachIndex, _x select 1];
_array set [_forEachIndex, _x select 2];
} forEach _helperArray;

_array
1 change: 0 additions & 1 deletion addons/settings/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class GVAR(Row_Base): RscControlsGroupNoScrollbars {
idc = IDC_SETTING_DEFAULT;
style = ST_PICTURE;
text = ICON_DEFAULT;
tooltip = CSTRING(default_tooltip);
x = POS_W(26.5);
y = POS_H(0) + TABLE_LINE_SPACING/2;
w = POS_W(1);
Expand Down
18 changes: 18 additions & 0 deletions addons/settings/gui_createCategory.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@ private _lastSubCategory = "$START";
default {controlNull};
};

// ----- determine display string for default value
private _defaultValueToolTip = switch (toUpper _settingType) do {
case "LIST": {
(_settingData param [1, []]) param [_defaultValue, ""]
};
case "COLOR": {
private _template = (["R: %1","%G: %2", "B: %3", "A: %4"] select [0, count _defaultValue]) joinString "\n";
format ([_template] + _defaultValue)
};
case "TIME": {
_defaultValue call CBA_fnc_formatElapsedTime
};
default {_defaultValue};
};

// ----- set tooltip on "Reset to default" button
(_ctrlSettingGroup controlsGroupCtrl IDC_SETTING_DEFAULT) ctrlSetTooltip (format ["%1\n%2", localize LSTRING(default_tooltip), _defaultValueToolTip]);

_ctrlSettingGroup setVariable [QGVAR(setting), _setting];
_ctrlSettingGroup setVariable [QGVAR(source), _source];
_ctrlSettingGroup setVariable [QGVAR(params), _settingData];
Expand Down
12 changes: 7 additions & 5 deletions addons/strings/fnc_decodeURL.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ private _return = _cache getVariable _string;

if (isNil "_return") then {
_return = _string;

{
_return = ([_return] + _x) call CBA_fnc_replace;
} forEach UTF8_TABLE;


// Only replace if there is at least one character to replace
if ("%" in _return) then {
{
_return = ([_return] + _x) call CBA_fnc_replace;
} forEach UTF8_TABLE;
};
if (isNull _cache) then {
_cache = [] call CBA_fnc_createNamespace;
missionNamespace setVariable [QGVAR(URLCache), _cache];
Expand Down
4 changes: 2 additions & 2 deletions tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,9 @@ def main(argv):

else:
if check_external:
cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"]
cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+G", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"]
else:
cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "-X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"]
cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "-G", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"]

color("grey")
if quiet:
Expand Down

0 comments on commit 4bd293c

Please sign in to comment.