mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Modifiers for ground unit transfer window
This commit is contained in:
parent
ad227965ea
commit
057ea58d8e
@ -24,6 +24,7 @@
|
||||
* **[UI]** Improved parking space information in air wing configuration dialog.
|
||||
* **[Squadrons]** Warning messages when opening up a squadron through the air wing dialog, indicating squadrons that potentially won't fit w.r.t. parking space.
|
||||
* **[Squadrons Transfers]** Determine number of available parking slots more accurately w.r.t. squadron transfers, taking aircraft dimensions into account which should prevent forced air-starts.
|
||||
* **[UX]** Allow usage of CTRL/SHIFT modifiers in ground unit transfer window.
|
||||
|
||||
## Fixes
|
||||
* **[New Game Wizard]** Settings would not persist when going back to a previous page (obsolete due to overhaul).
|
||||
|
||||
@ -19,6 +19,7 @@ from PySide2.QtWidgets import (
|
||||
QSpacerItem,
|
||||
QVBoxLayout,
|
||||
QWidget,
|
||||
QApplication,
|
||||
)
|
||||
from dcs.unittype import UnitType
|
||||
|
||||
@ -220,8 +221,16 @@ class ScrollingUnitTransferGrid(QFrame):
|
||||
if not origin_inventory:
|
||||
return
|
||||
|
||||
self.transfers[unit_type] += 1
|
||||
origin_inventory -= 1
|
||||
modifiers = QApplication.keyboardModifiers()
|
||||
if modifiers == Qt.ShiftModifier:
|
||||
amount = 10
|
||||
elif modifiers == Qt.ControlModifier:
|
||||
amount = 5
|
||||
else:
|
||||
amount = 1
|
||||
|
||||
self.transfers[unit_type] += min(origin_inventory, amount)
|
||||
origin_inventory -= min(origin_inventory, amount)
|
||||
controls.set_quantity(self.transfers[unit_type])
|
||||
origin_inventory_label.setText(str(origin_inventory))
|
||||
self.transfer_quantity_changed.emit()
|
||||
@ -232,8 +241,16 @@ class ScrollingUnitTransferGrid(QFrame):
|
||||
if not controls.quantity:
|
||||
return
|
||||
|
||||
self.transfers[unit_type] -= 1
|
||||
origin_inventory += 1
|
||||
modifiers = QApplication.keyboardModifiers()
|
||||
if modifiers == Qt.ShiftModifier:
|
||||
amount = 10
|
||||
elif modifiers == Qt.ControlModifier:
|
||||
amount = 5
|
||||
else:
|
||||
amount = 1
|
||||
|
||||
self.transfers[unit_type] -= min(self.transfers[unit_type], amount)
|
||||
origin_inventory += min(self.transfers[unit_type], amount)
|
||||
controls.set_quantity(self.transfers[unit_type])
|
||||
origin_inventory_label.setText(str(origin_inventory))
|
||||
self.transfer_quantity_changed.emit()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user