MCPcopy Create free account
hub / github.com/NetHack/NetHack / PutStr

Method PutStr

win/Qt/qt_menu.cpp:1133–1151  ·  view source on GitHub ↗

handle a line of text for a text window

Source from the content-addressed store, hash-verified

1131
1132// handle a line of text for a text window
1133void NetHackQtTextWindow::PutStr(int attr UNUSED, const QString& text)
1134{
1135#if 1
1136 // 5.0: Always render text windows with fixed-width font. The majority
1137 // of text files we'll ever display including ('license' and 'history')
1138 // happen to have some lines with four spaces anyway and/or they have
1139 // been pre-formatted to fit within less than 80 columns. For data.base
1140 // entries, some do have four spaces (usually the final attribution)
1141 // and some don't, resulting in inconsistent display from one entry to
1142 // another if the default proportional font is ever used.
1143 str_fixed = true;
1144#else
1145 // if any line contains four consecutive spaces, render this text window
1146 // using fixed-width font; skip substring lookup if flag is already set
1147 str_fixed = str_fixed || text.contains(" ");
1148#endif
1149 // instead of outputting the line directly, save it for future rendering
1150 lines->addItem(text);
1151}
1152
1153// prompt for a target string and search current text window for it;
1154// if found, highlight the next line target occurs on;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected