doodle/pkg/branding/builds/builds.go

37 lines
812 B
Go
Raw Permalink Normal View History

2024-04-19 03:23:07 +00:00
// Package builds handles build-specific branding strings.
package builds
import (
"fmt"
"git.kirsle.net/SketchyMaze/doodle/pkg/balance"
"git.kirsle.net/SketchyMaze/doodle/pkg/branding"
"git.kirsle.net/SketchyMaze/doodle/pkg/plus/dpp"
2024-04-19 03:23:07 +00:00
)
var (
/*
Version string for user display.
It may look like the following:
- "v1.2.3 (open source)" for FOSS builds of the game.
- "v1.2.3 (shareware)" for unregistered Doodle++ builds.
- "v1.2.3" for registered Doodle++ builds.
*/
Version = branding.Version
VersionSuffix = " (unknown)"
)
func init() {
if !balance.DPP {
VersionSuffix = " (open source)"
} else if !dpp.Driver.IsRegistered() {
2024-04-19 03:23:07 +00:00
VersionSuffix = " (shareware)"
} else {
2024-04-19 05:49:12 +00:00
VersionSuffix = " (registered)"
2024-04-19 03:23:07 +00:00
}
Version = fmt.Sprintf("v%s%s", branding.Version, VersionSuffix)
}