227 Commits

Author SHA1 Message Date
Simon Clark
995a89d370 Add initial version of the unit info window.
DCS features a massive range of aircraft and land vehicles, and not all of them make their role(s) clear just from the name alone. What this commit does is add an "information" button (and resultant window) to the recruitment section. This should allow new players to understand what each unit is/does.

Current state - every aircraft has a country of origin and an introduction date for that variant. Some also have a small placeholder description, taken from ED's store page for that aircraft. There is also a placeholder picture (taken from a rejected image from my own personal photography) that will, in time, show a banner image of each unit.

Todo - add appropriate screenshots for each aircraft's banner, replace the placeholder text for each aircraft (this will take a while...) and add more data points for each unit type, such as a unit role (i.e. "air-superiority fighter", "multirole fighter", etc) or perhaps a list of weapons carried. I also haven't made a start on the huge number of ground units yet.
2021-01-18 19:27:54 +00:00
Simon Clark
24a212a987 Make the C-130 work. For real this time.
Also separate out SEAD and DEAD taskings. Some aircraft can DEAD but not SEAD.

Also make the recruitment menu use the pretty names in the alphabetical sort func.
2021-01-17 21:41:02 +00:00
Simon Clark
3282ba0302 Hercules mod has AC-130s, so CAS makes sense too. 2021-01-17 21:10:14 +00:00
Simon Clark
a4db443f93 Add the Hercules to strike tasks.
It's not strike capable per se, but can transport objects for a strike.
2021-01-17 14:56:36 +00:00
Dan Albert
1a2475dc25 Add display option for BARCAP commit range. 2021-01-16 15:15:40 -08: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
c40ad75fa2 Add DEAD to the selectable aircraft list. 2021-01-13 10:37:05 +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
Dan Albert
a1136953d0 Fix custom waypoints. 2021-01-11 20:16:23 -08:00
Simon Clark
7ae934e940 Make new flight comboboxes auto-adjust their size.
Content was previously being cut off when the first airport selected had a shorter name than the one the player wanted.
2021-01-08 22:52:21 +00:00
Simon Clark
0bfd766a0b Make the base capture cheat also toggleable.
Also changelog.
2021-01-07 23:04:33 +00:00
Simon Clark
591c62b6d5 Make frontline advance/retreat cheats optional.
This can now be toggled on and off in the cheats menu.
2021-01-07 17:46:06 +00: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
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
a6dc3d2aff Handle threat/detection per group.
Some SAMs have multiple groups (such as an SA-10 group with its
accompanying SA-15 and SA-19 groups). This shows each group's threat and
detection separately on the map, and also makes it so that an SA-10 with
dead radars will no longer contribute to the threat zone just because
the shilka next to it still has a functioning radar.

https://github.com/Khopa/dcs_liberation/issues/647
Fixes https://github.com/Khopa/dcs_liberation/issues/672
2020-12-26 15:52:36 -08:00
Dan Albert
17dd1b193e Remove aa_ranges in favor of using the TGO data. 2020-12-26 15:25:23 -08:00
Dan Albert
8be2841bdf Fix New Package for naval control points.
Also reordered the tasks so ship-specific tasks appear first.

Fixes https://github.com/Khopa/dcs_liberation/issues/628
2020-12-26 14:30:26 -08:00
Dan Albert
3bdf1377c0 Flesh out intel displays.
* Add enemy air and ground unit reports.
* Changes the summary to be a comparison of relative strengths rather
  than raw enemy numbers.

Fixes https://github.com/Khopa/dcs_liberation/issues/658
2020-12-25 16:08:02 -08:00
Dan Albert
1d76ee4871 Add basic intel window.
Currently only shows the enemy's economic information.

https://github.com/Khopa/dcs_liberation/issues/658
2020-12-25 03:24:33 -08:00
Dan Albert
b53cac4c7a Add basic enemy intel widget.
https://github.com/Khopa/dcs_liberation/issues/658
2020-12-25 01:38:14 -08:00
Dan Albert
b9138acbc8 Use shapely projection instead of brute force.
Converts the landmap to use MultiPolygon instead of a collection of
polygons, since Shapely has explicit support for this.

Because we've done that, we can use a single projection from a line
instead of brute forcing the extent of the front line.

This makes turn processing ~66% faster (3 seconds to 1.8).

There are probably other places this should be used.
2020-12-24 01:20:15 -08:00
Dan Albert
2a65916f7c Log time taken in turn processing. 2020-12-24 00:53:36 -08:00
Dan Albert
8c1ebfda02 Show ASAP TOT for debug view flights. 2020-12-23 21:42:13 -08:00
Dan Albert
91d9bbdc97 Add visual debugging for other fligth plans. 2020-12-23 17:31:04 -08:00
Dan Albert
575f4e1786 Clean up debug display options. 2020-12-23 17:19:57 -08:00
Dan Albert
bff905fae5 Use navmeshes to improve TARCAP flight plans.
Started with TARCAP because they're simple, but will follow and extend
this to the other flight plans next.

This works by building navigation meshes (navmeshes) of the theater
based on the threat regions. A navmesh is created for each faction to
allow the unique pathing around each side's threats. Navmeshes are built
such that there are nav edges around threat zones to allow the planner
to pick waypoints that (slightly) route around threats before
approaching the target.

