Removes duplicated code in messaging system

This commit is contained in:
sloumdrone 2019-09-15 21:26:32 -07:00
parent e7a1b4e348
commit 1af11f1b8f
1 changed files with 1 additions and 16 deletions

View File

@ -563,23 +563,8 @@ func (c *client) SetMessage(msg string, isError bool) {
}
func (c *client) DrawMessage() {
leadIn, leadOut := "", ""
if c.Options["theme"] == "normal" {
leadIn = "\033[7m"
leadOut = "\033[0m"
}
if c.MessageIsErr {
leadIn = "\033[31;1m"
leadOut = "\033[0m"
if c.Options["theme"] == "normal" {
leadIn = "\033[41;1;7m"
}
}
cui.MoveCursorTo(c.Height-1, 0)
fmt.Printf("%s%-*.*s%s", leadIn, c.Width, c.Width, c.Message, leadOut)
fmt.Print(c.RenderMessage())
}
func (c *client) RenderMessage() string {