diff --git a/pkg/branding/builds/builds.go b/pkg/branding/builds/builds.go index d91cd26..d481df1 100644 --- a/pkg/branding/builds/builds.go +++ b/pkg/branding/builds/builds.go @@ -29,7 +29,7 @@ func init() { } else if !dpp.Driver.IsRegistered() { VersionSuffix = " (shareware)" } else { - VersionSuffix = "" + VersionSuffix = " (registered)" } Version = fmt.Sprintf("v%s%s", branding.Version, VersionSuffix) diff --git a/pkg/editor_ui_menubar.go b/pkg/editor_ui_menubar.go index d9f9fe0..9ddae37 100644 --- a/pkg/editor_ui_menubar.go +++ b/pkg/editor_ui_menubar.go @@ -112,9 +112,11 @@ func (u *EditorUI) SetupMenuBar(d *Doodle) *ui.MenuBar { levelMenu.AddItemAccel("Playtest", "P", func() { u.Scene.Playtest() }) - levelMenu.AddItem("Publish", func() { - u.OpenPublishWindow() - }) + if balance.DPP { + levelMenu.AddItem("Publish", func() { + u.OpenPublishWindow() + }) + } levelMenu.AddSeparator() levelMenu.AddItem("Screenshot", func() { diff --git a/pkg/plus/bootstrap/bootstrap_dpp.go b/pkg/plus/bootstrap/bootstrap.go similarity index 93% rename from pkg/plus/bootstrap/bootstrap_dpp.go rename to pkg/plus/bootstrap/bootstrap.go index 5e6c566..066a339 100644 --- a/pkg/plus/bootstrap/bootstrap_dpp.go +++ b/pkg/plus/bootstrap/bootstrap.go @@ -1,6 +1,3 @@ -//go:build dpp -// +build dpp - /* Package bootstrap is a common import between the Doodle and Doodad programs. diff --git a/pkg/plus/bootstrap/bootstrap_foss.go b/pkg/plus/bootstrap/bootstrap_foss.go deleted file mode 100644 index dd213f1..0000000 --- a/pkg/plus/bootstrap/bootstrap_foss.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build !dpp -// +build !dpp - -package bootstrap - -import ( - "git.kirsle.net/SketchyMaze/doodle/pkg/plus/dpp" -) - -var Driver dpp.Pluggable - -func InitPlugins() { - Driver = dpp.Plugin{} -} diff --git a/pkg/plus/dpp/plugin.go b/pkg/plus/dpp/plugin.go index 606d883..ebb2e14 100644 --- a/pkg/plus/dpp/plugin.go +++ b/pkg/plus/dpp/plugin.go @@ -8,9 +8,12 @@ import ( "git.kirsle.net/SketchyMaze/doodle/pkg/plus" ) +// Driver is the currently installed Doodle++ implementation (FOSS or DPP). var Driver Pluggable -// Plugin +// Pluggable defines the interface for Doodle++ functions, so that their implementations +// can avoid cyclic dependency errors. Documentation for these functions is only spelled +// out in the SketchyMaze/dpp package. type Pluggable interface { LoadFromEmbeddable(string, filesystem.Embeddable, bool) (*doodads.Doodad, error) IsRegistered() bool diff --git a/pkg/plus/dpp/plus_foss.go b/pkg/plus/dpp/plus_foss.go index f122399..87ddfa9 100644 --- a/pkg/plus/dpp/plus_foss.go +++ b/pkg/plus/dpp/plus_foss.go @@ -4,8 +4,6 @@ package dpp import ( - "errors" - "git.kirsle.net/SketchyMaze/doodle/pkg/doodads" "git.kirsle.net/SketchyMaze/doodle/pkg/filesystem" "git.kirsle.net/SketchyMaze/doodle/pkg/level" @@ -13,8 +11,6 @@ import ( "git.kirsle.net/SketchyMaze/doodle/pkg/plus" ) -var ErrNotImplemented = errors.New("not implemented") - type Plugin struct{} func (Plugin) LoadFromEmbeddable(filename string, fs filesystem.Embeddable, force bool) (*doodads.Doodad, error) { @@ -30,11 +26,11 @@ func (Plugin) IsRegistered() bool { } func (Plugin) GetRegistration() (plus.Registration, error) { - return plus.Registration{}, ErrNotImplemented + return plus.Registration{}, plus.ErrNotImplemented } func (Plugin) UploadLicenseFile(string) (plus.Registration, error) { - return plus.Registration{}, ErrNotImplemented + return plus.Registration{}, plus.ErrNotImplemented } func (Plugin) IsLevelPackSigned(*levelpack.LevelPack) bool {