Skip to content

Commit 1ca8181

Browse files
authored
3.10.0 Testing Fixes 3 (#3729)
- Fixed bug where remarks option didn't show. - Fixed bug where you couldn't save the client settings if no settings actually changed. - Fixed bug where players on DS would lose their original role when becoming commander. - Fixed bug where commander traits might not be applied correctly on DS.
1 parent 0aabc7c commit 1ca8181

File tree

7 files changed

+52
-39
lines changed

7 files changed

+52
-39
lines changed

A3A/addons/core/functions/OrgPlayers/fn_theBossTransfer.sqf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ if !(isServer) exitWith {};
33
FIX_LINE_NUMBERS()
44
params [["_newBoss", objNull], ["_silent", false]];
55

6-
if (!isNull theBoss) then
7-
{
8-
Debug_1("Removing %1 from Boss roles.", name theBoss);
6+
private _oldBoss = theBoss;
7+
theBoss = _newBoss;
8+
publicVariable "theBoss";
99

10-
bossHCGroupsTransfer = hcAllGroups theBoss;
11-
hcRemoveAllGroups theBoss;
10+
if (!isNull _oldBoss) then {
11+
Debug_1("Removing %1 from Boss roles.", name _oldBoss);
1212

13-
theBoss synchronizeObjectsRemove [HC_commanderX];
14-
HC_commanderX synchronizeObjectsRemove [theBoss];
15-
[player getVariable ["A3A_Role","rifleman"],true] remoteExecCall ["A3A_fnc_unitTraits", theBoss];
16-
};
13+
bossHCGroupsTransfer = hcAllGroups _oldBoss;
14+
hcRemoveAllGroups _oldBoss;
1715

18-
theBoss = _newBoss;
19-
publicVariable "theBoss";
16+
_oldBoss synchronizeObjectsRemove [HC_commanderX];
17+
HC_commanderX synchronizeObjectsRemove [_oldBoss];
18+
[nil,true] remoteExecCall ["A3A_fnc_unitTraits", _oldBoss];
19+
};
2020

2121
if (isNull _newBoss) exitWith {
2222
[_silent] spawn {

A3A/addons/core/functions/init/fn_initClient.sqf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,6 @@ mapX addAction [localize "STR_A3A_fn_init_initclient_addact_gameOpt", {
337337
mapX addAction [localize "STR_A3A_fn_init_initclient_addact_mapinfo", A3A_fnc_mapInfoDialog,nil,0,false,true,"","(isPlayer _this) and (_this == _this getVariable ['owner',objNull]) and (side (group _this) == teamPlayer)", 4];
338338
if (isMultiplayer) then {mapX addAction [localize "STR_A3A_fn_init_initclient_addact_ailoadinfo", { [] remoteExec ["A3A_fnc_AILoadInfo",2];},nil,0,false,true,"",""]}; // should be no reason to restrict the aiLoadInfo to anyone
339339

340-
// allow player to open any nearby helipads
341-
player addAction ["Open Heli Garage",
342-
"
343-
if ([getPosATL player] call A3A_fnc_enemyNearCheck) exitWith {[localize 'STR_A3A_fn_init_initclient_helipad',localize 'STR_A3A_fn_init_initclient_helipad_enemies'] call A3A_fnc_customHint};
344-
_helipad = (nearestObjects [player, ['a3a_helipad'], 8, true])#0;
345-
HR_GRG_accessPoint = _helipad;
346-
HR_GRG_accessLimit = 'helipad';
347-
createDialog 'HR_GRG_VehicleSelect';
348-
", nil, 4, true, true, "","(count (nearestObjects [player, ['a3a_helipad'], 8, true]) > 0) && {((isNil 'HR_GRG_Placing') || {!HR_GRG_Placing}) && player isEqualTo vehicle player && _this == _this getVariable ['owner',objNull]}"
349-
];
350-
351340
// Get list of buildable objects, has map (and template?) dependency
352341
call A3A_fnc_initBuildableObjects;
353342

A3A/addons/core/functions/init/fn_installClientEH.sqf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,17 @@ player addEventHandler ["WeaponDisassembled", {
114114
[_veh] remoteExecCall ["A3A_fnc_garrisonServer_remVehicle", 2];
115115
};
116116
}];
117+
118+
119+
// Actions dont persist across respawns so they're temporarily stuck here
120+
121+
// allow player to open any nearby helipads
122+
player addAction ["Open Heli Garage",
123+
"
124+
if ([getPosATL player] call A3A_fnc_enemyNearCheck) exitWith {[localize 'STR_A3A_fn_init_initclient_helipad',localize 'STR_A3A_fn_init_initclient_helipad_enemies'] call A3A_fnc_customHint};
125+
_helipad = (nearestObjects [player, ['a3a_helipad'], 8, true])#0;
126+
HR_GRG_accessPoint = _helipad;
127+
HR_GRG_accessLimit = 'helipad';
128+
createDialog 'HR_GRG_VehicleSelect';
129+
", nil, 4, true, true, "","(count (nearestObjects [player, ['a3a_helipad'], 8, true]) > 0) && {((isNil 'HR_GRG_Placing') || {!HR_GRG_Placing}) && player isEqualTo vehicle player && _this == _this getVariable ['owner',objNull]}"
130+
];

A3A/addons/gui/Stringtable.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4766,6 +4766,9 @@
47664766
<Key ID="STR_antistasi_dialogs_roleselect_capExplanation">
47674767
<Original>The cap of slots per role (excluding riflemen and the commander) increases as the player count increases. The number per role increases linearly from 3 slots at 3 players to 6 slots at 38 players.</Original>
47684768
</Key>
4769+
<Key ID="STR_antistasi_dialogs_roleselect_capNames">
4770+
<Original>Players in this role:</Original>
4771+
</Key>
47694772
<Key ID="STR_antistasi_dialogs_roleselect_welcome">
47704773
<Original>Welcome to Antistasi! To get started, select a role from the list on the left and use "set role". You can revisit this screen any time by opening the Battle Menu with Y.</Original>
47714774
</Key>

A3A/addons/gui/functions/mainMenu/fn_optionsDialog.sqf

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,22 @@ switch (_mode) do
139139
private _tableEntry = _tableParams#_tableIndex;
140140
if ((_tableEntry#1) != _value) then {_mismatches pushBack _tableEntry};
141141
} forEach _playerParams;
142-
if (count _mismatches == 0) exitWith {};
143-
{
144-
_x params ["_cfg","_value"];
145-
private _searchText = format ["A3A_clientOptions_%1", _cfg];
146-
profileNamespace setVariable [_searchText, _value];
147-
} forEach _tableParams;
148-
saveprofilenamespace;
149-
// These are now the values that were changed
150-
{
151-
_x params ["_cfg","_value"];
152-
private _action = getText (A3A_SETUP_CONFIGFILE/"A3A"/"clientOptions"/_cfg/"stateChange");
153-
if (_action isEqualTo "") then {continue};
154-
_value spawn (compile _action);
155-
Info_2("Client setting updated: Name %1 new value %2", _cfg, _value);
156-
} forEach _mismatches;
142+
if (count _mismatches > 0) then {
143+
{
144+
_x params ["_cfg","_value"];
145+
private _searchText = format ["A3A_clientOptions_%1", _cfg];
146+
profileNamespace setVariable [_searchText, _value];
147+
} forEach _tableParams;
148+
saveprofilenamespace;
149+
// These are now the values that were changed
150+
{
151+
_x params ["_cfg","_value"];
152+
private _action = getText (A3A_SETUP_CONFIGFILE/"A3A"/"clientOptions"/_cfg/"stateChange");
153+
if (_action isEqualTo "") then {continue};
154+
_value spawn (compile _action);
155+
Info_2("Client setting updated: Name %1 new value %2", _cfg, _value);
156+
} forEach _mismatches;
157+
};
157158
_display closeDisplay 0;
158159
};
159160
case ("handleCloseButton"):

A3A/addons/gui/functions/mainMenu/fn_showInterruptButtons.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private _doShow = if (!isClass (missionConfigFile/"A3A") ) then {
1616
} else {
1717
switch (_button) do {
1818
case ("options"): { true };
19-
case ("remarks"): { (!isNil "A3A_enableRemarks" && {A3A_enableRemarks > 0})};
19+
case ("remarks"): { (!isNil "A3A_useRemarks" && {A3A_useRemarks > 0})};
2020
default { true };
2121
};
2222
};

A3A/addons/gui/functions/roleSelect/fn_roleSelectDialog.sqf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ switch (_mode) do
8484

8585
private _imagePath = format ["x\A3A\addons\GUI\dialogues\textures\banner_%1.jpg",_roleName];
8686
_bannerImage ctrlSetText _imagePath;
87-
private _currentCount = {_x getVariable ["A3A_Role", "none"] == _roleName} count allPlayers;
87+
private _currentPlayers = allPlayers select {_x getVariable ["A3A_Role", "none"] == _roleName};
88+
private _currentCount = count _currentPlayers;
8889
private _maxCount = [_roleName] call FUNCMAIN(getRoleCap);
8990
private _firstLineText = localize format ["STR_antistasi_dialogs_roleselect_info_%1", _roleName];
9091
private _secondLineText = localize format ["STR_antistasi_dialogs_roleselect_utility_%1", _roleName];
@@ -107,6 +108,11 @@ switch (_mode) do
107108
_slotExplanation = localize "STR_antistasi_dialogs_roleselect_capExplanationCommander";
108109
};
109110
};
111+
if (_roleName != "commander" && (_currentCount > 0)) then {
112+
private _playerList = _currentPlayers apply {name _x};
113+
private _formattedList = ([localize "STR_antistasi_dialogs_roleselect_capNames"] + _playerList) joinString "\n";
114+
_slotExplanation = [_slotExplanation, _formattedList] joinString "\n\n";
115+
};
110116
if ((_currentCount >= _maxCount || (_roleName == "commander")) && {_roleName != "rifleman"}) then {
111117
_setRoleButton ctrlEnable false;
112118
if (_roleName == "commander") then {

0 commit comments

Comments
 (0)