Skip to content

Commit d6ebcd0

Browse files
authored
Merge branch 'object-Object:main' into main
2 parents 4d2798c + b423249 commit d6ebcd0

File tree

98 files changed

+4093
-477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+4093
-477
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,19 @@ name: Run CI/CD pipeline
22

33
on:
44
push:
5-
branches: "*"
5+
branches: ["*"]
66
pull_request:
77
workflow_dispatch:
88

99
permissions:
1010
contents: read
1111

1212
jobs:
13-
setup:
14-
runs-on: ubuntu-latest
15-
outputs:
16-
is-main-branch: |-
17-
${{
18-
github.event_name != 'pull_request' && contains(
19-
fromJson('["main", "1.19"]'),
20-
(github.head_ref || github.ref_name)
21-
)
22-
}}
23-
steps:
24-
- name: Print message so the workflow isn't invalid
25-
run: 'echo "HexDebug <3 HexBug"'
26-
2713
build-docs:
28-
needs: setup
29-
uses: hexdoc-dev/actions/.github/workflows/hexdoc.yml@v1
14+
uses: ./.github/workflows/docs.yml
3015
permissions:
3116
contents: write
3217
pages: read
33-
secrets:
34-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3518
with:
36-
python-version: 3.11
37-
deploy-pages: ${{ needs.setup.outputs.is-main-branch == 'true' }}
19+
deploy-pages: ${{ github.event_name != 'pull_request' && contains(fromJson(vars.HEXDOC_BRANCHES), github.ref_name) }}
3820
release: false

