Skip to content
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

Roles: Improved wheel menu role selection. #179

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Comment on lines -95 to -97
Copy link
Contributor Author

@dijksterhuis dijksterhuis Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are handled by the call to vn_mf_fnc_change_team within para_player_init_server.sqf

after a double check, this might cause an issue for missions if player spawn location when joining a server is not in range of a duty officer?

// ./mission/functions/core/teams/fn_change_team.sqf
// ...
if (vn_mf_duty_officers inAreaArray [getPos _player, 20, 20, 0, false, 20] isEqualTo []) exitWith {
        ["TaskFailed",["","STR_vn_mf_needdutyofficer"]] remoteExecCall ["para_c_fnc_show_notification",_player];
        false
};

[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