821 Commits

Author SHA1 Message Date
Dan Albert
4715773bba Store the owning coalition in ControlPoint.
This is needed fairly often, and we have a lot of Game being passed
around to ControlPoint methods specifically to support this. Just store
the owning Coalition directly in the ControlPoint to clean up. I haven't
cleaned up *every* API here, but did that aircraft allocations as an
example.
2021-08-28 16:40:55 -07:00
Dan Albert
4423288a53 Assign aircraft to squadrons rather than bases.
This is needed to support the upcoming squadron transfers, since
squadrons need to bring their aircraft with them.

https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-15 17:42:56 -07:00
Dan Albert
9768fb3493 Add base selection UI to startup.
https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-14 21:46:27 -07:00
Dan Albert
90ad1f4a61 Change squadrons to operate out of a single base.
https://github.com/dcs-liberation/dcs_liberation/issues/1145

Currently this is fixed at the start of the campaign. The squadron
locations are defined by the campaign file.

Follow up work:

* Track aircraft ownership per-squadron rather than per-airbase.
* UI for relocating squadrons.
* Ferry missions for squadrons that are relocating.
* Auto-relocation (probably only for retreat handling).

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1138
2021-08-14 21:46:27 -07:00
Dan Albert
d2e22ef8bf More campaign loader cleanup. 2021-08-14 13:39:27 -07:00
Magnus Wolffelt
103675e5bb
Make some paths cross-platform compatible (#1543)
* Make some paths cross-platform compatible

* Fix lint error for Path
2021-08-14 21:45:23 +02:00
RndName
b5b0d82a1a
Open all files with utf-8 encoding
- will not be used for binary read/writes (rb,wb)!
- prevents a bug where units with special characters in the unit name can not be tracked anymore as there will be a name mismatch due to wrong encoding
2021-08-14 13:10:43 +02:00
RndName
adeebbc422
Enable sell button according to available aircraft
also added a tooltip which gives the user the hint that maybe the aircraft is assigned to mission and therefore the button is disabled
2021-08-12 22:06:48 +02:00
Dan Albert
88d52003b3 Allow using yaml for campaign definitions.
JSON continues to be supported as well. No additional work needed here,
just needed to allow both.
2021-08-10 18:21:52 -07:00
Dan Albert
91daabc9d2 Fixup auto-assignable tasks when limits change.
The air wing config was fixing the main `mission_types` field, but the
`auto_assignable_mission_types` property had already been set. Update
that field whenever the `mission_types` are changed.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1515
2021-08-07 14:04:32 -07:00
Kangwook Lee
def5454e5f Add battle damage assessment option 2021-08-07 13:11:10 -07:00
Kangwook Lee
74e6226d13 Fix typo 2021-08-07 13:03:13 -07:00
Kangwook Lee
5cbf8db272 Add QLogsWindow 2021-08-01 15:42:14 -07:00
Kangwook Lee
6ee0c7600b Add HookableInMemoryHandler logging handler 2021-08-01 15:42:14 -07:00
RndName
67fa4a8910
fix generation of empty transfer during cp capture
when a cp capture happens and the next cp has pending unit deliveries then they will be redeployed to the newly captured cp. The redeploy was drecreasing the num of pending unit deliveries for the old cp but was not removing them completly from the dict when all were removed
2021-07-25 15:24:16 +02:00
bgreman
91d430085e
Addresses #478, adding a heading class to represent headings and angles (#1387)
* Addresses #478, adding a heading class to represent headings and angles
Removed some unused code

* Fixing bad merge

* Formatting

* Fixing type issues and other merge resolution misses
2021-07-21 10:29:37 -04:00
Dan Albert
fab550157a Add a per-aircraft weapon linter.
Run with `main.py lint-weapons $AIRCRAFT` to show all the weapons the
aircraft can carry that do not have data.
2021-07-19 20:07:58 -07:00
Dan Albert
e87aa83666 Add CLI generator options for date restrictions. 2021-07-19 16:27:20 -07:00
Dan Albert
0eb8ec70d9 Make opfor airwing configurable. 2021-07-18 16:09:20 -07:00
Dan Albert
270f87f193 Add per-aircraft tabs to air wing configuration. 2021-07-18 15:49:58 -07:00
Dan Albert
e22e8669e1 Add fallback locations for join zones.
It's rare with the current 5NM buffer around the origin, but if we use
the hold distance as the buffer like we maybe should it's possible for
the preferred join locations to fall entirely within the home zone. In
that case, fall back to a location within the max-turn-zone that's
outside the home zone and is nearest the IP.
2021-07-18 14:52:12 -07:00
Dan Albert
9bb8e00c3d Allow configuration of the air wing at game start.
After completing the new game wizard but before initializing turn 0,
open a dialog to allow the player to customize their air wing. With this
they can remove squadrons from the game, rename them, add players, or
change allowed mission types. *Adding* squadrons is not currently
supported, nor is changing the squadron's livery (the data in pydcs is
an arbitrary class hierarchy that can't be safely indexed by country).

This only applies to the blue air wing for now.

Future improvements:

* Add squadron button.
* Collapse disable squadrons to declutter?
* Tabs on the side like the settings dialog to group by aircraft type.
* Top tab bar to switch between red and blue air wings.
2021-07-17 14:29:04 -07:00
Dan Albert
82cca0a602 [3/3] Rework hold points. 2021-07-15 23:21:56 -07:00
Dan Albert
d444d716f5 [2/3] Improve join point placement. 2021-07-15 23:18:10 -07:00
Dan Albert
e03d710d53 [1/3] Rework IP placement.
Test cases:

1. Target is not threatened.

   The IP should be placed on a direct heading from the origin to the
   target at the max ingress distance, or very near the origin airfield
   if the airfield is closer to the target than the IP distance.

2. Unthreatened home zone, max IP between origin and target, safe
   locations available for IP.

   The IP should be placed in LAR at the closest point to home.

3. Unthreatened home zone, origin within LAR, safe locations available
   for IP.

   The IP should be placed near the origin airfield to prevent
   backtracking more than needed.

4. Unthreatened home zone, origin entirely nearer the target than LAR,
   safe locations available for IP.

   The IP should be placed in LAR as close as possible to the origin.

5. Threatened home zone, safe locations available for IP.

   The IP should be placed in LAR as close as possible to the origin.

6. No safe IP.

   The IP should be placed in LAR at the point nearest the threat
   boundary.
2021-07-15 23:18:10 -07:00
RndName
62036a273e allow user to set empty dcs install dir
This will allow expert users to disable the automatic MissionScripting.lua replacement. There are many warnings and errors which have to be ignored to achieve this because DCS Liberation will not work with unmodified MissionScripting.lua
2021-07-15 13:46:59 -07:00
Dan Albert
72c181a399 Fix budget mismatch in the UI.
Much of the UI was using the old budget which wasn't removed from Game
like it should have been when Coaltion was introduced. The UI displayed
(and in some cases pulled from) the starting budget rather than the real
budget.
2021-07-14 17:33:01 -07:00
Dan Albert
7648716199 Make weapon groups explicit and moddable.
The only parts of the old weapon data that worked well (didn't commonly
result in empty pylons) did this implicitly, so make the grouping
explicit.

This also moves the data out of Python and into the resources, which
both makes the data moddable and isolates us from a huge amount of
effort and a save compat break whenever ED changes weapon names.

I didn't auto migrate the old data since the old groups were not
explict and there's no way to infer the grouping. Besides, since most of
the weapons were *not* grouped, the old data did more harm than good in
my experience. I've handled the AIM-120 and AIM-7 for now, but will get
at least all the fox 3 missiles before we ship.
2021-07-14 01:04:03 -07:00
Dan Albert
a1910f49a8 Color navmesh zones based on threat. 2021-07-13 17:49:10 -07:00
Dan Albert
24f6aff8c8 Reduce mission planning dependence on Game. 2021-07-13 15:20:42 -07:00
Dan Albert
17c19d453b Factor out Coalition from Game. 2021-07-13 14:29:40 -07:00
Dan Albert
0a416ab758 Let the TheaterCommander manage front line stance.
This improves the AI behavior by choosing the stances non-randomly:

* Breakthrough will be used if the base is expected to be capturable and
  the coalition outnumbers the enemy by 20%.
* Elimination will be used if the coalition has at least as many units
  as the enemy.
* Defensive will be used if the coalition has at least half as many
  units as the enemy.
* Retreat will be used if the coalition is significantly outnumbers.

This also exposes the option to the player.
2021-07-12 21:12:02 -07:00
RndName
7229b886e0 replan opfor mission on sell or buy of tgos 2021-07-07 14:12:20 -07:00
Khopa
ec88d07ef1 Corrected some bugs preventing marianas campaigns from running 2021-07-04 19:34:58 +02:00
bgreman
aa328d3ef7
Adds Marianas Islands support (#1406)
* Implements #1399

* Reverting accidental change in generate_landmap.py

* Changelog update

* Import beacon data for Marianas.

Co-authored-by: Dan Albert <dan@gingerhq.net>
2021-07-03 14:51:26 -04:00
Dan Albert
727facfb90 Fixup None loadouts for aircraft with no loadouts.
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
2021-07-02 17:33:24 -07:00
RndName
96be6c0efe correct prices for ewr and sams
prices will now be calculated for the whole group by the generator by
looking up the price using the  GroundUnitType wrapper

fixes #1163
2021-07-02 16:46:16 -07:00
Chris Seagraves
bc2539b566 Fix for crash when clear weather.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1394
2021-07-01 20:07:01 -07:00
Dan Albert
c89416702d Revert "Revert "Add Cloud Base Altitude to Weather Display (#1371)""
This reverts commit b2dd8c68e1aa7cb9e009777cc6e6a06272496dca.
2021-07-01 20:07:01 -07:00
Dan Albert
b2dd8c68e1 Revert "Add Cloud Base Altitude to Weather Display (#1371)"
Reverting until
https://github.com/dcs-liberation/dcs_liberation/issues/1394 is
resovled.

This reverts commit f80696b7244d2eace20111dacdcb149cb4747055.
2021-07-01 20:00:08 -07:00
bgreman
7ba4077f9f
Fixes #240 by making statistics windows axis labels integers (#1370) 2021-06-30 23:50:02 -04:00
Chris Seagraves
e94d48c265
Notes to kneeboard (#1375)
Adds global-level kneeboard notes.  Explicit save compatability with 4.0.0
2021-06-30 18:07:53 -04:00
Chris Seagraves
f80696b724
Add Cloud Base Altitude to Weather Display (#1371)
Adds tooltip with cloud base altitude to weather panel
2021-06-30 15:22:14 -04:00
Chris Seagraves
5f5b5f69e3
asset reference links 😎 (#1363)
Adds urls to unit info pages that don't have data.
2021-06-30 15:04:06 -04:00
Chris Seagraves
d99f8fef09
Update main.py (#1382) 2021-06-29 18:19:37 -04:00
Simon Clark
e39f17b3de Fix begin campaign button on reload. 2021-06-26 22:43:22 +01:00
Brock Greman
34470336e4 Clarify the impact of non-cold flight starts. 2021-06-26 12:29:17 -07:00
Chris Seagraves
ffcae66f59
Include control point name in ground object info.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/498
2021-06-26 11:24:12 -07:00
Dan Albert
e6bf318cdf Fix save path for new games. 2021-06-26 10:59:58 -07:00
Chris Seagraves
b601d713d2
Use directory of current save for open/save-as. 2021-06-25 23:01:49 -07:00