Jazz2::Editor namespace

Namespaces

namespace ActionIds
Identifiers of the actions of the level editor.
namespace EventCatalogParts
namespace Implementation
namespace StampClipboard
Stamps as text in the clipboard of the system, so they can be pasted into another instance of the game.
namespace TileMasks
Collision masks of tiles packed a bit per pixel, as tile sets store them.
namespace ToolActions
Actions of the tools and of the selection, and what they do.
namespace ToolMath
Small helpers shared by the tools of the level editor and the smart tiles.
namespace ToolTests
Tests of the tools of the level editor and of the level it shows, run by EditorSelfTest.

Classes

class ActionRegistry
All actions of the level editor.
struct AddTilesOptions
How the tiles of an image are cut and matched to the colors, see AddTilesFromImageAsync().
struct Annotation
A bookmark or a note placed in a level, for the editor only.
class AnnotationCache
Bookmarks and notes of a level, read again only when they change.
class AutosaveService
Keeps a copy of unsaved changes, so they aren't lost if the game ends unexpectedly.
class BackgroundJob
Work done off the user interface, on a thread of its own where the platform has threads.
class BlockGrab
Grabs a block of tiles as the stamp by its two corners marked with a key, as B of Jazz Creation Station.
class BrushTool
Paints the stamp, or erases.
struct CatalogText
Text of a description of an event, a literal is shown as it is, a text translated by _x() is kept.
class CommandArchive
Keeps the history of changes in a recovery copy of a level, so they can be undone after it's restored.
class CommandHistory
Undo and redo history of a level being edited.
class CompressedBuffer
Data compressed by Deflate in memory.
class ContentTileSetLibrary
Tile set library of the game content.
struct CustomWeaponTemplate
Template of a custom weapon, read from a .json file in Editor/Weapons/.
struct DocumentAnimation
An animated tile of a level being edited.
class DocumentChanges
Collects what changed in a level being edited.
struct DocumentEvent
An event of the grid, at a tile of the sprite layer.
class DocumentFiles
The file of the level being edited and the files around it.
struct DocumentLayer
A layer of a level being edited.
class DocumentSnapshot
Parts of a level being edited, compressed in memory.
struct DocumentTileArea
Area of a layer whose tiles changed.
struct DocumentViewState
How a level was seen and played in the editor the last time, for the editor only.
class EditCommand
Undoable change of a level being edited.
struct EditorAction
Something the user can do in the level editor.
class EditorCamera
Camera of the level editor.
class EditorDebugConsole
Commands to test the level editor without input, only in debug builds.
struct EditorIcons
Vector art of the icons of the level editor, see UI::Windows::Icons.
struct EditorInitialization
Tells the level editor what to open.
class EditorInputRouter
Takes the keyboard, the mouse, the touch screen and the gamepad in the level editor.
class EditorLevelHandler
Shows a level being edited.
class EditorSceneCanvas
Canvas in the level, drawn among its layers in pixels of the level.
class EditorSelfTest
Self-test of the level editor, run by the /editor-selftest [directory] command-line switch.
class EditorSession
The level editor.
struct EditorSettings
Settings of the level editor, kept in Jazz2.Editor.json in the configuration directory.
class EditorShell
Interface of the level editor on a desktop.
class EditorTool
Tool used in the view of the level editor.
struct EpisodeFile
An episode file (.j2e) as the editor reads and writes it.
struct EpisodeImage
Image of an episode, RGBA pixels row by row.
struct EpisodeLevelInfo
What the editor needs to know of a level of an episode without loading it.
class EventCatalog
All events the editor knows, how they are shown and how their parameters are edited.
struct EventDescriptor
Description of an event, how it's shown and how its parameters are edited.
struct EventDirection
An arrow of an event along the values of its parameters, see EventPreviews::CollectDirections().
struct EventExtensionError
A description of an event from outside of the game that couldn't be used, see EventCatalog::GetExtensionErrors().
struct EventFindOptions
Which events Find and Replace finds, see ReplaceEvents().
struct EventGizmo
A handle in the view that changes a parameter of an event by dragging it.
class EventGizmos
Finds the handles of events and changes their parameters by them.
class EventGrid
Events to choose from, as a grid of their pictures and names.
class EventInspectorPanel
Properties of the selected events, or of the event to place when none is selected.
struct EventLightShape
How a light event lights up its surroundings, see EventPreviews::GetLight().
struct EventLink
A line between events linked by the values of their parameters, see EventPreviews::CollectLinks().
struct EventParamField
Parameter of an event, a value stored in the 16 bytes of parameters of the event.
class EventPickerPanel
Panel with the events to choose from, by category.
struct EventPreviewCase
How an event looks for a value of one of its parameters, see EventDescriptor::PreviewCases.
class EventPreviews
Draws events as the level editor shows them.
struct EventPreviewSpec
How an event is drawn, as the object it spawns looks with its parameters.
class EventSelection
Selected events, of the event grid by their tiles and off the grid by their indices.
struct EventStamp
Events the event tool places.
class EventTool
Places, selects, moves and erases events.
class EyedropperTool
Picks tiles of the layer as the stamp.
class FakeToolHost
Host of the tools of the level editor for tests, only over a document and its history.
struct FieldMirror
How a value changes when its event is mirrored one way.
class FillTool
Fills an area of the same tiles with the stamp.
struct FiringRange
The firing range the preview of a weapon shows.
class GroundLineTool
Draws ground along a line, with slopes as steep as the line, and changes it later.
class HandTool
Moves the view.
class IDocumentEditor
Changes the level being edited, see IToolHost.
class IDocumentFilesHost
What DocumentFiles needs of the level editor beyond IEditorContext.
class IEditorContext
What the panels and the dialogs of the level editor need from it.
class IFeedback
Tells the user about what happened, see IToolHost.
class IInputRouterHost
What EditorInputRouter needs of the level editor beyond IEditorContext.
class ILevelView
Shows the level being edited, see IToolHost.
class InsertLayerCommand
Adds a layer or removes one.
class InspectorPanel
Properties of the layer being edited.
class IPlayTest
A level being played from the editor, see PlayTestLevelHandler.
class IPlayTestHost
What a PlayTestController needs of the level editor that hosts it.
class ISelectionHost
Keeps what is selected and what the tools paint with, see IToolHost.
class ITileSetLibrary
Provides information about tile sets to a level being edited.
class IToolHost
What tools need from the level editor.
class JobProgress
How far work done off the user interface is, shared by the work and the window that waits for it.
struct LayeredStamp
A rectangle of tiles of several layers with the events in it, copied and pasted as one.
class LayerIdRemap
Identities of this run of the editor for the layers kept by another one.
class LayerResizeHandles
Handles on the frame of the layer being edited that resize the layer when they're dragged.
class LayersPanel
List of the layers of the level, with their visibility and lock.
struct LayerView
How a layer is shown in the view.
class LevelDocument
A level being edited.
struct LevelProblem
A problem found in a level, see CheckLevel().
struct LevelStatistics
What a level has in a difficulty, counted from its events.
struct LevelTextLanguageState
Language of the translations shown in the dialog of the level texts.
class LevelThumbnail
Draws a level small, a pixel for a tile in the average color of the tile.
struct LevelWeapons
Weapons of a level as the editor changes them.
class MaskOverlay
Shows the collision masks of a layer over the level.
class MeasureTool
Measures distances in the level and shows how far the player jumps.
class MoveLayerCommand
Moves a layer to another position in the list of layers.
struct OkLab
A color in the Oklab color space, where distances follow how different colors look.
class PaletteFile
Reads and writes palettes in the files other programs use, by their extension.
class PaletteMapper
Finds the entries of a palette closest to colors, and remembers them.
class PaletteSearch
Finds the entries of a palette that look the closest to colors.
struct ParamOption
Option of a parameter of the type ParamType::Enum or ParamType::Flags.
class PathTool
Places the event to place along a path, at even distances — a row or an arc of coins or gems.
class PlayOverlays
What is shown over the level being edited of how it's played.
struct PlayPath
Path the player took in a play-test, for the editor to show.
class PlayPathHistory
Paths the player took in the last play-tests of a level.
class PlayTestController
Plays the level being edited, and returns to editing it.
class PlayTestDebug
Debug tools of a level played from the level editor.
struct PlayTestDebugOptions
Debug toggles of a level played from the level editor.
class PlayTestDebugOverlay
Draws debug information of a play-test over the level.
class PlayTestLevelHandler
Plays a level being edited.
class PlayTestMpLevelHandler
Plays a level being edited as multiplayer in local splitscreen.
struct PlayTestOptions
How a play-test starts.
class PlayTestRootNode
Node every object of a level is under, it updates them with the time of the play-test.
class PlayTransition
Reveals the level being played from the editor in a growing ring.
struct PngCodec
Reads and writes PNG images for the editor.
struct PoEntry
Entry of a gettext catalog.
class PoFile
Reads and writes gettext catalogs, .po and .pot files.
struct PropertyChoice
A value of a dropdown of fixed choices and the text it's shown with, see AddChoiceDropdown().
class RectangleTool
Fills a rectangle with the stamp.
class RulesFile
The rules of a tile set, Tilesets/<name>.rules.
class RuntimeSync
Brings the level shown by the editor up to date with the level being edited.
class SavedComparison
Shows where the level being edited differs from its file saved on disk.
class ScriptGraphics
The sprites the script of a level gives the objects of the events, so the editor shows them.
struct ScriptParamChoice
A named value of a parameter of a weapon of a script.
struct ScriptParamValue
Value of a parameter of a weapon of a script.
struct ScriptWeaponClass
A weapon a script library of JJ2+ offers, as MLLE sets it up.
struct ScriptWeaponParam
A parameter of a weapon of a script, in the order the library reads them.
struct ScriptWeaponTemplate
Description of a weapon of a script, its library and its parameters.
class SelectTool
Selects a rectangle of tiles.
class SetAdditionalPaletteCommand
Changes the colors of an additional palette of the level, as an undoable step.
class SetAnimationCommand
Changes the timing and the frames of an animated tile, the number of animated tiles stays the same.
class SetChunkCommand
Changes the payload of a chunk, as an undoable step.
class SetEventsCommand
Changes events of the grid.
class SetLayerPropertiesCommand
Changes the description or the name of a layer, its size stays the same.
class SetLayerTextureCommand
Replaces the texture of its own of a layer, or removes it, see DocumentLayer::Texture.
class SetLevelPaletteCommand
Changes the palette of the level, and whether the level uses it.
class SetLevelPropertiesCommand
Changes the level flags and properties.
class SetLevelTilesCommand
Changes the pixels or the masks of tiles the level stores in itself, see Formats::ExtraTileSetRecord::Embedded.
class SetOffGridEventsCommand
Changes the events placed off the grid, all of them at once.
class SetTerrainSplinesCommand
Changes the ground laid along lines and the tiles of its layer as one step.
class SetTileOverrideCommand
Changes how the level overrides the pixels and the collision mask of a tile.
class SetTilesCommand
Changes tiles of a layer.
class ShapeTool
Draws a line, the outline of a rectangle, or an ellipse with the stamp.
struct Shortcut
Key and modifiers that run an action.
struct SimulatedShot
A shot of the firing range, frame by frame.
class SmartBrushTool
Paints ground, the tiles are chosen by the tiles around them.
class SmartTileModel
Learns how the tiles of a tile set fit together, from the levels that use it.
class SnapshotCommand
Change of parts of a level kept as snapshots before and after it.
class StampPreview
The stamp of the brush, drawn small.
class StatusBar
Status bar at the bottom of the window.
class StrokeTool
Base of the tools that paint tiles.
class TerrainCoverageView
Shows which of the 47 ways the cells around can be solid have tiles to choose from.
class TerrainRules
Tiles chosen by hand for ground with given neighbors, instead of those learned from levels.
struct TerrainSpline
Ground laid along a line, kept so it can be changed and laid again.
class TileGrid
Tiles of a tile set to pick the stamp from.
struct TileImportOptions
How an image is made into a tile set, see SliceTileSet().
struct TileImportResult
What SliceTileSet() did.
class TileLod
Draws the tile layers from far away as images instead of tiles.
class TilePickerPanel
Panel with the tile grid and its controls.
class TilePixelTool
Paints the pixels of a tile right in the level, for the tile editor.
struct TilePrefab
A stamp of tiles kept with a tile set under a name, to paint it in any level of the tile set.
struct TileRef
Reference to a tile of a level being edited.
class TileSelection
Selected tiles of a layer.
class TileSetDataCache
Tile sets read whole, for the pixels and the masks of their tiles.
class TileShapes
Shapes of the collision masks of the tiles of a tile set.
struct TileSource
The tile set a source of tiles of a level takes them from, see ResolveTileSource().
struct TileStamp
Tiles the brush paints with.
struct TileTarget
Where tiles are added to.
class ToolManager
Keeps the tools and which of them is used.
struct ToolOptionItem
A value of an option of a tool, or a toggle, see ToolOptionsBuilder.
class ToolOptionsBar
Options of the tool chosen, in the toolbar, see EditorTool::BuildOptions().
class ToolOptionsBuilder
Makes the options of a tool, shown in the toolbar while the tool is chosen, see EditorTool::BuildOptions().
struct ToolPointer
Pointer over the view, as a tool sees it.
struct ToolSettings
Options shared by the tools, kept with the settings of the editor.
class TouchGestures
Tells what the fingers on a touch screen do in the level editor.
class UpdateWatcher
Takes no room, only calls a function every frame.
class WandTool
Selects an area of the same tiles.
class WeaponPreview
Preview of a custom weapon in a firing range.
class WeaponSpriteView
An animation of a weapon in a small box, as it plays in the game.
struct WeaponTemplateImage
An image a template of a custom weapon takes from a PNG file next to it, with how its frames are laid out.
struct WebFileBridge
Moves files between the level editor and the computer the browser runs on.

