Skip to content

Commit

Permalink
added a conditional modal for savefile overwrites
Browse files Browse the repository at this point in the history
  • Loading branch information
denandz committed Oct 4, 2020
1 parent bbed3f0 commit 7e93239
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions views/saveview.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ func (view *SaveRestoreView) Init(app *tview.Application, replays *ReplayView, p
} else {
msg = "Save Failed"
}

notifModal(app, view.Layout, msg)
} else {
msg = "File Exists"
boolModal(app, view.Layout, "File exists - overwrite?", func(b bool) {
if b == true {
if !Save(filename.GetText(), replays, proxy) {
log.Println("[!] Error: Save failed")
}
}
})
}

notifModal(app, view.Layout, msg)

}).AddButton("Load", func() {
})
form.AddButton("Load", func() {
if Load(filename.GetText(), replays, proxy) {
msg = "Loaded"
} else {
Expand Down

0 comments on commit 7e93239

Please sign in to comment.