wave-survival/modules/wave_survival/interactable.cpp

34 lines
1 KiB
C++

#include "interactable.h"
#include "macros.h"
void Interactable::_bind_methods() {
ClassDB::bind_method(D_METHOD("activate", "interactor"), &self_type::activate);
ClassDB::bind_method(D_METHOD("set_highlighted", "value"), &self_type::set_highlighted);
ClassDB::bind_method(D_METHOD("get_highlighted"), &self_type::get_highlighted);
GDVIRTUAL_BIND(_activated, "interactor");
GDVIRTUAL_BIND(_highlight_changed, "interactor", "value");
}
void Interactable::activate(PlayerInteractor *interactor) {
activated(interactor);
GDVIRTUAL_CALL(_activated, interactor);
}
void Interactable::set_highlighted(PlayerInteractor *interactor, bool value) {
this->highlighted = value;
highlight_changed(interactor, value);
GDVIRTUAL_CALL(_highlight_changed, interactor, value);
}
bool Interactable::get_highlighted() const {
return this->highlighted;
}
void Interactable::set_highlight_tooltip(String value) {
this->highlight_tooltip = value;
}
String Interactable::get_highlight_tooltip() const {
return this->highlight_tooltip;
}