edit

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package edit contains logic for creating and updating game content. The services in this package modify resources directly.

Index

Constants

View Source
const (
	VariableContextCitadel = VariableBaseContextIdentifier(0)
	VariableContextEngine  = VariableBaseContextIdentifier(1)
)

Context identifier are listed below.

Variables

This section is empty.

Functions

This section is empty.

Types

type AugmentedTextBlockSetter

type AugmentedTextBlockSetter interface {
	SetResourceBlock(lang resource.Language, id resource.ID, index int, data []byte)
	SetResourceBlocks(lang resource.Language, id resource.ID, data [][]byte)
	DelResource(lang resource.Language, id resource.ID)
}

AugmentedTextBlockSetter modifies resource blocks.

type AugmentedTextService

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

AugmentedTextService provides read/write functionality.

func NewAugmentedTextService

func NewAugmentedTextService(
	textViewer media.TextViewerService, textSetter media.TextSetterService,
	audioViewer media.AudioViewerService, audioSetter media.AudioSetterService) AugmentedTextService

NewAugmentedTextService returns a new instance based on given accessor.

func (AugmentedTextService) Clear

func (service AugmentedTextService) Clear(setter AugmentedTextBlockSetter, key resource.Key)

Clear sets the text to an empty string and sets an empty sound if audio is associated.

func (AugmentedTextService) Remove

func (service AugmentedTextService) Remove(setter AugmentedTextBlockSetter, key resource.Key)

Remove erases the text and audio from the resources.

func (AugmentedTextService) RestoreFunc

func (service AugmentedTextService) RestoreFunc(key resource.Key) func(setter AugmentedTextBlockSetter)

RestoreFunc creates a snapshot of all associated media components and returns a function to restore it.

func (AugmentedTextService) RestoreSoundFunc

func (service AugmentedTextService) RestoreSoundFunc(key resource.Key) func(setter AugmentedTextBlockSetter)

RestoreSoundFunc creates a snapshot of the current sound and returns a function to restore it. In case the text resource has no audio, a stub method will be returned.

func (AugmentedTextService) RestoreTextFunc

func (service AugmentedTextService) RestoreTextFunc(key resource.Key) func(setter AugmentedTextBlockSetter)

RestoreTextFunc creates a snapshot of the current textual state and returns a function to restore it.

func (AugmentedTextService) SetSound

func (service AugmentedTextService) SetSound(setter AugmentedTextBlockSetter, key resource.Key, sound audio.L8)

SetSound changes the sound of a text resource. Should the text resource have no audio component, this call does nothing.

func (AugmentedTextService) SetText

func (service AugmentedTextService) SetText(setter AugmentedTextBlockSetter, key resource.Key, value string)

SetText changes the textual value of a text resource.

func (AugmentedTextService) Sound

func (service AugmentedTextService) Sound(key resource.Key) audio.L8

Sound returns the audio value of the identified text resource. In case the text resource has no audio, an empty sound will be returned.

func (AugmentedTextService) Text

func (service AugmentedTextService) Text(key resource.Key) string

Text returns the textual value of the identified text resource.

func (AugmentedTextService) WithAudio

func (service AugmentedTextService) WithAudio(key resource.Key) bool

WithAudio returns true if the identified resource is one with an audio component.

type EditableLevels added in v1.8.0

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

EditableLevels is a list of levels that can be modified.

func NewEditableLevels added in v1.8.0

func NewEditableLevels(registry cmd.Registry, mod *world.Mod) *EditableLevels

NewEditableLevels returns a new instance for given mod.

func (*EditableLevels) CommitLevelChanges added in v1.8.0

func (levels *EditableLevels) CommitLevelChanges(index int) error

CommitLevelChanges applies any level data change compared to the underlying mod.

func (*EditableLevels) InvalidateResources added in v1.8.0

func (levels *EditableLevels) InvalidateResources(modifiedIDs []resource.ID)

