mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Reorder Cancel option in menus to be more consistent (fixes #32)
This commit is contained in:
parent
c6b99a50e2
commit
d6bed7ad4c
@ -292,6 +292,7 @@ func searchCurseforgeInternal(args []string, mcVersion string) (bool, modInfo) {
|
||||
|
||||
menu := wmenu.NewMenu("Choose a number:")
|
||||
|
||||
menu.Option("Cancel", nil, false, nil)
|
||||
if len(fuzzySearchResults) == 0 {
|
||||
for i, v := range results {
|
||||
menu.Option(v.Name, v, i == 0, nil)
|
||||
@ -301,7 +302,6 @@ func searchCurseforgeInternal(args []string, mcVersion string) (bool, modInfo) {
|
||||
menu.Option(results[v.Index].Name, results[v.Index], i == 0, nil)
|
||||
}
|
||||
}
|
||||
menu.Option("Cancel", nil, false, nil)
|
||||
|
||||
var modInfoData modInfo
|
||||
var cancelled bool
|
||||
|
@ -105,10 +105,10 @@ func installViaSearch(query string, pack core.Pack) error {
|
||||
|
||||
//Create menu for the user to choose the correct mod
|
||||
menu := wmenu.NewMenu("Choose a number:")
|
||||
menu.Option("Cancel", nil, false, nil)
|
||||
for i, v := range results {
|
||||
menu.Option(v.Title, v, i == 0, nil)
|
||||
}
|
||||
menu.Option("Cancel", nil, false, nil)
|
||||
|
||||
menu.Action(func(menuRes []wmenu.Opt) error {
|
||||
if len(menuRes) != 1 || menuRes[0].Value == nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user