mirror of https://github.com/PrimeDecomp/prime.git
parent
8e96fba1fb
commit
c5fa86c9bb
|
@ -460,7 +460,7 @@ LIBS = [
|
|||
"GuiSys/CGuiWidgetDrawParms",
|
||||
"GuiSys/CAuiEnergyBarT01",
|
||||
"GuiSys/CAuiImagePane",
|
||||
"GuiSys/CRepeatState",
|
||||
["GuiSys/CRepeatState", True],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef _CGUITABLEGROUP
|
||||
#define _CGUITABLEGROUP
|
||||
|
||||
#include "GuiSys/CGuiObject.hpp"
|
||||
|
||||
class CGuiTableGroup {
|
||||
public:
|
||||
class CRepeatState {
|
||||
CRepeatState();
|
||||
uchar Update(float dt, bool state);
|
||||
private:
|
||||
float x0_timer;
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _CGUITABLEGROUP
|
|
@ -403,7 +403,7 @@ GUISYS :=\
|
|||
$(BUILD_DIR)/asm/GuiSys/CGuiWidgetDrawParms.o\
|
||||
$(BUILD_DIR)/asm/GuiSys/CAuiEnergyBarT01.o\
|
||||
$(BUILD_DIR)/asm/GuiSys/CAuiImagePane.o\
|
||||
$(BUILD_DIR)/asm/GuiSys/CRepeatState.o\
|
||||
$(BUILD_DIR)/src/GuiSys/CRepeatState.o\
|
||||
|
||||
COLLISION :=\
|
||||
$(BUILD_DIR)/asm/Collision/CCollidableAABox.o\
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#include "GuiSys/CGuiTableGroup.hpp"
|
||||
|
||||
CGuiTableGroup::CRepeatState::CRepeatState() : x0_timer(0.f) {}
|
||||
|
||||
uchar CGuiTableGroup::CRepeatState::Update(float dt, bool state) {
|
||||
bool ret = false;
|
||||
if (x0_timer == 0.f) {
|
||||
if (state) {
|
||||
x0_timer = 0.6f;
|
||||
ret = true;
|
||||
}
|
||||
} else {
|
||||
if (state) {
|
||||
x0_timer -= dt;
|
||||
if (x0_timer <= 0.f) {
|
||||
x0_timer = 0.05f;
|
||||
ret = true;
|
||||
}
|
||||
} else {
|
||||
x0_timer = 0.f;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
Loading…
Reference in New Issue