A library that makes automating events in ADOFAI levels more convenient.
Project description
This is a library that makes automating events in ADOFAI levels more convenient.
List of Functions:
getFileString(filename : str) -> str
- Returns the ADOFAI file as a string.
- It is recommended to use
getFileDict()instead.
getFileDict(filename : str) -> dict
- Returns the specified file in the form of nested dictionaries and lists.
- Refer to any
.adofaifile to see the structure of this dictionary. - Use this for any function with
leveldictas an argument.
addEvent(event : dict, leveldict : dict) -> dict
- Adds the given
eventtoleveldictand returns a copy ofleveldict. - Remember to reassign the output to the original dictionary!
- Most fields can be omitted, in which case a default value is used.
- Note: Events are always in the form of dictionaries. Their structure and field names are the same as how they appear in
.adofaifiles.
searchEvents(searchfor : dict, leveldict : dict) -> list[dict]
- Returns a list of all events in
leveldictthat match all fields insearchfor. - For example,
will return a list of allsearchfor={"eventType": "moveDecorations", "tag": "sampleTag"}moveDecorationevents with tagsampleTag. - This function directly modifies
leveldict.
removeEvents(searchfor : dict, leveldict : dict) -> list[dict]
- Similar to
searchEvents, but removes all matching events. - This function returns a list of removed events.
- This function directly modifies
leveldict.
replaceField(searchfor : dict, field : str, new, leveldict : dict) -> None
- Searches for events in
leveldictusingsearchfor, and replaces the value infieldwithnew. - For example,
finds allreplaceField({"eventType": "Flash", "duration": 0.5}, "startColor", "800080", leveldict)Flashevents with duration0.5and changes their start color to#800080.
writeToFile(leveldict : dict, filename : str) -> None
- Writes the
leveldictto the specified file.
Changelog
2.0.2 (2023/09/03)
- Minor bugfix
- Fixed markdown bug on README and CHANGELOG for real this time
2.0.1 (2023/09/03)
- Minor bugfix
- Fixed markdown bug on README and CHANGELOG (hopefully)
2.0.0 (2023/09/03)
- Major update
- Completely overhauled file reading to use dictionaries instead of strings
- Added
getFileDict() - Added 3 new utility functions:
searchEvents(),removeEvents()andreplaceField() getAngles(),setAngles()and all event functions are now deprecated- Updated documentation
- README and CHANGELOG now uses markdown
0.1.1 (2023/07/17)
- Minor bugfixes
- Fixed encoding incompatibility
- Fixed output string for
moveDecorations()
0.1.0 (2023/06/15)
- Minor update
- Added dynamic pivot offset, parallax offset, masking and blending fields to
addDecoration()andmoveDecorations() - Added angleOffset to
setSpeed()
0.0.3 (2023/06/14)
- Minor bugfix: fixed filename
__init__.py
0.0.2 (2023/06/13)
- Minor bugfix:
're'is no longer a dependency
0.0.1 (2023/05/28)
- First Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
adofaipy-2.0.2.tar.gz
(60.0 kB
view details)
File details
Details for the file adofaipy-2.0.2.tar.gz.
File metadata
- Download URL: adofaipy-2.0.2.tar.gz
- Upload date:
- Size: 60.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8ae0691d9367019136d301d10829f7490e13fdf589c6c994d1138c41ed161c5
|
|
| MD5 |
43341714b8f5aaa95ad8ceef212576aa
|
|
| BLAKE2b-256 |
d4cf006b7142d679fd30ad05940ca0e96cf1f52f024c29b90518b443e8fe6c77
|