fix wu line iface, pending opacity
This commit is contained in:
36
engine/gamelog/messages.go
Normal file
36
engine/gamelog/messages.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package gamelog
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var Log = &GameLog{RedrawLogs: true}
|
||||
|
||||
type GameLog struct {
|
||||
Messages []Message
|
||||
MaxHeight int
|
||||
RedrawLogs bool
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
GameTS uint64
|
||||
RealTS time.Time
|
||||
Message string
|
||||
}
|
||||
|
||||
func (gl *GameLog) GetMaxHeight() int {
|
||||
return gl.MaxHeight
|
||||
}
|
||||
|
||||
func (gl *GameLog) SetMaxHeight(i int) {
|
||||
gl.MaxHeight = i
|
||||
}
|
||||
|
||||
func (gl *GameLog) Msg(msg string) {
|
||||
gl.Messages = append(gl.Messages, Message{
|
||||
GameTS: 0, //fixme
|
||||
RealTS: time.Now(),
|
||||
Message: msg,
|
||||
})
|
||||
gl.RedrawLogs = true
|
||||
}
|
||||
Reference in New Issue
Block a user