133 Commits

Author SHA1 Message Date
Dan Albert
ac4a7441e9 Add predefined squadron support.
https://github.com/dcs-liberation/dcs_liberation/issues/276
2021-05-27 00:23:40 -07:00
Dan Albert
1b7a225f9d Replace client count with player pilots.
https://github.com/dcs-liberation/dcs_liberation/issues/276
2021-05-26 20:33:23 -07:00
Dan Albert
8b8e018521 Fix cases where pilots were not returned.
https://github.com/dcs-liberation/dcs_liberation/issues/276
2021-05-26 18:49:19 -07:00
Dan Albert
4147d2f684 Initial squadrons implementation.
Doesn't actually do anything yet, but squadrons are created for each
aircraft type and pilots will be created as needed to fill flights.

https://github.com/dcs-liberation/dcs_liberation/issues/276
2021-05-26 17:49:53 -07:00
Dan Albert
e94657875f Reselect same row after deleting waypoint. 2021-05-24 18:20:19 -07:00
Dan Albert
305d1f0523 Reset non-custom loadout when changing task. 2021-05-24 16:57:36 -07:00
Dan Albert
970f2c25dd Fix loadout reset when disabling custom loadouts. 2021-05-24 16:49:31 -07:00
Dan Albert
c3802e5a37 Make UI created packages ASAP by default. 2021-05-22 19:35:56 -07:00
Dan Albert
2df17c32cd Clean up aircraft selector. 2021-05-22 17:11:10 -07:00
Dan Albert
f63d218aae Fix loadouts to work with clean pylons. 2021-05-17 21:28:12 -07:00
Dan Albert
d41e69d770 Add DCS loadout selector.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/273.
2021-05-17 01:24:55 -07:00
Dan Albert
0e3bc1ce43 Loadout implementation cleanup.
Loadout selection no longer has two (disagreeing) implementations. What
the UI shows is now what the miz will have.

We now store the chosen layout in the Flight *always*, not just for
custom loadouts. This means that we do loadout lookups at the start of
each turn, but the data is cached in pydcs.

