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

Conversation

dijksterhuis
Copy link
Contributor

@dijksterhuis dijksterhuis commented Jun 18, 2024

Role icons are now brightly highlighted and wheel menu option border is white when the player already has the role, wheel menu text displays "Remove XXXXXX Training" and clicking the option will remove the role from the player's traits. New notification added which indicates to the player the training has been removed successfully.

20241124010533_1

Adding a role is basically the inverse. Icons are "dull", wheel menu text shows "Add XXXXXX Training" and the "Training Complete" notification is shown.

Because players can only have one role selected at a time, there's also now "Swapping" logic when a player tries to add a new trait when they already have one selected. As before, removes the existing trait then sets the new trait as active. But now there's an explicit "Training Swapped" notification.

Wheel menu highlighted roles are are also updated after changing teams. If a team has default training roles configured, players will see those default options as highlighted and be able to remove them.

Additional changes

  • On server join, players were unable to select roles from duty officer if they had previously joined a server (required a respawn to get access). See changed line in fn_change_team.sqf.
  • Add explicit notifications for reasons why a player cannot select a role (not allowed as rolelimit in teams.hpp is set to 0; too many players have taken the role already). See here
  • Disable ability to carry over roles when switching teams -- Spike Team players could have the Engineer role if they joined Mike Force, took Engineer role, then switched back to Spike team (Spike Team have Engineer role limit of 0, which should disable the role completely for them). See fn_apply_unit_traits.sqf changes.
  • vn_mf_traits_map variable broadcast updates could be missed when pruning null/disconnected players and not subsequently updating a player's roles

Extra Screenshots

Previously selected roles now have wheel menu text explicitly indicating the option removes the role
20241124000645_1

Not allowed the training as role limit is set to zero for this team in teams.hpp
20241124011759_1

Too many players in the team already have the role (this was simulated by disabling the logic for the screenshot above, hence the 0/0 count)
20241124012027_1

@dijksterhuis dijksterhuis force-pushed the roles-improve-duty-officer-wheel-menu-role-selection branch from fd5b258 to 25dc83a Compare June 18, 2024 14:52
@dijksterhuis dijksterhuis force-pushed the roles-improve-duty-officer-wheel-menu-role-selection branch from 25dc83a to fa65e38 Compare June 18, 2024 14:53
Comment on lines -95 to -97
call vn_mf_fnc_apply_unit_traits;

call vn_mf_fnc_action_trait;
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
};

@veteran29
Copy link
Member

I think having the button in the wheel but greyed out/disabled would be better UX, keeping buttons in same place is important for muscle memory etc.

@dijksterhuis
Copy link
Contributor Author

dijksterhuis commented Oct 7, 2024

I think having the button in the wheel but greyed out/disabled would be better UX, keeping buttons in same place is important for muscle memory etc.

Hmmm. I see what you're saying.

I feel like just having it disabled / greyed out would still be confusing: "why is it grey..? why can't i select it...?"

What do you think about

  • grey it out as "disabled"
  • if the player selects it -- return a paradigm notification message with "You have already have this role / training!"

That way there's natural feedback for the user about what "greyed out" means in the wheel menu.

I'm a fan of explicit UI messages as it saves on having to write user guides.

@IceEagle132
Copy link
Contributor

I'd make the roles already assigned to the player visually distinct by either greying them out or marking them with an indicator, such as a lock icon. Additionally, when a player tries to select an already assigned role, I'd display a small pop-up or notification explaining why the role is unavailable. This way the UI remains intuitive, prevents redundancy, and provides clear feedback, enhancing overall user experience while keeping the functionality simple and responsive.

@dijksterhuis dijksterhuis changed the title Roles: Hide wheel menu roles already assigned to a player. Roles: Improved UX for wheel menu role selection. Nov 24, 2024
@dijksterhuis dijksterhuis changed the title Roles: Improved UX for wheel menu role selection. Roles: Improved wheel menu role selection. Nov 24, 2024

// save changes to array and push to all players
missionNamespace setVariable ["vn_mf_traits_map", _current_traits_map];
publicVariable "vn_mf_traits_map";
Copy link
Contributor Author

@dijksterhuis dijksterhuis Nov 24, 2024

Choose a reason for hiding this comment

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

if player was not allowed to take a role, pruning disconnected players changes to vn_mf_traits_map would not have been broadcast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants