ci / release (push) Successful in 5m5s
ci-platforms / build (amd64, windows, windows-2022) (push) Skipped
ci-platforms / build (arm64, darwin, macos-15) (push) Skipped
ci-platforms / build (amd64, darwin, macos-15-intel) (push) Skipped
ci / checks (push) Successful in 4m41s
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 7m14s
The remaining editor strings and undo step names; component, field, enum, setting, diagnostic and Script API texts under schema.*, enum.*, setting.*, diag.* and api.*; the launcher, the in-game Settings View with a Language setting, the CLI and aego schema show --lang. Every documentation page has a .ru.md translation; the site has a full Russian tree with hreflang, a language switch and ru/llms.txt; aego docs check --lang ru. New doc.tutorial and doc.recipe icons. Fix: an animator restored by a rewind prepares its controller before the replayed step.
86 lines
2.7 KiB
Go
86 lines
2.7 KiB
Go
package projectsettings
|
|
|
|
import (
|
|
"aego/asset"
|
|
"aego/core/ids"
|
|
"aego/engine/i18n"
|
|
"aego/project"
|
|
"aego/ui/core"
|
|
"aego/ui/widgets"
|
|
)
|
|
|
|
type page struct {
|
|
id string
|
|
title string
|
|
order int
|
|
section string
|
|
owner string
|
|
project func(*core.Context, *project.Project) bool
|
|
draw func(any) bool
|
|
drawUI func(*core.Context, any) bool
|
|
settings func(*core.Context) bool
|
|
}
|
|
|
|
func (p *Panel) builtin() []page {
|
|
out := []page{{id: "project", title: i18n.Tr("editor.projectsettings.page_project", "Project"), order: 0, project: p.drawProject}}
|
|
if p.d.Settings != nil {
|
|
out = append(out, page{id: "registry", title: i18n.Tr("editor.projectsettings.page_registry", "Settings Registry"), order: 1000, settings: p.drawRegistry})
|
|
}
|
|
return out
|
|
}
|
|
|
|
func intField(ui *core.Context, label string, v *int, lo float64) bool {
|
|
f := float64(*v)
|
|
e := widgets.DragNumber(ui, ui.ID(label), widgets.Field(ui, label), &f, widgets.NumberOpts{Int: true, Speed: 1, Min: lo, HasMin: true})
|
|
if e.Changed {
|
|
*v = int(f)
|
|
}
|
|
return e.Changed
|
|
}
|
|
|
|
func textField(ui *core.Context, label string, v *string) bool {
|
|
_, committed := widgets.TextFieldRect(ui, ui.ID(label), widgets.Field(ui, label), v, false)
|
|
return committed
|
|
}
|
|
|
|
func (p *Panel) drawProject(ui *core.Context, pr *project.Project) bool {
|
|
changed := textField(ui, i18n.Tr("editor.projectsettings.name", "Name"), &pr.Name)
|
|
ui.TextIn(widgets.Field(ui, i18n.Tr("editor.projectsettings.module", "Module")), pr.Module, ui.Theme.TextDim, core.AlignLeft)
|
|
if p.d.Pipeline != nil {
|
|
var names []string
|
|
var list []ids.AssetID
|
|
cur := -1
|
|
for _, a := range p.d.Pipeline.Assets() {
|
|
if a.Kind != asset.ArtScene {
|
|
continue
|
|
}
|
|
if a.ID == pr.MainScene {
|
|
cur = len(names)
|
|
}
|
|
names = append(names, a.Path)
|
|
list = append(list, a.ID)
|
|
}
|
|
if widgets.Combo(ui, ui.ID("main"), widgets.Field(ui, i18n.Tr("editor.projectsettings.startup_scene", "Startup Scene")), &cur, names, false) && cur >= 0 {
|
|
pr.MainScene = list[cur]
|
|
changed = true
|
|
}
|
|
}
|
|
space := 0
|
|
if pr.DefaultSpace == project.Space3D {
|
|
space = 1
|
|
}
|
|
if widgets.Combo(ui, ui.ID("space"), widgets.Field(ui, i18n.Tr("editor.projectsettings.default_space", "Default Space")), &space, []string{"2D", "3D"}, false) {
|
|
pr.DefaultSpace = project.Space2D
|
|
if space == 1 {
|
|
pr.DefaultSpace = project.Space3D
|
|
}
|
|
changed = true
|
|
}
|
|
widgets.Separator(ui)
|
|
widgets.Label(ui, i18n.Tr("editor.projectsettings.window", "Window"))
|
|
changed = intField(ui, i18n.Tr("editor.projectsettings.width", "Width"), &pr.Window.Width, 64) || changed
|
|
changed = intField(ui, i18n.Tr("editor.projectsettings.height", "Height"), &pr.Window.Height, 64) || changed
|
|
changed = textField(ui, i18n.Tr("editor.projectsettings.game_title", "Title"), &pr.Window.Title) || changed
|
|
return changed
|
|
}
|