2023-12-16 17:36:57 +01:00
|
|
|
#pragma once
|
2024-11-27 20:44:36 +01:00
|
|
|
|
2023-12-16 17:36:57 +01:00
|
|
|
#include "ConfigRendererItemGeneric.h"
|
|
|
|
#include "config/WUPSConfigItem.h"
|
|
|
|
|
2024-11-27 20:44:36 +01:00
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
#include <wups/config.h>
|
|
|
|
|
|
|
|
class ConfigRendererItem final : public ConfigRendererItemGeneric {
|
2023-12-16 17:36:57 +01:00
|
|
|
public:
|
2024-11-27 20:44:36 +01:00
|
|
|
explicit ConfigRendererItem(const WUPSConfigAPIBackend::WUPSConfigItem *item);
|
|
|
|
|
|
|
|
void Draw(uint32_t yOffset, bool isHighlighted) const override;
|
|
|
|
|
|
|
|
[[nodiscard]] std::string GetValueToPrint(bool isHighlighted) const;
|
|
|
|
|
|
|
|
void Update(bool isHighlighted) override;
|
|
|
|
|
|
|
|
void ResetNeedsRedraw() override;
|
|
|
|
|
|
|
|
[[nodiscard]] bool NeedsRedraw() const override;
|
|
|
|
|
|
|
|
void SetIsSelected(bool isSelected) override;
|
|
|
|
|
|
|
|
void OnButtonPressed(WUPSConfigButtons buttons) override;
|
|
|
|
|
|
|
|
[[nodiscard]] bool IsMovementAllowed() const override;
|
|
|
|
|
|
|
|
void OnInput(WUPSConfigSimplePadData input) override;
|
|
|
|
|
|
|
|
void OnInputEx(WUPSConfigComplexPadData input) override;
|
2023-12-16 17:36:57 +01:00
|
|
|
|
|
|
|
private:
|
2024-11-27 20:44:36 +01:00
|
|
|
const WUPSConfigAPIBackend::WUPSConfigItem *mItem = nullptr;
|
2024-05-03 11:55:27 +02:00
|
|
|
std::string mCurItemText;
|
|
|
|
bool mNeedsDraw = true;
|
2023-12-16 17:36:57 +01:00
|
|
|
};
|