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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user