Skip to content
Zachary Perlmutter edited this page Feb 26, 2024 · 4 revisions

Scroll of Debug is an easy-to-implement extension to Shattered Pixel Dungeon that can make debugging drastically easier.

Implementing into your project

By merging

The two implementations are based on Shattered v1.0 and Shattered v1.2. When pulling into your repository, you should import the newest version that is already implemented by your project --- that is, if your code doesn't contain commits from Shattered v1.2 and up, then you should pull the older implementation.

The only difference between the implementations are those due to code changes made by Shattered Pixel Dungeon in those releases. There is no difference in functionality of Scroll of Debug itself.

The distinct advantage of this approach is that it makes implementation of Scroll of Debug almost trivial and leaves you able to easily implement updates to Scroll of Debug by simply pulling in the ScrollOfDebug repository.

If you have a v1.0 implementation of Scroll of Debug and you implement Shattered source of v1.2 or higher, you should pull in ScrollOfDebug/1.2 at the same time as your implementation to ensure Scroll of Debug works properly.

PC-only

The PC-only branches neglect android support, but in exchange their footprint in the code is practically non-existent. The only change to actual Shattered code is a singular change in GameScene.java, which adds the Scroll of Debug.

For personal testing only, you should only need this implementation.

As of v2.0 classes can also be manually loaded into this implementation of scroll of debug when ran on other platforms by typing out their full (case-sensitive) package name, after which they'll be able to be used as normal.

APK Support

Android support can be provided by pulling in the corresponding branch. It is much more invasive, requiring changes in the SPD-Classes and android modules.

APK support is useful if you want to distribute Scroll of Debug versions of your project to testers.

APK support can be added to an existing PC-only implementation of ScrollOfDebug by merging the corresponding branch into your project.

Subtrees

The master branch can be directly pulled into an implementing repository if the offset is core/src/main/java/com/zrp200/scrollofdebug/.

git remote add ScrollOfDebug https://github.com/Zrp200/ScrollOfDebug.git
git subtree add ScrollOfDebug master -P core/src/main/java/com/zrp200/scrollofdebug

This requires manually applying code to add Scroll of Debug to a player's inventory and doesn't have android support by default. However, the subtree method does not make any assumptions about the actual commit history of the project: if the code structure matches what Scroll of Debug expects, it should just work.

Android support is possible to implement from here, but it requires manually applying the changes. This can possibly be done by cherrypicking from the implementation branches, but I have not seriously investigated this at this time.

Clone this wiki locally