Skip to content

package editor_plugin

import "kaijuengine.com/editor/editor_plugin"

Functions

AddGitPluginToStorage

func AddGitPluginToStorage(modulePath string) error

AddPluginFromGit

func AddPluginFromGit(gitURL string) (string, error)

AddPluginFromGitHub

func AddPluginFromGitHub(githubURL string) (string, error)

CreatePluginProject

func CreatePluginProject(path string) error

GetStoredGitPlugins

func GetStoredGitPlugins() ([]string, error)

IsPluginFolder

func IsPluginFolder(path string) bool

PluginsFolder

func PluginsFolder() (string, error)

RemoveGitPluginFromStorage

func RemoveGitPluginFromStorage(modulePath string) error

UpdatePluginConfigState

func UpdatePluginConfigState(info PluginInfo) error

Types

EditorInterface

interface

type EditorInterface interface {
    Host() *engine.Host
    BlurInterface()
    FocusInterface()
    Actions() *editor_action.Service
    Settings() *editor_settings.Settings
    Events() *editor_events.EditorEvents
    History() *memento.History
    Project() *project.Project
    ProjectFileSystem() *project_file_system.FileSystem
    StageView() *editor_stage_view.StageView

    // Workspace registry access.
    SelectWorkspace(id string) error
    Workspace(id string) (editor_workspace.Workspace, bool)
    Workspaces() []editor_workspace.Workspace
}

EditorInterface is what plugins receive in their Launch() callback. It is a superset of editor_workspace.WorkspaceEditorInterface — anything a built-in workspace can do, a plugin can do during runtime.

To register a workspace, plugins call editor_workspace_registry.Register(&MyWorkspace{}) from their package init() (alongside the existing editor.RegisterPlugin call). The editor's reconcile step picks up late registrations on plugin launch and rebuilds the menu bar tab strip.

EditorPlugin

interface

type EditorPlugin interface {
    Launch(EditorInterface) error
}

PluginConfig

struct

type PluginConfig struct {
    Name        string
    PackageName string
    Description string
    Version     float64
    Author      string
    Website     string
    Enabled     bool
    GitModule   string `json:",omitempty"`
}

PluginInfo

struct

type PluginInfo struct {
    Path   string
    Config PluginConfig
}

AvailablePlugins

func AvailablePlugins() []PluginInfo