Show volume for users.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"git.stormux.org/storm/barnard/gumble/gumble"
|
"git.stormux.org/storm/barnard/gumble/gumble"
|
||||||
"git.stormux.org/storm/barnard/uiterm"
|
"git.stormux.org/storm/barnard/uiterm"
|
||||||
"sort"
|
"sort"
|
||||||
@@ -11,7 +12,10 @@ func (ti TreeItem) String() string {
|
|||||||
if ti.User.LocallyMuted {
|
if ti.User.LocallyMuted {
|
||||||
return "[MUTED] " + ti.User.Name
|
return "[MUTED] " + ti.User.Name
|
||||||
}
|
}
|
||||||
return ti.User.Name
|
// Calculate total volume as percentage
|
||||||
|
boostPercent := float32(ti.User.Boost-1) * 10
|
||||||
|
totalVolume := ti.User.Volume*100 + boostPercent
|
||||||
|
return fmt.Sprintf("%s [%.0f%%]", ti.User.Name, totalVolume)
|
||||||
}
|
}
|
||||||
if ti.Channel != nil {
|
if ti.Channel != nil {
|
||||||
return "#" + ti.Channel.Name
|
return "#" + ti.Channel.Name
|
||||||
|
Reference in New Issue
Block a user