27 lines
		
	
	
		
			879 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			879 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#include "interactable.h"
 | 
						|
#include "heads_up_display.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;
 | 
						|
}
 |