Era-specific loadout degradation is still done at generation (and
presentation) time. This is so that players can toggle that option and
have it affect the *current* turn, rather than the next one.
2021-05-17 01:23:00 -07:00
Dan Albert
d9d68cd37c Add a new Leaflet based map UI.
This is extremely WIP. It is not usable for play yet. Enable with
`--new-map`.
2021-05-12 21:52:23 -07:00
Khopa
977845e2f4 Fixed links to github in the repo to account for the transfer to the new github organization. 2021-05-07 13:08:39 +02:00
Dan Albert
481f195725 Airlift support.
UI isn't finished. Bulk transfers where the player doesn't care what
aircraft get used work (though they're chosen with no thought at all),
but being able to plan your own airlift flight isn't here yet.

Cargo planes are not implemented yet.

No way to view the cargo of a flight (will come with the cargo flight
planning UI).

The airlift flight/package creation should probably be moved out of the
UI and into the game code.

AI doesn't use these yet.

https://github.com/Khopa/dcs_liberation/issues/825
2021-04-22 00:30:18 -07:00
Dan Albert
157a59e3c4 Fix UI crash when unchecking default loadout.
This was throwing because it was being called with the wrong number of
arguments, preventing the UI from actually updating back to the default.
2021-04-18 13:05:22 -07:00
Khopa
5bd4c00257 Merge branch 'develop_2_4_x' into develop
# Conflicts:
#	changelog.md
#	game/db.py
#	game/navmesh.py
#	game/operation/operation.py
#	game/theater/conflicttheater.py
#	game/theater/controlpoint.py
#	game/theater/start_generator.py
#	game/theater/theatergroundobject.py
#	game/threatzones.py
#	game/version.py
#	gen/aircraft.py
#	gen/airsupportgen.py
#	gen/fleet/carrier_group.py
#	gen/flights/ai_flight_planner.py
#	gen/flights/ai_flight_planner_db.py
#	gen/flights/flightplan.py
#	gen/flights/waypointbuilder.py
#	gen/groundobjectsgen.py
#	gen/kneeboard.py
#	pydcs
#	pydcs_extensions/f22a/f22a.py
#	qt_ui/uiconstants.py
#	qt_ui/widgets/combos/QAircraftTypeSelector.py
#	qt_ui/widgets/map/QLiberationMap.py
#	qt_ui/windows/QUnitInfoWindow.py
#	qt_ui/windows/mission/flight/payload/QPylonEditor.py
#	qt_ui/windows/settings/QSettingsWindow.py
2021-03-21 18:50:50 +01:00
Khopa
58d5aa9944 Fixes : Missing weapons names would cause flight edition window to crash while setting up default loadout UI, preventing the user from editing flights. 2021-02-26 23:30:23 +01:00
Khopa
523ef08697 Ran black reformater on 2.4x branch 2021-02-22 20:55:51 +01:00
Dan Albert
a47bef1f13 Blacken. 2021-02-12 20:10:45 -08:00
Dan Albert
d56c2f7a50 Allow editing the arrival/diver airfield.
Fixes https://github.com/Khopa/dcs_liberation/issues/810
2021-01-31 14:26:14 -08:00
Dan Albert
944a8e9cd6 Allow selecting start type when creating flights. 2021-01-30 16:16:04 -08:00
Dan Albert
34d4ecd4e6 Add an option for default start type.
Changing this completely breaks OCA/Aircraft missions, but if the player
doesn't care about those this can reduce airfield congestion. The UI
warns about this.

This also makes the AI start type selectable in the flight UI.

Fixes https://github.com/Khopa/dcs_liberation/issues/387
Fixes https://github.com/Khopa/dcs_liberation/issues/729
2021-01-30 15:04:23 -08:00
Dan Albert
5047b535c4 Make ASAP a checkbox and maintain ASAP on changes.
Fixes https://github.com/Khopa/dcs_liberation/issues/642
2021-01-30 13:33:39 -08:00
Simon Clark
6217075adc Add mission planning docs link to TOT field.
Completes: #696
2021-01-30 01:12:59 +00:00
Simon Clark
883f233c09 Adds WIP handling for default payload display with restricted date feature enabled. 2021-01-30 01:00:40 +00:00
Simon Clark
b80aad7449 Link custom theater/faction/loadout docs in UI.
Contributes-to: #614
2021-01-30 00:19:29 +00:00
Simon Clark
1e1cebc3fc Display a "No aircraft available" message.
If in the create flight dialog, there are no suitable aircraft for a task, or no aircraft left at all, a suitable message is now shown that prevents the user from creating a flight.

Also adds in a quick "remember what plane the user had selected last" feature.
2021-01-13 12:11:53 +00:00
Simon Clark
727ec6bc28 Filter mission types by aircraft.
First stab at implementing #392.
You can now only select aircraft types that can do the selected task.
2021-01-12 18:58:29 +00:00
Simon Clark
7269dbb79d Edit Flight window is now dynamically sized.
This means that the waypoint names no longer get cut off.

Contributes-to: Khopa/dcs_liberation#754
2021-01-10 13:07:02 +00:00
Simon Clark
64b2eeface Stop loadout resetting each time the editor opens. 2021-01-08 10:22:56 +00:00
Simon Clark
558dc591a3 Made the payload editor more user-friendly.
A user can now modify the existing default loadout, rather than starting from scratch.

Also adds WIP handling for removed pylons, which looks like it may need some PyDCS work.

Also fixes the F-14B default loadouts for everything OTHER than fighter sweep again.
2021-01-08 09:42:09 +00:00
Simon Clark
7085bce6d4 Add support for some extra loadout types.
Also fixes the bug that @Starfire13 spotted in Khopa/dcs_liberation#744.
2021-01-07 13:37:16 +00:00
Simon Clark
a654c8229a Make the default loadout code more resilient.
It can now cope with the payload overrides defined in the db.
2021-01-07 11:31:46 +00:00
Simon Clark
f2e35c185b Displays the default loadout in the payload UI.
The default loadout is now displayed whenever the custom loadout checkbox is unchecked.

The custom loadout is reset when the custom loadout is checked, to force the user to be prescriptive about the loadout.

Contributes-to: Khopa/dcs_liberation#725
2021-01-07 01:45:45 -08:00
Simon Clark
c740c8304b
Adds prettier user-facing aircraft names. (#726)
This makes the names of the aircraft displayed to the player in the UI more verbose and readable.

It allows allows specific countries to display an aircraft's name differently. An example of this would be the JF-17 Thunder, which is known in China as the FC-1 Fierce Dragon - this now displays correctly in the Liberation UI.
2021-01-05 13:21:38 -08:00
Dan Albert
34945e7eba Add date-based loadout restriction.
Follow up work:

* Data entry. I plan to do the air-to-air missiles in the near term. I
  covered some variants of the AIM-120, AIM-7, and AIM-9 here, but there
  are variants of those weapons for each mounting rack that need to be
  done still, as well as all the non-US weapons.
* Arbitrary start dates.

https://github.com/Khopa/dcs_liberation/issues/490
2021-01-04 15:13:40 -08:00
Dan Albert
507b217065 Clean up custom loadout interface.
Wraps the pydcs data in a real type so we don't need to spread the
reflection all over.
2021-01-04 15:13:40 -08:00
walterroach
d7e48662e0 Add custom flight names
Mildly breaks save compat with 2.3; All existing flight dialogs will be
broken, passing the turn or recreating all the flights in the UI will
allow you to continue
2020-12-28 10:52:25 -06:00
Dan Albert
2ac818dcdd Convert to new unit APIs, remove old APIs.
There are probably plenty of raw ints around that never used the old
conversion APIs, but we'll just need to fix those when we see them.

Fixes https://github.com/Khopa/dcs_liberation/issues/558
2020-12-19 22:08:57 -08:00
Dan Albert
113947b9f0 Add types for distance and speed.
Not converting all at once so I can prove the concept. After that we'll
want to cover all the cases where an int distance or speed is a part of
the save game (I've done one of them here with `Flight.alt`) so further
cleanups don't break save compat.

https://github.com/Khopa/dcs_liberation/issues/558
2020-12-19 21:07:55 -08:00
Dan Albert
745dfc71bc Improve TOT planning.
Moves all TOT planning into the FlightPlan to clean up specialized
behavior and improve planning characteristics.

The important part of this change is that flights are now planning to
the mission time for their flight rather than the package as a whole.
For example, a TARCAP is planned based on the time from startup to the
patrol point, a sweep is planned based on the time from startup to the
sween end point, and a strike flight is planned based on the time from
startup to the target location. TOT offsets can be handled within the
flight plan.

As another benefit of theis cleanup, flights without hold points no
longer account for the hold time in their planning, so those flights are
planned to reach their targets sooner.

As a follow up TotEstimator can be removed, but I want to keep this low
impact for 2.3.2.

Fixes https://github.com/Khopa/dcs_liberation/issues/593
2020-12-19 11:20:16 -08:00
Dan Albert
296e6e8e8f Fix adding custom waypoints.
Fixes https://github.com/Khopa/dcs_liberation/issues/604
2020-12-17 16:21:31 -08:00
Dan Albert
1848338ef7 Fix UI exception for custom flight plans. 2020-12-12 18:27:30 -08:00
Dan Albert
07e5c568c4 Show takeoff time in waypoint list.
https://github.com/Khopa/dcs_liberation/issues/536
2020-12-12 13:22:23 -08:00
Dan Albert
b0b9c1c8e6 Fix deletion of waypoints.
`FlightPlan.waypoints` returns a list created from the iterator now, so
removing items from that list does not actually alter the flight plan.

Fixes https://github.com/Khopa/dcs_liberation/issues/489
2020-12-06 15:32:28 -08:00
Dan Albert
6e0af7c144 Fix names of tasks to not use the enum name. 2020-11-23 17:15:42 -08:00
walterroach
fc6ca162af Merge branch 'develop_2_2_x' into develop 2020-11-21 18:24:36 -06:00
Dan Albert
ae68a35a1a Remove save compat since it's breaking anyway.
Removal of old paths/names for things that no longer exist.
2020-11-20 17:06:01 -08:00
Dan Albert
a9fcfe60f4 Add arrival/divert airfield selection.
Breaks save compat because it adds new fields to `Flight` that have no
constant default. Removing all of our other save compat at the same
time.

Note that player flights with a divert point will have a nav point for
their actual landing point. This is because we place the divert point
last, and DCS won't let us have a land point anywhere but the final
waypoint. It would allow a LandingReFuAr point, but they're only
generated for player flights anyway so it doesn't really matter.

Fixes https://github.com/Khopa/dcs_liberation/issues/342
2020-11-20 16:16:00 -08:00