Skip to content

Commit

Permalink
Mainline version update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahvohck committed Dec 21, 2020
2 parents 632ac44 + ee9b2e5 commit d7edfe3
Show file tree
Hide file tree
Showing 14 changed files with 730 additions and 207 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ previous_spacehaven_path.txt
quicklaunch_*.jar
quicklaunch_*/
extra_mods_path.txt
env/
.vscode/.ropeproject/
.vscode/settings.json
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Startup file",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/spacehaven-modloader.py",
"console": "integratedTerminal"
}
]
}
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
# Change Log
## v0.9.0
- On Windows, the game will be autolocated via Steam if possible.
- `<modid>` tag in info.xml: Defines a prefix that can be used in various places during mod creation.
- Automatic texture packing: instead of defining a `textures` file, texture regions can be defined as needed in `animations`. Add a `filename=""` attribute to the `<assetPos />` tag, and it will be packed automatically into `modid.cim`. This will fail if a mod ID is not specified. Textures must still be located in `moddir/textures` and paths are relative to this directory.
- Automatic texture patching writes the resulting textures XML to `moddir/library/generated_textures.xml` for debugging
- Attempt to normalize file paths in a bunch of places
- More instances of log cleanup - less errors, more error messages
- Decouple mod database from window class
- Decouple mod info from window class

## v0.8.2
Bugfix: textures were not being merged in due to missing file during the build process

## v0.8.1
- New PatchOperation: AttributeMath (not in PatchOperation specification)
- Requires an addtional attribute on the `<value />` tag: opType
- Supported operations: `add`, `subtract`, `multiply`, `divide`
- `<Noload />` tag - Prevents a patch from loading (good for optional patches, or patches in development)
- Version bump to 0.8.1 to allow for better versioning in the future.
- General code refactoring

## v0.0.8
Support for [PatchOperation][1] modding
- AttributeSet -> PatchOperationAttributeSet
- AttributeAdd -> PatchOperationAttributeAdd
- AttributeRemove -> PatchOperationAttributeRemove
- Add -> PatchOperationAdd
- Insert -> PatchOperationInsert
- Remove -> PatchOperationRemove
- Replace -> PatchOperationReplace

Patches are loaded from `moddir/patches`, and are loaded after merge-by-id to allow modding other mods and to prevent clobbering.
Patch failure is logged to logs.txt

## v0.0.2
- Adds support for patching all definitions in `library/haven`, not just `Elements` and `Products`.
Expand All @@ -7,4 +40,7 @@
- Adds game version checking/warnings

## v0.0.1
Initial Release
Initial Release


[1]: <https://rimworldwiki.com/wiki/Modding_Tutorials/PatchOperations>
14 changes: 14 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Codebase
- PEP 8 compliance
- Better file structure
- Strip leading slashes on autopacked region images
- Strip trailing extensions from autopacked region images

# Repository
- Create a powershell build script for Windows
- Remove need for textures_annotations.xml?
- Update README.md
- At least update the modloader image
- Then the Modding Guide
- Then other parts
- Look into github wikis
5 changes: 3 additions & 2 deletions loader/assets/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ def annotate(corePath):
if not asset_id in texture_names:
continue
assetPos.set('_annotation', texture_names[asset_id])


annotatedPath = os.path.join(corePath, "library", "animations_annotated.xml")
animations.write(annotatedPath)
ui.log.log(" Wrote annotated annimations to {}".format(annotatedPath))
ui.log.log(" Wrote annotated annimations to {}".format(annotatedPath))

haven = ElementTree.parse(os.path.join(corePath, "library", "haven"), parser=XMLParser(recover=True))
texts = ElementTree.parse(os.path.join(corePath, "library", "texts"), parser=XMLParser(recover=True))
Expand Down Expand Up @@ -147,4 +148,4 @@ def _annotate_elt(element, attr = None):

annotatedHavenPath = os.path.join(corePath, "library", "haven_annotated.xml")
haven.write(annotatedHavenPath)
ui.log.log(" Wrote annotated spacehaven library to {}".format(annotatedHavenPath))
ui.log.log(" Wrote annotated spacehaven library to {}".format(annotatedHavenPath))
Loading

0 comments on commit d7edfe3

Please sign in to comment.