Package: adofaipy
This is a library that makes automating events in ADOFAI levels more convenient.List of Classes:LevelDictInitalize withLevelDict(filename, encoding)(encoding is optional, default is utf-8-sig)LevelDict.filename : strThe filename of the file from which theLevelDictwas obtained.LevelDict.encoding : strThe encoding of the file from which theLevelDictwas obtained.LevelDict.leveldict : dictThe specified file in the form of nested dictionaries and lists.LevelDict.angleData : list[float]A list of all tile angles in the level.LevelDict.actions : list[Action]A list of all actions (tile-based events) in the level.LevelDict.decorations : list[Decoration]A list of all decorations (including objects and text) in the level.LevelDict.nonFloorDecos : list[Decoration]A list of all decorations in the level that are not tied to any particular tile.LevelDict.settings : SettingsThe level settings, as a Settings object.LevelDict.tiles : list[Tile]A list of all tiles in the level. (SeeTileclass)LevelDict.appendTile(self, angle : float) -> None:Adds a single tile to the end of the level.LevelDict.appendTiles(self, angles : list[float]) -> None:Adds a list of tiles to the end of the level.LevelDict.insertTile(self, angle : float, index : int) -> None:Adds a single tile to the level before the specified index.LevelDict.insertTiles(self, angles : list[float], index : int) -> None:Adds a list of tiles to the level before the specified index.LevelDict.addAction(self, event : Action) -> int:Adds the given action to the level. Returns the index of the event within the tile.LevelDict.addDecoration(self, event : Decoration) -> int:Adds the given decoration to the level. Returns the index of the event within the tile / within the list of non-floor decorations.LevelDict.getActions(self, condition : Callable) -> list[Action]:Returns a list of actions in the level that meet the given condition. Returns a list of all actions if condition is not specified.LevelDict.getDecorations(self, condition : Callable) -> list[Decoration]:Returns a list of decorations in the level that meet the given condition. Returns a list of all decorations if condition is not specified.LevelDict.removeActions(self, condition : Callable) -> list[Action]:Removes all actions in the level that meet the given condition. Returns a list of removed actions.LevelDict.removeDecorations(self, condition : Callable) -> list[Decoration]:Removes all decorations in the level that meet the given condition. Returns a list of removed decorations.LevelDict.popAction(self, tile, index) -> Action:Removes the action at the specified tile at the specified index. Returns the event.LevelDict.popDecoration(self, tile, index) -> Decoration:Removes the decoration at the specified tile at the specified index. Returns the event.LevelDict.replaceFieldAction(self, condition : Callable, field : str, new) -> None:Changes the value of "field" to "new" in all actions that meet the given condition.LevelDict.replaceFieldDecoration(self, condition : Callable, field : str, new) -> None:Changes the value of "field" to "new" in all decorations that meet the given condition.LevelDict.writeDictToFile(self, leveldict : dict, filename : str):Writes the given dictionary to the specified file. Overwrites the original file if filename is not specified.Use this if you are working withLevelDict.leveldict.LevelDict.writeToFile(self, filename : str=None) -> None:Writes the level to the specified file. Overwrites the original file if filename is not specified.SettingsPart of a LevelDict object. The properties of this class are equivalent to the parameters in thesettingsfield of a .adofai file.TileA list of Tiles is contained within a LevelDict object.Tile.angle : floatThe angle that the tile points towards (0 degrees is facing right, 90 degrees is facing upwards)Tile.actions : list[Action]A list of actions which are present on that particular tile.Tile.decorations : list[Decoration]A list of decorations which are present on that particular tile.ActionAn event that goes on a tile (one with a purple icon). AnActionobject behaves like adict. The keys depend on the event type. Check any entry in theactionsfield of a .adofai file for more information on the fields used by that event type.Action objects are found in a list of actions in aTileobject.DecorationA decoration, object decoration, or text decoration (anything found in the decorations menu on the left sidebar). ADecorationobject behaves like adict. The keys depend on the event type. Check any entry in thedecorationsfield of a .adofai file for more information on the fields used by that event type.Decoration objects are found in a list of decorations in aTileobject. If the decoration is not tied to any tile, it is found in the list of non-floor decos.# Changelog3.0.1 (2023/12/02)Minor bugfixFixed markdown bug on README and CHANGELOGRemoved unnessecary files3.0.0 (2023/12/01)Major updateCompletely overhauled file structure to use a class-based systemToo much to list! Read the docs for more info2.0.3 (2023/09/23)Minor bugfixesFixedaddEvent()not detectingaddObjectandaddTexteventsFixedremoveEvents()not modifyingleveldictFixed typo inreplaceField()Added logo to README2.0.2 (2023/09/03)Minor bugfixFixed markdown bug on README and CHANGELOG for real this time2.0.1 (2023/09/03)Minor bugfixFixed markdown bug on README and CHANGELOG (hopefully)2.0.0 (2023/09/03)Major updateCompletely overhauled file reading to use dictionaries instead of stringsAddedgetFileDict()Added 3 new utility functions:searchEvents(),removeEvents()andreplaceField()getAngles(),setAngles()and all event functions are now deprecatedUpdated documentationREADME and CHANGELOG now uses markdown0.1.1 (2023/07/17)Minor bugfixesFixed encoding incompatibilityFixed output string formoveDecorations()0.1.0 (2023/06/15)Minor updateAdded dynamic pivot offset, parallax offset, masking and blending fields toaddDecoration()andmoveDecorations()Added angleOffset tosetSpeed()0.0.3 (2023/06/14)Minor bugfix: fixed filename__init__.py0.0.2 (2023/06/13)Minor bugfix:'re'is no longer a dependency0.0.1 (2023/05/28)First Release