InvalidateResources informs all levels of changed resource identifier.

func (*EditableLevels) IsLevelAvailable added in v1.8.0

func (levels *EditableLevels) IsLevelAvailable(index int) bool

IsLevelAvailable returns true if the given index is a valid level.

func (*EditableLevels) IsLevelReadOnly added in v1.8.0

func (levels *EditableLevels) IsLevelReadOnly(index int) bool

IsLevelReadOnly returns true if the identified level cannot be modified.

func (*EditableLevels) IsObjectInUse added in v1.8.0

func (levels *EditableLevels) IsObjectInUse(levelIndex int, id level.ObjectID) bool

IsObjectInUse returns true if the given object ID is in use in given level.

func (*EditableLevels) IsTileOnMap added in v1.8.0

func (levels *EditableLevels) IsTileOnMap(levelIndex int, pos level.TilePosition) bool

IsTileOnMap returns true if the given tile position points to a valid tile in the given level.

func (*EditableLevels) Level added in v1.8.0

func (levels *EditableLevels) Level(index int) *level.Level

Level returns the pointer to the given level. The function panics if the index is invalid.

type GameObjectBitmapInfo added in v1.8.0

type GameObjectBitmapInfo struct {
	// Start is the index for the first object bitmap in ids.ObjectBitmaps.
	Start int
	// Count is the amount of bitmaps the object has in total.
	Count int
	// IconRecommendation is the offset from start for using icons.
	IconRecommendation int
}

GameObjectBitmapInfo contains indices about bitmaps for a particular game object.

type GameObjectsService added in v1.8.0

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

GameObjectsService provides information for game objects.

func NewGameObjectsService added in v1.8.0

func NewGameObjectsService(mod *world.Mod) *GameObjectsService

NewGameObjectsService returns a new instance.

func (*GameObjectsService) AllProperties added in v1.8.0

func (service *GameObjectsService) AllProperties() object.PropertiesTable

AllProperties returns the currently know properties.

func (*GameObjectsService) BitmapInfo added in v1.8.0

func (service *GameObjectsService) BitmapInfo() map[object.Triple]GameObjectBitmapInfo

BitmapInfo returns information on all bitmaps.

func (*GameObjectsService) PropertiesFor added in v1.8.0

func (service *GameObjectsService) PropertiesFor(triple object.Triple) (object.Properties, error)

PropertiesFor returns the properties for the given triple.

type GameStateService added in v1.7.0

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

GameStateService handles all details on the global game state.

func NewGameStateService added in v1.7.0

func NewGameStateService(registry cmd.Registry) *GameStateService

NewGameStateService returns a new instance.

func (GameStateService) BooleanVariable added in v1.7.0

func (service GameStateService) BooleanVariable(index int) archive.GameVariableInfo

BooleanVariable returns the variable info as per project settings for the given index.

func (GameStateService) BooleanVariableOverride added in v1.7.0

func (service GameStateService) BooleanVariableOverride(index int) bool

BooleanVariableOverride returns true if project-specific details are stored for given variable index.

func (GameStateService) CurrentSettings added in v1.7.0

func (service GameStateService) CurrentSettings() GameStateSettings

CurrentSettings returns the snapshot of the project.

func (*GameStateService) DefaultAllVariables added in v1.7.0

func (service *GameStateService) DefaultAllVariables() error

DefaultAllVariables removes all project specific overrides.

func (*GameStateService) DefaultBooleanVariable added in v1.7.0

func (service *GameStateService) DefaultBooleanVariable(index int) error

DefaultBooleanVariable clears the variable info for the given index in the project settings.

func (*GameStateService) DefaultIntegerVariable added in v1.7.0

func (service *GameStateService) DefaultIntegerVariable(index int) error

DefaultIntegerVariable clears the variable info for the given index in the project settings.

func (GameStateService) IntegerVariable added in v1.7.0

func (service GameStateService) IntegerVariable(index int) archive.GameVariableInfo

