implement ui
This commit is contained in:
51
src/ui/SelectedBuildingPanel.h
Normal file
51
src/ui/SelectedBuildingPanel.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "EntityId.h"
|
||||
#include "GameConfig.h"
|
||||
|
||||
class Simulation;
|
||||
class QLabel;
|
||||
class QComboBox;
|
||||
class QPushButton;
|
||||
class QVBoxLayout;
|
||||
|
||||
class SelectedBuildingPanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SelectedBuildingPanel(Simulation* sim, const GameConfig* config,
|
||||
QWidget* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void onSelectionChanged(const std::vector<EntityId>& ids);
|
||||
|
||||
private slots:
|
||||
void onRecipeChanged(int comboIndex);
|
||||
void onClearBelt();
|
||||
|
||||
private:
|
||||
void rebuild();
|
||||
void clearContent();
|
||||
void buildEmpty();
|
||||
void buildSingle(EntityId id);
|
||||
void buildMulti(const std::vector<EntityId>& ids);
|
||||
|
||||
Simulation* m_sim;
|
||||
const GameConfig* m_config;
|
||||
std::vector<EntityId> m_selection;
|
||||
|
||||
QVBoxLayout* m_layout;
|
||||
QLabel* m_titleLabel;
|
||||
QComboBox* m_recipeCombo;
|
||||
QPushButton* m_clearBeltBtn;
|
||||
QLabel* m_buffersLabel;
|
||||
|
||||
EntityId m_singleId;
|
||||
std::string m_currentRecipeId;
|
||||
};
|
||||
Reference in New Issue
Block a user