mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add flight intra radio channel to mission briefing (#1475)
This commit is contained in:
parent
d2fe11ba6f
commit
6034c899d3
@ -136,6 +136,16 @@ def format_waypoint_time(waypoint: FlightWaypoint, depart_prefix: str) -> str:
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
def format_intra_flight_channel(flight: FlightData) -> str:
|
||||||
|
frequency = flight.intra_flight_channel
|
||||||
|
channel = flight.channel_for(frequency)
|
||||||
|
if channel is None:
|
||||||
|
return str(frequency)
|
||||||
|
|
||||||
|
channel_name = flight.aircraft_type.channel_name(channel.radio_id, channel.channel)
|
||||||
|
return f"{channel_name} ({frequency})"
|
||||||
|
|
||||||
|
|
||||||
class BriefingGenerator(MissionInfoGenerator):
|
class BriefingGenerator(MissionInfoGenerator):
|
||||||
def __init__(self, mission: Mission, game: Game):
|
def __init__(self, mission: Mission, game: Game):
|
||||||
super().__init__(mission, game)
|
super().__init__(mission, game)
|
||||||
@ -151,6 +161,7 @@ class BriefingGenerator(MissionInfoGenerator):
|
|||||||
lstrip_blocks=True,
|
lstrip_blocks=True,
|
||||||
)
|
)
|
||||||
env.filters["waypoint_timing"] = format_waypoint_time
|
env.filters["waypoint_timing"] = format_waypoint_time
|
||||||
|
env.filters["intra_flight_channel"] = format_intra_flight_channel
|
||||||
self.template = env.get_template("briefingtemplate_EN.j2")
|
self.template = env.get_template("briefingtemplate_EN.j2")
|
||||||
|
|
||||||
def generate(self) -> None:
|
def generate(self) -> None:
|
||||||
|
|||||||
@ -67,6 +67,7 @@ DCS Liberation 第 {{ game.turn }} 回合
|
|||||||
{% for flight in flights if flight.client_units %}
|
{% for flight in flights if flight.client_units %}
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{{ flight.flight_type }} {{ flight.units[0].type }} x {{flight.size}}, departing in {{ flight.departure_delay }}, {{ flight.package.target.name}}
|
{{ flight.flight_type }} {{ flight.units[0].type }} x {{flight.size}}, departing in {{ flight.departure_delay }}, {{ flight.package.target.name}}
|
||||||
|
频率 : {{ intra_flight_channel(flight) }}
|
||||||
{% for waypoint in flight.waypoints %}
|
{% for waypoint in flight.waypoints %}
|
||||||
{{ loop.index0 }} {{waypoint|waypoint_timing("Depart ")}}-- {{waypoint.name}} : {{ waypoint.description}}
|
{{ loop.index0 }} {{waypoint|waypoint_timing("Depart ")}}-- {{waypoint.name}} : {{ waypoint.description}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -67,6 +67,7 @@ Your flights:
|
|||||||
{% for flight in flights if flight.client_units %}
|
{% for flight in flights if flight.client_units %}
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{{ flight.flight_type }} {{ flight.units[0].type }} x {{ flight.size }}, departing in {{ flight.departure_delay }}, {{ flight.package.target.name}}
|
{{ flight.flight_type }} {{ flight.units[0].type }} x {{ flight.size }}, departing in {{ flight.departure_delay }}, {{ flight.package.target.name}}
|
||||||
|
Freq : {{ intra_flight_channel(flight) }}
|
||||||
{% for waypoint in flight.waypoints %}
|
{% for waypoint in flight.waypoints %}
|
||||||
{{ loop.index0 }} {{waypoint|waypoint_timing("Depart ")}}-- {{waypoint.name}} : {{ waypoint.description}}
|
{{ loop.index0 }} {{waypoint|waypoint_timing("Depart ")}}-- {{waypoint.name}} : {{ waypoint.description}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -67,6 +67,7 @@ Vols :
|
|||||||
{% for flight in flights if flight.client_units %}
|
{% for flight in flights if flight.client_units %}
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{{ flight.flight_type }} {{ flight.units[0].type }} x {{flight.size}}, départ dans {{ flight.departure_delay }}, {{ flight.package.target.name}}
|
{{ flight.flight_type }} {{ flight.units[0].type }} x {{flight.size}}, départ dans {{ flight.departure_delay }}, {{ flight.package.target.name}}
|
||||||
|
Fréq : {{ intra_flight_channel(flight) }}
|
||||||
{% for waypoint in flight.waypoints %}
|
{% for waypoint in flight.waypoints %}
|
||||||
{{ loop.index0 }} {{waypoint|waypoint_timing("Départ dans ")}}-- {{waypoint.name}} : {{ waypoint.description}}
|
{{ loop.index0 }} {{waypoint|waypoint_timing("Départ dans ")}}-- {{waypoint.name}} : {{ waypoint.description}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user