Doodle++ Code Cleanup
This commit is contained in:
parent
a79601f983
commit
33dc17bb19
|
@ -29,7 +29,7 @@ func init() {
|
||||||
} else if !dpp.Driver.IsRegistered() {
|
} else if !dpp.Driver.IsRegistered() {
|
||||||
VersionSuffix = " (shareware)"
|
VersionSuffix = " (shareware)"
|
||||||
} else {
|
} else {
|
||||||
VersionSuffix = ""
|
VersionSuffix = " (registered)"
|
||||||
}
|
}
|
||||||
|
|
||||||
Version = fmt.Sprintf("v%s%s", branding.Version, VersionSuffix)
|
Version = fmt.Sprintf("v%s%s", branding.Version, VersionSuffix)
|
||||||
|
|
|
@ -112,9 +112,11 @@ func (u *EditorUI) SetupMenuBar(d *Doodle) *ui.MenuBar {
|
||||||
levelMenu.AddItemAccel("Playtest", "P", func() {
|
levelMenu.AddItemAccel("Playtest", "P", func() {
|
||||||
u.Scene.Playtest()
|
u.Scene.Playtest()
|
||||||
})
|
})
|
||||||
|
if balance.DPP {
|
||||||
levelMenu.AddItem("Publish", func() {
|
levelMenu.AddItem("Publish", func() {
|
||||||
u.OpenPublishWindow()
|
u.OpenPublishWindow()
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
levelMenu.AddSeparator()
|
levelMenu.AddSeparator()
|
||||||
levelMenu.AddItem("Screenshot", func() {
|
levelMenu.AddItem("Screenshot", func() {
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
//go:build dpp
|
|
||||||
// +build dpp
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package bootstrap is a common import between the Doodle and Doodad programs.
|
Package bootstrap is a common import between the Doodle and Doodad programs.
|
||||||
|
|
|
@ -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{}
|
|
||||||
}
|
|
|
@ -8,9 +8,12 @@ import (
|
||||||
"git.kirsle.net/SketchyMaze/doodle/pkg/plus"
|
"git.kirsle.net/SketchyMaze/doodle/pkg/plus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Driver is the currently installed Doodle++ implementation (FOSS or DPP).
|
||||||
var Driver Pluggable
|
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 {
|
type Pluggable interface {
|
||||||
LoadFromEmbeddable(string, filesystem.Embeddable, bool) (*doodads.Doodad, error)
|
LoadFromEmbeddable(string, filesystem.Embeddable, bool) (*doodads.Doodad, error)
|
||||||
IsRegistered() bool
|
IsRegistered() bool
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
package dpp
|
package dpp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
|
|
||||||
"git.kirsle.net/SketchyMaze/doodle/pkg/doodads"
|
"git.kirsle.net/SketchyMaze/doodle/pkg/doodads"
|
||||||
"git.kirsle.net/SketchyMaze/doodle/pkg/filesystem"
|
"git.kirsle.net/SketchyMaze/doodle/pkg/filesystem"
|
||||||
"git.kirsle.net/SketchyMaze/doodle/pkg/level"
|
"git.kirsle.net/SketchyMaze/doodle/pkg/level"
|
||||||
|
@ -13,8 +11,6 @@ import (
|
||||||
"git.kirsle.net/SketchyMaze/doodle/pkg/plus"
|
"git.kirsle.net/SketchyMaze/doodle/pkg/plus"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNotImplemented = errors.New("not implemented")
|
|
||||||
|
|
||||||
type Plugin struct{}
|
type Plugin struct{}
|
||||||
|
|
||||||
func (Plugin) LoadFromEmbeddable(filename string, fs filesystem.Embeddable, force bool) (*doodads.Doodad, error) {
|
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) {
|
func (Plugin) GetRegistration() (plus.Registration, error) {
|
||||||
return plus.Registration{}, ErrNotImplemented
|
return plus.Registration{}, plus.ErrNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Plugin) UploadLicenseFile(string) (plus.Registration, error) {
|
func (Plugin) UploadLicenseFile(string) (plus.Registration, error) {
|
||||||
return plus.Registration{}, ErrNotImplemented
|
return plus.Registration{}, plus.ErrNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Plugin) IsLevelPackSigned(*levelpack.LevelPack) bool {
|
func (Plugin) IsLevelPackSigned(*levelpack.LevelPack) bool {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user