IntegerVariable returns the variable info as per project settings for the given index.

func (GameStateService) IntegerVariableOverride added in v1.7.0

func (service GameStateService) IntegerVariableOverride(index int) bool

IntegerVariableOverride returns true if project-specific details are stored for given variable index.

func (*GameStateService) RestoreSettings added in v1.7.0

func (service *GameStateService) RestoreSettings(settings GameStateSettings)

RestoreSettings loads the given snapshot.

func (*GameStateService) SetBooleanVariable added in v1.7.0

func (service *GameStateService) SetBooleanVariable(index int, info archive.GameVariableInfo) error

SetBooleanVariable sets the variable info for the given index in the project settings.

func (*GameStateService) SetIntegerVariable added in v1.7.0

func (service *GameStateService) SetIntegerVariable(index int, info archive.GameVariableInfo) error

SetIntegerVariable sets the variable info for the given index in the project settings.

func (*GameStateService) SetVariableBaseContext added in v1.7.0

func (service *GameStateService) SetVariableBaseContext(identifier VariableBaseContextIdentifier)

SetVariableBaseContext sets the current context to use as basis for variables not specified by the project.

func (GameStateService) VariableBaseContext added in v1.7.0

func (service GameStateService) VariableBaseContext() VariableBaseContextIdentifier

VariableBaseContext returns the current context to use as basis for variables not specified by the project.

type GameStateSettings added in v1.7.0

type GameStateSettings struct {
	BaseContext int

	BooleanVariables []VariableSettings
	IntegerVariables []VariableSettings
}

GameStateSettings describe the game state details.

type LevelEditorService added in v1.8.0

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

LevelEditorService provides level editing functionality based on the currently selected level and content.

func NewLevelEditorService added in v1.8.0

func NewLevelEditorService(registry cmd.Registry,
	gameObjects *GameObjectsService,
	levels *EditableLevels,
	levelSelection *LevelSelectionService) *LevelEditorService

NewLevelEditorService returns a new instance.

func (*LevelEditorService) ChangeObjects added in v1.8.0

func (service *LevelEditorService) ChangeObjects(modifier level.ObjectMainEntryModifier) error

ChangeObjects modifies properties of selected objects. The modifier is called for each selected object.

func (*LevelEditorService) ChangeTiles added in v1.8.0

func (service *LevelEditorService) ChangeTiles(modifier func(*level.TileMapEntry)) error

ChangeTiles performs a modification on all currently selected tiles and commits these changes to the repository.

func (*LevelEditorService) ClearTiles added in v1.8.0

func (service *LevelEditorService) ClearTiles() error

ClearTiles resets the selected tiles.

func (*LevelEditorService) CreateNewObject added in v1.8.0

func (service *LevelEditorService) CreateNewObject(triple object.Triple, modifier level.ObjectMainEntryModifier) error

CreateNewObject adds a new object to the level and selects it.

func (*LevelEditorService) DeleteObjects added in v1.8.0

func (service *LevelEditorService) DeleteObjects() error

DeleteObjects deletes all currently selected objects, clearing the selection afterwards.

func (*LevelEditorService) HasSelectedObjects added in v1.8.0

func (service *LevelEditorService) HasSelectedObjects() bool

HasSelectedObjects returns true if a call to Objects() returns at least one item.

func (*LevelEditorService) HasSelectedTiles added in v1.8.0

func (service *LevelEditorService) HasSelectedTiles() bool

HasSelectedTiles returns true if Tiles() returns at least one entry.

func (*LevelEditorService) IsReadOnly added in v1.8.0

func (service *LevelEditorService) IsReadOnly() bool

IsReadOnly returns true if the currently selected level cannot be modified.

func (*LevelEditorService) Level added in v1.8.0

func (service *LevelEditorService) Level() *level.Level

Level returns the currently selected level.

func (*LevelEditorService) NewObjectTriple added in v1.8.0

func (service *LevelEditorService) NewObjectTriple() object.Triple

