* Update the displayed status. The current code in botl.c updates * two lines of information. Both lines are always updated one after * the other. So only do our update when we update the second line. * * Information on the first line: * name, attributes, alignment, score * * Information on the second line: * dlvl, gold, hp, power, ac, {level & exp or HD **} * status (hunger,
| 2477 | * [**] HD is shown instead of level and exp if mtimedone is non-zero. |
| 2478 | */ |
| 2479 | void NetHackQtStatusWindow::updateStats() |
| 2480 | { |
| 2481 | if (!parentWidget()) return; |
| 2482 | |
| 2483 | char buf[BUFSZ]; |
| 2484 | |
| 2485 | if (cursy != 0) return; /* do a complete update when line 0 is done */ |
| 2486 | |
| 2487 | if (ACURR(A_STR) > 118) { |
| 2488 | Sprintf(buf,"STR:%d",ACURR(A_STR)-100); |
| 2489 | } else if (ACURR(A_STR)==118) { |
| 2490 | Sprintf(buf,"STR:18/**"); |
| 2491 | } else if(ACURR(A_STR) > 18) { |
| 2492 | Sprintf(buf,"STR:18/%02d",ACURR(A_STR)-18); |
| 2493 | } else { |
| 2494 | Sprintf(buf,"STR:%d",ACURR(A_STR)); |
| 2495 | } |
| 2496 | str.setLabel(buf,NetHackQtLabelledIcon::NoNum,ACURR(A_STR)); |
| 2497 | |
| 2498 | dex.setLabel("DEX:",(long)ACURR(A_DEX)); |
| 2499 | con.setLabel("CON:",(long)ACURR(A_CON)); |
| 2500 | intel.setLabel("INT:",(long)ACURR(A_INT)); |
| 2501 | wis.setLabel("WIS:",(long)ACURR(A_WIS)); |
| 2502 | cha.setLabel("CHA:",(long)ACURR(A_CHA)); |
| 2503 | const char* hung=hu_stat[u.uhs]; |
| 2504 | if (hung[0]==' ') { |
| 2505 | hunger.hide(); |
| 2506 | } else { |
| 2507 | hunger.setIcon(u.uhs ? p_hungry : p_satiated); |
| 2508 | hunger.setLabel(hung); |
| 2509 | hunger.show(); |
| 2510 | } |
| 2511 | if (Confusion) confused.show(); else confused.hide(); |
| 2512 | if (Sick) { |
| 2513 | if (u.usick_type & SICK_VOMITABLE) { |
| 2514 | sick_fp.show(); |
| 2515 | } else { |
| 2516 | sick_fp.hide(); |
| 2517 | } |
| 2518 | if (u.usick_type & SICK_NONVOMITABLE) { |
| 2519 | sick_il.show(); |
| 2520 | } else { |
| 2521 | sick_il.hide(); |
| 2522 | } |
| 2523 | } else { |
| 2524 | sick_fp.hide(); |
| 2525 | sick_il.hide(); |
| 2526 | } |
| 2527 | if (Blind) blind.show(); else blind.hide(); |
| 2528 | if (Stunned) stunned.show(); else stunned.hide(); |
| 2529 | if (Hallucination) hallu.show(); else hallu.hide(); |
| 2530 | const char* enc=enc_stat[near_capacity()]; |
| 2531 | if (enc[0]==' ' || !enc[0]) { |
| 2532 | encumber.hide(); |
| 2533 | } else { |
| 2534 | encumber.setIcon(p_encumber[near_capacity()-1]); |
| 2535 | encumber.setLabel(enc); |
| 2536 | encumber.show(); |
nothing calls this directly
no test coverage detected