Miscellaneous stubs

This gets Solarmax to the main level select screen
(once BitmapData.draw support is added)
This commit is contained in:
Aaron Hill 2022-08-25 21:07:37 -05:00 committed by Mike Welsh
parent 61d0f73fdb
commit c4157fd0ce
3 changed files with 50 additions and 2 deletions

View File

@ -578,6 +578,24 @@ pub fn are_inaccessible_objects_under_point<'gc>(
Err("DisplayObjectContainer.areInaccessibleObjectsUnderPoint not yet implemented".into()) Err("DisplayObjectContainer.areInaccessibleObjectsUnderPoint not yet implemented".into())
} }
pub fn mouse_children<'gc>(
_activation: &mut Activation<'_, 'gc, '_>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error> {
log::warn!("DisplayObjectContainer.mouseChildren getter: not yet implemented");
Ok(Value::Undefined)
}
pub fn set_mouse_children<'gc>(
_activation: &mut Activation<'_, 'gc, '_>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error> {
log::warn!("DisplayObjectContainer.mouseChildren setter: not yet implemented");
Ok(Value::Undefined)
}
/// Construct `DisplayObjectContainer`'s class. /// Construct `DisplayObjectContainer`'s class.
pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> { pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> {
let class = Class::new( let class = Class::new(
@ -607,7 +625,14 @@ pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>
&str, &str,
Option<NativeMethodImpl>, Option<NativeMethodImpl>,
Option<NativeMethodImpl>, Option<NativeMethodImpl>,
)] = &[("numChildren", Some(num_children), None)]; )] = &[
("numChildren", Some(num_children), None),
(
"mouseChildren",
Some(mouse_children),
Some(set_mouse_children),
),
];
write.define_public_builtin_instance_properties(mc, PUBLIC_INSTANCE_PROPERTIES); write.define_public_builtin_instance_properties(mc, PUBLIC_INSTANCE_PROPERTIES);
const PUBLIC_INSTANCE_METHODS: &[(&str, NativeMethodImpl)] = &[ const PUBLIC_INSTANCE_METHODS: &[(&str, NativeMethodImpl)] = &[

View File

@ -7,7 +7,7 @@
public function BlurFilter(blurX: Number = 4.0, blurY: Number = 4.0, quality: int = 1) { public function BlurFilter(blurX: Number = 4.0, blurY: Number = 4.0, quality: int = 1) {
this.blurX = blurX; this.blurX = blurX;
this.blurY = blurY; this.blurY = blurY;
this.quality = qualty; this.quality = quality;
} }
override public function clone(): BitmapFilter { override public function clone(): BitmapFilter {

View File

@ -874,6 +874,24 @@ pub fn set_text_format<'gc>(
Ok(Value::Undefined) Ok(Value::Undefined)
} }
pub fn anti_alias_type<'gc>(
_activation: &mut Activation<'_, 'gc, '_>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error> {
log::warn!("TextField.antiAliasType getter: not yet implemented");
Ok(Value::Undefined)
}
pub fn set_anti_alias_type<'gc>(
_activation: &mut Activation<'_, 'gc, '_>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error> {
log::warn!("TextField.antiAliasType setter: not yet implemented");
Ok(Value::Undefined)
}
/// Construct `TextField`'s class. /// Construct `TextField`'s class.
pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> { pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> {
let class = Class::new( let class = Class::new(
@ -923,6 +941,11 @@ pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>
("textWidth", Some(text_width), None), ("textWidth", Some(text_width), None),
("type", Some(get_type), Some(set_type)), ("type", Some(get_type), Some(set_type)),
("wordWrap", Some(word_wrap), Some(set_word_wrap)), ("wordWrap", Some(word_wrap), Some(set_word_wrap)),
(
"antiAliasType",
Some(anti_alias_type),
Some(set_anti_alias_type),
),
]; ];
write.define_public_builtin_instance_properties(mc, PUBLIC_INSTANCE_PROPERTIES); write.define_public_builtin_instance_properties(mc, PUBLIC_INSTANCE_PROPERTIES);