NewObjectTriple returns the identifier of implicitly created objects.

func (*LevelEditorService) Objects added in v1.8.0

func (service *LevelEditorService) Objects() []*level.ObjectMainEntry

Objects returns the list of currently selected objects of the current level.

func (*LevelEditorService) PlaceObjectsOnCeiling added in v1.8.0

func (service *LevelEditorService) PlaceObjectsOnCeiling() error

PlaceObjectsOnCeiling puts all selected objects to hang from the ceiling.

func (*LevelEditorService) PlaceObjectsOnEyeLevel added in v1.8.0

func (service *LevelEditorService) PlaceObjectsOnEyeLevel() error

PlaceObjectsOnEyeLevel puts all selected objects to be at eye level (approximately).

func (*LevelEditorService) PlaceObjectsOnFloor added in v1.8.0

func (service *LevelEditorService) PlaceObjectsOnFloor() error

PlaceObjectsOnFloor puts all selected objects to sit on the floor.

func (*LevelEditorService) SetNewObjectTriple added in v1.8.0

func (service *LevelEditorService) SetNewObjectTriple(value object.Triple)

SetNewObjectTriple sets the identifier for implicitly created objects.

func (*LevelEditorService) Tiles added in v1.8.0

func (service *LevelEditorService) Tiles() []*level.TileMapEntry

Tiles returns the list of currently selected tiles of the current level.

type LevelInfoProvider added in v1.8.0

type LevelInfoProvider interface {
	IsLevelAvailable(index int) bool
	IsObjectInUse(levelIndex int, id level.ObjectID) bool
	IsTileOnMap(levelIndex int, pos level.TilePosition) bool
}

LevelInfoProvider returns details on level content.

type LevelSelectionService added in v1.8.0

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

LevelSelectionService keeps track of selections related to levels.

func NewLevelSelectionService added in v1.8.0

func NewLevelSelectionService(provider LevelInfoProvider) *LevelSelectionService

NewLevelSelectionService returns a new instance.

func (*LevelSelectionService) AddCurrentSelectedObjects added in v1.8.0

func (service *LevelSelectionService) AddCurrentSelectedObjects(ids []level.ObjectID)

AddCurrentSelectedObjects adds the given object IDs to the list of currently selected in the current level.

func (*LevelSelectionService) AddCurrentSelectedTiles added in v1.8.0

func (service *LevelSelectionService) AddCurrentSelectedTiles(list []level.TilePosition)

AddCurrentSelectedTiles adds the given tile IDs to the list of currently selected in the current level.

func (*LevelSelectionService) CurrentLevelID added in v1.8.0

func (service *LevelSelectionService) CurrentLevelID() int

CurrentLevelID returns the identifier for the currently selected level.

func (*LevelSelectionService) CurrentSelectedObjects added in v1.8.0

func (service *LevelSelectionService) CurrentSelectedObjects() []level.ObjectID

CurrentSelectedObjects returns the list of currently selected objects in the current level.

func (*LevelSelectionService) CurrentSelectedTiles added in v1.8.0

func (service *LevelSelectionService) CurrentSelectedTiles() []level.TilePosition

CurrentSelectedTiles returns the list of currently selected tiles in the current level.

func (*LevelSelectionService) IsTileSelected added in v1.8.0

func (service *LevelSelectionService) IsTileSelected(pos level.TilePosition) bool

IsTileSelected returns true if the given tile is currently selected.

func (*LevelSelectionService) NumberOfSelectedObjects added in v1.8.0

func (service *LevelSelectionService) NumberOfSelectedObjects() int

NumberOfSelectedObjects returns the number of currently selected objects in the current level.

func (*LevelSelectionService) RemoveCurrentSelectedObjects added in v1.8.0

func (service *LevelSelectionService) RemoveCurrentSelectedObjects(ids []level.ObjectID)

RemoveCurrentSelectedObjects removes the given object IDs from the list of currently selected in the current level.

