Skip to content

Commit 0e70efd

Browse files
committed
Deal with calling base method + vtable override
1 parent 671c486 commit 0e70efd

2,642 files changed

Lines changed: 190432 additions & 170177 deletions

File tree

Some content is hidden

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

src/generated/app.rs

Lines changed: 866 additions & 866 deletions
Large diffs are not rendered by default.

src/generated/app/abscommand.rs

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,41 @@ use crate::system::object::{IObject,Object}
1818
#[cfg(feature = "app-abscommand-types")]
1919
pub use __types::*;
2020

21-
#[cfg(feature="app-abscommand")]#[doc(hidden)]#[allow(non_snake_case,non_camel_case_types,clippy::too_many_arguments)]mod __AbsCommand_unity2_raw{use super:: * ;
22-
pub unsafe fn get_name(this:AbsCommand,__unity2_method_info: ::unity2::OptionalMethod,)-> ::unity2::Il2CppString{let __vt= ::unity2::Cast::get_class(this).raw().get_vtable();
21+
#[cfg(feature="app-abscommand")]pub trait IAbsCommandMethods:IAbsCommand{#[doc="`get_Name()` overload"]fn get_name(self,)-> ::unity2::Il2CppString{unsafe{let __receiver= <AbsCommand as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
22+
{let __vt= ::unity2::Cast::get_class(__receiver).raw().get_vtable();
2323
let __vi= *__vt.get(4usize).unwrap_or_else(||panic!("unity2: virtual slot {}
2424
out of range (vtable len {}
2525
) on the runtime class behind {}
2626
(method `{}
2727
`)",4usize,__vt.len(), <AbsCommand as::unity2::ClassIdentity> ::NAME,"get_Name",));
28-
let inner:extern "C" fn(AbsCommand, ::unity2::OptionalMethod,)-> ::unity2::Il2CppString= ::core::mem::transmute(__vi.method_ptr);
29-
let _=__unity2_method_info;
28+
let __inner:extern "C" fn(AbsCommand, ::unity2::OptionalMethod,)-> ::unity2::Il2CppString= ::core::mem::transmute(__vi.method_ptr);
3029
let __mi: ::unity2::OptionalMethod= ::core::option::Option::Some(& *(__vi.method_info as*const::unity2::MethodInfo as*const()),);
31-
inner(this,__mi)}
32-
pub unsafe fn get_arg_num(this:AbsCommand,__unity2_method_info: ::unity2::OptionalMethod,)->i32{let __vt= ::unity2::Cast::get_class(this).raw().get_vtable();
30+
__inner(__receiver,__mi)}
31+
}
32+
}
33+
#[doc="`get_ArgNum()` overload"]fn get_arg_num(self,)->i32{unsafe{let __receiver= <AbsCommand as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
34+
{let __vt= ::unity2::Cast::get_class(__receiver).raw().get_vtable();
3335
let __vi= *__vt.get(7usize).unwrap_or_else(||panic!("unity2: virtual slot {}
3436
out of range (vtable len {}
3537
) on the runtime class behind {}
3638
(method `{}
3739
`)",7usize,__vt.len(), <AbsCommand as::unity2::ClassIdentity> ::NAME,"get_ArgNum",));
38-
let inner:extern "C" fn(AbsCommand, ::unity2::OptionalMethod,)->i32= ::core::mem::transmute(__vi.method_ptr);
39-
let _=__unity2_method_info;
40+
let __inner:extern "C" fn(AbsCommand, ::unity2::OptionalMethod,)->i32= ::core::mem::transmute(__vi.method_ptr);
4041
let __mi: ::unity2::OptionalMethod= ::core::option::Option::Some(& *(__vi.method_info as*const::unity2::MethodInfo as*const()),);
41-
inner(this,__mi)}
42-
pub unsafe fn func(this:AbsCommand,args:crate::system::collections::generic::list_1::List_1<f32> ,__unity2_method_info: ::unity2::OptionalMethod,)->f32{let __vt= ::unity2::Cast::get_class(this).raw().get_vtable();
42+
__inner(__receiver,__mi)}
43+
}
44+
}
45+
#[doc="`Func(crate::system::collections::generic::list_1::List_1<f32>)` overload"]fn func(self,args:impl::core::convert::Into<crate::system::collections::generic::list_1::List_1<f32> >)->f32{unsafe{let __receiver= <AbsCommand as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
46+
{let __vt= ::unity2::Cast::get_class(__receiver).raw().get_vtable();
4347
let __vi= *__vt.get(24usize).unwrap_or_else(||panic!("unity2: virtual slot {}
4448
out of range (vtable len {}
4549
) on the runtime class behind {}
4650
(method `{}
4751
`)",24usize,__vt.len(), <AbsCommand as::unity2::ClassIdentity> ::NAME,"Func",));
48-
let inner:extern "C" fn(AbsCommand,crate::system::collections::generic::list_1::List_1<f32> , ::unity2::OptionalMethod,)->f32= ::core::mem::transmute(__vi.method_ptr);
49-
let _=__unity2_method_info;
52+
let __inner:extern "C" fn(AbsCommand,crate::system::collections::generic::list_1::List_1<f32> , ::unity2::OptionalMethod,)->f32= ::core::mem::transmute(__vi.method_ptr);
5053
let __mi: ::unity2::OptionalMethod= ::core::option::Option::Some(& *(__vi.method_info as*const::unity2::MethodInfo as*const()),);
51-
inner(this,args,__mi)}
54+
__inner(__receiver, ::core::convert::Into::into(args),__mi)}
5255
}
53-
54-
#[cfg(feature="app-abscommand")]pub trait IAbsCommandMethods:IAbsCommand{#[doc="`get_Name()` overload"]fn get_name(self,)-> ::unity2::Il2CppString{unsafe{let __receiver= <AbsCommand as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
55-
__AbsCommand_unity2_raw::get_name(__receiver, ::core::option::Option::None)}
56-
}
57-
#[doc="`get_ArgNum()` overload"]fn get_arg_num(self,)->i32{unsafe{let __receiver= <AbsCommand as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
58-
__AbsCommand_unity2_raw::get_arg_num(__receiver, ::core::option::Option::None)}
59-
}
60-
#[doc="`Func(crate::system::collections::generic::list_1::List_1<f32>)` overload"]fn func(self,args:impl::core::convert::Into<crate::system::collections::generic::list_1::List_1<f32> >)->f32{unsafe{let __receiver= <AbsCommand as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
61-
__AbsCommand_unity2_raw::func(__receiver, ::core::convert::Into::into(args), ::core::option::Option::None)}
6256
}
6357
#[doc="`.ctor()` overload"]fn ctor(self,)->(){unsafe{let __receiver= <AbsCommand as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
6458
::unity2::il2cpp_call!((::unity2::module_base()+0x27b4a30usize)as*mut u8,();
@@ -74,6 +68,17 @@ pub fn func_method_info()-> & 'static::unity2::il2cpp::MethodInfo{<Self as::unit
7468
pub fn ctor_method_info()-> & 'static::unity2::il2cpp::MethodInfo{<Self as::unity2::ClassIdentity> ::class().raw().get_methods()[3]}
7569
}
7670