.github/workflows/docs.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: "[Reusable] Build and push the web book"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
deploy-pages:
7+
type: boolean
8+
required: true
9+
release:
10+
type: boolean
11+
required: true
12+
description: Whether the book should be built in preparation for a release.
13+
14+
jobs:
15+
build-hexdoc:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
pages: read
20+
outputs:
21+
pages-url: ${{ steps.build.outputs.pages-url }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v6
26+
with:
27+
python-version-file: .python-version
28+
29+
- uses: astral-sh/setup-uv@v6
30+
with:
31+
activate-environment: true
32+
enable-cache: true
33+
34+
- uses: actions/setup-java@v4
35+
with:
36+
distribution: temurin
37+
java-version: 17
38+
39+
- uses: gradle/actions/setup-gradle@v4
40+
with:
41+
gradle-home-cache-includes: |
42+
caches
43+
notifications
44+
loom-cache
45+
46+
- uses: ts-graphviz/setup-graphviz@v2
47+
48+
- name: Sync dependencies
49+
run: uv sync --frozen --no-dev
50+
51+
- name: Build API docs
52+
run: ./gradlew :dokkaGenerate
53+
54+
- id: build
55+
uses: hexdoc-dev/actions/build@v1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
release: ${{ inputs.release }}
60+
61+
deploy-pages:
62+
needs: build-hexdoc
63+
if: inputs.deploy-pages
64+
runs-on: ubuntu-latest
65+
concurrency:
66+
group: hexdoc-deploy-pages
67+
cancel-in-progress: false
68+
permissions:
69+
contents: write
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- uses: actions/setup-python@v6
74+
with:
75+
python-version-file: .python-version
76+
77+
- uses: astral-sh/setup-uv@v6
78+
with:
79+
activate-environment: true
80+
enable-cache: true
81+
82+
- name: Sync dependencies
83+
run: uv sync --frozen --no-dev
84+
85+
- name: Merge new hexdoc build into existing book
86+
uses: hexdoc-dev/actions/merge@v1
87+
with:
88+
release: ${{ inputs.release }}
89+
site-url: ${{ needs.build-hexdoc.outputs.pages-url }}
90+
91+
- name: Deploy to Pages
92+
uses: hexdoc-dev/actions/deploy-pages@v1
93+
with:
94+
merge: false
95+
release: ${{ inputs.release }}

.github/workflows/release.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ name: Release
22

33
on:
44
push:
5-
tags: 'v[0-9]+.[0-9]+.[0-9]+*'
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
67
workflow_dispatch:
78
inputs:
8-
publish-docs:
9-
description: Publish the web book
10-
type: boolean
11-
default: false
129
dry-run:
1310
description: Perform a dry run
1411
type: boolean
@@ -22,20 +19,17 @@ permissions:
2219

2320
jobs:
2421
build-docs:
25-
uses: hexdoc-dev/actions/.github/workflows/hexdoc.yml@v1
22+
uses: ./.github/workflows/docs.yml
2623
permissions:
2724
contents: write
2825
pages: read
29-
secrets:
30-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3126
with:
32-
python-version: 3.11
33-
deploy-pages: ${{ github.event_name == 'push' || inputs.publish-docs && !inputs.dry-run }}
27+
deploy-pages: ${{ github.event_name == 'push' || !inputs.dry-run }}
3428
release: true
3529

36-
publish-docs:
30+
publish-pypi:
3731
needs: build-docs
38-
if: github.event_name == 'push' || inputs.publish-docs && !inputs.dry-run
32+
if: github.event_name == 'push' || !inputs.dry-run
3933
runs-on: ubuntu-latest
4034
environment:
4135
name: pypi

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ celerybeat.pid
156156
# Environments
157157
.env
158158
.venv
159-
env/
160159
venv/
161-
ENV/
162160
env.bak/
163161
venv.bak/
164162

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
66

77
## [UNRELEASED]
88

9+
### Added
10+
11+
- Added support for debugging spell circles! Right-click (or sneak-right-click, for toolsmiths) on the impetus with a Debugger to start a debug session.
12+
- New items: Quenched Debugger and Quenched Evaluator! These post-enlightenment debug tools allow up to 4 hexes to be debugged at once. Scroll while holding sneak and sprint in order to switch between the available "debug thread" slots.
13+
- API: Added API documentation to the web book! The API docs from the latest commit pushed to `main` are available [here](https://hexdebug.hexxy.media/v/latest/main/api/), and there is a link to the API docs for each version in the header of the corresponding web book.
14+
- API: Added support for implementing debug support in casting devices/environments other than the Debugger item (eg. circles, wisps, cassettes). See the API documentation for more details, especially the sequence diagrams in the `hexdebug-core-common` module.
15+
- API: Added a new mini-mod called HexDebug Core (`hexdebug-core-*`). This is a minimal, Java-only mod containing only the API classes required to implement debug support. The intention is for HexDebug Core to be included in other addons via Jar-in-Jar, allowing addons to implement optional debugging support in their casting environments while minimizing the amount of overhead and added complexity from checking whether HexDebug is loaded or not.
16+
- API: Added Mojmap-remapped `common` jars (`hexdebug-common-mojmap` and `hexdebug-core-common-mojmap`) for use in VanillaGradle-based xplat projects.
17+
918
### Changed
1019

1120
- Update zh_cn translations, by ChuijkYahus in [#60](https://github.com/object-Object/HexDebug/pull/60).
1221
- Source files can now be viewed after the hex that created them finishes debugging.
1322
- Removed the random prefix from source filenames.
23+
- Active debug sessions are now terminated on death.
24+
- API: The `SplicingTableIotaRenderer` tooltip is now stored in a field on the renderer, allowing it to be updated in `render` if HexDebug isn't updating it frequently enough for your use case.
1425

1526
### Fixed
1627

Common/Mojmap/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// this is in its own project because otherwise Gradle gets confused about having multiple remap tasks (?)
2+
3+
plugins {
4+
id("hexdebug.conventions.mojmap")
5+
}

Common/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id("hexdebug.conventions.architectury")
3+
id("hexdebug.conventions.dokka")
34
}
45

56
architectury {
@@ -24,13 +25,13 @@ dependencies {
2425
annotationProcessor(it)
2526
}
2627

27-
api(libs.bundles.lsp4j)
28+
implementation(libs.bundles.lsp4j)
2829

2930
implementation(libs.bundles.ktor)
3031

3132
modImplementation(libs.ioticblocks.common)
3233

3334
modCompileOnly(libs.emi.xplat)
3435

35-
api(project(":Core"))
36+
api(project(":hexdebug-core-common", "namedElements"))
3637
}

Common/dokka.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Module hexdebug-common

Common/src/main/java/gay/object/hexdebug/api/client/splicing/SplicingTableIotaRenderer.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.minecraft.network.chat.Component;
1111
import org.jetbrains.annotations.ApiStatus;
1212
import org.jetbrains.annotations.NotNull;
13+
import org.jetbrains.annotations.Nullable;
1314

1415
public abstract class SplicingTableIotaRenderer {
1516
@NotNull
@@ -19,6 +20,9 @@ public abstract class SplicingTableIotaRenderer {
1920
private int x;
2021
private int y;
2122

23+
@Nullable
24+
private Tooltip tooltip;
25+
2226
public SplicingTableIotaRenderer(
2327
@NotNull IotaType<?> type,
2428
@NotNull SplicingTableIotaClientView iota,
@@ -59,6 +63,24 @@ public void setY(int y) {
5963
this.y = y;
6064
}
6165

66+
/**
67+
* Returns the cached tooltip for this renderer. This is called every frame, immediately after
68+
* {@link SplicingTableIotaRenderer#render}.
69+
*/
70+
@Nullable
71+
public Tooltip getTooltip() {
72+
return tooltip;
73+
}
74+
75+
/**
76+
* Sets the cached tooltip for this renderer. By default, this is called only when the renderer
77+
* is moved to a new position, receiving the value returned by
78+
* {@link SplicingTableIotaRenderer#createTooltip}.
79+
*/
80+
public void setTooltip(@Nullable Tooltip tooltip) {
81+
this.tooltip = tooltip;
82+
}
83+
6284
/** Renders one frame of this iota. */
6385
public abstract void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick);
6486

@@ -69,7 +91,8 @@ public SplicingTableIotaBackgroundType getBackgroundType() {
6991
}
7092

7193
/**
72-
* Creates and returns a new {@link Tooltip} for the provided iota.
94+
* Creates and returns a new {@link Tooltip} for the provided iota. By default, this is called
95+
* only when the renderer is moved to a new position.
7396
* <br>
7497
* In most cases, you'll likely want to override
7598
* {@link SplicingTableIotaRenderer#buildTooltip} instead.

0 commit comments

Comments
 (0)