mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 02:35:28 +00:00
refactor(component): use is a RequestUse message handler
Components no longer have a virtual OnUse; each component that reacts to a use registers a RequestUse handler, like the client's components. The entity runs the INTERACT trigger and the script, then delivers a RequestUseEvent (carrying the user) to the handlers. The mission choice of a multi-interact use goes only to the mission offer, as before. Switches keep a direct EnterIfResponding for touches and pets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,11 +66,11 @@ public:
|
||||
MissionOfferComponent(Entity* parent, const int32_t componentID);
|
||||
|
||||
/**
|
||||
* Handles the OnUse event triggered by some entity, determines which missions to show based on what they may
|
||||
* Handles a RequestUse triggered by some entity, determines which missions to show based on what they may
|
||||
* hand in now and what they may start based on their mission history.
|
||||
* @param originator the entity that triggered the event
|
||||
*/
|
||||
void OnUse(Entity* originator) override;
|
||||
bool OnRequestUse(GameMessages::RequestUseEvent& event);
|
||||
|
||||
/**
|
||||
* Offers all the missions an entity can accept to said entity
|
||||
|
||||
Reference in New Issue
Block a user