111 Commits

Author SHA1 Message Date
Dan Albert
1d5a410bc5
Move logging_config to game.
This isn't unique to the UI, the UI is just the current caller.
2022-09-04 12:07:06 +02:00
Dan Albert
ad9686947b
Remove splash screen delay.
This has been in for a long time, so people will have seen the message
by now (and it's on our GitHub page).
2022-09-03 19:13:21 +02:00
Dan Albert
c5b50ceeae
Add campaign property for campaign start time.
This field is optional. Omitting the field (or using only a date instead
of a full timestamp) will use the old behavior of picking a random
daylight hour to start the campaign.

This doesn't include any UI in the new game wizard yet. This is only a
campaign yaml option.

https://github.com/dcs-liberation/dcs_liberation/issues/2400
2022-09-03 19:13:20 +02:00
Raffson
8dab64f4c3
Support for Su-30 mod 2022-08-14 14:45:25 +02:00
root0fall
267da47f6e Fix grammatical typo in main.py 2022-08-07 09:34:09 -07:00
Dan Albert
21199d9a24 Fix the command-line campaign generator for IADS. 2022-07-11 13:25:16 -07:00
RndName
5cdfe62e2d Implement advanced skynet functions
- factor out own class for the iadsnetwork within the conflicttheater
- This class will handle all Skynet related things - no specific group_name handling necessary in future
- make iadsbuilding own TGO class because SAM & EWRs are Vehicle Groups. IADS Elements dont have any groups attached.
- added command center, connection node and power source as Ground objects which can be added by the campaign designer
- adjust lua generator to support new iads units
- parse the campaign yaml to get the iads network information
- use the range as fallback if no yaml information was found
- complete rewrite of the skynet lua script
- allow destruction of iads network to be persistent over all rounds
- modified the presetlocation handling: the wrapper PresetLocation for PointWithHeading now stores the original name from the campaign miz to have the ability to process campaign yaml configurations based on the ground unit
- Implementation of the UI representation for the IADS Network
- Give user the option to enable or disable advanced iads
- Extended the layout system: Implement Sub task handling to support PD
2022-04-19 10:41:16 +02:00
RndName
25d0dcd08e Allow campaign designer to set default economy values
default starting money and income multiplier can be set in campaign.yaml

bumps campaign Version to 10.1
2022-04-10 10:24:25 +02:00
Dan Albert
f72b2a21f7 Remove the old map.
The new map has no open bugs.
2022-03-20 16:13:07 -07:00
Benjamin Fischer
1207b082dc another high dpi fix which fixes some resizing issues. 2022-03-12 18:40:07 -08:00
Benjamin Fischer
2c10d3f5b2 fixes #1987 by adding highdpi qt attributes. 2022-03-12 11:44:32 -08:00
Benjamin Fischer
827c68bf75 Fixes #1774 by adding a logmessage for non ascii install path. 2022-03-11 18:48:43 -08:00
Dan Albert
4053356e13 Default to the React map the default.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 02:02:25 -08:00
Dan Albert
8165d3bd8c Add support for running the build react map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:53:22 -08:00
Dan Albert
73fcfcec7b Handle map reset when the game is loaded/unloaded.
https://github.com/dcs-liberation/dcs_liberation/issues/2039

Partial fix for
https://github.com/dcs-liberation/dcs_liberation/issues/2045 (now works
in the new map, old one not fixed yet).
2022-03-05 18:02:46 -08:00
Dan Albert
2c6e8c414c Add --dev flag to put the game in developer mode.
Right now the only thing this does is remove sleeps meant to give people
time to read things that developers have already seen hundreds of times.
2022-03-05 11:24:37 -08:00
Khopa
510dcd762f 🇺🇦 Support for Ukraine 2022-03-02 17:52:47 +01:00
Dan Albert
59e98b31df Add a basic React implementation of the map.
See client/README.md for instructions.
2022-02-28 00:31:56 -08:00
Dan Albert
c16ca40894 Move waypoints and commit boundaries to FastAPI. 2022-02-20 13:30:36 -08:00
Dan Albert
b4742ad54c Move faction cache out of db.py. 2022-02-18 17:58:34 -08:00
Dan Albert
e3ee988225 Move mod vehicle registration to a decorator.
This cruft doesn't need to be in game.db, it can be kept with the mod
support code.
2022-02-18 12:54:41 -08:00
Dan Albert
21f7912458 Add websocket event stream for sim updates.
As a proof of concept this only covers the flight positions.
2022-02-16 01:34:56 -08:00
Dan Albert
350f08be2f Add FastAPI interface between the game and map.
A possible explanation for the infrequent CTDs we've been seeing since
adding fast forward is that QWebChannel doesn't keep a reference to the
python objects that it passes to js, so if the object is GC'd before the
front end is done with it, it crashes.

