mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 18:27:42 +00:00
New code style refactor
This commit is contained in:
@@ -3,60 +3,57 @@
|
||||
#include "CGuiCompoundWidget.hpp"
|
||||
#include <functional>
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
class CSimplePool;
|
||||
|
||||
class CGuiSliderGroup : public CGuiCompoundWidget
|
||||
{
|
||||
class CGuiSliderGroup : public CGuiCompoundWidget {
|
||||
public:
|
||||
enum class EState
|
||||
{
|
||||
None,
|
||||
Decreasing,
|
||||
Increasing
|
||||
};
|
||||
enum class EState { None, Decreasing, Increasing };
|
||||
|
||||
private:
|
||||
float xb8_minVal;
|
||||
float xbc_maxVal;
|
||||
float xc0_roundedCurVal;
|
||||
float xc4_curVal;
|
||||
float xc8_increment;
|
||||
CGuiWidget* xcc_sliderRangeWidgets[2] = {};
|
||||
std::function<void(CGuiSliderGroup*, float)> xd8_changeCallback;
|
||||
EState xf0_state = EState::None;
|
||||
union {
|
||||
struct
|
||||
{
|
||||
bool xf4_24_inputPending : 1;
|
||||
};
|
||||
u8 _dummy = 0;
|
||||
float xb8_minVal;
|
||||
float xbc_maxVal;
|
||||
float xc0_roundedCurVal;
|
||||
float xc4_curVal;
|
||||
float xc8_increment;
|
||||
CGuiWidget* xcc_sliderRangeWidgets[2] = {};
|
||||
std::function<void(CGuiSliderGroup*, float)> xd8_changeCallback;
|
||||
EState xf0_state = EState::None;
|
||||
union {
|
||||
struct {
|
||||
bool xf4_24_inputPending : 1;
|
||||
};
|
||||
u8 _dummy = 0;
|
||||
};
|
||||
|
||||
void StartDecreasing();
|
||||
void StartIncreasing();
|
||||
void StartDecreasing();
|
||||
void StartIncreasing();
|
||||
|
||||
public:
|
||||
CGuiSliderGroup(const CGuiWidgetParms& parms, float a, float b, float c, float d);
|
||||
FourCC GetWidgetTypeID() const { return FOURCC('SLGP'); }
|
||||
CGuiSliderGroup(const CGuiWidgetParms& parms, float a, float b, float c, float d);
|
||||
FourCC GetWidgetTypeID() const { return FOURCC('SLGP'); }
|
||||
|
||||
EState GetState() const { return xf0_state; }
|
||||
void SetSelectionChangedCallback(std::function<void(CGuiSliderGroup*, float)>&& func);
|
||||
void SetIncrement(float inc) { xc8_increment = inc; }
|
||||
void SetMinVal(float min) { xb8_minVal = min; SetCurVal(xc0_roundedCurVal); }
|
||||
void SetMaxVal(float max) { xbc_maxVal = max; SetCurVal(xc0_roundedCurVal); }
|
||||
void SetCurVal(float cur);
|
||||
float GetGurVal() const { return xc0_roundedCurVal; }
|
||||
EState GetState() const { return xf0_state; }
|
||||
void SetSelectionChangedCallback(std::function<void(CGuiSliderGroup*, float)>&& func);
|
||||
void SetIncrement(float inc) { xc8_increment = inc; }
|
||||
void SetMinVal(float min) {
|
||||
xb8_minVal = min;
|
||||
SetCurVal(xc0_roundedCurVal);
|
||||
}
|
||||
void SetMaxVal(float max) {
|
||||
xbc_maxVal = max;
|
||||
SetCurVal(xc0_roundedCurVal);
|
||||
}
|
||||
void SetCurVal(float cur);
|
||||
float GetGurVal() const { return xc0_roundedCurVal; }
|
||||
|
||||
void ProcessUserInput(const CFinalInput& input);
|
||||
void Update(float dt);
|
||||
void ProcessUserInput(const CFinalInput& input);
|
||||
void Update(float dt);
|
||||
|
||||
bool AddWorkerWidget(CGuiWidget* worker);
|
||||
CGuiWidget* GetWorkerWidget(int id) const;
|
||||
bool AddWorkerWidget(CGuiWidget* worker);
|
||||
CGuiWidget* GetWorkerWidget(int id) const;
|
||||
|
||||
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
||||
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user