Using the navmesh, routes are found using A*. Performance appears
adequate, and could probably be improved with a cache if needed since
the small number of origin points means many flights will share portions
of their flight paths.

This adds a few visual debugging tools to the map. They're disabled by
default, but changing the local `debug` variable in `DisplayOptions` to
`True` will make them appear in the display options menu. These are:

* Display navmeshes (red and blue). Displaying either navmesh will draw
  each navmesh polygon on the map view and highlight the mesh that
  contains the cursor. Neighbors are indicated by a small yellow line
  pointing from the center of the polygon's edge/vertext that is shared
  with its neighbor toward the centroid of the zone.
* Shortest path from control point to mouse location. The first control
  point for the selected faction is arbitrarily selected, and the
  shortest path from that control point to the mouse cursor will be
  drawn on the map.
* TARCAP plan near mouse location. A TARCAP will be planned from the
  faction's first control point to the target nearest the mouse cursor.

https://github.com/Khopa/dcs_liberation/issues/292
2020-12-23 17:09:34 -08:00
Khopa
b0ad664ece Merge branch 'develop_2_3_x' into develop
# Conflicts:
#	changelog.md
#	game/procurement.py
#	resources/factions/iraq_1991.json
2020-12-22 23:32:06 +01:00
Khopa
12bf26223d Added shorad units on frontline 2020-12-22 23:23:32 +01:00
Dan Albert
56d7993c8f Improve threat zone display options. 2020-12-22 13:57:05 -08:00
Dan Albert
86558bdef6 Add threat zone modeling.
Creates threat zones around airfields and non-trivial air defenses (it's
not worth dodging anything with a threat range under 3nm). These threat
zones can be used to aid mission planning and waypoint placement.

https://github.com/Khopa/dcs_liberation/issues/292
2020-12-22 13:12:04 -08: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
Khopa
feed55186f Migrated "polygon" code to shapely 2020-12-12 02:31:43 +01:00
Khopa
9d774eaad8 Fixed culling display distance. Allowed smaller distance for culling (useful for WW2 maps) 2020-12-11 22:39:09 +01:00
Dan Albert
f659dc1f76 Reference point rework.
* Introduce a real type.
* Rewrite _transform_point to make use of Point.
* Add shift modifier for large (10 pixel) adjustements to reference
  points. Unmodified behavior is now single pixel.
* Use WASD for moving the second point (shift modified numpad keys don't
  seem to work).
* Add a debug option to draw transformed reference points to check for
  errors. If they don't overlap, something is wrong.
* Cleaned up all the existing reference points. Caucasus in particular
  is now *much* better.

As an added bonus, the cleanup for carrier movement projection now also
shows an invalid destination when the destination is on land.
2020-12-10 21:08:38 -08:00
Khopa
8137d57cdf Dev : Improved Reference point setup mode, made it easier to setup point with polygon map appearing as transparent overlay, and displaying reference points on the map [Press Shift+R to toggle the mode]) 2020-12-11 00:08:08 +01:00
Khopa
1258f3e17c Carrier and Tarawa are now fully moveable 2020-12-10 00:13:34 +01:00
Khopa
c74e18e449 Target positions for ship movement are now properly projected on DCS game X,Y plane 2020-12-09 22:55:11 +01:00
Dan Albert
e0223ded54 Fix display of AA ranges for most ship types.
Fixes https://github.com/Khopa/dcs_liberation/issues/390
2020-12-06 14:22:33 -08:00
Khopa
2012ad0aa3 Fixed cursor / single click behaviour on map. 2020-12-06 21:12:44 +01:00
Dan Albert
15d72a8dcb Fix turn number off by one.
Fixes https://github.com/Khopa/dcs_liberation/issues/482
2020-12-06 01:08:23 -08:00
Dan Albert
bac47dad83 Add settings for scaling income.
This adds both player and enemy income multiplier options. Note that
previously the AI was only getting 75% of their income. I've changed
that to give them their full income by default since the player can now
influence it.
2020-12-05 18:06:57 -08:00
Khopa
72ac806cb8 Possible to plan ships movements on the map (UI only) 2020-12-03 01:01:15 +01:00
walterroach
edbe2d86f2 Merge branch 'develop' into frontline_vector 2020-11-27 13:47:10 -06:00
walterroach
4e12a1cdad Rework frontline vector
Ensures frontline stays outside of exclusion zones by adjusting its
position and width

Adds a DisplayOption for viewing the frontline vector on the map
2020-11-27 13:46:53 -06:00
Ignacio Muñoz Fernandez
7fcf74a8ed added none check on budget setGame 2020-11-26 15:43:36 -08:00
Ignacio Muñoz Fernandez
a0d38f7465 fix: disable topbar buttons when game is None 2020-11-26 15:43:36 -08:00
Dan Albert
2bd673a531 Don't allow operating on broken runways.
Doesn't allow helos or harriers to do it either even though they should
be able to because we don't currently support ground spawns, which would
be needed to prevent those aircraft from using the runway. Even then, I
don't know if they can be forced to *land* vertically.

Fixes https://github.com/Khopa/dcs_liberation/issues/432
2020-11-25 18:50:00 -08:00
Ignacio Muñoz Fernandez
a1b64bc72d
Cleanup QWeatherInfoWindow and rjust wind bearings. (#456) 2020-11-25 18:10:46 -08:00
Dan Albert
ee768b9147 Display damaged runways. 2020-11-25 18:07:51 -08:00