Compare commits
2 Commits
41f69052b5
...
34a927d426
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34a927d426 | ||
|
|
0591b91f53 |
16
ui.go
16
ui.go
@@ -125,7 +125,7 @@ func (b *Barnard) OnScrollOutputBottom(ui *uiterm.Ui, key uiterm.Key) {
|
||||
b.UiOutput.ScrollBottom()
|
||||
}
|
||||
|
||||
var commands = []string{"/clear", "/deafen", "/exit", "/help", "/quit"}
|
||||
var commands = []string{"/clear", "/deafen", "/exit", "/help", "/quit", "/register"}
|
||||
|
||||
func (b *Barnard) OnFocusPress(ui *uiterm.Ui, key uiterm.Key) {
|
||||
active := b.Ui.Active()
|
||||
@@ -181,8 +181,20 @@ func (b *Barnard) OnTextInput(ui *uiterm.Ui, textbox *uiterm.Textbox, text strin
|
||||
case "/clear":
|
||||
b.OnClearPress(ui, 0)
|
||||
return
|
||||
case "/register":
|
||||
if b.Client != nil && b.Client.Self != nil {
|
||||
if b.Client.Self.IsRegistered() {
|
||||
b.AddOutputLine("Already registered")
|
||||
} else {
|
||||
b.Client.Self.Register()
|
||||
b.AddOutputLine("Registration request sent")
|
||||
}
|
||||
}
|
||||
return
|
||||
case "/help":
|
||||
b.AddOutputLine("/quit /exit /deafen /clear /help")
|
||||
b.AddOutputLine("Commands: /quit /exit /deafen /clear /register /help")
|
||||
b.AddOutputLine("Keys: F1 deafen, F4 transmit, F10 quit, Tab focus, Ctrl+L clear")
|
||||
b.AddOutputLine("Keys: PgUp/PgDn scroll, Home/End top/bottom, Ctrl+W del word")
|
||||
return
|
||||
}
|
||||
if b.Client != nil && b.Client.Self != nil {
|
||||
|
||||
Reference in New Issue
Block a user