Added lights panel tab to send LED commands. However we can not get in-game lighting as its on the socket not websocket. More reason for the bridge

This commit is contained in:
Jon ESA
2026-04-02 11:14:36 +01:00
parent 3dc9ee91d4
commit 9671785a14
7 changed files with 362 additions and 1 deletions

43
LightsPanel.h Normal file
View File

@@ -0,0 +1,43 @@
#pragma once
#include <QColor>
#include <QMap>
#include <QWidget>
class QLabel;
class QPushButton;
class LightsPanel : public QWidget
{
Q_OBJECT
public:
explicit LightsPanel(QWidget *parent = nullptr);
void setRnpCount(int count);
void reset();
signals:
void commandRequested(const QString &cmd);
protected:
void paintEvent(QPaintEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
private:
int segmentAt(const QPointF &pos) const;
void sendLedCommand(int panel, const QColor &color);
void pickColor();
void updateSendBtn();
int m_count = 0;
int m_selected = -1;
QColor m_ledColor = QColor(255, 0, 0);
QMap<int, QColor> m_panelColors;
QLabel *m_statusLabel = nullptr;
QLabel *m_selectedLabel = nullptr;
QPushButton *m_colorBtn = nullptr;
QPushButton *m_sendBtn = nullptr;
QPushButton *m_sendAllBtn = nullptr;
QPushButton *m_clearAllBtn = nullptr;
};