diff options
| author | Joe <rbo@gmx.us> | 2024-05-10 20:20:20 +0200 | 
|---|---|---|
| committer | Joe <rbo@gmx.us> | 2024-05-10 20:20:20 +0200 | 
| commit | 70c7c5d6e110d42dd2d8404268d283baf78626fb (patch) | |
| tree | cdfd6efd09c9237351f72c54357e10549326b066 /src | |
| parent | help (diff) | |
| download | hardflip-70c7c5d6e110d42dd2d8404268d283baf78626fb.tar.gz hardflip-70c7c5d6e110d42dd2d8404268d283baf78626fb.tar.bz2 hardflip-70c7c5d6e110d42dd2d8404268d283baf78626fb.tar.xz hardflip-70c7c5d6e110d42dd2d8404268d283baf78626fb.tar.zst hardflip-70c7c5d6e110d42dd2d8404268d283baf78626fb.zip  | |
go
Diffstat (limited to '')
| -rw-r--r-- | src/c_defs.go | 2 | ||||
| -rw-r--r-- | src/e_keys.go | 1 | ||||
| -rw-r--r-- | src/i_help.go | 14 | 
3 files changed, 14 insertions, 3 deletions
diff --git a/src/c_defs.go b/src/c_defs.go index 928e4a3..5d741ae 100644 --- a/src/c_defs.go +++ b/src/c_defs.go @@ -179,7 +179,7 @@ const (  )  var ( -	HELP_KEYS = [][2]string{ +	HELP_NORMAL_KEYS = [][2]string{  	{"j | <down>",	"Down"},  	{"k | <up>",	"Up"},  	{"a | i",		"Insert host"}, diff --git a/src/e_keys.go b/src/e_keys.go index 079dc88..9f82ccc 100644 --- a/src/e_keys.go +++ b/src/e_keys.go @@ -842,6 +842,7 @@ func e_help_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {  		return true  	} else if event.Rune() == 'j' ||  			  event.Key() == tcell.KeyDown { +		ui.help_scroll += 1  	} else if event.Rune() == 'k' ||  			  event.Key() == tcell.KeyUp {  		if ui.help_scroll >= 0 { diff --git a/src/i_help.go b/src/i_help.go index 335d5d2..bafe1e2 100644 --- a/src/i_help.go +++ b/src/i_help.go @@ -51,6 +51,8 @@  package main +import "github.com/gdamore/tcell/v2" +  func i_draw_help(ui HardUI) {  	if ui.dim[W] < 12 || ui.dim[H] < 6 {  		return @@ -65,8 +67,16 @@ func i_draw_help(ui HardUI) {  		win.L, win.T, win.R, win.B,  		ui.style[BOX_STYLE], ui.style[HEAD_STYLE],  		" Keys ", true) -	i_help_normal(ui) +	line := 0 +	i_help_normal(ui, win, &line)  } -func i_help_normal(ui HardUI) { +func i_help_normal(ui HardUI, win Quad, line *int) { +	for _, v := range HELP_NORMAL_KEYS { +		i_draw_text(ui.s, win.L + 4,  win.T + 1 + *line, win.R - 1, win.T + 1 + *line, +			ui.style[DEF_STYLE], v[0]) +		i_draw_text(ui.s, win.L + 10, win.T + 1 + *line, win.R - 1, win.T + 1 +  *line, +			ui.style[DEF_STYLE], v[1]) +		*line += 1 +	}  }  | 
