Skip to content

Commit 8644394

Browse files
committed
Add team_color static method to the rendering manager
1 parent 6e6731d commit 8644394

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

rlbot/managers/rendering.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ def __init__(self, game_interface: SocketRelay):
5555
def create_color(red: int, green: int, blue: int, alpha: int = 255):
5656
return flat.Color(alpha, red, green, blue)
5757

58+
@staticmethod
59+
def team_color(team: int, alt_color: int):
60+
if team == 0:
61+
return Renderer.cyan if alt_color else Renderer.blue
62+
elif team == 1:
63+
return Renderer.red if alt_color else Renderer.orange
64+
65+
return Renderer.gray if alt_color else Renderer.white
66+
5867
@staticmethod
5968
def _get_group_id(group_id: str) -> int:
6069
return hash(str(group_id).encode("utf-8")) % MAX_INT

rlbot/version.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "5.0.0-beta.2"
1+
__version__ = "5.0.0-beta.3"
22

33

44
RESET_SEQ = "\033[0m"
@@ -15,6 +15,9 @@ def _get_color(color: int) -> str:
1515
)
1616

1717
RELEASE_NOTES = {
18+
"5.0.0-beta.3": """
19+
Add `team_color` static method to the rendering manager
20+
""",
1821
"5.0.0-beta.2": """
1922
Ensure bots don't fall behind the most recent GameTickPacket.
2023
""",

0 commit comments

Comments
 (0)