-
Notifications
You must be signed in to change notification settings - Fork 27
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
base: master
Are you sure you want to change the base?
Conversation
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. |
pictures of new vs old? |
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 @ |
There was a problem hiding this 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
Would it be possible to reverse the naming schema? Something like:
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. |
private _str = ""; | ||
private _teamColor = ''; | ||
private _roleColor = ''; |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 + |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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-GVAR
d ones
There was a problem hiding this 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
/* | ||
* 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 | ||
*/ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'] + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Likely won't be worked on for at least a ~week so can be skipped for next potato update |
I've slowly been rolling each of these features into separate PRs:
|
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
Updated look and style with role labels (along with the existing icons), player color highlight to find yourself, team colors
TODO