implement joystick item switching
This commit is contained in:
@ -38,16 +38,6 @@ void ItemScrollBox::addItem(std::weak_ptr<Item> item)
|
||||
widgets_.back()->setShortcuts(QKeySequence(Qt::Key_R), QKeySequence(Qt::Key_F), QKeySequence(Qt::Key_V));
|
||||
else if(train->getTrainId() == 4)
|
||||
widgets_.back()->setShortcuts(QKeySequence(Qt::Key_T), QKeySequence(Qt::Key_G), QKeySequence(Qt::Key_B));
|
||||
|
||||
std::vector<std::shared_ptr<TrainJs>> joysticks = TrainJs::getJsDevices();
|
||||
for(auto joystick: joysticks)
|
||||
{
|
||||
if(!joystick->itemIsSet())
|
||||
{
|
||||
joystick->setItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(turnout)
|
||||
{
|
||||
|
@ -23,7 +23,6 @@ private:
|
||||
signals:
|
||||
void deleteRequest(const ItemData& item);
|
||||
|
||||
|
||||
public:
|
||||
explicit ItemScrollBox(QWidget *parent = nullptr);
|
||||
~ItemScrollBox();
|
||||
|
@ -73,7 +73,6 @@ void ItemWidget::deleteItem()
|
||||
|
||||
void ItemWidget::setValue(int8_t value)
|
||||
{
|
||||
moveToValue(value);
|
||||
if(auto workingItem = item_.lock())
|
||||
workingItem->setValue(value);
|
||||
else
|
||||
|
Reference in New Issue
Block a user