// NewReplay returns a new Replay with a given configuration.
NewReplay returns a new Replay with a given configuration.
// NewReplay returns a new Replay with a given configuration .
func NewReplay(cfg ReplayConfig) *Replay {
	rep := &Replay{
		grid:    cfg.Grid,
		decoder: cfg.FrameDecoder,
		auto:    true,
		speed:   1,
		undo:    [][]gruid.FrameCell{},
		keys:    cfg.Keys,
	}
	if rep.keys.Quit == nil {
		rep.keys.Quit = []gruid.Key{gruid.KeyEscape, "Q", "q"}
	}
	if rep.keys.Pause == nil {
		rep.keys.Pause = []gruid.Key{gruid.KeySpace, "P", "p"}
	}
	if rep.keys.SpeedMore == nil {
		rep.keys.SpeedMore = []gruid.Key{"+", "}"}
	}
	if rep.keys.SpeedLess == nil {
		rep.keys.SpeedLess = []gruid.Key{"-", "{"}
	}
	if rep.keys.FrameNext == nil {
		rep.keys.FrameNext = []gruid.Key{gruid.KeyArrowRight, "l"}
	}
	if rep.keys.FramePrev == nil {
		rep.keys.FramePrev = []gruid.Key{gruid.KeyArrowLeft, "h"}
	}
	if rep.keys.Forward == nil {
		rep.keys.Forward = []gruid.Key{gruid.KeyArrowUp, "k"}
	}
	if rep.keys.Backward == nil {
		rep.keys.Backward = []gruid.Key{gruid.KeyArrowDown, "j"}
	}
	if rep.keys.Help == nil {
		rep.keys.Help = []gruid.Key{"?"}
	}
	rep.dirty = true
	max := cfg.Grid.Size()
	rep.pager = NewPager(PagerConfig{
		Grid: gruid.NewGrid(max.X, max.Y),
		Box:  &Box{Title: Text("Help")},
		Keys: PagerKeys{Quit: []gruid.Key{gruid.KeyEscape, "q", "Q", "x", "X", "?"}},
	})
	rep.setPagerLines()
	return rep
}
func NewReplay ( cfg ReplayConfig ) * Replay { rep := & Replay { grid : cfg . Grid , decoder : cfg . FrameDecoder , auto : true , speed : 1 , undo : [ ] [ ] gruid . FrameCell { } , keys : cfg . Keys , } if rep . keys . Quit == nil { rep . keys . Quit = [ ] gruid . Key { gruid . KeyEscape , " " , " " } } if rep . keys . Pause == nil { rep . keys . Pause = [ ] gruid . Key { gruid . KeySpace , " " , " " } } if rep . keys . SpeedMore == nil { rep . keys . SpeedMore = [ ] gruid . Key { " " , " " } } if rep . keys . SpeedLess == nil { rep . keys . SpeedLess = [ ] gruid . Key { " " , " " } } if rep . keys . FrameNext == nil { rep . keys . FrameNext = [ ] gruid . Key { gruid . KeyArrowRight , " " } } if rep . keys . FramePrev == nil { rep . keys . FramePrev = [ ] gruid . Key { gruid . KeyArrowLeft , " " } } if rep . keys . Forward == nil { rep . keys . Forward = [ ] gruid . Key { gruid . KeyArrowUp , " " } } if rep . keys . Backward == nil { rep . keys . Backward = [ ] gruid . Key { gruid . KeyArrowDown , " " } } if rep . keys . Help == nil { rep . keys . Help = [ ] gruid . Key { " " } } rep . dirty = true max := cfg . Grid . Size ( ) rep . pager = NewPager ( PagerConfig { Grid : gruid . NewGrid ( max . X , max . Y ) , Box : & Box { Title : Text ( " " ) } , Keys : PagerKeys { Quit : [ ] gruid . Key { gruid . KeyEscape , " " , " " , " " , " " , " " } } , } ) rep . setPagerLines ( ) return rep }
NewReplay returns a new Replay with a given configuration.
NewReplay returns a new Replay with a given configuration .