Skip to content

Commit 0d02ca8

Browse files
authored
Merge pull request #54 from MHFU-ModKit/studio/send-hitboxes
feat(studio): Send hitboxes to game
2 parents 0bdb5d8 + 81a4dfd commit 0d02ca8

10 files changed

Lines changed: 26 additions & 11 deletions

File tree

‎apps/studio/src/mhfu_studio/monster/panels/action.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
EVERYWHERE = {"UNMEASURED"}
4343
LUA_NOTE = (
4444
"The game reads moves from your mod's Lua file, not from this file. Copy them into the"
45-
" mod's P.define{…}; Send to game carries only the hitboxes."
45+
" mod's P.define{…}; Send hitboxes to game carries nothing else."
4646
)
4747
ROWS_TIP = (
4848
"Every action worth a clip: your moves, then the base monster's attacks, then what the game"

‎apps/studio/src/mhfu_studio/monster/panels/hitboxes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def __init__(self, ws: MonsterWorkspace, studio: Studio) -> None:
229229
lay.addWidget(edit)
230230

231231
ship = kit.Section(
232-
"4 Send to game", tip="Your hitboxes onto the memory stick, or into the game"
232+
f"4 {ws.send_label}", tip="Your hitboxes onto the memory stick, or into the game"
233233
)
234234
self.send = SendRow(ws, studio)
235235
self.push = PushRow(ws, studio)

‎apps/studio/src/mhfu_studio/monster/panels/push.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-3.0-or-later
22
# SPDX-FileCopyrightText: 2026 sp00ktober
3-
"""Push to game, beside Send to game: the hit tables straight into the running game."""
3+
"""Push to game, beside Send hitboxes to game: the hit tables straight into the running game."""
44

55
from __future__ import annotations
66

‎apps/studio/src/mhfu_studio/monster/panels/widgets.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-3.0-or-later
22
# SPDX-FileCopyrightText: 2026 sp00ktober
33
"""Qt pieces the monster panels share: the source switch, a volume's form, the no-scene state,
4-
the see-through switch and the Send to game row."""
4+
the see-through switch and the Send hitboxes to game row."""
55

66
from __future__ import annotations
77

@@ -130,13 +130,13 @@ def sync_see_through(box: QCheckBox, ws: MonsterWorkspace) -> None:
130130

131131

132132
class SendRow(QWidget):
133-
"""The title bar's Send to game where a panel's task ends, and why it cannot run."""
133+
"""The title bar's Send hitboxes to game where a panel's task ends, and why it cannot run."""
134134

135135
def __init__(self, ws: MonsterWorkspace, studio: Studio) -> None:
136136
super().__init__()
137137
self.ws, self.studio = ws, studio
138138
self.send = kit.button(
139-
"Send to game",
139+
ws.send_label,
140140
tip="Puts your hitboxes, hurtboxes and damage grid on the memory stick, saved or"
141141
" not; a running game reloads them. The title bar's button (⌘↩) does the same.",
142142
on=studio.act("send", studio.send),

‎apps/studio/src/mhfu_studio/monster/push.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,5 @@ def stick_differs(m: Manifest, mods: Path) -> str:
138138
return ""
139139
return (
140140
f"; the memory stick's {path.name} (id {found[1]}) puts its own tables back while the"
141-
" port is in the area: Send to game to put these there too"
141+
" port is in the area: Send hitboxes to game to put these there too"
142142
)

‎apps/studio/src/mhfu_studio/monster/validate.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def _attacks(m: Manifest, intel: SpeciesIntel | None) -> list[Finding]:
580580
if attacks is None or not attacks.present:
581581
msg = (
582582
f"no attack data for {species.label(host)}: hit groups, attack ids and sizes are "
583-
"not checked, and Send to game refuses until there is."
583+
"not checked, and Send hitboxes to game refuses until there is."
584584
)
585585
out.append(_f("warning", "HITBOX_UNCHECKED", "hitbox", msg))
586586
return out

‎apps/studio/src/mhfu_studio/monster/workspace.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class _Warm:
123123
class MonsterWorkspace(Workspace):
124124
name = "monster"
125125
filters = ("Port manifest", "*.toml", "Monster PAC", "*.bin *.pac")
126+
send_label = "Send hitboxes to game"
126127

127128
def __init__(self, data: Data | None = None, intel_root: Path | None = None) -> None:
128129
self._data = data
@@ -131,7 +132,7 @@ def __init__(self, data: Data | None = None, intel_root: Path | None = None) ->
131132
self._found = _roots()
132133
#: what the last `warmup` read, for `open` to take
133134
self._warm: _Warm | None = None
134-
#: the manifest as the last Send to game sent it
135+
#: the manifest as the last Send hitboxes to game sent it
135136
self._sent: Manifest | None = None
136137
#: species intel from this directory instead of the cache built from the game
137138
self.intel_root = intel_root
@@ -317,7 +318,7 @@ def next_steps(self) -> Sequence[Step]:
317318
Step("Pick an action", self.pair is not None),
318319
Step("Copy the base monster's hitboxes", bool(m.hitboxes)),
319320
Step("Change one", self._hitboxes_changed(m)),
320-
Step("Send to game", self._sent is m, SEND_KEY),
321+
Step(self.send_label, self._sent is m, SEND_KEY),
321322
)
322323

323324
def _hitboxes_changed(self, m: Manifest) -> bool:

‎apps/studio/src/mhfu_studio/shell/workspace.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ class Workspace(Protocol):
157157
name: str
158158
#: open-dialog filters as (name, pattern) pairs: ("Port manifest", "*.toml", ...)
159159
filters: Sequence[str] = ("All files", "*")
160+
#: the title bar's send button, saying what this workspace sends
161+
send_label: str = "Send to game"
160162
#: how often `message` was set: the studio shows each one, a repeat too
161163
said: int = 0
162164
_message: str = ""

‎apps/studio/src/mhfu_studio/ui/window.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ def _fill_view_menu(self, ws: Workspace) -> None:
633633
def _sync_send(self) -> None:
634634
"""Send only sends, Stop only stops; the title bar's button is Stop while a job runs."""
635635
job, why = self.studio.job, self.studio.send_blocker()
636+
self.send_action.setText(self.studio.active.send_label)
636637
for a, tip, on in (
637638
(self.send_action, why or chrome.SEND_TIP, why is None),
638639
(self.stop_action, STOP_TIP if job is None else f"Stops {job.title}", job is not None),
@@ -795,7 +796,8 @@ def _sync_window(self, ws: Workspace) -> None:
795796
self.message.setToolTip(message) # the bar clips it
796797
hint = ws.hint()
797798
if hint and self.send_action.isEnabled(): # `_sync_send` asked the workspace
798-
hint += f" \u00b7 {about.native(self.send_action.shortcut())} send to game"
799+
label = self.studio.active.send_label.lower()
800+
hint += f" \u00b7 {about.native(self.send_action.shortcut())} {label}"
799801
self.hint.setText(hint)
800802
self.hint.setToolTip(hint)
801803
self._sync_problems()

‎apps/studio/tests/ui/test_job.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import Any
66

77
import pytest
8+
from mhfu_studio.monster.workspace import MonsterWorkspace
89
from mhfu_studio.shell import studio as studio_module
910
from mhfu_studio.shell.workspace import Job
1011
from mhfu_studio.ui.job import ProcessRunner
@@ -130,3 +131,12 @@ def test_message_tip(make_window: Make) -> None:
130131
w.studio.message = "x" * 400
131132
w.sync()
132133
assert w.message.toolTip() == "x" * 400
134+
135+
136+
def test_send_says_what_it_sends(make_window: Make) -> None:
137+
ws = Sender(Job("help", ("--help",)))
138+
ws.send_label = "Send hitboxes to game"
139+
w = make_window(ws, FakeWorkspace("monster"))
140+
w.sync()
141+
assert w.bar.send.text() == "Send hitboxes to game"
142+
assert MonsterWorkspace.send_label == "Send hitboxes to game"

0 commit comments

Comments
 (0)