We don't really like QWebChannel anyway, so this begins replacing that
with FastAPI.
2022-02-15 18:14:34 -08:00
RndName
93a0db3112
Add otion to ignore the empty install dir warning message
Adds a do not show again checkbox to the empty install dir warning popup on lib start. This only appears when the install dir is empty to prevent mission scripting replacement.

Also adds a warning message to the log when the dir is empty. Will help to identify this in bug reports.
2022-01-22 13:13:18 +01:00
MetalStormGhost
88bc4fd852
F-104 mod support. 2021-12-22 13:01:51 -08:00
Dan Albert
2a75d14e0e Revert upgrade to pyside6.
This appears to be incompatible with pyinstaller. I get the following
when trying to run the executable generated with pyside6:

```
Traceback (most recent call last):
  File "qt_ui\main.py", line 29, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "qt_ui\windows\QLiberationWindow.py", line 28, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "qt_ui\widgets\map\QLiberationMap.py", line 11, in <module>
ImportError: could not import module 'PySide6.QtPrintSupport'
```
2021-11-21 17:39:43 -08:00
Dan Albert
4a7dae9cc2 Upgrade to PySide6.
PySide2 renamed to PySide6 for Qt 6 support. It doesn't seem like
PySide2 is getting a 3.10 wheel, so upgrade to Qt 6 to prep for that.
2021-11-20 19:26:18 -08:00
Dan Albert
12f420f50e Pre-emptive Python 3.10 compat.
Iterator is no longer exposed directly in collections, but is in
collections.abc.
2021-11-20 18:49:14 -08:00
Dan Albert
c2e5cba061 Implement manual squadron transfers.
Lightly tested but seems to work fine.

https://github.com/dcs-liberation/dcs_liberation/issues/1145
2021-08-29 16:21:54 -07:00
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
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
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
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
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
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
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
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
Chris Seagraves
d99f8fef09
Update main.py (#1382) 2021-06-29 18:19:37 -04:00
Dan Albert
47e038c9fa Fix command line campaign generator. 2021-06-20 23:46:06 -07:00
Simon Clark
963ab38b2e Refactor the mod select changes, re-add accidentally deleted factions. 2021-06-21 01:16:48 +01:00
Simon Clark
11069cc219 Make mod selection nicer and deprecate MB-339.
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.
2021-06-21 01:16:41 +01:00
Dan Albert
30f6220c3e Remove the old map. 2021-05-30 19:57:14 -07:00
Dan Albert
748a752e29 Fix pydcs loadout cache for command line launcher. 2021-05-27 19:58:45 -07:00
Dan Albert
e49da6afd6 Inject the saved games path from preferences.
pydcs can't guess the saved games path accurately for all users, so
inject the path that they've told us is correct to work around that.

It seems pydcs has two problems:

1. Only `DCS` is checked, not `DCS.openbeta`.
2. Only `%USERPROFILE%/Saved Games` is used, so if the user has moved
   their Saved Games directory (but not their whole user profile) pydcs
   cannot find the location.

https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid would
be the starting place for fixing problem 2 properly. 1 is just a matter
of trying both.
2021-05-26 16:02:54 -07:00
Dan Albert
a4fbcd2d02 Update pydcs for loadout loading fix. 2021-05-23 13:07:16 -07:00
Dan Albert
f4b64370bb Remove fallback for old non-convoy behavior. 2021-05-18 19:21:43 -07:00
Dan Albert
5050914d25 Make the new UI the default. 2021-05-15 03:38:29 -07:00
Dan Albert
3c5f1f7c4b Log python version at startup. 2021-05-13 19:16:54 -07:00