func (*LevelSelectionService) RemoveCurrentSelectedTiles added in v1.8.0

func (service *LevelSelectionService) RemoveCurrentSelectedTiles(list []level.TilePosition)

RemoveCurrentSelectedTiles removes the given tile IDs from the list of currently selected in the current level.

func (*LevelSelectionService) SetCurrentLevelID added in v1.8.0

func (service *LevelSelectionService) SetCurrentLevelID(index int)

SetCurrentLevelID sets the currently selected level.

func (*LevelSelectionService) SetCurrentLevelIDTask added in v1.8.0

func (service *LevelSelectionService) SetCurrentLevelIDTask(index int) cmd.Task

SetCurrentLevelIDTask returns a command task that will set the current level.

func (*LevelSelectionService) SetCurrentSelectedObjects added in v1.8.0

func (service *LevelSelectionService) SetCurrentSelectedObjects(ids []level.ObjectID)

SetCurrentSelectedObjects sets the list of currently selected objects in the current level.

func (*LevelSelectionService) SetCurrentSelectedTiles added in v1.8.0

func (service *LevelSelectionService) SetCurrentSelectedTiles(list []level.TilePosition)

SetCurrentSelectedTiles sets the list of currently selected tiles in the current level.

func (*LevelSelectionService) ToggleObjectSelection added in v1.8.0

func (service *LevelSelectionService) ToggleObjectSelection(ids []level.ObjectID)

ToggleObjectSelection toggles the selection of the given object IDs in the current level.

func (*LevelSelectionService) ToggleTileSelection added in v1.8.0

func (service *LevelSelectionService) ToggleTileSelection(list []level.TilePosition)

ToggleTileSelection toggles the selection of the given tile IDs in the current level.

type ManifestEntrySettings added in v1.6.0

type ManifestEntrySettings struct {
	Origin []string
}

ManifestEntrySettings describe the properties of one manifest entry in a project.

type MovieService

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

MovieService provides read/write functionality.

func NewMovieService

func NewMovieService(codepage text.Codepage,
	movieViewer media.MovieViewerService, movieSetter media.MovieSetterService) MovieService

NewMovieService returns a new instance based on given accessor.

func (MovieService) AddScene

func (service MovieService) AddScene(setter media.MovieBlockSetter, key resource.Key, scene movie.HighResScene)

AddScene adds the given scene at the end of the movie.

func (MovieService) Audio

func (service MovieService) Audio(key resource.Key) audio.L8

Audio returns the audio component of identified movie.

func (MovieService) MoveSceneEarlier

func (service MovieService) MoveSceneEarlier(setter media.MovieBlockSetter, key resource.Key, scene int)

MoveSceneEarlier moves the given scene one step earlier.

func (MovieService) MoveSceneLater

func (service MovieService) MoveSceneLater(setter media.MovieBlockSetter, key resource.Key, scene int)

MoveSceneLater moves the given scene one step later.

func (MovieService) Remove

func (service MovieService) Remove(setter media.MovieBlockSetter, key resource.Key)

Remove erases the movie from the resources.

func (MovieService) RemoveScene

func (service MovieService) RemoveScene(setter media.MovieBlockSetter, key resource.Key, scene int)

RemoveScene cuts out the given scene from the movie.

func (MovieService) RestoreFunc

func (service MovieService) RestoreFunc(key resource.Key) func(setter media.MovieBlockSetter)

RestoreFunc creates a snapshot of the current movie and returns a function to restore it.

func (MovieService) SetAudio

func (service MovieService) SetAudio(setter media.MovieBlockSetter, key resource.Key, soundData audio.L8)

SetAudio sets the audio component of identified movie.

func (MovieService) SetSceneFramesDisplayTime

func (service MovieService) SetSceneFramesDisplayTime(setter media.MovieBlockSetter, key resource.Key,
	scene int, displayTime time.Duration)

SetSceneFramesDisplayTime sets the display time for each frame.

