Finish addLine split (addLinePageBreak)
This commit is contained in:
@@ -544,6 +544,25 @@ func (g *RogueGame) addLinePaged(line string, isFlush bool) {
|
||||
}
|
||||
|
||||
if pg.lineCnt >= NumLines-1 || isFlush {
|
||||
g.addLinePageBreak(prompt, isFlush)
|
||||
}
|
||||
|
||||
if !isFlush && (pg.lineCnt != 0 || line != "") {
|
||||
g.scr.Hw.MvAddStr(pg.lineCnt, 0, line)
|
||||
|
||||
pg.lineCnt++
|
||||
if pg.maxlen < len(line) {
|
||||
pg.maxlen = len(line)
|
||||
}
|
||||
|
||||
pg.lastLine = line
|
||||
}
|
||||
}
|
||||
|
||||
// addLinePageBreak prompts at a full page and starts a fresh one
|
||||
// (things.c add_line).
|
||||
func (g *RogueGame) addLinePageBreak(prompt string, isFlush bool) {
|
||||
pg := &g.invPage
|
||||
if g.Options.InvType == InvOver && isFlush && !pg.newpage {
|
||||
g.addLineOverlay(prompt)
|
||||
} else {
|
||||
@@ -559,18 +578,6 @@ func (g *RogueGame) addLinePaged(line string, isFlush bool) {
|
||||
pg.maxlen = len(prompt)
|
||||
}
|
||||
|
||||
if !isFlush && (pg.lineCnt != 0 || line != "") {
|
||||
g.scr.Hw.MvAddStr(pg.lineCnt, 0, line)
|
||||
|
||||
pg.lineCnt++
|
||||
if pg.maxlen < len(line) {
|
||||
pg.maxlen = len(line)
|
||||
}
|
||||
|
||||
pg.lastLine = line
|
||||
}
|
||||
}
|
||||
|
||||
// addLineOverlay draws the accumulated list in a box at the top right
|
||||
// of the screen, prompts, and restores what was beneath (things.c
|
||||
// add_line).
|
||||
|
||||
Reference in New Issue
Block a user