projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update helpers/location to 'frosted' ui
[carveJwlIkooP6JGAAIwe30JlM.git]
/
ent_npc.c
diff --git
a/ent_npc.c
b/ent_npc.c
index d43122330120a34bbec263daed8f30d2f8ba1cf9..7a4b484b534f22d389e3e3793cc15739a311109f 100644
(file)
--- a/
ent_npc.c
+++ b/
ent_npc.c
@@
-70,7
+70,7
@@
static struct npc *npc_resolve( u32 id )
else return NULL;
}
else return NULL;
}
-static
void
npc_slowmo_call( ent_npc *npc, ent_call *call )
+static
entity_call_result
npc_slowmo_call( ent_npc *npc, ent_call *call )
{
if( call->function == 0 )
{
{
if( call->function == 0 )
{
@@
-96,22
+96,26
@@
static void npc_slowmo_call( ent_npc *npc, ent_call *call )
if( gui_new_helper( input_button_list[k_srbind_replay_resume], &text ))
vg_strcat( &text, "Resume" );
}
if( gui_new_helper( input_button_list[k_srbind_replay_resume], &text ))
vg_strcat( &text, "Resume" );
}
+ return k_entity_call_result_OK;
}
else if( call->function == -1 )
{
world_entity_clear_focus();
gui_helper_clear();
}
else if( call->function == -1 )
{
world_entity_clear_focus();
gui_helper_clear();
+ return k_entity_call_result_OK;
}
}
+ else
+ return k_entity_call_result_unhandled;
}
}
-
void
ent_npc_call( world_instance *world, ent_call *call )
+
entity_call_result
ent_npc_call( world_instance *world, ent_call *call )
{
u32 index = mdl_entity_id_id( call->id );
ent_npc *npc = mdl_arritm( &world->ent_npc, index );
if( npc->id == 2 )
{
{
u32 index = mdl_entity_id_id( call->id );
ent_npc *npc = mdl_arritm( &world->ent_npc, index );
if( npc->id == 2 )
{
- npc_slowmo_call( npc, call );
+
return
npc_slowmo_call( npc, call );
}
else if( npc->id == 3 )
{
}
else if( npc->id == 3 )
{
@@
-122,12
+126,16
@@
void ent_npc_call( world_instance *world, ent_call *call )
vg_str text;
if( gui_new_helper( input_button_list[k_srbind_maccept], &text ))
vg_strcat( &text, "Preview course" );
vg_str text;
if( gui_new_helper( input_button_list[k_srbind_maccept], &text ))
vg_strcat( &text, "Preview course" );
+ return k_entity_call_result_OK;
}
else if( call->function == -1 )
{
world_entity_clear_focus();
gui_helper_clear();
}
else if( call->function == -1 )
{
world_entity_clear_focus();
gui_helper_clear();
+ return k_entity_call_result_OK;
}
}
+ else
+ return k_entity_call_result_unhandled;
}
else if( npc->id == 4 )
{
}
else if( npc->id == 4 )
{
@@
-137,11
+145,15
@@
void ent_npc_call( world_instance *world, ent_call *call )
vg_str text;
if( gui_new_helper( input_button_list[k_srbind_camera], &text ))
vg_strcat( &text, "First/Thirdperson" );
vg_str text;
if( gui_new_helper( input_button_list[k_srbind_camera], &text ))
vg_strcat( &text, "First/Thirdperson" );
+ return k_entity_call_result_OK;
}
else if( call->function == -1 )
{
gui_helper_clear();
}
else if( call->function == -1 )
{
gui_helper_clear();
+ return k_entity_call_result_OK;
}
}
+ else
+ return k_entity_call_result_unhandled;
}
else
{
}
else
{
@@
-152,25
+164,25
@@
void ent_npc_call( world_instance *world, ent_call *call )
vg_str text;
if( gui_new_helper( input_button_list[k_srbind_maccept], &text ))
vg_strcat( &text, "Talk to ???" );
vg_str text;
if( gui_new_helper( input_button_list[k_srbind_maccept], &text ))
vg_strcat( &text, "Talk to ???" );
+ return k_entity_call_result_OK;
}
else if( call->function == -1 )
{
world_entity_clear_focus();
gui_helper_clear();
}
else if( call->function == -1 )
{
world_entity_clear_focus();
gui_helper_clear();
+ return k_entity_call_result_OK;
}
else
}
else
- {
- vg_print_backtrace();
- vg_error( "Unhandled function id: %i\n", call->function );
- }
+ return k_entity_call_result_unhandled;
}
}
}
}
-void ent_npc_preupdate( ent_
npc *ent, int active
)
+void ent_npc_preupdate( ent_
focus_context *ctx
)
{
{
- world_instance *world = world_current_instance();
+ world_instance *world = ctx->world;
+ ent_npc *ent = mdl_arritm( &world->ent_npc, ctx->index );
- if( !active )
+ if( !
ctx->
active )
{
if( button_down(k_srbind_maccept) )
{
{
if( button_down(k_srbind_maccept) )
{