Skip to content

Commit

Permalink
Roles: Hide wheel menu roles already assigned to a player.
Browse files Browse the repository at this point in the history
  • Loading branch information
dijksterhuis committed Jun 18, 2024
1 parent fb22c2f commit fa65e38
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions mission/functions/core/teams/fn_force_team_change.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ publicVariable _team;
[[_team], {
[] call vn_mf_fnc_task_refresh_tasks_client;
[] call vn_mf_fnc_tr_overview_team_update;
// apply new team's traits to player
[] call vn_mf_fnc_apply_unit_traits;
// resets the duty officer wheel menus on the client
[] call vn_mf_fnc_action_trait;
}] remoteExec ["spawn", _player];

[] remoteExecCall ["vn_mf_fnc_apply_unit_traits", _player];
9 changes: 7 additions & 2 deletions mission/functions/systems/traits/fn_action_trait.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ private _airSupport = ["enable_air_support", 1] call BIS_fnc_getParamValue;
private _artySupport = ["enable_arty_support", 1] call BIS_fnc_getParamValue;
{
private _agent = _x;

// reset any existing client-side wheel menu options
// to only show currently available roles to a player
_agent setVariable ["para_wheel_menu_dyn_actions", []];

{
private _traitConfig = _x;
private _trait = configName _traitConfig;
private _traitConfig = _x;
private _trait = configName _traitConfig;
private _traitName = getText(_traitConfig >> "text");
private _image = getText(_traitConfig >> "image");
if !(_trait == "vn_artillery" && (_airSupport == 0 && _artySupport == 0)) then {
Expand Down
3 changes: 3 additions & 0 deletions mission/functions/systems/traits/fn_settrait.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@ if !(vn_mf_duty_officers inAreaArray [getPos _player, 20, 20, 0, false, 20] isEq
};

[_trait,_allowed] call BIS_fnc_log;

// reset the duty officer wheel menu on the client
[] remoteExecCall ["vn_mf_fnc_action_trait",_player];
};
3 changes: 0 additions & 3 deletions mission/para_player_init_client.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ progressLoadingScreen 1.0;
//Setup teleporters
call vn_mf_fnc_action_teleport;

call vn_mf_fnc_apply_unit_traits;

call vn_mf_fnc_action_trait;
[parseText format["<t font='tt2020base_vn' color='#F5F2D0'>%1</t>",localize "STR_vn_mf_loading10"]] call vn_mf_fnc_update_loading_screen;

// apply health effects
Expand Down

0 comments on commit fa65e38

Please sign in to comment.