| 1376 | set_text((const char*)NULL); |
| 1377 | } |
| 1378 | void 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 | } |
no test coverage detected