71+
#[cfg(feature="app-abscommand")]impl AbsCommand{#[doc="Direct (non-virtual) call to `AbsCommand`'s own `get_Name`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]pub unsafe fn get_name(this:impl::core::convert::Into< ::unity2::IlInstance> ,)-> ::unity2::Il2CppString{let __mi=Self::get_name_method_info();
72+
let __inner:extern "C" fn(::unity2::IlInstance, ::unity2::OptionalMethod,)-> ::unity2::Il2CppString= ::core::mem::transmute(__mi.method_ptr);
73+
__inner(this.into(), ::core::option::Option::None)}
74+
#[doc="Direct (non-virtual) call to `AbsCommand`'s own `get_ArgNum`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]pub unsafe fn get_arg_num(this:impl::core::convert::Into< ::unity2::IlInstance> ,)->i32{let __mi=Self::get_arg_num_method_info();
75+
let __inner:extern "C" fn(::unity2::IlInstance, ::unity2::OptionalMethod,)->i32= ::core::mem::transmute(__mi.method_ptr);
76+
__inner(this.into(), ::core::option::Option::None)}
77+
#[doc="Direct (non-virtual) call to `AbsCommand`'s own `Func`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]pub unsafe fn func(this:impl::core::convert::Into< ::unity2::IlInstance> ,args:crate::system::collections::generic::list_1::List_1<f32> ,)->f32{let __mi=Self::func_method_info();
78+
let __inner:extern "C" fn(::unity2::IlInstance,crate::system::collections::generic::list_1::List_1<f32> , ::unity2::OptionalMethod,)->f32= ::core::mem::transmute(__mi.method_ptr);
79+
__inner(this.into(),args, ::core::option::Option::None)}
80+
}
81+
7782
#[cfg(feature="app-abscommand")]impl AbsCommand{#[doc="`.ctor()` — no args"]pub fn new()->Self{let this= <Self as::unity2::FromIlInstance> ::instantiate().unwrap_or_else(||panic!("{}
7883
::{}
7984
failed to instantiate", ::core::stringify!(AbsCommand), ::core::stringify!(new),));

