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

ORBAT Improvements (courtesy of SIA/McKendrick) #542

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kil0byt3
Copy link
Member

@kil0byt3 kil0byt3 commented Sep 9, 2024

Borrowed code with permission, plenty of tweaks to make it work with BW framework/POTATO along with customization

Adds "Refresh" button that will update ORBAT to current state

  • May be problematic as it could be a game-ified way to check which members of the player side are dead - could add check to only run during SafeStart? This feature is great for JIPs but not if it will be abused

Updated look and style with role labels (along with the existing icons), player color highlight to find yourself, team colors

TODO

  • side handling
  • Team colors don't work (?)
  • Add SafeStart check for refresh button if desired
  • confirm how it works on player death (akin to DUI?)
  • player name then role (reverse)

@lambdatiger
Copy link
Contributor

I think our current ORBAT is pretty nice. IMO, just adding the player highlight element and adding the refresh button would be a better approach.

@TheCandianVendingMachine
Copy link
Contributor

pictures of new vs old?

@kil0byt3
Copy link
Member Author

kil0byt3 commented Sep 9, 2024

Old
image

New
image

@kil0byt3
Copy link
Member Author

kil0byt3 commented Sep 9, 2024

i did have the "BluFor" bit at the start of the roles truncated, I'm not sure why that's back to being stringSplit at the @

Copy link
Contributor

@TheCandianVendingMachine TheCandianVendingMachine left a comment

Choose a reason for hiding this comment

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

per #scripting,

There is no handling for friendly/enemy sides, so needs to either not be refreshable in TvT or hide enemy sides.

we need feature parity with our current ORBAT, need to update

@AChesheireCat
Copy link
Contributor

Old

New

Would it be possible to reverse the naming schema? Something like:

[name] : BluFor Company Commander

I really prefer how easy to read the old version is - you can see the team member's name at a glance, whereas the new one is kinda cluttered in comparison.

Comment on lines +21 to +23
private _str = "";
private _teamColor = '';
private _roleColor = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

all should be '' or "", no mixing

private _roleColor = '';

{
private _sideColor = [side _x] call BIS_fnc_sideColor; // Get RGBA color value of group's side.
Copy link
Contributor

Choose a reason for hiding this comment

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

side _x -> side _x

_role = (_role splitString "@") select 0;
};

if (_x == player) then { _roleColor = '#B21A00' /* red */ } else { _roleColor = '#ffffff' /* white */ }; // Set color of player's name to red
Copy link
Contributor

Choose a reason for hiding this comment

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

player -> ACE_PLAYER? in general all of these requests are because I don't know if we want remote-controlled units to be the side for the ORBAT. If not, ignore


// Get unit's team and associated color
if (group _x == group player) then {
_teamColor = switch (assignedTeam _x) do {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we follow from this?

Copy link
Contributor

Choose a reason for hiding this comment

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

The pure colors (as done in those arrays) doesn't have good contrast on the briefing screen, I would recommend derivatives of the side color, but maybe softened a bit.

};

_roleIcon = format ["<img color='%1' image='\A3\Ui_F\Data\Map\VehicleIcons\"+ (getText(configFile >> "CfgVehicles" >> (typeOf _x) >> "icon")) + "_ca.paa' width='15' height='15'/>", _teamColor]; // Get icon of units' role from config.
_str = _str +
Copy link
Contributor

Choose a reason for hiding this comment

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

format please

_str = _str + "<br />" // Add extra line break after each group.
} forEach _allGroupsWithPlayers;

orbat = player createDiaryRecord ["Diary", ["ORBAT", "<execute expression='call potato_briefing_fnc_addOrbat;'>Refresh</execute><br></br><br></br>" + _str]]; // Add ORBAT text to diary along with "Refresh" button.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is gross, i think we can use macros to make it better? Something like this should work? (Untested)

"<execute expression='call potato_briefing_fnc_addOrbat;'>Refresh</execute><br></br><br></br>" -> QUOTE(<execute expression='call FUNC(addOrbat);'>Refresh</execute><br></br><br></br>)

_str = _str + "<br />" // Add extra line break after each group.
} forEach _allGroupsWithPlayers;

orbat = player createDiaryRecord ["Diary", ["ORBAT", "<execute expression='call potato_briefing_fnc_addOrbat;'>Refresh</execute><br></br><br></br>" + _str]]; // Add ORBAT text to diary along with "Refresh" button.
Copy link
Contributor

Choose a reason for hiding this comment

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

why use a global orbat variable? we should try to avoid in every case, especially non-GVARd ones

Copy link
Contributor

@TheCandianVendingMachine TheCandianVendingMachine left a comment

Choose a reason for hiding this comment

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

tabs -> spaces as well please

Comment on lines 1 to 6
/*
* Author: PabstMirror
* Function used to add the order of battle to player's diary
*
* Arguments:
* 0: Unit to add to the OrBat to <OBJECT>
*
* Examples:
* [player] call potato_briefing_fnc_addOrbat;
* Author: McKendrick @ SIA
* Adds "ORBAT" tab to briefing that displays a list of players by their squad and roles. Execute locally.
*
* Public: Yes
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

this is public and we completely break API. There are a handful of files this is not compatible with (see). any "public" function must maintain and work as expected between API versions

_role = (_role splitString "@") select 0;
};

if (_x == player) then { _roleColor = '#B21A00' /* red */ } else { _roleColor = '#ffffff' /* white */ }; // Set color of player's name to red

Choose a reason for hiding this comment

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

Suggested change
if (_x == player) then { _roleColor = '#B21A00' /* red */ } else { _roleColor = '#ffffff' /* white */ }; // Set color of player's name to red
if (_x == player) then { _roleColor = '#B21A00' /* red */ } else { _roleColor = '#A9A9A9' /* dark medium gray */ }; // Set color of player's name to red

Change color for better contrast with player names

_roleIcon +
" " +
format ["<font color='%2' face='%3'>%1: </font>", _role, _roleColor, 'PuristaBold'] +
format ["<font color='%2' face='%3'>%1</font>", (name _x), _teamColor, 'PuristaLight'] +

Choose a reason for hiding this comment

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

Suggested change
format ["<font color='%2' face='%3'>%1</font>", (name _x), _teamColor, 'PuristaLight'] +
format ["<font color='%2' face='%3'>%1 : </font>", (name _x), _teamColor, 'PuristaLight'] +
format ["<font color='%2' face='%3'>%1</font>", _role, _roleColor, 'PuristaMedium'] +

Reorder to follow chesh's suggestion [name] : [role], and font change for better contrast with player names

@PabstMirror PabstMirror added this to the Ongoing milestone Sep 11, 2024
@kil0byt3
Copy link
Member Author

Likely won't be worked on for at least a ~week so can be skipped for next potato update

@lambdatiger
Copy link
Contributor

lambdatiger commented Nov 7, 2024

I've slowly been rolling each of these features into separate PRs:

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.

6 participants