mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 09:22:18 -05:00
LUS Cleanup: Controllers cleanup (#1016)
This commit is contained in:
parent
6d0d608e38
commit
2d60c772bf
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "Controller.h"
|
#include "Controller.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace Ship {
|
namespace Ship {
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Lib/ImGui/imgui.h"
|
#include "Lib/ImGui/imgui.h"
|
||||||
|
|
||||||
namespace Ship {
|
namespace Ship {
|
||||||
|
@ -4,32 +4,34 @@
|
|||||||
|
|
||||||
#include "Controller.h"
|
#include "Controller.h"
|
||||||
|
|
||||||
class VirtualController final : public Ship::Controller {
|
namespace Ship {
|
||||||
public:
|
class VirtualController final : public Controller {
|
||||||
VirtualController(const std::string& CUID, const std::string& KeyName, bool Connected) {
|
public:
|
||||||
GUID = CUID;
|
VirtualController(const std::string& CUID, const std::string& KeyName, bool Connected) {
|
||||||
isConnected = Connected;
|
GUID = CUID;
|
||||||
ButtonName = KeyName;
|
isConnected = Connected;
|
||||||
}
|
ButtonName = KeyName;
|
||||||
|
}
|
||||||
|
|
||||||
std::map<std::vector<std::string>, int32_t> ReadButtonPress();
|
std::map<std::vector<std::string>, int32_t> ReadButtonPress();
|
||||||
void ReadFromSource(int32_t slot) override {}
|
void ReadFromSource(int32_t slot) override {}
|
||||||
const char* GetControllerName() override { return GUID.c_str(); }
|
const char* GetControllerName() override { return GUID.c_str(); }
|
||||||
const char* GetButtonName(int slot, int n64Button) override { return ButtonName.c_str(); }
|
const char* GetButtonName(int slot, int n64Button) override { return ButtonName.c_str(); }
|
||||||
void WriteToSource(int32_t slot, ControllerCallback* controller) override { }
|
void WriteToSource(int32_t slot, ControllerCallback* controller) override { }
|
||||||
bool Connected() const override { return isConnected; }
|
bool Connected() const override { return isConnected; }
|
||||||
bool CanRumble() const override { return false; }
|
bool CanRumble() const override { return false; }
|
||||||
bool CanGyro() const override { return false; }
|
bool CanGyro() const override { return false; }
|
||||||
|
|
||||||
void ClearRawPress() override {}
|
void ClearRawPress() override {}
|
||||||
int32_t ReadRawPress() override { return -1; }
|
int32_t ReadRawPress() override { return -1; }
|
||||||
bool HasPadConf() const { return true; }
|
bool HasPadConf() const { return true; }
|
||||||
std::optional<std::string> GetPadConfSection() { return "Unk"; }
|
std::optional<std::string> GetPadConfSection() { return "Unk"; }
|
||||||
void CreateDefaultBinding(int32_t slot) override {}
|
void CreateDefaultBinding(int32_t slot) override {}
|
||||||
protected:
|
protected:
|
||||||
std::string ButtonName;
|
std::string ButtonName;
|
||||||
bool isConnected = false;
|
bool isConnected = false;
|
||||||
std::string GetControllerType() { return "Unk"; }
|
std::string GetControllerType() { return "Unk"; }
|
||||||
std::string GetConfSection() { return "Unk"; }
|
std::string GetConfSection() { return "Unk"; }
|
||||||
std::string GetBindingConfSection() { return "Unk"; }
|
std::string GetBindingConfSection() { return "Unk"; }
|
||||||
};
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user