NFEditor

package
v0.0.0-...-6b2d15a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MainMenuSceneTemplate = NFScene.New(
	"MainMenu", NFLayout.NewLayout(
		"VBox",
		NFLayout.NewChildren(
			NFWidget.New(
				"Label",
				NFWidget.NewChildren(),
				NFData.NewNFInterfaceMap(
					NFData.NewKeyVal("Text", "Main Menu"),
				),
			),
			NFWidget.New(
				"Button",
				NFWidget.NewChildren(),
				NFData.NewNFInterfaceMap(
					NFData.NewKeyVal("Text", "New Game"),
					NFData.NewKeyVal("OnTapped", "NewGame"),
					NFData.NewKeyVal("OnTappedArgs", NFData.NewNFInterfaceMap(
						NFData.NewKeyVal("NewGameScene", "NewGame"),
					)),
				),
			),
			NFWidget.New(
				"Button",
				NFWidget.NewChildren(),
				NFData.NewNFInterfaceMap(
					NFData.NewKeyVal("Text", "Load Game"),
					NFData.NewKeyVal("OnTapped", "LoadGame"),
				),
			),
			NFWidget.New(
				"Button",
				NFWidget.NewChildren(),
				NFData.NewNFInterfaceMap(
					NFData.NewKeyVal("Text", "Settings"),
					NFData.NewKeyVal("OnTapped", "Settings"),
				),
			),
			NFWidget.New(
				"Button",
				NFWidget.NewChildren(),
				NFData.NewNFInterfaceMap(
					NFData.NewKeyVal("Text", "Quit"),
					NFData.NewKeyVal("OnTapped", "Quit"),
				),
			),
		),
		NFData.NewNFInterfaceMap(),
	),
	NFData.NewNFInterfaceMap(),
)
View Source
var NewGameSceneTemplate = NFScene.New(
	"NewGame", NFLayout.NewLayout(
		"ExampleLayout",
		NFLayout.NewChildren(
			NFWidget.New(
				"ExampleWidget",
				NFWidget.NewChildren(),
				NFData.NewNFInterfaceMap(
					NFData.NewKeyVal("message", "Hello World"),
					NFData.NewKeyVal("action", "CustomFunction.ExampleFunction"),
				),
			),
		),
		NFData.NewNFInterfaceMap(),
	),
	NFData.NewNFInterfaceMap(),
)

Functions

func CheckAndInstallDependencies

func CheckAndInstallDependencies(window fyne.Window)

func CreateMainContent

func CreateMainContent(window fyne.Window)

CreateMainContent updates the loading variable as the NovellaForge content is created

func CreateMainGrid

func CreateMainGrid(window fyne.Window) fyne.CanvasObject

CreateMainGrid creates the main grid layout for the main window

func CreateMainMenu

func CreateMainMenu(window fyne.Window)

func CreateParamItem

func CreateParamItem(key string, val interface{}, parentObject NFData.CoupledObject, parentObjectKey string, parentForm *widget.Form, window fyne.Window) *widget.FormItem

CreateParamItem creates a FormItem for a parameter

Current Issues: The entries do not properly display validation issues or disable save buttons, but nothing will be saved if the entry is invalid, so it's not a critical issue

func CreateProjectSettings

func CreateProjectSettings(window fyne.Window) fyne.CanvasObject

func CreateSceneEditor

func CreateSceneEditor(window fyne.Window) fyne.CanvasObject

func CreateSceneObjects

func CreateSceneObjects(window fyne.Window) fyne.CanvasObject

func CreateScenePreview

func CreateScenePreview(window fyne.Window) fyne.CanvasObject

func CreateSceneProperties

func CreateSceneProperties(window fyne.Window) fyne.CanvasObject

func CreateSceneSelector

func CreateSceneSelector(window fyne.Window) fyne.CanvasObject

func FormButtons

func FormButtons(parentKey string, parentForm *widget.Form, parentObject NFData.CoupledObject, window fyne.Window) *widget.FormItem

func InitButtons

func InitButtons(window fyne.Window, continueLastButton *widget.Button, openRecentButton *widget.Button) error

func MakeFromTemplate

func MakeFromTemplate(templatePath, destinationPath string, data interface{}) error

func NewProjectDialog

func NewProjectDialog(window fyne.Window)

func OpenFromInfo

func OpenFromInfo(info NFInfo, window fyne.Window) error

func OpenProjectDialog

func OpenProjectDialog(window fyne.Window)

func OpenRecentDialog

func OpenRecentDialog(window fyne.Window) error

func SanitizeProjectName

func SanitizeProjectName(name string) (bool, error)

SanitizeProjectName sanitizes the project name to ensure it's a valid Go identifier

func UpdateMenuBar

func UpdateMenuBar(window fyne.Window)

func UpdateProjectInfo

func UpdateProjectInfo(info NFInfo) error

Types

type CustomShortcut

type CustomShortcut struct {
	// contains filtered or unexported fields
}

func NewCustomShortcut

func NewCustomShortcut(name string, key fyne.KeyName, mod fyne.KeyModifier) *CustomShortcut

func (CustomShortcut) Key

func (c CustomShortcut) Key() fyne.KeyName

func (CustomShortcut) Mod

func (c CustomShortcut) Mod() fyne.KeyModifier

func (CustomShortcut) ShortcutName

func (c CustomShortcut) ShortcutName() string

type NFInfo

type NFInfo struct {
	Name     string    `json:"Name"`
	Path     string    `json:"Path"`
	OpenDate time.Time `json:"Last Opened"`
}

func Deserialize

func Deserialize(file []byte) (project NFInfo, err error)

func ReadProjectInfo

func ReadProjectInfo() ([]NFInfo, error)

ReadProjectInfo reads the project info from the project file

func (NFInfo) Load

func (p NFInfo) Load(window fyne.Window) error

Load takes a deserialized project and loads it into the editor loading the scenes and functions as well

type NFProject

type NFProject struct {
	Info   NFInfo
	Config *NFConfig.NFConfig
}
var (
	//go:embed Templates/*
	Templates     embed.FS
	ActiveProject *NFProject
)

func (NFProject) Create

func (p NFProject) Create(window fyne.Window) error

func (NFProject) SerializeInfo

func (p NFProject) SerializeInfo() []byte

type OpenPage

type OpenPage int // Enum for the different pages of the editor to allow changing the menu bar based on the page
const (
	HomePage OpenPage = iota
	EditorPage
)

Directories

Path Synopsis
Templates

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL