avm2: Implement fscommand()
This commit is contained in:
parent
6b788faa9d
commit
0f4edf9574
|
@ -1,7 +1,4 @@
|
||||||
package flash.system {
|
package flash.system {
|
||||||
import __ruffle__.stub_method;
|
public native function fscommand(command:String, args:String = ""):void;
|
||||||
public function fscommand(command:String, args:String = ""):void {
|
|
||||||
stub_method("flash.system", "fscommand");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,3 +5,29 @@ pub mod application_domain;
|
||||||
pub mod capabilities;
|
pub mod capabilities;
|
||||||
pub mod security;
|
pub mod security;
|
||||||
pub mod system;
|
pub mod system;
|
||||||
|
|
||||||
|
use crate::avm2::activation::Activation;
|
||||||
|
use crate::avm2::object::Object;
|
||||||
|
use crate::avm2::parameters::ParametersExt;
|
||||||
|
use crate::avm2::value::Value;
|
||||||
|
use crate::avm2::Error;
|
||||||
|
|
||||||
|
/// Implements `flash.system.fscommand` method
|
||||||
|
pub fn fscommand<'gc>(
|
||||||
|
activation: &mut Activation<'_, 'gc>,
|
||||||
|
_this: Object<'gc>,
|
||||||
|
args: &[Value<'gc>],
|
||||||
|
) -> Result<Value<'gc>, Error<'gc>> {
|
||||||
|
let command = args.get_string(activation, 0)?;
|
||||||
|
let args = args.get_string(activation, 1)?;
|
||||||
|
|
||||||
|
if !activation
|
||||||
|
.context
|
||||||
|
.external_interface
|
||||||
|
.invoke_fs_command(&command.to_utf8_lossy(), &args.to_utf8_lossy())
|
||||||
|
{
|
||||||
|
tracing::warn!("Unknown FSCommand: {}", command);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(Value::Undefined)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue