ppsspp/UI/JoystickHistoryView.h

40 lines
766 B
C
Raw Permalink Normal View History

2023-02-01 13:58:16 +00:00
#pragma once
#include <deque>
#include "Common/UI/View.h"
enum class StickHistoryViewType {
INPUT,
OUTPUT,
OTHER,
2023-02-01 13:58:16 +00:00
};
class JoystickHistoryView : public UI::InertView {
public:
JoystickHistoryView(StickHistoryViewType type, std::string_view title, UI::LayoutParams *layoutParams = nullptr)
2023-02-01 13:58:16 +00:00
: UI::InertView(layoutParams), title_(title), type_(type) {}
void Draw(UIContext &dc) override;
std::string DescribeText() const override { return "Analog Stick View"; }
void Update() override;
void SetXY(float x, float y) {
curX_ = x;
curY_ = y;
}
private:
struct Location {
float x;
float y;
};
float curX_ = 0.0f;
float curY_ = 0.0f;
std::deque<Location> locations_;
int maxCount_ = 500;
std::string title_;
StickHistoryViewType type_;
};