| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <memory> |
| 7 |
#include <string> |
| 8 |
#include <vector> |
| 9 |
|
| 10 |
#include "Common/CommonTypes.h" |
| 11 |
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" |
| 12 |
#include "InputCommon/ControllerEmu/ControllerEmu.h" |
| 13 |
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h" |
| 14 |
|
| 15 |
namespace ControllerEmu |
| 16 |
{ |
| 17 |
class AttachedController : public ControlGroupContainer |
| 18 |
{ |
| 19 |
public: |
| 20 |
virtual void LoadDefaults(); |
| 21 |
}; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
class Attachments : public ControlGroup |
| 26 |
{ |
| 27 |
public: |
| 28 |
explicit Attachments(const std::string& name); |
| 29 |
|
| 30 |
void AddAttachment(std::unique_ptr<AttachedController> att); |
| 31 |
|
| 32 |
u32 GetSelectedAttachment() const; |
| 33 |
void SetSelectedAttachment(u32 val); |
| 34 |
|
| 35 |
NumericSetting<int>& GetSelectionSetting(); |
| 36 |
SubscribableSettingValue<int>& GetAttachmentSetting(); |
| 37 |
|
| 38 |
const std::vector<std::unique_ptr<AttachedController>>& GetAttachmentList() const; |
| 39 |
|
| 40 |
void LoadConfig(Common::IniFile::Section* sec, const std::string& base) override; |
| 41 |
void SaveConfig(Common::IniFile::Section* sec, const std::string& base) override; |
| 42 |
|
| 43 |
void UpdateReferences(ciface::ExpressionParser::ControlEnvironment& env) override; |
| 44 |
|
| 45 |
private: |
| 46 |
SubscribableSettingValue<int> m_selection_value; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
NumericSetting<int> m_selection_setting = {&m_selection_value, {""}, 0, 0, 0}; |
| 51 |
|
| 52 |
std::vector<std::unique_ptr<AttachedController>> m_attachments; |
| 53 |
}; |
| 54 |
} |