Example #1
0
        // a regular ol' line of text
        public override int VisitLine_statement(YarnSpinnerParser.Line_statementContext context)
        {
            // grabbing the line of text and stripping off any "'s if they had them
            string lineText = context.text().GetText().Trim('"');

            // getting the lineID from the hashtags if it has one
            string lineID = compiler.GetLineID(context.hashtag_block());

            // technically this only gets the line the statement started on
            int lineNumber = context.Start.Line;

            string stringID = compiler.RegisterString(lineText, compiler.currentNode.Name, lineID, lineNumber);

            compiler.Emit(OpCode.RunLine, new Operand(stringID));

            return(0);
        }
Example #2
0
        // a regular ol' line of text
        public override int VisitLine_statement(YarnSpinnerParser.Line_statementContext context)
        {
            // grabbing the line of text and stripping off any "'s if they had them
            string lineText = context.text().GetText().Trim('"');

            // getting the lineID from the hashtags if it has one
            string lineID = compiler.GetLineID(context.hashtag_block());

            // technically this only gets the line the statement started on
            int lineNumber = context.Start.Line;

            // TODO: why is this called num?
            string num = compiler.program.RegisterString(lineText, compiler.currentNode.name, lineID, lineNumber, true);

            compiler.Emit(ByteCode.RunLine, num);

            return(0);
        }