src/generated/app/accessoryblankmenuitem.rs

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,33 @@ use crate::system::object::{IObject,Object}
1818
#[cfg(feature = "app-accessoryblankmenuitem-types")]
1919
pub use __types::*;
2020

21-
#[cfg(feature="app-accessoryblankmenuitem")]#[doc(hidden)]#[allow(non_snake_case,non_camel_case_types,clippy::too_many_arguments)]mod __AccessoryBlankMenuItem_unity2_raw{use super:: * ;
22-
pub unsafe fn get_name(this:AccessoryBlankMenuItem,__unity2_method_info: ::unity2::OptionalMethod,)-> ::unity2::Il2CppString{let __vt= ::unity2::Cast::get_class(this).raw().get_vtable();
21+
#[cfg(feature="app-accessoryblankmenuitem")]pub trait IAccessoryBlankMenuItemMethods:IAccessoryBlankMenuItem{#[doc="`.ctor()` overload"]fn ctor(self,)->(){unsafe{let __receiver= <AccessoryBlankMenuItem as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
22+
::unity2::il2cpp_call!((::unity2::module_base()+0x27b4a40usize)as*mut u8,();
23+
(AccessoryBlankMenuItem)__receiver)}
24+
}
25+
#[doc="`GetName()` overload"]fn get_name(self,)-> ::unity2::Il2CppString{unsafe{let __receiver= <AccessoryBlankMenuItem as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
26+
{let __vt= ::unity2::Cast::get_class(__receiver).raw().get_vtable();
2327
let __vi= *__vt.get(4usize).unwrap_or_else(||panic!("unity2: virtual slot {}
2428
out of range (vtable len {}
2529
) on the runtime class behind {}
2630
(method `{}
2731
`)",4usize,__vt.len(), <AccessoryBlankMenuItem as::unity2::ClassIdentity> ::NAME,"GetName",));
28-
let inner:extern "C" fn(AccessoryBlankMenuItem, ::unity2::OptionalMethod,)-> ::unity2::Il2CppString= ::core::mem::transmute(__vi.method_ptr);
29-
let _=__unity2_method_info;
32+
let __inner:extern "C" fn(AccessoryBlankMenuItem, ::unity2::OptionalMethod,)-> ::unity2::Il2CppString= ::core::mem::transmute(__vi.method_ptr);
3033
let __mi: ::unity2::OptionalMethod= ::core::option::Option::Some(& *(__vi.method_info as*const::unity2::MethodInfo as*const()),);
31-
inner(this,__mi)}
32-
pub unsafe fn build_attribute(this:AccessoryBlankMenuItem,__unity2_method_info: ::unity2::OptionalMethod,)->crate::app::basicmenuitem::BasicMenuItem_Attribute{let __vt= ::unity2::Cast::get_class(this).raw().get_vtable();
34+
__inner(__receiver,__mi)}
35+
}
36+
}
37+
#[doc="`BuildAttribute()` overload"]fn build_attribute(self,)->crate::app::basicmenuitem::BasicMenuItem_Attribute{unsafe{let __receiver= <AccessoryBlankMenuItem as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
38+
{let __vt= ::unity2::Cast::get_class(__receiver).raw().get_vtable();
3339
let __vi= *__vt.get(8usize).unwrap_or_else(||panic!("unity2: virtual slot {}
3440
out of range (vtable len {}
3541
) on the runtime class behind {}
3642
(method `{}
3743
`)",8usize,__vt.len(), <AccessoryBlankMenuItem as::unity2::ClassIdentity> ::NAME,"BuildAttribute",));
38-
let inner:extern "C" fn(AccessoryBlankMenuItem, ::unity2::OptionalMethod,)->crate::app::basicmenuitem::BasicMenuItem_Attribute= ::core::mem::transmute(__vi.method_ptr);
39-
let _=__unity2_method_info;
44+
let __inner:extern "C" fn(AccessoryBlankMenuItem, ::unity2::OptionalMethod,)->crate::app::basicmenuitem::BasicMenuItem_Attribute= ::core::mem::transmute(__vi.method_ptr);
4045
let __mi: ::unity2::OptionalMethod= ::core::option::Option::Some(& *(__vi.method_info as*const::unity2::MethodInfo as*const()),);
41-
inner(this,__mi)}
42-
}
43-
44-
#[cfg(feature="app-accessoryblankmenuitem")]pub trait IAccessoryBlankMenuItemMethods:IAccessoryBlankMenuItem{#[doc="`.ctor()` overload"]fn ctor(self,)->(){unsafe{let __receiver= <AccessoryBlankMenuItem as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
45-
::unity2::il2cpp_call!((::unity2::module_base()+0x27b4a40usize)as*mut u8,();
46-
(AccessoryBlankMenuItem)__receiver)}
46+
__inner(__receiver,__mi)}
4747
}
48-
#[doc="`GetName()` overload"]fn get_name(self,)-> ::unity2::Il2CppString{unsafe{let __receiver= <AccessoryBlankMenuItem as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
49-
__AccessoryBlankMenuItem_unity2_raw::get_name(__receiver, ::core::option::Option::None)}
50-
}
51-
#[doc="`BuildAttribute()` overload"]fn build_attribute(self,)->crate::app::basicmenuitem::BasicMenuItem_Attribute{unsafe{let __receiver= <AccessoryBlankMenuItem as::unity2::FromIlInstance> ::from_il_instance(<Self as::unity2::SystemObject> ::as_instance(self),);
52-
__AccessoryBlankMenuItem_unity2_raw::build_attribute(__receiver, ::core::option::Option::None)}
5348
}
5449
}
5550

