Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
epic-64 committed Oct 19, 2024
1 parent 049f308 commit 0a968b9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/ScalaScape/components/Lantern.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ case class TerminalString(content: String, position: Pos, color: TextColor = DEF
case class LineWord(content: String, color: TextColor = TextColor.ANSI.DEFAULT)

case class TerminalLine(words: List[LineWord], pos: Pos):
def render(): TerminalParagraph =
def toParagraph: TerminalParagraph =
val x = pos.x

// create a list of TerminalString objects, each one offset by the length of the previous string
Expand All @@ -22,7 +22,7 @@ case class TerminalLine(words: List[LineWord], pos: Pos):
}

TerminalParagraph(terminalStrings)
end render
end toParagraph
end TerminalLine

case class TerminalParagraph(list: List[TerminalString]):
Expand Down
32 changes: 16 additions & 16 deletions src/main/scala/ScalaScape/components/Skills.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ trait SubSkill extends Skill:
val par: Skill = parent(state)
val parentXpString = s"${par.name} (${par.level} / 99)"
val parentXpString2 = s"${par.xp} / ${par.xpForNextLevel}"

TerminalParagraph(
List(
TerminalString(parentXpString, Pos(x, y), WHITE),
TerminalString(parentXpString2, Pos(x + width - parentXpString2.length, y), BLACK_BRIGHT)
)

val parts = List(
TerminalString(parentXpString, Pos(x, y), WHITE),
TerminalString(parentXpString2, Pos(x + width - parentXpString2.length, y), BLACK_BRIGHT)
)

TerminalParagraph(parts)
++ ProgressBar.from(pb(width, par.progressToNextLevel, Pos(x, y + 1), BLUE_BRIGHT))
}

Expand All @@ -84,18 +84,18 @@ trait SubSkill extends Skill:
) ++ ProgressBar.from(pb(width, progressToNextLevel, Pos(x, y + offset + 1), CYAN))
}

def actionBar(offset: Int) =
TerminalLine(
List(
LineWord("Action Progress: ETA: ", WHITE),
LineWord(f"$remainingDuration%1.1f", CYAN_BRIGHT),
LineWord(" seconds", WHITE)
),
Pos(x, y + offset)
).render()
def actionBar(offset: Int) = {
val line = List(
LineWord("Action Progress: ETA: ", WHITE),
LineWord(f"$remainingDuration%1.1f", CYAN_BRIGHT),
LineWord(" seconds", WHITE)
)

TerminalLine(line, Pos(x, y + offset)).toParagraph
++ ProgressBar.from(pb(width, actionProgress, Pos(x, y + offset + 1), GREEN_BRIGHT))
}

TerminalParagraph(skillXpBar.list ++ masteryXpBar(3).list ++ actionBar(6).list)
skillXpBar ++ masteryXpBar(3) ++ actionBar(6)
end render
end SubSkill

Expand Down

0 comments on commit 0a968b9

Please sign in to comment.