WIP Doodle++ #93

Merged
kirsle merged 4 commits from dpp into master 2024-04-19 05:49:41 +00:00
6 changed files with 12 additions and 28 deletions
Showing only changes of commit 33dc17bb19 - Show all commits

View File

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

View File

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

View File

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

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

View File

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