From 195822885ee8aa2c15848492bc35f95735d66a55 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Fri, 12 Jan 2024 19:51:48 -0500 Subject: [PATCH] avm2: Stub all remaining TextField methods and properties --- core/src/avm2/globals/flash/text/TextField.as | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/core/src/avm2/globals/flash/text/TextField.as b/core/src/avm2/globals/flash/text/TextField.as index 2b94d03194cf..e7b489c51979 100644 --- a/core/src/avm2/globals/flash/text/TextField.as +++ b/core/src/avm2/globals/flash/text/TextField.as @@ -1,6 +1,8 @@ package flash.text { import flash.display.InteractiveObject; + import flash.display.DisplayObject; import flash.geom.Rectangle; + import __ruffle__.stub_getter; import __ruffle__.stub_setter; import __ruffle__.stub_method; @@ -154,5 +156,45 @@ package flash.text { stub_method("flash.text.TextField", "getCharBoundaries"); return new Rectangle(0, 0, 1, 1); } + + public function getFirstCharInParagraph(charIndex:int):int { + stub_method("flash.text.TextField", "getFirstCharInParagraph"); + return 0; + } + + public function getImageReference(id:String):DisplayObject { + stub_method("flash.text.TextField", "getImageReference"); + return null; + } + + public function getLineIndexAtPoint(x:Number, y:Number):int { + stub_method("flash.text.TextField", "getLineIndexAtPoint"); + return 0; + } + + public function getLineIndexOfChar(charIndex:int):int { + stub_method("flash.text.TextField", "getLineIndexOfChar"); + return 0; + } + + public function getLineOffset(lineIndex:int):int { + stub_method("flash.text.TextField", "getLineOffset"); + return 0; + } + + public function getParagraphLength(charIndex:int):int { + stub_method("flash.text.TextField", "getParagraphLength"); + return 0; + } + + public static function isFontCompatible(fontName:String, fontStyle:String):Boolean { + stub_method("flash.text.TextField", "isFontCompatible"); + return true; + } + + public function get textInteractionMode():String { + stub_getter("flash.text.TextField", "textInteractionMode"); + return TextInteractionMode.NORMAL; + } } }