From 102544877d57388feffcd978f535e7fc54b4ad8e Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 20 May 2021 16:57:35 -0700 Subject: [PATCH] Fix common cases of kneeboard overflow. --- changelog.md | 1 + gen/kneeboard.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 50252a96..6ab94362 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,7 @@ Saves from 2.5 are not compatible with 3.0. * **[Campaign AI]** AI now considers Ju-88s for CAS, strike, and DEAD missions. * **[Campaign AI]** Fix purchase of aircraft by priority (the faction's list was being used as the priority list rather than the game's). * **[Flight Planner]** AI strike flight plans now include the correct target actions for building groups. +* **[Kneeboard]** ATC table overflow alleviated by wrapping long airfield names and splitting ATC frequency and channel into separate rows. * **[UI]** Added new web based map UI. This is mostly functional but many of the old display options are a WIP. Revert to the old map with --old-map. * **[UI]** Campaigns generated for an older or newer version of the game will now be marked as incompatible. They can still be played, but bugs may be present. * **[UI]** DCS loadouts are now selectable in the loadout setup menu. diff --git a/gen/kneeboard.py b/gen/kneeboard.py index 4b53d792..d650d80d 100644 --- a/gen/kneeboard.py +++ b/gen/kneeboard.py @@ -23,6 +23,7 @@ only be added per airframe, so PvP missions where each side have the same aircraft will be able to see the enemy's kneeboard for the same airframe. """ import datetime +import textwrap from collections import defaultdict from dataclasses import dataclass from pathlib import Path @@ -335,7 +336,7 @@ class BriefingPage(KneeboardPage): ils = "" return [ row_title, - runway.airfield_name, + "\n".join(textwrap.wrap(runway.airfield_name, width=24)), atc, tacan, ils, @@ -349,7 +350,7 @@ class BriefingPage(KneeboardPage): namer = AIRCRAFT_DATA[self.flight.aircraft_type.id].channel_namer channel_name = namer.channel_name(channel.radio_id, channel.channel) - return f"{channel_name} {frequency}" + return f"{channel_name}\n{frequency}" class SupportPage(KneeboardPage):