feat: added interactions, demo packs and destructables

This commit is contained in:
Sara 2025-07-28 21:17:11 +02:00
parent d66c999039
commit 5a4ac26c72
12 changed files with 369 additions and 23 deletions

View file

@ -0,0 +1,30 @@
#ifndef INTERACTABLE_H
#define INTERACTABLE_H
#include "player_interactor.h"
#include "scene/main/node.h"
class Interactable : public Node {
GDCLASS(Interactable, Node);
static void _bind_methods();
protected:
virtual void activated(PlayerInteractor *interactor) {}
GDVIRTUAL1_REQUIRED(_activated, PlayerInteractor *);
virtual void highlight_changed(PlayerInteractor *interactor, bool new_value) {}
GDVIRTUAL2(_highlight_changed, PlayerInteractor *, bool);
public:
void activate(PlayerInteractor *interactor);
void set_highlighted(PlayerInteractor *interactor, bool value);
bool get_highlighted() const;
void set_highlight_tooltip(String value);
String get_highlight_tooltip() const;
private:
bool highlighted{ false };
String highlight_tooltip{ "Activate" };
};
#endif // !INTERACTABLE_H