Skip to content

Commit 9b370c1

Browse files
committed
Added red and blue to the warehouse.xlsx options
1 parent bf60c5b commit 9b370c1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

plugins/mission/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ On export, the Excel file will be named `warehouse_<airport>.xlsx`, where airpor
7373
If you want to upload the warehouse information to any other airport, all you need to do is change the ICAO in its name.
7474

7575
### Upload a Warehouse Inventory to all Airbases of a Coalition
76+
If you add "RED" or "BLUE" instead of an ICAO, you can upload the warehouse inventory to all airbases of this coalition.
7677
You can also _remove_ the ICAO completely and upload a file named `warehouse.xlsx`.
7778
You will then be asked to which coalition you want to upload the warehouse inventory.
7879
Afterward, all warehouses of this coalition will be filled with the respective inventory information.

plugins/mission/commands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2524,7 +2524,7 @@ async def handle_warehouse_uploads(self, message: discord.Message):
25242524

25252525
att = message.attachments[0]
25262526
filename = att.filename.lower()
2527-
match = re.match(r'^warehouse-([a-zA-Z]{4})\.xlsx?$', filename)
2527+
match = re.match(r'^warehouse_([^.]*)\.xlsx?$', filename)
25282528
if not match:
25292529
coalition = await utils.selection(
25302530
ctx,
@@ -2537,6 +2537,9 @@ async def handle_warehouse_uploads(self, message: discord.Message):
25372537

25382538
data = await server.send_to_dcs_sync({"command": "getMissionSituation"})
25392539
airports = data.get('coalitions', {}).get(coalition, {}).get('airbases')
2540+
elif match.group(1).upper() in ['RED', 'BLUE']:
2541+
data = await server.send_to_dcs_sync({"command": "getMissionSituation"})
2542+
airports = data.get('coalitions', {}).get(match.group(1).upper(), {}).get('airbases')
25402543
else:
25412544
icao = match.group(1).upper()
25422545
airport = next((x for x in server.current_mission.airbases if x.get('code', x.get('type')) == icao), None)

0 commit comments

Comments
 (0)