Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/SB/Game/zTaskBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,39 @@ void ztaskbox::on_talk_start()
}
}

S32 ztaskbox::cb_dispatch(xBase*, xBase* to, U32 event, const F32*, xBase*)
{
ztaskbox& taskbox = *(ztaskbox*)to;

switch (event)
{
case eEventReset:
taskbox.reset();
break;
case eEventStartConversation:
taskbox.start_talk(NULL);
break;
case eEventEndConversation:
taskbox.stop_talk();
break;
case eEventTaskBox_Initiate:
taskbox.initiate();
break;
case eEventTaskBox_SetSuccess:
taskbox.succeed();
break;
case eEventTaskBox_SetFailure:
taskbox.fail();
break;
case eEventTaskBox_OnAccept:
case eEventTaskBox_OnDecline:
case eEventTaskBox_OnComplete:
break;
}

return 1;
}

void ztaskbox::talk_callback::on_start()
{
this->task->on_talk_start();
Expand Down
1 change: 1 addition & 0 deletions src/SB/Game/zTaskBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct ztaskbox : xBase

void on_talk_start();
void on_talk_stop(ztalkbox::answer_enum answer);
static S32 cb_dispatch(xBase*, xBase* to, U32 event, const F32* argf, xBase*);
void set_state(state_enum state);
void set_callback(callback* cb);
void stop_talk();
Expand Down