mirror of
https://github.com/leoetlino/project-restoration
synced 2025-10-06 00:32:43 +02:00
game/ui: Add touch handler stuff
This commit is contained in:
@@ -241,7 +241,7 @@ public:
|
||||
virtual void init0(LayoutBase* layout, const char* name);
|
||||
virtual void init(LayoutBase* layout, const char* name);
|
||||
virtual void reset();
|
||||
virtual void calc(Matrix34& mtx, Vec4& vec, Matrix23& mtx23, int, float speed);
|
||||
virtual void calc(Matrix34& mtx, Vec4& vec, Matrix23& mtx23, int, float time_delta);
|
||||
|
||||
const char* GetName() const { return name; }
|
||||
WidgetType GetType() const;
|
||||
@@ -381,9 +381,9 @@ public:
|
||||
virtual void init(LayoutClass*, MainWidget** main_widgets, int num_main_widgets,
|
||||
AnimPlayer** players, int num_players, const char* name);
|
||||
virtual void m3();
|
||||
virtual void calc(Matrix34& mtx, Vec4& vec, Matrix23& mtx2, int, float speed);
|
||||
virtual void calc(Matrix34& mtx, Vec4& vec, Matrix23& mtx2, int, float time_delta);
|
||||
|
||||
void calc(float speed = 0.033333);
|
||||
void calc(float time_delta = 0.033333);
|
||||
|
||||
const char* GetName() const { return name; }
|
||||
LayoutClass& GetCl() const { return *cl; }
|
||||
@@ -409,7 +409,10 @@ static_assert(sizeof(LayoutBase) == 0x16C);
|
||||
|
||||
class Layout : public LayoutBase {
|
||||
public:
|
||||
virtual void m5();
|
||||
// Usually called from the calc function to detect on-screen button presses and update button
|
||||
// state accordingly.
|
||||
virtual void HandleTouch(bool a, bool b, bool c, ScreenContext& ctx, int d, float time_delta,
|
||||
float x, float y);
|
||||
virtual void m6();
|
||||
virtual void DoInit();
|
||||
virtual void m8();
|
||||
@@ -420,6 +423,13 @@ private:
|
||||
};
|
||||
static_assert(sizeof(Layout) == 0x170);
|
||||
|
||||
class TouchHandler {
|
||||
public:
|
||||
virtual bool UpdateState(Layout*, ScreenContext& ctx, float x, float y);
|
||||
virtual bool OnActivate(Layout*, bool, ScreenContext& ctx, float x, float y);
|
||||
virtual bool OnRelease(Layout*, bool, bool, ScreenContext& ctx, float x, float y);
|
||||
};
|
||||
|
||||
class LayoutMgr {
|
||||
public:
|
||||
static LayoutMgr& Instance();
|
||||
|
Reference in New Issue
Block a user