Doodle++ Code Cleanup

pull/93/head
Noah 2024-04-18 22:49:12 -07:00
parent a79601f983
commit 33dc17bb19
6 changed files with 12 additions and 28 deletions

View File

@ -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)

View File

@ -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() {

View File

@ -1,6 +1,3 @@
//go:build dpp
// +build dpp
/*
Package bootstrap is a common import between the Doodle and Doodad programs.

View File

@ -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{}
}

View File

@ -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

View File

@ -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 {