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 {
1377 return;
1378 }
1379
1380 xTextAsset* a = (xTextAsset*)xSTFindAsset(textID, NULL);
1381 if (!a)
1382 {
1383 return;
1384 }
1385
1386 add_text((const char*)(a + 1));
1387}
1388void ztalkbox::clear_text()
1389{
1390 set_text((const char*)NULL);
1391}
1392void ztalkbox::start_talk(const char* s, callback* cb, zNPCCommon* npc)
1393{
1394 this->npc = npc;
1395
1396 if (shared.active)
1397 {
1398 shared.active->stop_talk();
1399 }
1400
1401 activate(*this);
1402
1403 shared.cb = cb;
1404 shared.wait_event_mask = 0;
1405
1406 reset_auto_wait();
1407
1408 shared.allow_quit = (asset->allow_quit != 0);
1409 shared.quitting = false;
1410
1411 if (asset->trap)
1412 {
1413 zEntPlayerControlOff((zControlOwner)0x10);
1414 }
1415 else
1416 {
1417 zEntPlayerControlOn((zControlOwner)0x10);
1418 }
1419 MasterTellSlaves(1);
1420 refresh_prompts();
1421
1422 ztextbox& d = *dialog_box;
1423
1424 if (d.flag.active)
1425 {
1426 d.deactivate();
1427 }
1428
1429 if (s)
1430 {
1431 d.set_text(s);
1432 }
1433
1434 d.refresh();
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