Skip to content

Commit 7b06507

Browse files
committed
Push code for 1.25.0
1 parent 213b67b commit 7b06507

File tree

12 files changed

+222
-82
lines changed

12 files changed

+222
-82
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package-resources = [
1212
]
1313

1414
[dependencies]
15-
skyline = { git = "https://github.com/ultimate-research/skyline-rs" }
15+
skyline = "0.5.1"
1616
ozone_macro = { path = "./ozone_macro" }
1717
cobalt = { path = "crates/cobalt" }
1818
updater = { path = "crates/updater" }

crates/cobalt/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "cobalt"
3-
version = "1.23.0"
3+
version = "1.25.0"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
skyline = { git = "https://github.com/ultimate-research/skyline-rs" }
9+
skyline = "0.5.1"
1010
unity = { version = "0.3.0", git = "https://github.com/DivineDragonFanClub/unity" }
1111
engage = { version = "0.10.0", git = "https://github.com/DivineDragonFanClub/engage" }
1212
mods = { path = "../mods" }
@@ -23,4 +23,5 @@ gamedata = { path = "../gamedata" }
2323
easer = "0.3.0"
2424
phf = { version = "0.11", features = ["macros"] }
2525
lazysimd = { git = "https://github.com/Raytwo/lazysimd" }
26-
image = { version = "0.24.9", default-features = false, features = ["png"] }
26+
image = { version = "0.24.9", default-features = false, features = ["png"] }
27+

crates/cobalt/src/api/events/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
use std::cell::RefCell;
12
use std::sync::{
23
LazyLock, RwLock
34
};
4-
5+
use engage::proc::desc::ProcDesc;
56
use engage::proc::ProcInst;
67

78
mod event;
@@ -20,7 +21,11 @@ pub enum SystemEvent {
2021
MsbtLoaded,
2122
LanguageChanged,
2223
SaveLoaded { ty: i32, slot_id: i32 },
23-
ProcInstJump { proc: &'static ProcInst, label: i32 }
24+
ProcInstJump { proc: &'static ProcInst, label: i32 },
25+
ProcInstBind {
26+
proc: RefCell<&'static mut ProcInst>,
27+
parent: RefCell<Option<&'static mut ProcInst>>,
28+
},
2429
}
2530

2631
#[repr(C)]

crates/cobalt/src/audio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub struct FileCommon {}
153153
#[repr(C)]
154154
pub struct FileCommonStaticFields<'a> {
155155
lock_object: &'a (),
156-
dictionary: &'a Dictionary<&'a Il2CppString, &'a mut FileData>,
156+
dictionary: &'a Dictionary<'a, &'a Il2CppString, &'a mut FileData>,
157157
// Meh
158158
}
159159

crates/cobalt/src/catalog.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ pub fn from_json_hook(json: &Il2CppString, method_info: OptionalMethod) -> *cons
167167
Asset::Sprite(_) => 2,
168168
Asset::Text(_) => 12,
169169
Asset::Terrain(_) => 13,
170+
Asset::AnimationClip(_) => 36,
171+
Asset::AnimatorOverrideController(_) => 47,
170172
Asset::Unparsed(_) => {
171173
// We handle any type that isn't parsed by Astra-formats here
172174
match found_asset.type_hash() {
173-
// AnimationClip
174-
-80937412517696055409803870673809846754 => 36,
175175
_ => 4
176176
}
177177
},
@@ -203,6 +203,7 @@ pub fn from_json_hook(json: &Il2CppString, method_info: OptionalMethod) -> *cons
203203
".asset",
204204
".unity",
205205
".fbx",
206+
".overrideController"
206207
];
207208

208209
let internal_path = suffixes.iter().fold(internal_path, |path, suffix| {

crates/cobalt/src/lib.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
#![feature(stmt_expr_attributes)]
33
#![feature(unsafe_cell_from_mut)]
44

5+
use std::cell::RefCell;
56
use engage::{
67
gamedata::{Gamedata, GodData},
78
godpool::god_pool_try_get_gid,
89
proc::{ProcInst, ProcInstFields},
910
};
11+
use engage::proc::desc::ProcDesc;
1012
use unity::prelude::*;
1113

1214
pub mod api;
@@ -56,6 +58,33 @@ pub fn procinst_jump(this: &'static ProcInst, label: &i32, method_info: Optional
5658

5759
call_original!(this, label, method_info)
5860
}
61+
#[skyline::from_offset(0x0281e4d0)]
62+
pub fn proc_inst_create_internal(
63+
this: &ProcInst,
64+
parent: Option<&ProcInst>,
65+
desc: &Il2CppArray<&ProcDesc>,
66+
name: Option<&Il2CppString>,
67+
is_bind: bool,
68+
method_info: OptionalMethod) -> &'static ProcInst;
69+
70+
#[skyline::hook(offset=0x280a6b0)]
71+
pub fn proc_inst_create_bind(
72+
this: &'static mut ProcInst,
73+
parent: Option<&'static mut ProcInst>,
74+
desc: &'static Il2CppArray<&'static ProcDesc>,
75+
name: Option<&Il2CppString>,
76+
method_info: OptionalMethod) -> &'static ProcInst
77+
{
78+
let proc =
79+
unsafe {
80+
proc_inst_create_internal(this, parent.as_deref(), desc, name, true, method_info)
81+
};
82+
crate::api::events::publish_system_event(api::events::SystemEvent::ProcInstBind {
83+
proc: RefCell::new(this),
84+
parent: RefCell::new(parent)
85+
});
86+
proc
87+
}
5988

6089
#[skyline::from_offset(0x429cc8)]
6190
pub fn value_to_int(value: &i32) -> &i32;

crates/cobalt/src/sequences/titleloop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use engage::{
77

88
use crate::api::events::{Event, SystemEvent};
99

10-
const TITLELOOPSEQUENCE_HASHCODE: i32 = -988690862;
10+
pub const TITLELOOPSEQUENCE_HASHCODE: i32 = -988690862;
1111

1212
pub extern "C" fn grand_opening_skip(evt: &Event<SystemEvent>) {
1313
if let Event::Args(ev) = evt {

0 commit comments

Comments
 (0)