avm1: Rename Library::instantiate_by_id

This commit is contained in:
Mike Welsh 2019-12-17 03:25:52 -08:00
parent fc3878d6d9
commit dae3e27fb3
4 changed files with 13 additions and 13 deletions

View File

@ -272,11 +272,11 @@ pub fn duplicate_movie_clip<'gc>(
if depth < 0 || depth > 2_130_706_428 {
return Ok(Value::Undefined.into());
}
if let Ok(mut new_clip) = context.library.instantiate_display_object_by_id(
movie_clip.id(),
context.gc_context,
&avm.prototypes,
) {
if let Ok(mut new_clip) =
context
.library
.instantiate_by_id(movie_clip.id(), context.gc_context, &avm.prototypes)
{
// Set name and attach to parent.
new_clip.set_name(context.gc_context, &new_instance_name);
parent.add_child_from_avm(context, new_clip, depth);

View File

@ -143,7 +143,7 @@ impl<'gc> ButtonData<'gc> {
self.children.clear();
for record in &self.static_data.records {
if record.states.contains(&swf_state) {
if let Ok(mut child) = context.library.instantiate_display_object_by_id(
if let Ok(mut child) = context.library.instantiate_by_id(
record.id,
context.gc_context,
&context.system_prototypes,
@ -173,7 +173,7 @@ impl<'gc> ButtonData<'gc> {
for record in &self.static_data.records {
if record.states.contains(&swf::ButtonState::HitTest) {
match context.library.instantiate_display_object_by_id(
match context.library.instantiate_by_id(
record.id,
context.gc_context,
&context.system_prototypes,

View File

@ -494,11 +494,11 @@ impl<'gc> MovieClipData<'gc> {
place_object: &swf::PlaceObject,
copy_previous_properties: bool,
) -> Option<DisplayObject<'gc>> {
if let Ok(mut child) = context.library.instantiate_display_object_by_id(
id,
context.gc_context,
&context.system_prototypes,
) {
if let Ok(mut child) =
context
.library
.instantiate_by_id(id, context.gc_context, &context.system_prototypes)
{
// Remove previous child from children list,
// and add new childonto front of the list.
let prev_child = self.children.insert(depth, child);

View File

@ -75,7 +75,7 @@ impl<'gc> Library<'gc> {
}
/// Instantiates the library item with the given character ID into a display object.
pub fn instantiate_display_object_by_id(
pub fn instantiate_by_id(
&self,
id: CharacterId,
gc_context: MutationContext<'gc, '_>,