func (MovieService) SetSubtitles

func (service MovieService) SetSubtitles(setter media.MovieBlockSetter, key resource.Key,
	language resource.Language, subtitles movie.SubtitleList)

SetSubtitles sets the subtitles of identified movie in given language.

func (MovieService) SizeWarning

func (service MovieService) SizeWarning(key resource.Key) bool

SizeWarning returns true if the given movie is larger than the underlying archive would support.

func (MovieService) Subtitles

func (service MovieService) Subtitles(key resource.Key, language resource.Language) movie.SubtitleList

Subtitles returns the subtitles associated with the given key.

func (MovieService) Video

func (service MovieService) Video(key resource.Key) []movie.Scene

Video returns the video component of identified movie.

type ProjectService added in v1.6.0

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

ProjectService handles the overall information about the active project.

func NewProjectService added in v1.6.0

func NewProjectService(commander cmd.Registry, mod *world.Mod) *ProjectService

NewProjectService returns a new instance of a service for given mod.

func (*ProjectService) AddManifestEntry added in v1.6.0

func (service *ProjectService) AddManifestEntry(at int, entry *world.ManifestEntry) error

AddManifestEntry attempts to insert the given manifest entry at given index.

func (ProjectService) CurrentSettings added in v1.6.0

func (service ProjectService) CurrentSettings() ProjectSettings

CurrentSettings returns the snapshot of the project.

func (ProjectService) CurrentStateFilename added in v1.7.0

func (service ProjectService) CurrentStateFilename() string

CurrentStateFilename returns the name for the state of the project.

func (ProjectService) Mod added in v1.6.0

func (service ProjectService) Mod() *world.Mod

Mod returns the currently active mod in the project.

func (ProjectService) ModHasStorageLocation added in v1.6.0

func (service ProjectService) ModHasStorageLocation() bool

ModHasStorageLocation returns whether the mod has a place to be stored.

func (ProjectService) ModPath added in v1.7.0

func (service ProjectService) ModPath() string

ModPath returns the base path of the mod in the project.

func (*ProjectService) ModifyModWith added in v1.7.0

func (service *ProjectService) ModifyModWith(modifier func(world.Modder) error) (err error)

ModifyModWith runs a function with the intent to alter the current mod.

func (*ProjectService) MoveManifestEntry added in v1.6.0

func (service *ProjectService) MoveManifestEntry(to, from int) error

MoveManifestEntry attempts to remove the manifest entry at given from index and re-insert it at given to index.

func (*ProjectService) NewMod added in v1.6.0

func (service *ProjectService) NewMod()

NewMod resets the mod to a new state.

func (*ProjectService) RemoveManifestEntry added in v1.6.0

func (service *ProjectService) RemoveManifestEntry(at int) error

RemoveManifestEntry attempts to remove the manifest entry at given index.

func (*ProjectService) ResetProject added in v1.7.0

func (service *ProjectService) ResetProject()

ResetProject clears the project and returns it to initial state.

func (*ProjectService) RestoreProject added in v1.7.0

func (service *ProjectService) RestoreProject(settings ProjectSettings, stateFilename string)

RestoreProject sets internal data based on the given settings.

func (*ProjectService) SaveMod added in v1.6.0

func (service *ProjectService) SaveMod() error

SaveMod will store the currently active mod in its current path.

func (*ProjectService) SaveModUnder added in v1.6.0

func (service *ProjectService) SaveModUnder(modPath string) error

SaveModUnder will store the currently active mod in the given path.

func (ProjectService) SaveStatus added in v1.6.0

func (service ProjectService) SaveStatus() SaveStatus

SaveStatus returns the current pending save information.

func (*ProjectService) SetCurrentStateFilename added in v1.7.0

func (service *ProjectService) SetCurrentStateFilename(value string)

SetCurrentStateFilename updates the current filename.

func (*ProjectService) TryLoadModFrom added in v1.6.0