@@ -60,6 +55,14 @@ pub fn get_name_method_info()-> & 'static::unity2::il2cpp::MethodInfo{<Self as::
6055
pub fn build_attribute_method_info()-> & 'static::unity2::il2cpp::MethodInfo{<Self as::unity2::ClassIdentity> ::class().raw().get_methods()[2]}
6156
}
6257

58+
#[cfg(feature="app-accessoryblankmenuitem")]impl AccessoryBlankMenuItem{#[doc="Direct (non-virtual) call to `AccessoryBlankMenuItem`'s own `GetName`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]pub unsafe fn get_name(this:impl::core::convert::Into< ::unity2::IlInstance> ,)-> ::unity2::Il2CppString{let __mi=Self::get_name_method_info();
59+
let __inner:extern "C" fn(::unity2::IlInstance, ::unity2::OptionalMethod,)-> ::unity2::Il2CppString= ::core::mem::transmute(__mi.method_ptr);
60+
__inner(this.into(), ::core::option::Option::None)}
61+
#[doc="Direct (non-virtual) call to `AccessoryBlankMenuItem`'s own `BuildAttribute`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]pub unsafe fn build_attribute(this:impl::core::convert::Into< ::unity2::IlInstance> ,)->crate::app::basicmenuitem::BasicMenuItem_Attribute{let __mi=Self::build_attribute_method_info();
62+
let __inner:extern "C" fn(::unity2::IlInstance, ::unity2::OptionalMethod,)->crate::app::basicmenuitem::BasicMenuItem_Attribute= ::core::mem::transmute(__mi.method_ptr);
63+
__inner(this.into(), ::core::option::Option::None)}
64+
}
65+
6366
#[cfg(feature="app-accessoryblankmenuitem")]impl AccessoryBlankMenuItem{#[doc="`.ctor()` — no args"]pub fn new()->Self{let this= <Self as::unity2::FromIlInstance> ::instantiate().unwrap_or_else(||panic!("{}
6467
::{}
6568
failed to instantiate", ::core::stringify!(AccessoryBlankMenuItem), ::core::stringify!(new),));

0 commit comments

Comments
 (0)