2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-03-09 19:47:37 -08:00
|
|
|
|
2019-09-22 14:52:05 -07:00
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
#include "Runtime/GuiSys/CGuiGroup.hpp"
|
2016-03-09 19:47:37 -08:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2017-01-21 17:40:12 -08:00
|
|
|
class CSimplePool;
|
2016-03-09 19:47:37 -08:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CAuiMeter : public CGuiGroup {
|
|
|
|
bool xc4_noRoundUp;
|
|
|
|
s32 xc8_maxCapacity;
|
|
|
|
s32 xcc_capacity;
|
|
|
|
s32 xd0_value = 0;
|
|
|
|
std::vector<CGuiGroup*> xd4_workers;
|
|
|
|
void UpdateMeterWorkers();
|
2017-01-13 20:16:10 -08:00
|
|
|
|
2016-03-10 16:23:16 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CAuiMeter(const CGuiWidgetParms& parms, bool noRoundUp, u32 maxCapacity, u32 workerCount);
|
2019-08-09 05:45:18 -07:00
|
|
|
FourCC GetWidgetTypeID() const override { return FOURCC('METR'); }
|
2017-01-13 20:16:10 -08:00
|
|
|
|
2019-08-09 05:45:18 -07:00
|
|
|
void OnVisibleChange() override;
|
2018-12-07 21:30:43 -08:00
|
|
|
void SetCurrValue(s32 val);
|
|
|
|
void SetCapacity(s32 cap);
|
|
|
|
void SetMaxCapacity(s32 cap);
|
2019-08-09 05:45:18 -07:00
|
|
|
CGuiWidget* GetWorkerWidget(int id) const override;
|
|
|
|
bool AddWorkerWidget(CGuiWidget* worker) override;
|
2017-01-13 20:16:10 -08:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
static std::shared_ptr<CGuiWidget> Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp);
|
2016-03-09 19:47:37 -08:00
|
|
|
};
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|