This includes the basics that we need to get type checking for pydcs
calls.
Type checking has been disabled in a few monkey-patching cases. Patches
ought to be sent upstream (or in the case of dead unit tracking,
replaced with a better model).
(cherry picked from commit 9de08dc83ff1ed30b15f5c7acc21da316fce9b6b)
This is as much as we can do until pydcs actually adds the py.typed
file. Once that's added there are a few ugly monkey patching corners
that will just need `# type: ignore` for now, but we can't pre-add those
since we have mypy warning us about superfluous ignore comments.
(cherry picked from commit 96c7b87ac7ef9382ffad9c3b5846fd8c0df8b0a2)
By default mypy doesn't type check the code within an untyped function.
This enables that and fixes typing errors to accomodate it.
This did uncover a very old bug:
https://github.com/dcs-liberation/dcs_liberation/issues/1417
(cherry picked from commit fc32b983413dd741a23d33db6da89ddcba7bed64)
The loadout case actually could (and previously did) hide bugs from the
type checker, since mypy was smart enough to see that we were removing
None from the input it assumed that the member was non-optional, but
later modifications could cause null values, and since those came from
the UI mypy couldn't reason about this. This meant that mypy assumed the
type could not be optional and wouldn't check that case.
(cherry picked from commit 299ed88f09d506df1a10e5454b237263e5cbeeab)
* Implements #1399
* Reverting accidental change in generate_landmap.py
* Changelog update
* Import beacon data for Marianas.
Co-authored-by: Dan Albert <dan@gingerhq.net>
(cherry picked from commit aa328d3ef715bd86180b29d8784ae9040d51aec6)
Aircraft that have no loadouts at all (such as the IL-78M) will have no
loadouts and thus no values in the dropdown menu. If the player toggles
the custom layout box we reset the flight's loadout to the selected
loadout, and with no loadouts in the combo box that is None, and
`Flight.loadout` isn't supposed to be optional.
Check for that case in the loadout selector and replace with an empty
loadout if that happens.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1402
(cherry picked from commit 727facfb90dac06c3eb74b90e0296a097fae79a3)
The prices are only estimations due to randomization. the real price will be only known when the generator was used and the final units are known
(cherry picked from commit b2db27f9aa06ddbeb6c9e87686abb04cd2f2bb16)
prices will now be calculated for the whole group by the generator by
looking up the price using the GroundUnitType wrapper
fixes#1163
(cherry picked from commit 96be6c0efe4b6b0f3af38bf5c43a9818e1eed4e6)
- added information about the role of the aa site
- moved handling of ground name from tgo to the sam generator to make the tgo cleaner
- adjusted the skynet-config lua to the changes
(cherry picked from commit de443fa3f0ac7ab2d450ec097cf7ac94f17f3506)
This doesn't currently interact very well with the auto purchase since
the procurer might by aircraft that don't have pilots available. That
should be fixed, but for the short term we should just default to not
enabling this new feature.
(cherry picked from commit 3ddfc47d3a0cbf9688c0fecbdbdf70bab6adeb9e)
If these orders can't be fulfilled for the faction it will prevent the
faction from ordering any non-reserve aircraft since transports are
given priority after reserve missions, and they'll never be fulfillable.
As such, no non-reserve aircraft will ever be purchased for factions
without transport aircraft.
Factions without transport aircraft are screwed in other ways, but this
will fix their air planning for campaigns that aren't dependent on
airlift.
(cherry picked from commit e96210f48cd88fcdd9e33e077430653b56fd0941)
Mod selection is now done via checkbox in the new game wizard.
The MB-339 is being turned into a paid module, and the free mod no longer works, so it's been removed.
This is redundant because plan_mission already checks this.
This reverts commit 3338df9836878714f8b72aeb176bed16a33eb65b.
(cherry picked from commit d0745001094d01e1bb49cb7cb6ecdf11eac7e9f8)
We were doignt his for escorts, but now that we quit planning as soon as
we find an unplannable mission (to save money for higher priority
missions), if we hit an early unplannable mission like BARCAP no other
missions wil be planned.
Maybe fixes https://github.com/dcs-liberation/dcs_liberation/issues/1228
This is an attempt to remove a lot of our supposedly unnecessary error
handling. Every aircraft should have a price, a description, a name,
etc; and none of those should require carrying around the faction's
country as context.
This moves all the data for aircraft into yaml files (only one converted
here as an example). Most of the "extended unit info" isn't actually
being read yet.
To replace the renaming of units based on the county, we instead
generate multiple types of each unit when necessary. The CF-18 is just
as much a first-class type as the F/A-18 is.
This doesn't work in its current state because it does break all the
existing names for aircraft that are used in the faction and squadron
files, and we no longer let those errors go as a warning. It will be an
annoying one time switch, but it allows us to define the names that get
used in these files instead of being sensitive to changes as they happen
in pydcs, and allows faction designers to specifically choose, for
example, the Su-22 instead of the Su-17.
One thing not handled by this is aircraft task capability. This is
because the lists in ai_flight_planner_db.py are a priority list, and to
move it out to a yaml file we'd need to assign a weight to it that would
be used to stack rank each aircraft. That's doable, but it makes it much
more difficult to see the ordering of aircraft at a glance, and much
more annoying to move aircraft around in the priority list. I don't
think this is worth doing, and the priority lists will remain in their
own separate lists.
This includes the converted I used to convert all the old unit info and
factions to the new format. This doesn't need to live long, but we may
want to reuse it in the future so we want it in the version history.
This Pull Request lets users plan Tanker flights.
Features:
- Introduction of `Refueling` flight type.
- Tankers can be purchased at airbases and carriers.
- Tankers get planned by AI.
- Tankers are planned from airbases and at aircraft carriers.
- Tankers aim to be at high, fast, and 70 miles from the nearest threat.
(A10s won't be able to tank)
- Tankers racetrack orbit for one hour.
- Optional Tickbox to enable legacy tankers.
- S-3B Tanker added to factions.
- KC-130 MPRS added to factions.
- Kneeboard shows planned tankers, their tacans, and radios.
Limitations:
- AI doesn't know whether to plan probe and drogue or boom refueling
tankers.
- User can't choose tanker speed. Heavily loaded aircraft may have
trouble.
- User can't choose tanker altitude. A-10s will not make it to high
altitude.
Problems:
- Tanker callsigns do not increment, see attached image. (Investigated:
Need to use `FlyingType.callsign_dict`, instead of just
`FlyingType.callsign`. This seems like it might be significant work
to do.).
- Having a flight of two or more tankers only spawns one tanker.
- Let me know if you have a solution, or feel free to commit one.
https://user-images.githubusercontent.com/74509817/120909602-d7bc3680-c633-11eb-80d7-eccd4e095770.png