Skip to content

Commit

Permalink
Change reference to Home / Away to colors, changed fonts, updated theme
Browse files Browse the repository at this point in the history
  • Loading branch information
achhabra2 committed May 13, 2020
1 parent 356d1e9 commit 7cdd3ec
Show file tree
Hide file tree
Showing 20 changed files with 2,005 additions and 55 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Better KQB Scoreboard

Better KQB Scoreboard helps casters keep track of the score and display it beautifully. KQB Scoreboard was written in Go and provides a front end interface for use with OBS. It will import the teams and standings from IGL to display within your cast.
Better KQB Scoreboard helps casters keep track of scores and display them beautifully within OBS. It is primarily targeted at IGL match casters, but will be adding support for custom matches as well. It allows you to directly import team data (teams, standings, avatars, etc.) directly from IGL so there is no room for error when setting up your stream. It will prompt you to record map wins and will tally the results for you and they will be displayed properly within the widget. Thus allowing you to focus on streaming and let the widget handle the legwork for you.

KQB Scoreboard was written in Go and provides a browser widget interface for use with OBS.

## Instructions
1. Download the entire release zip file from github
2. Unzip the directory and run the kqb-scoreboard executable (Mac and Windows compatible)
3. Create a browser source in OBS pointed at http://localhost:8080
* Within the browser source set the dimensions to 1920 x 450
* Within the browser source set the dimensions to 1440 x 450 (Large) or 1920 x 450 (Smaller)
* Then add a green chroma filter to make it transparent
4. Profit

Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ go 1.14

require (
github.com/gorilla/websocket v1.4.2
github.com/joho/godotenv v1.3.0
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/manifoldco/promptui v0.7.0
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd // indirect
golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f // indirect
)
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWs
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a h1:FaWFmfWdAUKbSCtOU2QjDaorUexogfaMgbipgYATUMU=
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
Expand All @@ -29,8 +27,6 @@ github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0=
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
Binary file modified kqb-scoreboard
Binary file not shown.
Binary file modified kqb-scoreboard.exe
Binary file not shown.
20 changes: 13 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
IglWestID = "5e4c6b5178d46abdfeb49e71"
IglEastID = "5e4b295560f132acbb31b8f5"
PlaceholderImage = "https://bulma.io/images/placeholders/128x128.png"
KQBAvatarImage = "/avatar.png"
)

type Team struct {
Expand All @@ -38,8 +39,8 @@ type Stats struct {
MatchesLost int
}

var h Team = Team{"Home Team", PlaceholderImage, 1, 1, Stats{1, 1, 1, 1}}
var a Team = Team{"Away Team", PlaceholderImage, 1, 1, Stats{1, 1, 1, 1}}
var h Team = Team{"Blue Team", PlaceholderImage, 1, 1, Stats{1, 1, 1, 1}}
var a Team = Team{"Gold Team", PlaceholderImage, 1, 1, Stats{1, 1, 1, 1}}
var s Scoreboard = Scoreboard{&h, &a, 0, 0, 0, 0}

func setupLogs() {
Expand All @@ -61,13 +62,16 @@ func main() {
wg.Add(1)
StartHTTPServer()
SetupCloseHandler()
apiUrl, _ := PromptIglCircuit()
apiUrl, err := PromptIglCircuit()
if err != nil {
os.Exit(0)
}
teams := GetTeamInfo(apiUrl)
home, err := PromptTeam("Home", teams)
home, err := PromptTeam("Blue", teams)
if err != nil {
os.Exit(0)
}
away, err := PromptTeam("Away", teams)
away, err := PromptTeam("Gold", teams)
if err != nil {
os.Exit(0)
}
Expand Down Expand Up @@ -116,6 +120,8 @@ func GetTeamInfo(url string) []Team {
test.Div = int(t.(map[string]interface{})["div"].(float64))
if t.(map[string]interface{})["logo"] != nil {
test.Img = t.(map[string]interface{})["logo"].(string)
} else {
test.Img = KQBAvatarImage
}
test.Stats.GamesWon, _ = strconv.Atoi(s.(map[string]interface{})["Games Won"].(string))
test.Stats.GamesLost, _ = strconv.Atoi(s.(map[string]interface{})["Games Lost"].(string))
Expand Down Expand Up @@ -197,8 +203,8 @@ func RecordMapScore(s *Scoreboard) error {
ID int
}
m := []MapWinPrompt{
{fmt.Sprintf("%s (Home) Won Map", s.Home.Name), "cyan", 0},
{fmt.Sprintf("%s (Away) Won Map", s.Away.Name), "yellow", 1},
{fmt.Sprintf("%s (Blue) Won Map", s.Home.Name), "cyan", 0},
{fmt.Sprintf("%s (Gold) Won Map", s.Away.Name), "yellow", 1},
}
templates := &promptui.SelectTemplates{
Label: "{{ . | red | bold }}?",
Expand Down
35 changes: 35 additions & 0 deletions prompts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package main

import (
"fmt"

"github.com/manifoldco/promptui"
)

func PromptIGLCustom() {
// Each template displays the data received from the prompt with some formatting.
templates := &promptui.PromptTemplates{
Prompt: "{{ . }} ",
Valid: "{{ . | green }} ",
Invalid: "{{ . | red }} ",
Success: "{{ . | bold }} ",
Confirm: "Is this an IGL Match or Custom Match?",
}

prompt := promptui.Prompt{
Label: "Select Match Type?",
Templates: templates,
IsConfirm: true,
}

result, err := prompt.Run()

if err != nil {
fmt.Printf("Prompt failed %v\n", err)
return
}

// The result of the prompt, if valid, is displayed in a formatted message.
fmt.Printf("You answered %s\n", result)
return
}
Binary file modified screenshots/scoreboard-ss-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/scoreboard-ss-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions static/fitty.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added static/fonts/pirulenrg.eot
Binary file not shown.
Binary file added static/fonts/pirulenrg.otf
Binary file not shown.
Loading

0 comments on commit 7cdd3ec

Please sign in to comment.