Merge pull request #27 from satisfactorymodding/command-help-enter
chore: add 'enter to select' to all scenes
This commit is contained in:
commit
774d0c40ef
12 changed files with 62 additions and 0 deletions
|
@ -60,6 +60,7 @@ Download the "all" build [here](https://github.com/Vilsol/ficsit-cli/releases/la
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
* Config files are located in `%APPDATA%\ficsit\`
|
* Config files are located in `%APPDATA%\ficsit\`
|
||||||
|
* Cached downloads are located at `%LOCALAPPDATA%\ficsit\downloadCache`
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
@ -67,6 +68,11 @@ func NewInstallation(root components.RootModel, parent tea.Model, installationDa
|
||||||
model.list.SetSize(model.list.Width(), model.list.Height())
|
model.list.SetSize(model.list.Width(), model.list.Height())
|
||||||
model.list.StatusMessageLifetime = time.Second * 3
|
model.list.StatusMessageLifetime = time.Second * 3
|
||||||
model.list.KeyMap.Quit.SetHelp("q", "back")
|
model.list.KeyMap.Quit.SetHelp("q", "back")
|
||||||
|
model.list.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ func NewInstallations(root components.RootModel, parent tea.Model) tea.Model {
|
||||||
l.AdditionalShortHelpKeys = func() []key.Binding {
|
l.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
return []key.Binding{
|
return []key.Binding{
|
||||||
key.NewBinding(key.WithKeys("n"), key.WithHelp("n", "new installation")),
|
key.NewBinding(key.WithKeys("n"), key.WithHelp("n", "new installation")),
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ func NewNewInstallation(root components.RootModel, parent tea.Model) tea.Model {
|
||||||
l.AdditionalShortHelpKeys = func() []key.Binding {
|
l.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
return []key.Binding{
|
return []key.Binding{
|
||||||
key.NewBinding(key.WithKeys(keys.KeyTab), key.WithHelp(keys.KeyTab, "select")),
|
key.NewBinding(key.WithKeys(keys.KeyTab), key.WithHelp(keys.KeyTab, "select")),
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "continue")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
@ -132,6 +133,11 @@ func NewMainMenu(root components.RootModel) tea.Model {
|
||||||
model.list.SetFilteringEnabled(false)
|
model.list.SetFilteringEnabled(false)
|
||||||
model.list.Title = "Main Menu"
|
model.list.Title = "Main Menu"
|
||||||
model.list.Styles = utils.ListStyles
|
model.list.Styles = utils.ListStyles
|
||||||
|
model.list.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
"github.com/charmbracelet/bubbles/spinner"
|
"github.com/charmbracelet/bubbles/spinner"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
@ -43,6 +44,11 @@ func NewInstalledMods(root components.RootModel, parent tea.Model) tea.Model {
|
||||||
l.Styles = utils.ListStyles
|
l.Styles = utils.ListStyles
|
||||||
l.SetSize(l.Width(), l.Height())
|
l.SetSize(l.Width(), l.Height())
|
||||||
l.KeyMap.Quit.SetHelp("q", "back")
|
l.KeyMap.Quit.SetHelp("q", "back")
|
||||||
|
l.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m := &installedModsList{
|
m := &installedModsList{
|
||||||
root: root,
|
root: root,
|
||||||
|
|
|
@ -3,6 +3,7 @@ package mods
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
@ -104,6 +105,11 @@ func NewModMenu(root components.RootModel, parent tea.Model, mod utils.Mod) tea.
|
||||||
model.list.SetSize(model.list.Width(), model.list.Height())
|
model.list.SetSize(model.list.Width(), model.list.Height())
|
||||||
model.list.StatusMessageLifetime = time.Second * 3
|
model.list.StatusMessageLifetime = time.Second * 3
|
||||||
model.list.KeyMap.Quit.SetHelp("q", "back")
|
model.list.KeyMap.Quit.SetHelp("q", "back")
|
||||||
|
model.list.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package mods
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
@ -70,6 +71,11 @@ func NewModVersion(root components.RootModel, parent tea.Model, mod utils.Mod) t
|
||||||
model.list.SetSize(model.list.Width(), model.list.Height())
|
model.list.SetSize(model.list.Width(), model.list.Height())
|
||||||
model.list.StatusMessageLifetime = time.Second * 3
|
model.list.StatusMessageLifetime = time.Second * 3
|
||||||
model.list.KeyMap.Quit.SetHelp("q", "back")
|
model.list.KeyMap.Quit.SetHelp("q", "back")
|
||||||
|
model.list.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ func NewMods(root components.RootModel, parent tea.Model) tea.Model {
|
||||||
return []key.Binding{
|
return []key.Binding{
|
||||||
key.NewBinding(key.WithKeys("s"), key.WithHelp("s", "sort")),
|
key.NewBinding(key.WithKeys("s"), key.WithHelp("s", "sort")),
|
||||||
key.NewBinding(key.WithKeys("o"), key.WithHelp("o", "order")),
|
key.NewBinding(key.WithKeys("o"), key.WithHelp("o", "order")),
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
l.AdditionalFullHelpKeys = l.AdditionalShortHelpKeys
|
l.AdditionalFullHelpKeys = l.AdditionalShortHelpKeys
|
||||||
|
@ -161,6 +162,11 @@ func NewMods(root components.RootModel, parent tea.Model) tea.Model {
|
||||||
sortFieldList.Title = modsTitle
|
sortFieldList.Title = modsTitle
|
||||||
sortFieldList.Styles = utils.ListStyles
|
sortFieldList.Styles = utils.ListStyles
|
||||||
sortFieldList.SetSize(l.Width(), l.Height())
|
sortFieldList.SetSize(l.Width(), l.Height())
|
||||||
|
sortFieldList.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sortOrderList := list.New([]list.Item{
|
sortOrderList := list.New([]list.Item{
|
||||||
utils.SimpleItemExtra[modsList, ficsit.ModsModsGetModsModsMod]{
|
utils.SimpleItemExtra[modsList, ficsit.ModsModsGetModsModsMod]{
|
||||||
|
@ -192,6 +198,11 @@ func NewMods(root components.RootModel, parent tea.Model) tea.Model {
|
||||||
sortOrderList.Title = modsTitle
|
sortOrderList.Title = modsTitle
|
||||||
sortOrderList.Styles = utils.ListStyles
|
sortOrderList.Styles = utils.ListStyles
|
||||||
sortOrderList.SetSize(l.Width(), l.Height())
|
sortOrderList.SetSize(l.Width(), l.Height())
|
||||||
|
sortOrderList.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m := &modsList{
|
m := &modsList{
|
||||||
root: root,
|
root: root,
|
||||||
|
@ -272,6 +283,11 @@ func (m modsList) Init() tea.Cmd {
|
||||||
|
|
||||||
func (m modsList) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
func (m modsList) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
m.list.KeyMap.Quit.SetHelp("q", "back")
|
m.list.KeyMap.Quit.SetHelp("q", "back")
|
||||||
|
m.list.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case tea.KeyMsg:
|
case tea.KeyMsg:
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
"github.com/charmbracelet/bubbles/spinner"
|
"github.com/charmbracelet/bubbles/spinner"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
@ -36,6 +37,11 @@ func NewModVersionList(root components.RootModel, parent tea.Model, mod utils.Mo
|
||||||
l.Styles = utils.ListStyles
|
l.Styles = utils.ListStyles
|
||||||
l.SetSize(l.Width(), l.Height())
|
l.SetSize(l.Width(), l.Height())
|
||||||
l.KeyMap.Quit.SetHelp("q", "back")
|
l.KeyMap.Quit.SetHelp("q", "back")
|
||||||
|
l.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m := &selectModVersionList{
|
m := &selectModVersionList{
|
||||||
root: root,
|
root: root,
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
@ -79,6 +80,11 @@ func NewProfile(root components.RootModel, parent tea.Model, profileData *cli.Pr
|
||||||
model.list.SetSize(model.list.Width(), model.list.Height())
|
model.list.SetSize(model.list.Width(), model.list.Height())
|
||||||
model.list.StatusMessageLifetime = time.Second * 3
|
model.list.StatusMessageLifetime = time.Second * 3
|
||||||
model.list.KeyMap.Quit.SetHelp("q", "back")
|
model.list.KeyMap.Quit.SetHelp("q", "back")
|
||||||
|
model.list.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
|
return []key.Binding{
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ func NewProfiles(root components.RootModel, parent tea.Model) tea.Model {
|
||||||
l.AdditionalShortHelpKeys = func() []key.Binding {
|
l.AdditionalShortHelpKeys = func() []key.Binding {
|
||||||
return []key.Binding{
|
return []key.Binding{
|
||||||
key.NewBinding(key.WithKeys("n"), key.WithHelp("n", "new profile")),
|
key.NewBinding(key.WithKeys("n"), key.WithHelp("n", "new profile")),
|
||||||
|
key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue