Skip to content

Commit 7111167

Browse files
sp00ktoberclaude
andcommitted
fix(ports): the Zinogre's lower rows clear the counter_is above them
b26 (counter_is, 224 high) overlapped b30 on a 200 pitch. The rows from y=2600 move down by 40. The blocks keep their order, so every path keeps its priority and the compiled rules are the same. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent e1aacf7 commit 7111167

2 files changed

Lines changed: 26 additions & 10 deletions

File tree

‎apps/studio/tests/monster/ui/test_behaviour.py‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from __future__ import annotations
77

8+
import itertools
89
from collections.abc import Callable
910
from pathlib import Path
1011
from typing import Any
@@ -22,7 +23,7 @@
2223
from mhfu_studio.shell.workspace import Dock
2324
from mhfu_studio.ui import kit, theme
2425
from mhfu_studio.ui.testing import FakeWorkspace
25-
from PySide6.QtCore import QPoint, QPointF, Qt
26+
from PySide6.QtCore import QPoint, QPointF, QRectF, Qt
2627
from PySide6.QtTest import QTest
2728
from PySide6.QtWidgets import QComboBox, QDockWidget, QToolButton
2829

@@ -341,6 +342,21 @@ def test_spread_out_is_one_step(panel: BehaviourPanel, ws: MonsterWorkspace) ->
341342
assert doc(ws).manifest == before
342343

343344

345+
def test_no_two_nodes_of_the_zinogre_overlap(
346+
qtbot: Any, ws: MonsterWorkspace, zinogre_toml: Path, synthetic_pac: bytes
347+
) -> None:
348+
from mhfu_studio.monster.core.scene import Scene
349+
350+
zin = PortDocument.open(zinogre_toml)
351+
ws.load(Scene.from_bytes(synthetic_pac, "z", path=zinogre_toml.with_suffix(".bin")), zin)
352+
p = make(qtbot, ws)
353+
rects = {
354+
i: QRectF(*n.view.xy_pos, n.view.width, n.view.height) for i, n in p.view._shown.items()
355+
}
356+
clash = [(a, b) for a, b in itertools.combinations(rects, 2) if rects[a].intersects(rects[b])]
357+
assert clash == []
358+
359+
344360
def test_part_and_main_options(panel: BehaviourPanel, ws: MonsterWorkspace) -> None:
345361
doc(ws).edit(lambda m: m.behaviour.blocks.__setitem__("b4", Block("on_flinch", (0.0, 0.0))))
346362
panel.sync()

‎ports/zinogre.toml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ play = [
11511151
kind = "idle"
11521152
at = [
11531153
400.0,
1154-
2600.0,
1154+
2640.0,
11551155
]
11561156
next = [
11571157
"b29",
@@ -1162,7 +1162,7 @@ label = "hunter far -> dash"
11621162
kind = "flag_is"
11631163
at = [
11641164
680.0,
1165-
2600.0,
1165+
2640.0,
11661166
]
11671167
flag = "in_combat"
11681168
next = [
@@ -1173,7 +1173,7 @@ next = [
11731173
kind = "distance"
11741174
at = [
11751175
960.0,
1176-
2600.0,
1176+
2640.0,
11771177
]
11781178
lo = 1500.0
11791179
next = [
@@ -1184,7 +1184,7 @@ next = [
11841184
kind = "cooldown"
11851185
at = [
11861186
1240.0,
1187-
2600.0,
1187+
2640.0,
11881188
]
11891189
frames = 300
11901190
play = [
@@ -1195,7 +1195,7 @@ play = [
11951195
kind = "idle"
11961196
at = [
11971197
400.0,
1198-
2800.0,
1198+
2840.0,
11991199
]
12001200
next = [
12011201
"b33",
@@ -1206,7 +1206,7 @@ label = "below 30% HP -> howl"
12061206
kind = "flag_is"
12071207
at = [
12081208
680.0,
1209-
2800.0,
1209+
2840.0,
12101210
]
12111211
flag = "in_combat"
12121212
next = [
@@ -1217,7 +1217,7 @@ next = [
12171217
kind = "monster_hp"
12181218
at = [
12191219
960.0,
1220-
2800.0,
1220+
2840.0,
12211221
]
12221222
hi = 30
12231223
next = [
@@ -1228,7 +1228,7 @@ next = [
12281228
kind = "limit"
12291229
at = [
12301230
1240.0,
1231-
2800.0,
1231+
2840.0,
12321232
]
12331233
times = 1
12341234
play = [
@@ -1239,7 +1239,7 @@ play = [
12391239
kind = "on_signal"
12401240
at = [
12411241
400.0,
1242-
3000.0,
1242+
3040.0,
12431243
]
12441244
name = "roar"
12451245
play = [

0 commit comments

Comments
 (0)