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.
48 lines
997 B
Go
48 lines
997 B
Go
package shell
|
|
|
|
import (
|
|
"aego/core/errs"
|
|
"aego/editor/core/document"
|
|
"aego/engine/i18n"
|
|
)
|
|
|
|
// playPrefabHint says why Play does not run a prefab document.
|
|
func playPrefabHint() string {
|
|
return i18n.Note("editor.shell.play_prefab_hint", "Play runs a scene: open this prefab from a scene to play it there")
|
|
}
|
|
|
|
func (a *App) playSource() (*document.SceneDocument, error) {
|
|
d := a.ctx.Docs.Edit()
|
|
if d == nil {
|
|
return nil, errs.New(errs.EditorDocument, "no scene is open")
|
|
}
|
|
src, ok := a.ctx.Docs.PlaySource(d.ID)
|
|
if !ok {
|
|
return nil, errs.New(errs.EditorCommand, playPrefabHint())
|
|
}
|
|
if src.ID != d.ID {
|
|
a.playReturn = d.ID
|
|
a.ctx.Docs.SetActive(src.ID)
|
|
}
|
|
return src, nil
|
|
}
|
|
|
|
func (a *App) afterPlay() {
|
|
if a.playReturn == 0 {
|
|
return
|
|
}
|
|
if a.ctx.Docs.Get(a.playReturn) != nil {
|
|
a.ctx.Docs.SetActive(a.playReturn)
|
|
}
|
|
a.playReturn = 0
|
|
}
|
|
|
|
func (a *App) canPlay() bool {
|
|
d := a.ctx.Docs.Edit()
|
|
if d == nil {
|
|
return false
|
|
}
|
|
_, ok := a.ctx.Docs.PlaySource(d.ID)
|
|
return ok
|
|
}
|