-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoteEdit.go
37 lines (33 loc) · 1.01 KB
/
noteEdit.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"strings"
"time"
)
func draftNote(player *characterData, input string) bool {
if !player.DraftNotes.Editing {
player.dirty = true
return false
}
if strings.EqualFold(input, "exit") {
player.DraftNotes.Editing = false
player.dirty = true
goForce(player, "")
return true
}
if strings.EqualFold(input, "wordwrap") {
if player.DraftNotes.Current.WordWrap {
player.DraftNotes.Current.WordWrap = false
} else {
player.DraftNotes.Current.WordWrap = true
}
player.send("wordwrap is now %v", boolToText(player.DraftNotes.Current.WordWrap))
player.dirty = true
}
return true
}
func createNewNote(player *characterData, noteTypeID uuidData) {
newNote := ¬eData{From: noteWhoData{Name: player.Name, UUID: player.UUID}, To: []noteWhoData{{Name: "all"}}, Subject: "", Text: "", Created: time.Now().UTC(), Modified: time.Now().UTC()}
player.DraftNotes.DraftNotes = append(player.DraftNotes.DraftNotes, newNote)
player.DraftNotes.Current = newNote
player.DraftNotes.Editing = true
}