MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / start_talk

Method start_talk

src/SB/Game/zTalkBox.cpp:1378–1438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1376 set_text((const char*)NULL);
1377}
1378void ztalkbox::start_talk(const char* s, callback* cb, zNPCCommon* npc)
1379{
1380 this->npc = npc;
1381
1382 if (shared.active)
1383 {
1384 shared.active->stop_talk();
1385 }
1386
1387 activate(*this);
1388
1389 shared.cb = cb;
1390 shared.wait_event_mask = 0;
1391
1392 reset_auto_wait();
1393
1394 shared.allow_quit = (asset->allow_quit != 0);
1395 shared.quitting = false;
1396
1397 if (asset->trap)
1398 {
1399 zEntPlayerControlOff((zControlOwner)0x10);
1400 }
1401 else
1402 {
1403 zEntPlayerControlOn((zControlOwner)0x10);
1404 }
1405 MasterTellSlaves(1);
1406 refresh_prompts();
1407
1408 ztextbox& d = *dialog_box;
1409
1410 if (d.flag.active)
1411 {
1412 d.deactivate();
1413 }
1414
1415 if (s)
1416 {
1417 d.set_text(s);
1418 }
1419
1420 d.refresh();
1421
1422 ((xtextbox::layout*)&shared.lt)->refresh(d.tb, false);
1423
1424 if (layout_contains_streams())
1425 {
1426 lock_stream();
1427 }
1428
1429 shared.state = shared.states[1];
1430 trigger(0x161);
1431
1432 if (cb)
1433 {
1434 cb->on_start();
1435 }

Callers 1

cb_dispatchFunction · 0.45

Calls 15

activateFunction · 0.85
MasterTellSlavesFunction · 0.85
layout_contains_streamsFunction · 0.85
lock_streamFunction · 0.85
reset_auto_waitFunction · 0.70
zEntPlayerControlOffFunction · 0.70
zEntPlayerControlOnFunction · 0.70
refresh_promptsFunction · 0.70
triggerFunction · 0.70
start_talkFunction · 0.50
xSTFindAssetFunction · 0.50
stop_talkMethod · 0.45

Tested by

no test coverage detected