Enums

enum class DocumentChangeKind : std::uint32_t { None = 0, Tiles = 0x01, LayerProperties = 0x02, LayerStructure = 0x04, AnimationTiming = 0x08, AnimationStructure = 0x10, Events = 0x20, Palette = 0x40, TileSets = 0x80, TileOverrides = 0x100, Texts = 0x200, LevelProperties = 0x400, EditorState = 0x800, Chunks = 0x1000, All = 0x1FFF }
Kind of a change of a level being edited, supports a bitwise combination of its member values.
enum class SnapshotParts : std::uint32_t { None = 0, Properties = 0x01, TileSets = 0x02, Texts = 0x04, Animations = 0x08, Layers = 0x10, Chunks = 0x20, All = 0x3F }
Parts of a level kept by a DocumentSnapshot, supports a bitwise combination of its member values.
enum class DocumentProblem : std::uint8_t { None, LayerSize, SpriteLayerCount, TooManyLayers, TooManyTexts, TooManyExtraTileSets, TooManyAnimations, TooManyFrames, UnaddressableTile }
Problem that would make a level unloadable, see LevelDocument::Validate().
enum class SplineKind : std::uint8_t { Ground, Ceiling, Band, Closed }
What is laid along a line.
enum class EventCategory : std::uint8_t { Basic, Scenery, Modifier, Area, Trigger, Warp, Light, Environment, Enemy, Boss, Collectible, Container, Other, Count }
Category of an event, the picker groups events by it.
enum class ParamType : std::uint8_t { UInt, Int, Bool, Enum, Flags, EventType, TextId, TriggerId, WarpId, String, Raw, Contents }
How a parameter of an event is edited.
enum class ParamUnit : std::uint8_t { None, Pixels, Tiles, Frames, Seconds, Percent, Degrees }
Unit of a parameter, shown next to its value.
enum class FieldCondition : std::uint8_t { Equals, NotEquals, AnyBits }
How the value of another field decides whether a field is shown, see EventParamField::VisibleIfField.
enum class MirrorMode : std::uint8_t { None, Negate, Toggle, Swap, SwapField }
What mirroring an event does to a value, see EventCatalog::MirrorParams().
enum class FieldGizmo : std::uint8_t { None, Radius, LengthDown, WidthRight, OffsetX, OffsetY }
A handle in the level that changes a value, see EventGizmos.
enum class EventLinkRole : std::uint8_t { None, Source, Target, Peer }
What a link of an event to others with the same value is, see EventPreviews::CollectLinks().
enum class DirectionAxis : std::uint8_t { None, X, Y }
Axis a value points an arrow along, see EventPreviews::CollectDirections().
enum class EventTraits : std::uint16_t { None = 0, TileModifier = 0x01, Area = 0x02, Object = 0x04, Unused = 0x08, MultiplayerOnly = 0x10 }
What an event is, helps the editor to show and check it.
enum class EventExtensionScope : std::uint8_t { Global, Level }
Where descriptions of events from outside of the game come from, see EventCatalog::LoadExtensions().
enum class EventGizmoKind : std::uint8_t { Radius, ChainLength, BridgeWidth, Offset, WaterLevel, CameraLeft, CameraWidth, Direction }
What a handle of an event changes.
enum class TileImportColors : std::uint8_t { OwnPalette, TrueColor, MatchPalette, Reduce }
What the colors of the tiles of an image become, see SliceTileSet().
enum class TileImportError : std::uint8_t { None, TooSmall, TooManyTiles, Cancelled }
Why SliceTileSet() couldn't make a tile set.
enum class ActionScope : std::uint8_t { Edit, Play, Both }
When the shortcut of an action works, see EditorAction::Scope.
enum class KeymapPreset : std::int32_t { Default, Jcs, Mlle }
Set of shortcuts like those of another level editor, see ActionRegistry::ApplyPreset().
enum class PlayStartMode : std::uint8_t { Resume, Here, FromStart }
Where a play-test starts.
enum class PlayTestMode : std::uint8_t { Edit, Entering, Play, Returning }
State of the play-tests of the level editor, see PlayTestController.
enum class FxTileKind : std::uint8_t { ClearGlass, GlassBlocks, FrostedGlass, Water, HeatHaze, Magnifier, Puddle, Count }
Effect the tiles of a blur behind layer are made with, see GenerateFxTiles().
enum class LevelProblemSeverity : std::uint8_t { Error, Warning, Info }
How bad a problem of a level is.
enum class LevelProblemFix : std::uint8_t { None, RemoveWarp, AddWarpTarget, AddStart, AddMultiplayerStart, AddCtfBase }
How a problem of a level can be fixed by a click, see LevelProblem::Fix.
enum class SimulatedShotEnd : std::uint8_t { Lifetime, Wall, Target, Triggered }
How a shot of the firing range ended, see SimulateWeapon().
enum class ScriptParamType : std::uint8_t { Bool, Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float, Double, String }
Type of a parameter of a weapon of a script, as jjSTREAM keeps it.
enum class ScriptWeaponTemplateSource : std::uint8_t { Json, MlleIni, Script }
Where a description of a weapon of a script comes from.
enum class InputModality : std::uint8_t { KeyboardMouse, Gamepad, Touch }
What the editor was used with last.
enum class PickerPanel : std::uint8_t { Tiles, Events }
What the panel with the tiles and the events shows.
enum class EditorToolType : std::uint8_t { Brush, Eraser, Rectangle, Fill, Eyedropper, Select, Wand, Hand, Event, Measure, Path, Smart, Ground, TilePixels, Shape, Count }
Tool of the level editor.
enum class TileModifierMode : std::uint8_t { Keep, Normal, Translucent, Invisible, Heat }
Modifier of tiles the tile tools paint, see Formats::TileRecord::ModifierMask.
enum class ToolShape : std::uint8_t { Line, Rectangle, Ellipse, FilledEllipse }
Shape the shape tool draws.
enum class EventPlaceMode : std::uint8_t { Paint, Rectangle, Fill, Select }
How the event tool places the event of the stamp, or that it only selects events.
enum class EditorIcon : std::uint16_t { None = std::uint16_t(UI::Windows::StockIcon::None), Close = std::uint16_t(UI::Windows::StockIcon::Close), CloseSmall = std::uint16_t(UI::Windows::StockIcon::CloseSmall), Check = std::uint16_t(UI::Windows::StockIcon::Check), ChevronLeft = std::uint16_t(UI::Windows::StockIcon::ChevronLeft), ChevronRight = std::uint16_t(UI::Windows::StockIcon::ChevronRight), ChevronDown = std::uint16_t(UI::Windows::StockIcon::ChevronDown), ArrowUp = std::uint16_t(UI::Windows::StockIcon::ArrowUp), ArrowDown = std::uint16_t(UI::Windows::StockIcon::ArrowDown), Up = std::uint16_t(UI::Windows::StockIcon::Up), Plus = std::uint16_t(UI::Windows::StockIcon::Plus), Minus = std::uint16_t(UI::Windows::StockIcon::Minus), Folder = std::uint16_t(UI::Windows::StockIcon::Folder), File = std::uint16_t(UI::Windows::StockIcon::File), Delete = std::uint16_t(UI::Windows::StockIcon::Delete), Search = std::uint16_t(UI::Windows::StockIcon::Search), Info = std::uint16_t(UI::Windows::StockIcon::Info), Warning = std::uint16_t(UI::Windows::StockIcon::Warning), Undock = std::uint16_t(UI::Windows::StockIcon::Undock), Dock = std::uint16_t(UI::Windows::StockIcon::Dock), CursorResizeHorizontal = std::uint16_t(UI::Windows::StockIcon::CursorResizeHorizontal), CursorResizeVertical = std::uint16_t(UI::Windows::StockIcon::CursorResizeVertical), CursorResizeNWSE = std::uint16_t(UI::Windows::StockIcon::CursorResizeNWSE), CursorResizeNESW = std::uint16_t(UI::Windows::StockIcon::CursorResizeNESW), CursorMove = std::uint16_t(UI::Windows::StockIcon::CursorMove), Brush = UI::Windows::IconId::FirstCustom, Eraser, Rectangle, Fill, Eyedropper, Select, Wand, Hand, Undo, Redo, Grid, Eye, EyeClosed, Lock, Unlock, Layers, Save, New, Play, Stop, ZoomIn, ZoomOut, Fit, FlipX, FlipY, Copy, Paste, Cut, Settings, Parallax, Tiles, Export, Event, Mask, Pause, Path, Measure, Reach, SmartBrush, Slope, Usage, EventPath, Map, RotateCW, RotateCCW, Dice, Shuffle, RandomFlipX, RandomFlipY, ShapeLine, Ellipse, FilledEllipse, More, Debug, EnterEditor, Shapes, History, Properties, EyeOff, PlayOutline, Passthrough, OverriddenAssets, InvertSelection, ScreenFrame, GrabBlock, PauseLayers, Import, Recovery, CommandPalette, RaceFlag, LightBulb, EventsOnTop, Weapon, Pencil, LevelFile, ScriptedLevelFile, BrokenFile, TileSetFile, MusicFile, TrueColorTileSetFile, CustomEnd }
Icon of the level editor.

