|
@@ -223,19 +223,14 @@ func (sr *SpinRiteMsg) Output() string {
|
|
// Bug: If we're changing to next message (sr.Next == True) ... but the
|
|
// Bug: If we're changing to next message (sr.Next == True) ... but the
|
|
// message is > SpinRite.Length, it shows the text beyond what it should.
|
|
// message is > SpinRite.Length, it shows the text beyond what it should.
|
|
|
|
|
|
- var texthalf int
|
|
|
|
- if Unicode {
|
|
|
|
- texthalf = len([]rune(msg)) / 2
|
|
|
|
- } else {
|
|
|
|
- texthalf = len(msg) / 2
|
|
|
|
- }
|
|
|
|
|
|
+ var texthalf int = StringLen(msg) / 2
|
|
|
|
|
|
// Place text center, outwards. Stopping if there's no space.
|
|
// Place text center, outwards. Stopping if there's no space.
|
|
|
|
|
|
for i := 0; i < texthalf+1; i++ {
|
|
for i := 0; i < texthalf+1; i++ {
|
|
if Unicode {
|
|
if Unicode {
|
|
if sr.OutputR[pos+i] == ' ' {
|
|
if sr.OutputR[pos+i] == ' ' {
|
|
- if texthalf+i < len(msg) {
|
|
|
|
|
|
+ if texthalf+i < StringLen(msg) {
|
|
sr.OutputR[pos+i] = []rune(msg)[texthalf+i]
|
|
sr.OutputR[pos+i] = []rune(msg)[texthalf+i]
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -250,15 +245,15 @@ func (sr *SpinRiteMsg) Output() string {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if sr.OutputB[pos+i] == ' ' {
|
|
if sr.OutputB[pos+i] == ' ' {
|
|
- if texthalf+i < len(msg) {
|
|
|
|
|
|
+ if texthalf+i < StringLen(msg) {
|
|
sr.OutputB[pos+i] = byte(msg[texthalf+i])
|
|
sr.OutputB[pos+i] = byte(msg[texthalf+i])
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
break
|
|
break
|
|
}
|
|
}
|
|
if i != 0 {
|
|
if i != 0 {
|
|
- if sr.OutputB[pos-1] == ' ' {
|
|
|
|
- sr.OutputB[pos-1] = byte(msg[texthalf-i])
|
|
|
|
|
|
+ if sr.OutputB[pos-i] == ' ' {
|
|
|
|
+ sr.OutputB[pos-i] = byte(msg[texthalf-i])
|
|
} else {
|
|
} else {
|
|
break
|
|
break
|
|
}
|
|
}
|