Skip to content

Commit dd365ed

Browse files
committed
Fix documentation for ProcInst and ProcDesc
1 parent 3be7a0e commit dd365ed

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

docs/app/procdesc/ProcDesc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
A Descriptor to be executed as part of a [`ProcInst`](crate::proc::ProcInst)
1+
A Descriptor to be executed as part of a [`ProcInst`](crate::app::procinst::ProcInst)
22

33
Acts as a very high level assembly instruction that is executed sequentially.

docs/app/procinst/ProcInst.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
Represents a Instruction unit for a [`Proc`].
1+
Represents an instruction unit for a [`Proc`](crate::app::proc::Proc).
22

33
The ProcInst is chained to other ProcInsts to be executed in order by one of the three Proc instances of the game.
44

5-
They act as a high-level virtual machine to execute [instructions](crate::proc::ProcDesc) in sequence. Said instructions are queued in a ProcDesc array.
5+
They act as a high-level virtual machine to execute [instructions](crate::app::procdesc::ProcDesc) in sequence. Said instructions are queued in a ProcDesc array.
66

7-
A lot of classes inherit from it, so implement [`IsProcInst`] on them to represent this relation.
8-
9-
If it is not possible for some reason, use the [cast](ProcInst::cast) methods to represent the chains as a ProcInst derivate of your choice.
10-
11-
Example:
12-
13-
```
14-
pub fn createmenubind_hook(proc: &mut Il2CppObject<ProcInst>) {
15-
let casted_child = proc.child.cast_mut::<BasicMenu>();
16-
}
17-
```
18-
19-
Keep in mind that [`IsProcInst`] is much more preferable, and [cast](ProcInst::cast) should only be used as a last resort.
7+
A lot of classes inherit from it; the bindgen emits `#[parent(...)]` chains so derived types coerce to `ProcInst` via the standard `Into` impls. For type-erased downcasts, use the methods on [`unity2::Cast`].

0 commit comments

Comments
 (0)