func (service *ProjectService) TryLoadModFrom(names []string) error

TryLoadModFrom attempts to set the active mod from given filenames.

type ProjectSettings added in v1.6.0

type ProjectSettings struct {
	ModFiles []string
	Manifest []ManifestEntrySettings
}

ProjectSettings describe the properties of a project.

type SaveStatus added in v1.6.0

type SaveStatus struct {

	// FilesModified is the count of how many files are affected by the current pending change.
	FilesModified int
	// SavePending is set if the mod has a storage location and changes are to be saved.
	SavePending bool
	// SaveIn is the duration after which an auto-save should happen.
	SaveIn time.Duration
	// contains filtered or unexported fields
}

SaveStatus describes the current change state.

func (SaveStatus) ConfirmPendingSave added in v1.6.0

func (status SaveStatus) ConfirmPendingSave()

ConfirmPendingSave marks that the recent auto-save status has been acknowledged and should no longer be notified. A new change will re-start the auto-save timer.

type SoundEffectService

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

SoundEffectService provides read/write functionality.

func NewSoundEffectService

NewSoundEffectService returns a new instance based on given accessor.

func (SoundEffectService) Audio

func (service SoundEffectService) Audio(key resource.Key) audio.L8

Audio returns the audio component of identified sound effect.

func (SoundEffectService) Clear

func (service SoundEffectService) Clear(setter media.SoundEffectBlockSetter, key resource.Key)

Clear resets the identified audio resource to a silent one-sample audio.

func (SoundEffectService) Modified

func (service SoundEffectService) Modified(key resource.Key) bool

Modified returns true if the identified sound resource is marked as modified.

func (SoundEffectService) Remove

func (service SoundEffectService) Remove(setter media.SoundEffectBlockSetter, key resource.Key)

Remove erases the sound from the resources.

func (SoundEffectService) RestoreFunc

func (service SoundEffectService) RestoreFunc(key resource.Key) func(setter media.SoundEffectBlockSetter)

RestoreFunc creates a snapshot of the current sound and returns a function to restore it.

func (SoundEffectService) SetAudio

func (service SoundEffectService) SetAudio(setter media.SoundEffectBlockSetter, key resource.Key, data audio.L8)

SetAudio sets the audio component of identified sound effect.

type TextInfo

type TextInfo struct {
	ID    resource.ID
	Title string
	// contains filtered or unexported fields
}

TextInfo describes one kind of text.

type TextInfoList

type TextInfoList []TextInfo

TextInfoList is a set of TextInfo.

func KnownTexts

func KnownTexts() TextInfoList

KnownTexts returns a set of known texts.

func (TextInfoList) ByID

func (list TextInfoList) ByID(id resource.ID) TextInfo

ByID returns a text info for the given identifier.

func (TextInfoList) Title

func (list TextInfoList) Title(id resource.ID) string

Title returns the title property of the identified info.

type VariableBaseContextIdentifier added in v1.7.0

type VariableBaseContextIdentifier int

VariableBaseContextIdentifier identifies which context for variable naming should be used.

func VariableContextIdentifiers added in v1.7.0

func VariableContextIdentifiers() []VariableBaseContextIdentifier

VariableContextIdentifiers returns a list of all available identifiers.

type VariableSettings added in v1.7.0

type VariableSettings struct {
	Index int

	ResetValue  *int16 `json:",omitempty"`
	Name        string
	Description string
	Limits      *struct {
		Minimum int16
		Maximum int16
	} `json:",omitempty"`
	ValueNames []struct {
		Value int16
		Name  string
	} `json:",omitempty"`
}

VariableSettings describe game variables.

Directories

Path Synopsis
Package media contains low-level media accessors and modifier.
Package media contains low-level media accessors and modifier.
Package undoable contains edit extensions that provide an undo-mechanism.
Package undoable contains edit extensions that provide an undo-mechanism.
cmd

Jump to

Keyboard shortcuts

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