Functions

auto ResolveTileSource(const LevelDocument& document, std::uint8_t source, TileSource& result) -> bool
Finds the tile set a source of tiles of a level takes them from.
void ExecuteGrowingTileIdSpace(CommandHistory& history, std::unique_ptr<EditCommand> command, DocumentChanges& changes, bool allowMerge = false)
Executes a change, the tile ID space of the level grows in the same step if the change uses a tile past it.
auto MakeLayerId() -> std::uint32_t
Returns a new identity of a layer, unique while the editor runs, see DocumentLayer::Id, it may be called on any thread.
auto UIntField(CatalogText name, std::uint8_t offset, std::uint8_t bits, std::int32_t min, std::int32_t max, std::int32_t defaultValue = 0, std::uint8_t shift = 0) -> EventParamField constexpr
Unsigned number of bits bits at the byte offset, starting at the bit shift.
auto IntField(CatalogText name, std::uint8_t offset, std::uint8_t bits, std::int32_t min, std::int32_t max, std::int32_t defaultValue = 0, std::uint8_t shift = 0) -> EventParamField constexpr
Signed number of bits bits at the byte offset.
auto BoolField(CatalogText name, std::uint8_t offset, std::uint8_t bit = 0, bool defaultValue = false) -> EventParamField constexpr
Yes or no, the bit bit of the byte offset.
template<std::size_t N>
auto EnumField(CatalogText name, std::uint8_t offset, std::uint8_t bits, const ParamOption(&options)[N], std::int32_t defaultValue = 0, std::uint8_t shift = 0) -> EventParamField constexpr
One of the options, bits bits at the byte offset.
template<std::size_t N>
auto FlagsField(CatalogText name, std::uint8_t offset, std::uint8_t bits, const ParamOption(&options)[N], std::int32_t defaultValue = 0, std::uint8_t shift = 0) -> EventParamField constexpr
Any of the options, each a bit of bits bits at the byte offset.
auto EventTypeField(CatalogText name, std::uint8_t offset, std::int32_t defaultValue = 0) -> EventParamField constexpr
Another event, 16 bits at the byte offset.
auto TextIdField(CatalogText name, std::uint8_t offset, std::int32_t defaultValue = 0) -> EventParamField constexpr
Index of a level text, 8 bits at the byte offset.
auto TriggerIdField(CatalogText name, std::uint8_t offset, std::int32_t defaultValue = 0) -> EventParamField constexpr
Index of a trigger, 8 bits at the byte offset.
auto WarpIdField(CatalogText name, std::uint8_t offset, std::uint8_t bits = 8, std::int32_t defaultValue = 0) -> EventParamField constexpr
Identifier of a warp, bits bits at the byte offset.
auto StringField(CatalogText name, std::uint8_t offset, std::uint8_t length) -> EventParamField constexpr
Text of length bytes starting at the byte offset.
auto ContentsField(CatalogText name, std::uint8_t offset, std::uint8_t length, std::int8_t typeField) -> EventParamField constexpr
Parameters of another event inside this one, length bytes from the byte offset.
auto DescribeEvent(EventType type, const char* key, CatalogText name, EventCategory category, CatalogText description, const char* previewMetadata, std::uint32_t previewAnimation, EventTraits traits) -> EventDescriptor constexpr
Description of an event without parameters.
template<std::size_t N>
auto DescribeEvent(EventType type, const char* key, CatalogText name, EventCategory category, CatalogText description, const EventParamField(&fields)[N], const char* previewMetadata, std::uint32_t previewAnimation, EventTraits traits) -> EventDescriptor constexpr
Description of an event with parameters.
auto ResolveEventPreview(const Formats::EventRecord& event, EventPreviewSpec& spec) -> bool
Finds how an event is drawn with its parameters.
auto SplitLevelReference(StringView reference, String& level) -> String
Splits a reference to a level, episode/level or just level within the same episode.
auto FindLevelFile(StringView reference, StringView currentLevelName, ArrayView<const String> episodeRoots) -> String
Finds the file of a level that a level refers to as its next, secret or bonus level.
auto FindAccentColor(const Formats::TileSetData& tileSet, const std::uint32_t* palette, Death::Containers::ArrayView<const float> tileWeights, nCine::Colorf& color) -> bool
Finds the color a tile set is known by — a vivid color that many of its pixels have.
void MatchPalette(const std::uint32_t(&from)[256], const std::uint32_t(&to)[256], std::uint8_t(&table)[256])
Maps each entry of a palette to the entry of another palette that looks the closest.
auto IsSpriteColor(std::int32_t index, std::uint32_t entry) -> bool
Returns whether an entry of the palette of a level is the color the sprites have at the same index.
auto BuildPalette(Death::Containers::ArrayView<const std::uint32_t> colors, std::uint32_t(&palette)[256], const bool(&locked)[256], Death::Containers::Function<bool(float)>&& progress = {}) -> std::int32_t
Picks colors for the free entries of a palette, so the colors of an image look as close as they can.
auto MakeTileSetSheet(const Formats::TileSetData& tileSet, const std::uint32_t* palette, std::int32_t columns) -> PngImage
Puts the tiles of a tile set side by side into an image, rows of columns of them.
auto MakeTileSetMaskSheet(const Formats::TileSetData& tileSet, std::int32_t columns) -> PngImage
Puts the collision masks of the tiles of a tile set side by side, solid pixels black, the others transparent.
auto MakeTileImage(const std::uint8_t* indices, const std::uint32_t* palette) -> PngImage
Makes an image of a tile, 32 × 32 palette indices with the colors of palette, entry 0 transparent.
auto HashTileOf(const Formats::TileSetData& data, std::int32_t tile) -> std::uint64_t
Returns a hash of a tile of a tile set, by which the same tiles are found.
auto ReadTileFromImage(const PngImage& image, std::int32_t x, std::int32_t y, const std::uint32_t* palette, std::uint8_t* indices) -> bool
Reads 32 × 32 pixels of an image from a position as palette indices.
auto MakeTextureImage(const std::uint8_t* indices, std::int32_t size, const std::uint32_t* palette) -> PngImage
Makes an indexed image of size × size palette indices with the colors of palette, entry 0 transparent.
auto ReadTextureFromImage(const PngImage& image, std::int32_t size, const std::uint32_t* palette, std::uint8_t* indices) -> bool
Reads an image of size × size pixels as palette indices, as ReadTileFromImage() reads a tile.
auto GetTileGrid(const PngImage& image, const TileImportOptions& options) -> nCine::Vector2i
Number of columns and rows of tiles in an image with the layout of options, see SliceTileSet().
auto SliceTileSet(const PngImage& image, const TileImportOptions& options, Formats::TileSetData& tileSet, TileImportResult& result) -> bool
Makes a tile set of an image, tiles of 32 × 32 pixels row by row.
auto DrawTileId(Painter& painter, Tiles::TileMap& tileMap, std::int32_t tileId, std::uint8_t flags, const Rectf& rect, float alpha = 1.0f, PaintLayer layer = PaintLayer::Content) -> bool
Draws a tile of a level by its tile ID.
auto DrawTile(Painter& painter, Tiles::TileMap& tileMap, const LevelDocument& document, const TileRef& tile, std::uint8_t flags, const Rectf& rect, float alpha = 1.0f, PaintLayer layer = PaintLayer::Content) -> bool
Draws a tile of a level by where it comes from.
void ShowEpisodeDialog(IEditorContext& session)
Shows the episode of the level being edited.
void ShowEventOutline(IEditorContext& session)
Shows all events placed in the level in a list that can be filtered.
void SetupLevelFileDialog(FileDialog& dialog)
Makes a file dialog show levels as the editor knows them.
void SetupTileSetFileDialog(FileDialog& dialog)
Makes a file dialog show tile sets with their icons, the first tiles and how many there are.
void SetupMusicFileDialog(FileDialog& dialog)
Makes a file dialog show music with its icons, the format and the title of the song.
void ShowLevelPicker(IEditorContext& session, StringView title, StringView current, Function<void(StringView)>&& onPicked)
Lets a level be picked, onPicked gets how a level refers to it.
void ShowTileSetPicker(IEditorContext& session, StringView title, StringView current, Function<void(StringView)>&& onPicked)
Lets a tile set be picked, onPicked gets its path relative to Tilesets without the extension.
void ShowMusicPicker(IEditorContext& session, StringView title, StringView current, Function<void(StringView)>&& onPicked)
Lets music be picked, onPicked gets its path relative to the place it's in, as the game looks for it.
void ShowFindReplaceDialog(IEditorContext& session)
Finds tiles or events of a kind and replaces them, or selects them.
auto ReplaceTiles(IEditorContext& session, std::int32_t layer, const TileRef& find, const TileRef& replace, bool anyFlip, bool onlySelected = false) -> std::int32_t
Replaces a tile with another one in the layers of a level, as a step that can be undone.
auto MatchesEventFind(IEditorContext& session, const EventFindOptions& find, const Formats::EventRecord& event, std::uint32_t cell, std::int32_t offGrid) -> bool
Returns whether an event, at a tile of the grid or off it by its index, is found.
auto CountFoundEvents(IEditorContext& session, const EventFindOptions& find) -> std::int32_t
Returns the number of events found, on the grid and off it.
auto ReplaceEvents(IEditorContext& session, const EventFindOptions& find, const Formats::EventRecord& replace, bool keepParams = true) -> std::int32_t
Replaces the events found with another event, as a step that can be undone.
auto ReplaceEvents(IEditorContext& session, const EventFindOptions& find, EventType replace, bool keepParams = true) -> std::int32_t
auto ReplaceEvents(IEditorContext& session, EventType find, EventType replace) -> std::int32_t
void GenerateFxTiles(FxTileKind kind, std::int32_t widthTiles, std::int32_t heightTiles, float strength, Formats::TileSetData& tiles)
Makes the tiles of an effect for a blur behind layer, as true color tiles without collision.
void ShowFxTileGeneratorDialog(IEditorContext& session)
Asks for an effect and a size, adds the tiles of it to the tile set shown in the tile picker and makes them the brush, to paint them on a layer drawn as blur behind.
void ShowCommandPalette(IEditorContext& session)
Shows a search of all actions of the editor, the one picked is done right away.
void ShowShortcutsDialog(IEditorContext& session)
Shows all actions with their shortcuts, which can be changed.
void ShowHistoryDialog(IEditorContext& session)
Shows the changes that can be undone and redone, a click goes back or forward to one of them.
void ShowResizeLayerDialog(IEditorContext& session)
Shows a dialog to resize the layer being edited.
auto ResizeLayerAsStep(IEditorContext& session, std::int32_t layer, Vector2i size, Vector2i offset, LevelDocument::ResizeFill fill) -> bool
Resizes a layer as one step that can be undone, as the dialog does, see LevelDocument::ResizeLayer().
void CheckLevel(const LevelDocument& document, SmallVectorImpl<LevelProblem>& problems)
Looks for what's probably wrong in a level.
void CheckReachability(IEditorContext& session, SmallVectorImpl<LevelProblem>& problems)
Adds what the player can't get to from the start: an exit, and things to collect, see EditorSession::ComputeReachability().
void CheckLayerTiles(IEditorContext& session, SmallVectorImpl<LevelProblem>& problems)
Adds problems of tiles that need their tile sets to tell, as tiles in palette colors on a layer drawn as Blur Behind.
void CheckLayerDrawing(const LevelDocument& document, std::int32_t layerIndex, bool aboutOthers, SmallVectorImpl<LevelProblem>& problems)
Adds what makes a layer drawn black, wrong or not at all, the texts without the name of the layer.
auto CountPaletteColorTiles(IEditorContext& session, std::int32_t layerIndex) -> std::int32_t
Returns how many tiles of a layer are in palette colors, which do nothing on a layer drawn as Blur Behind.
void CheckLevelSurroundings(IEditorContext& session, SmallVectorImpl<LevelProblem>& problems)
Adds problems the shown level tells, events inside solid tiles and warp targets in walls, and files.
auto FixLevelProblem(IEditorContext& session, LevelProblemFix fix, std::int32_t value) -> bool
Fixes a problem by LevelProblem::Fix or LevelProblem::AlternativeFix with LevelProblem::FixValue.
auto GetLevelProblemFixLabel(LevelProblemFix fix) -> String
Returns the label of the button that fixes a problem.
void ShowCheckLevelDialog(IEditorContext& session)
Shows the problems of the level, each can be shown in the view.
void ShowLevelPropertiesDialog(IEditorContext& session)
Shows the properties of the level — its name, the levels that follow, music, light, weather and flags.
void ShowLevelTextsDialog(IEditorContext& session)
Shows the texts of the level, which events show and refer to by their index.
void ShowAnimatedTilesDialog(IEditorContext& session)
Shows the animated tiles of the level, their frames and timing.
void ShowLevelStatisticsDialog(IEditorContext& session)
Shows what the level has in each difficulty.
void AddLevelTextLanguageBar(Stack* content, IEditorContext& session, const std::shared_ptr<LevelTextLanguageState>& state)
Adds the choice of the language and the buttons to export and import the texts for translators.
void AddLevelTextTranslationBox(Stack* row, IEditorContext& session, const std::shared_ptr<LevelTextLanguageState>& state, std::int32_t index)
Adds the box of the translation of a text, shown only while a language is chosen.
void SetLevelTextTranslation(IEditorContext& session, StringView language, std::int32_t index, StringView text)
Changes the translation of a text as an undoable step, an empty one removes it.
void ShowNavigator(IEditorContext& session, bool toggle = false)
Shows the whole level small, with the bookmarks and the notes.
void SetBookmark(IEditorContext& session, std::int32_t slot)
Remembers the middle of the view as a bookmark, from 1 to 9.
auto GoToBookmark(IEditorContext& session, std::int32_t slot) -> bool
Moves the view to a bookmark, from 1 to 9, returns false if it isn't set.
void AddNote(IEditorContext& session, Vector2f worldPos, StringView text = {})
Adds a note at a position in the level, it's written in ShowNavigator().
void ShowExportPackageDialog(IEditorContext& session)
Shows the dialog that exports the level as a package to publish, a ZIP archive.
void ShowPalettesDialog(IEditorContext& session, std::int32_t index = -1)
Shows the palettes of the level, their colors can be changed while the level is seen in them.
auto GetAdditionalPaletteLabel(IEditorContext& session, std::int32_t index) -> Death::Containers::String
Returns the name of the additional palette of an index, as the editor lists it, or an empty string.
auto MovePaletteEntries(IEditorContext& session, std::int32_t first, std::int32_t last, std::int32_t direction, bool keepLook) -> bool
Moves the entries first to last of the palette of the level an entry earlier or later, as one step.
void ShowPrefabsDialog(IEditorContext& session)
Shows the prefabs of the default tile set of the level, see TilePrefab.
void RunWithProgress(IEditorContext& session, StringView title, Function<void(JobProgress&)>&& work, Function<void(bool)>&& onDone)
Runs work off the user interface and shows how far it is in a window that can stop it.
auto IsPathInside(StringView path, StringView root) -> bool
Returns true if path is root itself or a file or directory inside it.
auto IsLevelOpenElsewhere(StringView levelPath, StringView ownPath) -> bool
Returns true if a level other than ownPath seems to be open in another editor.
auto AddChoiceDropdown(Element* row, ArrayView<const PropertyChoice> choices, Function<std::int32_t()>&& getter, Function<void(std::int32_t)>&& setter, Function<String(std::int32_t)>&& otherLabel = {}, Function<bool(std::int32_t)>&& isEnabled = {}) -> Dropdown*
Adds a dropdown of fixed choices bound to a value to a row of a form.
auto AddByteBox(Element* row, Function<std::uint8_t()>&& getter, Function<void(std::uint8_t, bool)>&& setter) -> NumberBox*
Adds a number box of a byte bound to a value to a row of a form.
void ShowRowWhen(Stack* row, Function<bool()>&& isVisible)
Shows a row of a form only while it applies.
void ShowRecoveryDialog(IEditorContext& session)
Shows all recovery copies of levels, those of levels that weren't saved yet and those whose file is gone.
void AddShellActions(IEditorContext& session, ActionRegistry& actions)
Adds the actions of the panels, the overlays and the dialogs of the interface.
auto DuplicateCurrentLayer(IEditorContext& session) -> bool
Adds a copy of the layer being edited after it, as an undoable step, the copy is edited then.
void SoloLayer(IEditorContext& session, std::int32_t layer)
Shows only one layer in the editor, or all of them again.
void SetLayerEditorOpacity(IEditorContext& session, std::int32_t layer, std::uint8_t opacity)
Sets the opacity the editor shows a layer with, 255 fully, see DocumentLayer::EditorOpacity.
auto MakeMenuEntry(EditorAction& action) -> MenuEntry
Makes an item of a menu running an action, with its label, icon and shortcut.
auto FormatInteger(std::int32_t value) -> String
Formats a whole number.
auto GetUnitSuffix(ParamUnit unit) -> StringView
Returns the short name of a unit of a parameter of an event shown after its name, empty for none.
auto AddLabeledRow(Element* parent, StringView label, StringView tooltip = {}, float labelWidth = 62.0f) -> Stack*
Adds a row with a label.
auto MatchesSearch(StringView text, StringView search) -> bool
Returns true if all words of a search are in a text, whatever the case of the letters.
auto FindEventField(const EventDescriptor* descriptor, ParamType type) -> const EventParamField*
Returns the first parameter of an event of a type, or nullptr.
auto GetDifficultyFlag(std::int32_t difficulty) -> std::uint8_t
Returns the flag of an event of a difficulty of the game, see Formats::EventRecord::Easy, 0 for none.
auto GetPrimaryEvent(IEditorContext& session, Formats::EventRecord& event) -> bool
Returns the event the event properties show.
auto IsLayerLocked(const LevelDocument& document, std::int32_t layer) -> bool
Returns true if a layer is locked in the editor, see DocumentLayer::EditorLocked.
auto CheckLayerUnlocked(IEditorContext& session, std::int32_t layer) -> bool
Returns true if a layer can be changed, shows why not otherwise.
void ShowOpenImageDialog(IEditorContext& session, StringView title, Function<void(StringView)>&& onChosen)
Shows a dialog to choose a PNG image to open, from the places images are read from, see EditorSession::GetImageRoots().
auto ShowSingleDialog(IEditorContext& session, const char* id, std::unique_ptr<Element> dialog, OverlayOptions&& options, Function<void()>&& onShownAgain = {}) -> Element*
Shows a dialog that isn't modal, only one of each.
auto ReuseSingleDialog(IEditorContext& session, const char* id, bool close = false) -> bool
Returns true if a dialog of id is shown already.
void AddPickerPanelTabs(Element* header, IEditorContext& session)
Adds the tabs that switch what the panel with the tiles and the events shows.
auto GetAutoLayerName(const LevelDocument& document, std::int32_t index) -> String
Returns a name for a layer that has none, by what it is.
auto GetLayerTitle(const LevelDocument& document, std::int32_t index) -> String
Returns the name of a layer, or the name it gets by what it is if it has none.
auto FillSelectionWithGround(IEditorContext& session) -> bool
Makes the selected cells ground, their tiles chosen by their neighbors, as one step.
auto BeautifySelection(IEditorContext& session) -> bool
Chooses better looking tiles for the selected ones, each with the same collision mask, as one step.
void ShowTerrainRulesDialog(IEditorContext& session)
Shows the tiles ground gets by its neighbors, and lets them be chosen by hand, see TerrainRules.
auto ShowModal(Surface& surface, std::unique_ptr<Element> dialog) -> Element*
Shows a dialog in the middle of the screen, the rest of the interface can't be used until it's closed.
auto ShowModeless(Surface& surface, std::unique_ptr<Element> dialog, Function<void()>&& onClosed = {}) -> Element*
Shows a window in the middle of the screen, the rest of the interface and the level can still be used.
void ShowTextPrompt(Surface& surface, StringView title, StringView label, StringView initialText, std::int32_t maxLength, Function<void(StringView)>&& onConfirmed)
Asks for a line of text in a small dialog.
void ShowTileEditor(IEditorContext& session, const TileRef& tile)
Shows a window to change the pixels and the collision mask of a tile, only in this level.
void ShowApplyTileChangesDialog(IEditorContext& session, std::int32_t source = -1)
Shows a window to save the tiles changed in this level into their tile set.
auto ApplyTileChanges(IEditorContext& session, std::uint8_t source, StringView newName, bool withPalette = false) -> bool
Saves the tiles of a tile set changed in this level into a tile set, as an undoable step.
auto CountChangedTiles(IEditorContext& session, std::uint8_t source) -> std::int32_t
Returns how many tiles of a tile set, as TileRef::Source, the level changes.
void ShowImportTileSetDialog(IEditorContext& session)
Asks for an image and makes a new tile set of it, in the user content.
void ImportTileSetImage(IEditorContext& session, Death::Containers::StringView path, Death::Containers::StringView name, bool addToLevel, bool asDefault, Death::Containers::StringView colors = {}, bool dither = false)
Makes a new tile set of an image as ShowImportTileSetDialog() does, for testing.
void ShowNewTileSetDialog(IEditorContext& session)
Asks for a name and a number of tiles and makes a new tile set of empty tiles, in the user content.
auto CreateEmptyTileSet(IEditorContext& session, Death::Containers::StringView name, std::int32_t tileCount, bool addToLevel, bool asDefault) -> bool
Makes a new tile set of empty tiles as ShowNewTileSetDialog() does, returns false if it can't be.
void ShowImportTileSetFileDialog(IEditorContext& session)
Asks for a tile set file and saves it into the user content as a new tile set.
auto ReadTileSetFile(Death::Containers::StringView path, Formats::TileSetData& data, bool& original) -> bool
Reads a whole tile set file of the original game or of this game, see ShowImportTileSetFileDialog().
auto ImportTileSetFile(IEditorContext& session, const Formats::TileSetData& data, Death::Containers::StringView name, bool addToLevel, bool asDefault) -> bool
Saves a tile set into the user content as ShowImportTileSetFileDialog() does, returns false if it can't be.
auto WriteTileSetWithAddedTiles(IEditorContext& session, StringView tileSet, StringView path, const Formats::TileSetData& data, std::int32_t oldCount) -> bool
Writes a tile set file that got new tiles at its end, with the other levels that would show other tiles.
void ShowTileSetLayoutDialog(IEditorContext& session)
Shows a window to delete tiles of the default tile set and to put them in another order.
auto RemapLevelToTileSetOrder(LevelDocument& document, ArrayView<const std::int32_t> order, StringView tileSet = {}, ArrayView<const std::int32_t> mergedInto = {}) -> std::int32_t
Changes the tiles of a tile set in a level to a new order of the tile set.
auto GetTileSetLabel(StringView name) -> String
Returns the name of a tile set as it's shown.
auto IsLevelTileSet(const LevelDocument& document, std::uint8_t source) -> bool
Returns true if a tile set of the level (as TileRef::Source) is stored in the level itself.
auto ReadTileSetOf(IEditorContext& session, std::uint8_t source, Formats::TileSetData& tileSet) -> bool
Reads a whole tile set of the level (as TileRef::Source), from its file or from the level, returns false if it can't.
auto SerializeTileSet(const Formats::TileSetData& tileSet, SmallVectorImpl<std::uint8_t>& bytes) -> bool
Writes a whole tile set into bytes as its file stores it.
void BakeRemapping(Formats::TileSetData& tileSet, const std::uint8_t* remapping)
Puts the colors an extra tile set is matched to into its 8-bit tiles, see Formats::ExtraTileSetRecord::Remapped.
auto CanAddTileIds(IEditorContext& session, std::int32_t added) -> bool
Returns true if the level can refer to added more tiles of its tile sets.
auto SuggestTileSetName(StringView base, StringView suffix) -> String
Returns a name for a new tile set made of base and suffix, as tile sets are named, that isn't taken yet.
auto IsOwnTileSetCopy(StringView name) -> bool
Returns true if the tile set file used is the copy in the user content, which is written over then.
void GetLevelPalette(IEditorContext& session, std::uint32_t(&palette)[256])
Fills the palette the level is shown in, its own one or the one of its default tile set, the first entry transparent.
void AddTileTargetRow(IEditorContext& session, Stack* row, std::shared_ptr<TileTarget> target)
Adds a dropdown to choose where tiles are added to into a row, with the name of a new tile set next to it.
void AddTileTargetNote(IEditorContext& session, Stack* parent, std::shared_ptr<TileTarget> target)
Adds a note about where the tiles go, for a tile set file shadowed by its copy in the user content, say.
void ShowTileSetsDialog(IEditorContext& session)
Shows the tile sets of the level — the default one and the extra ones that follow it.
void ShowExportTileSetImageDialog(IEditorContext& session, std::uint8_t source)
Asks where to save the tiles of a tile set of the level (as TileRef::Source) as an image.
auto SetDefaultTileSet(IEditorContext& session, StringView name) -> bool
Makes a tile set the default one of the level as an undoable step, returns false if it can't be read.
auto AddExtraTileSet(IEditorContext& session, StringView name, std::int32_t matchColors = -1) -> bool
Adds an extra tile set with all of its tiles as an undoable step, returns false if it can't be.
void ShowAddTilesFromImageDialog(IEditorContext& session)
Asks for an image and adds its tiles to the end of a tile set of the level.
auto AddTilesFromImage(IEditorContext& session, const TileTarget& target, StringView imagePath, bool skipExisting, bool dither) -> bool
Adds the tiles of an image to the end of a tile set, as ShowAddTilesFromImageDialog() does.
void AddTilesFromImageAsync(IEditorContext& session, const TileTarget& target, StringView imagePath, const AddTilesOptions& options, Function<void(bool)>&& onDone)
Adds the tiles of an image to the end of a tile set as AddTilesFromImage() does, cut off the user interface.
auto AppendTiles(IEditorContext& session, const TileTarget& target, const Formats::TileSetData& tiles, TileRef& first) -> bool
Adds all tiles of tiles to the end of a tile set, as one undoable step.
auto CopyTileIntoLevel(IEditorContext& session, const TileRef& tile, TileRef& copy) -> bool
Copies a tile into the tiles of this level, and the level shows the copy everywhere it showed the tile.
void SimulateWeapon(const WeaponDefinition& weapon, bool powered, SmallVectorImpl<SimulatedShot>& shots, const FiringRange& range = FiringRange(), std::int32_t volley = 0)
Simulates the shots one press of fire makes of a custom weapon in the firing range.
void SimulateHeldWeapon(const WeaponDefinition& weapon, bool powered, SmallVectorImpl<SimulatedShot>& shots, const FiringRange& range = FiringRange())
Simulates a weapon held for a while, it fires again whenever it can, only once if it fires once per press.
auto FindWeaponAnimation(StringView metadataPath, std::uint32_t animState) -> const GraphicResource*
Returns an animation of the game or of an image of the level, the first one of the metadata if it has no such state, nullptr for no metadata.
void DrawFittedFrame(Painter& painter, const GraphicResource& resource, std::int32_t frame, const Rectf& rect, bool additive = false)
Draws a frame of an animation fitted in a rectangle with its hotspot in the middle.
auto ReadMlleWeaponTemplates(StringView text, StringView sourcePath, SmallVectorImpl<ScriptWeaponTemplate>& templates) -> std::int32_t
Reads the weapons of a description of MLLE, an .ini file with a section of each weapon.
auto ReadWeaponTemplates(StringView text, StringView sourcePath, SmallVectorImpl<ScriptWeaponTemplate>& templates, SmallVectorImpl<CustomWeaponTemplate>* customTemplates = nullptr) -> std::int32_t
Reads the weapons of a description of the editor, a .json file.
void FindScriptWeaponTemplates(Death::Containers::ArrayView<const String> directories, SmallVectorImpl<ScriptWeaponTemplate>& templates, SmallVectorImpl<CustomWeaponTemplate>* customTemplates = nullptr)
Reads all descriptions of weapons (.json and .ini) in directories, custom weapons into customTemplates if given.
auto GuessScriptWeaponTemplate(StringView library, StringView text, StringView constructor, ScriptWeaponTemplate& result, Death::Containers::ArrayView<const StringView> includes = {}) -> bool
Guesses the parameters of a weapon from the text of its library.
auto GetScriptParamSize(ScriptParamType type) -> std::int32_t
Returns the size of a value of a parameter of a type, 0 for a text.
void MakeDefaultScriptParams(const ScriptWeaponTemplate& weaponTemplate, SmallVectorImpl<std::uint8_t>& data)
Returns the parameters as the weapon has them when it's chosen.
auto ReadScriptParams(const ScriptWeaponTemplate& weaponTemplate, Death::Containers::ArrayView<const std::uint8_t> data, SmallVectorImpl<ScriptParamValue>& values) -> std::size_t
Reads the values of the parameters, those missing are as the template has them.
void WriteScriptParams(const ScriptWeaponTemplate& weaponTemplate, Death::Containers::ArrayView<const ScriptParamValue> values, Death::Containers::ArrayView<const std::uint8_t> rest, SmallVectorImpl<std::uint8_t>& data)
Writes the values of the parameters, followed by rest.
auto IsScriptWeaponTemplateOf(const ScriptWeaponTemplate& weaponTemplate, StringView library, StringView constructor) -> bool
Returns true if a template is the one of the library and the code that creates a weapon.
auto GetScriptWeaponHookCall(StringView callback) -> StringView
Returns the call of the hook of the weapons a callback of the level script has to make, as processMain(, empty if it's not known.
void FindScriptWeapons(StringView library, StringView text, SmallVectorImpl<ScriptWeaponClass>& weapons)
Finds the weapons in the text of a script library.
void FindScriptWeapons(Death::Containers::ArrayView<const String> directories, SmallVectorImpl<ScriptWeaponClass>& weapons)
Finds the weapons of all script libraries (*.asc) in directories, the libraries of MLLE itself are left out.
void FindHandWrittenScriptWeapons(StringView script, String(&setUps)[MaxScriptWeapons])
Finds the weapons a level script sets up by itself, outside of the lines MLLE generates.
auto UpdateScriptWeaponLines(StringView script, const LevelWeapons& weapons) -> String
Returns the text of a level script with the lines MLLE generates for the weapons of the script made anew.
void ShowWeaponsDialog(IEditorContext& session)
Shows the weapons of the level.
auto ReadLevelWeapons(const LevelDocument& document, LevelWeapons& weapons) -> Formats::WeaponsChunk::ReadResult
Reads the weapons of a level, returns why if they can't be changed, see Formats::WeaponsChunk::Read().
auto ChangeLevelWeapons(IEditorContext& session, StringView name, Death::Containers::Function<void(LevelWeapons&)>&& change, bool final = true) -> bool
Changes the weapons of the level as an undoable step, changes while a value is dragged are merged until final.
auto GetLevelWeaponName(const WeaponsDescription& weapons, WeaponType weaponType) -> String
Returns the name of a weapon, as the level names it or as the game does.
auto GetStockWeaponName(WeaponType weaponType) -> StringView
Returns the name of a weapon of the game.
auto GetCachedLevelWeapons(IEditorContext& session) -> const LevelWeapons&
Returns the weapons of the level being edited, read again only when they changed.
auto GetEventOptionLabel(IEditorContext& session, const EventParamField& field, const ParamOption& option) -> String
Returns the label of an option of a parameter of an event.
auto ReadCustomWeaponTemplate(const Json::Value& value, StringView sourcePath, CustomWeaponTemplate& result) -> bool
Reads a template of a custom weapon from an item of a .json file.
auto ApplyCustomWeaponTemplate(const CustomWeaponTemplate& weaponTemplate, WeaponDefinition& weapon, Function<std::int32_t(const WeaponTemplateImage&)>&& addImage, Function<std::int32_t(StringView)>&& addSound) -> bool
Makes a weapon as a template describes it.
void WriteCustomWeaponTemplate(const WeaponDefinition& weapon, const WeaponsDescription& weapons, Function<String(std::int32_t)>&& imageFile, Function<String(std::int32_t)>&& soundFile, Json::Value& result)
Describes a custom weapon as an item of a template file.
auto WriteWeaponTemplateFile(const Json::Value& value) -> std::string
Returns the text of a template file, tab-indented, numbers as short as they're typed.
auto RemapLinkedIds(EventStamp& stamp, const LevelDocument& document) -> std::int32_t
Gives links that an event stamp has whole, as warps and triggers, an identifier the level doesn't use yet.
auto CopyOffGridEvents(const LevelDocument& document) -> SmallVector<Formats::OffGridEventRecord, 0>
Returns a copy of the events off the grid of a level, to be changed and set back as one step.
void DrawTileModifiers(Painter& painter, const DocumentLayer& layer, const LayerView& view, const Rectf& viewRect)
Marks the tiles of a layer seen in a rectangle of the screen that are translucent or invisible.
void DrawSelectionEdge(Painter& painter, float x, float y, float length, bool horizontal, float animTime)
Draws an edge of a selection as marching ants, short dashes moving along a dark line, as a bitmap editor has them.
auto WrapViewRect(const Recti& rect, Vector2i layerSize, const LayerView& view, Recti(&parts)[4]) -> std::int32_t
Splits a rectangle of cells of the view into rectangles of a layer, returns how many there are, at most 4.
auto MoveSelectedTiles(IToolHost& host, Vector2i offset) -> bool
Moves the selected tiles of the layer being edited by an offset, as one step, the selection with them.
auto CarrySelectedEvents(IToolHost& host, const TileSelection& selection, const String& name, Function<Vector2i(Vector2i)>&& mapCell, Function<Vector2i(Vector2i)>&& mapPixel, Function<void(Formats::EventRecord&)>&& transform) -> bool
Moves the events on the selected tiles of the sprite layer where the tiles go, as moving or mirroring them does.

Variables

std::int32_t MaxImportedTiles constexpr
Most tiles a tile set can have, as its file stores the number of them in 16 bits.
char LevelTileSetName constexpr
Name of the extra tile set a level stores in itself, see Formats::ExtraTileSetRecord::Embedded.
std::int32_t MaxScriptWeapons constexpr
Most weapons of a script, MLLE sets up the first nine.