improoove

This commit is contained in:
xbl
2025-12-23 22:13:52 +01:00
parent 324d9c6a86
commit 61a9425650
4 changed files with 11 additions and 3 deletions

View File

@ -361,7 +361,9 @@ def main_loop(screen):
if '------- Game Initialization -------' in message or 'Game Initialization' in message:
logger.info('Game initialization detected - refreshing server info')
ui.print_message("^6New Game - Refreshing Server Info^7\n")
timestamp = time.strftime('%H:%M:%S')
ui.print_message(f"^3[^7{timestamp}^3] ^0^3Game initialized - Refreshing server info^9^7\n")
rcon.send_command(b'qlx_serverBrandName')
rcon.send_command(b'g_factoryTitle')

View File

@ -52,6 +52,9 @@ class EventParser:
event_type = event['TYPE']
data = event['DATA']
if 'WARMUP' in data:
self.game_state.server_info.warmup = data['WARMUP']
# Route to appropriate handler
handler_map = {
'PLAYER_SWITCHTEAM': self._handle_switchteam,

View File

@ -28,6 +28,7 @@ class ServerInfo:
self.blue_score = 0
self.players = []
self.last_update = 0
self.warmup = False
def is_team_mode(self):
"""Check if current gametype is a team mode"""

6
ui.py
View File

@ -219,7 +219,8 @@ class UIManager:
teams = game_state.player_tracker.get_players_by_team()
if server_info.gametype in TEAM_MODES:
print_colored(self.info_window, f"^0^1(RED) ^4(BLUE) ^3(SPEC)^9\n", 0)
warmup_display = "^3Warmup: ^2YES^9" if server_info.warmup else "^3Warmup: ^1NO^9"
print_colored(self.info_window, f"^0^1(RED) ^4(BLUE) ^3(SPEC) {warmup_display}\n", 0)
red_players = teams['RED'][:4]
blue_players = teams['BLUE'][:4]
@ -243,7 +244,8 @@ class UIManager:
line = f"^0{red}^9{' ' * red_pad}^0{blue}^9{' ' * blue_pad}^0{spec}^9\n"
print_colored(self.info_window, line, 0)
else:
print_colored(self.info_window, f"^0^3(FREE)\n", 0)
warmup_display = "^3Warmup: ^2YES^9" if server_info.warmup else "^3Warmup: ^1NO^9"
print_colored(self.info_window, f"^0^3(FREE) {warmup_display}\n", 0)
free_players = teams['FREE'][:4]
for player in free_players:
print_colored(self.info_window, f"^0{player}^9\n", 0)