Пример #1
0
 //===========================================
 //  Setup pure lua functions
 //===========================================
 public override void SetupLuaFunctions(LuaEngine state)
 {
     WaitStartEntityTask = state.RunString("return function(_, ent, fun) return coroutine.yield(TASK:_WaitStartEntityTask(ent, fun)) end").First() as LuaFunction;
     WaitEntityTask      = state.RunString("return function(_, ent) return coroutine.yield(TASK:_WaitEntityTask(ent)) end").First() as LuaFunction;
     JoinCoroutines      = state.RunString("return function(_, ent) return coroutine.yield(TASK:_JoinCoroutines(ent)) end").First() as LuaFunction;
     WaitTask            = state.RunString("return function(_, ent) return coroutine.yield(TASK:_WaitTask(ent)) end").First() as LuaFunction;
 }
Пример #2
0
        //
        // Function setup
        //
        public override void SetupLuaFunctions(LuaEngine state)
        {
            WaitDialog = state.RunString(@"
            return function(_)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitDialog").First() as LuaFunction;

            WaitForChoice = state.RunString(@"
            return function(_)
                return coroutine.yield(UI:_WaitForChoice())
            end", "WaitForChoice").First() as LuaFunction;

            WaitShowMonologue = state.RunString(@"
            return function(_, text)
                UI:TextMonologue(text)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowMonologue").First() as LuaFunction;

            WaitShowDialogue = state.RunString(@"
            return function(_, text)
                UI:TextDialogue(text)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowDialogue").First() as LuaFunction;

            WaitShowVoiceOver = state.RunString(@"
            return function(_, text, expiretime)
                UI:TextVoiceOver(text, expiretime)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowVoiceOver").First() as LuaFunction;

            WaitInput = state.RunString(@"
            return function(_, any)
                UI:TextWaitMenu(any)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitInput").First() as LuaFunction;

            WaitShowTitle = state.RunString(@"
            return function(_, text, time)
                UI:TextShowTitle(text, time)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowTitle").First() as LuaFunction;

            WaitHideTitle = state.RunString(@"
            return function(_, time)
                UI:TextFadeTitle(time)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitHideTitle").First() as LuaFunction;

            WaitShowBG = state.RunString(@"
            return function(_, text, frameTime, time)
                UI:ShowBG(text, frameTime, time)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowBG").First() as LuaFunction;

            WaitHideBG = state.RunString(@"
            return function(_, time)
                UI:FadeBG(time)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitHideBG").First() as LuaFunction;
        }
Пример #3
0
 /// <summary>
 /// Setups any extra functionalities for this object written on the lua side.
 /// </summary>
 public override void SetupLuaFunctions(LuaEngine state)
 {
     CheckLevelSkills = state.RunString("return function(_,chara, oldLevel) return coroutine.yield(GAME:_CheckLevelSkills(chara, oldLevel)) end").First() as LuaFunction;
     EnterRescue      = state.RunString("return function(_, sosPath) return coroutine.yield(GAME:_EnterRescue(sosPath)) end").First() as LuaFunction;
     EnterDungeon     = state.RunString("return function(_, dungeonid, structureid, mapid, entryid, stakes, recorded, silentRestrict) return coroutine.yield(GAME:_EnterDungeon(dungeonid, structureid, mapid, entryid, stakes, recorded, silentRestrict)) end").First() as LuaFunction;
     ContinueDungeon  = state.RunString("return function(_, dungeonid, structureid, mapid, entryid) return coroutine.yield(GAME:_ContinueDungeon(dungeonid, structureid, mapid, entryid)) end").First() as LuaFunction;
     EndDungeonRun    = state.RunString("return function(_, result, destzoneid, structureid, mapid, entryid, display, fanfare) return coroutine.yield(GAME:_EndDungeonRun(result, destzoneid, structureid, mapid, entryid, display, fanfare)) end").First() as LuaFunction;
     FadeOut          = state.RunString("return function(_, bwhite, duration) return coroutine.yield(GAME:_FadeOut(bwhite, duration)) end").First() as LuaFunction;
     FadeIn           = state.RunString("return function(_, duration) return coroutine.yield(GAME:_FadeIn(duration)) end").First() as LuaFunction;
     MoveCamera       = state.RunString("return function(_, x, y, duration, toPlayer) return coroutine.yield(GAME:_MoveCamera(x, y, duration, toPlayer)) end").First() as LuaFunction;
     WaitFrames       = state.RunString("return function(_, frames) return coroutine.yield(GAME:_WaitFrames(frames)) end").First() as LuaFunction;
 }
Пример #4
0
        //
        // Function setup
        //
        public override void SetupLuaFunctions(LuaEngine state)
        {
            ShowTeamStorageMenu = state.RunString("return function(_) return coroutine.yield(UI:_StorageFlow()) end").First() as LuaFunction;
            ShowTravelMenu      = state.RunString("return function(_,dungeons,grounds) return coroutine.yield(UI:_TravelMenuFlow(dungeons,grounds)) end").First() as LuaFunction;

            WaitDialog = state.RunString(@"
            return function(_)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitDialog").First() as LuaFunction;

            WaitForChoice = state.RunString(@"
            return function(_)
                return coroutine.yield(UI:_WaitForChoice())
            end", "WaitForChoice").First() as LuaFunction;

            WaitShowMonologue = state.RunString(@"
            return function(_, text)
                UI:TextMonologue(text)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowMonologue").First() as LuaFunction;

            WaitShowDialogue = state.RunString(@"
            return function(_, text)
                UI:TextDialogue(text)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowDialogue").First() as LuaFunction;

            WaitShowVoiceOver = state.RunString(@"
            return function(_, text, expiretime)
                UI:TextVoiceOver(text, expiretime)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowVoiceOver").First() as LuaFunction;

            WaitShowTitle = state.RunString(@"
            return function(_, text, time)
                UI:TextShowTitle(text, time)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitShowTitle").First() as LuaFunction;

            WaitHideTitle = state.RunString(@"
            return function(_, time)
                UI:TextFadeTitle(time)
                return coroutine.yield(UI:_WaitDialog())
            end", "WaitHideTitle").First() as LuaFunction;
        }
Пример #5
0
        //
        //
        //


        public override void SetupLuaFunctions(LuaEngine state)
        {
            //Implement stuff that should be written in lua!
            MoveInDirection        = state.RunString("return function(_,chara, direction, duration) return coroutine.yield(GROUND:_MoveInDirection(chara, direction, duration)) end", "MoveInDirection").First() as LuaFunction;
            CharAnimateTurn        = state.RunString("return function(_,ch, direction, framedur, ccw) return coroutine.yield(GROUND:_CharAnimateTurn(ch, direction, framedur, ccw)) end", "CharAnimateTurn").First() as LuaFunction;
            CharAnimateTurnTo      = state.RunString("return function(_,ch, direction, framedur) return coroutine.yield(GROUND:_CharAnimateTurnTo(ch, direction, framedur)) end", "CharAnimateTurn").First() as LuaFunction;
            CharTurnToCharAnimated = state.RunString("return function(_,curch, turnto, framedur) return coroutine.yield(GROUND:_CharTurnToCharAnimated(curch, turnto, framedur)) end", "CharTurnToCharAnimated").First() as LuaFunction;

            MoveToMarker   = state.RunString("return function(_,ent, mark, shouldrun, speed) return coroutine.yield(GROUND:_MoveToMarker(ent, mark, shouldrun, speed)) end", "MoveToMarker").First() as LuaFunction;
            MoveToPosition = state.RunString("return function(_,ent, x, y, shouldrun, speed) return coroutine.yield(GROUND:_MoveToPosition(ent, x, y, shouldrun, speed)) end", "MoveToPosition").First() as LuaFunction;
        }
Пример #6
0
 public override void SetupLuaFunctions(LuaEngine state)
 {
     //TODO
     WaitFanfare = state.RunString("return function(_) return coroutine.yield(_:_WaitFanfare()) end").First() as LuaFunction;
     WaitSE      = state.RunString("return function(_) return coroutine.yield(_:_WaitSE()) end").First() as LuaFunction;
 }
Пример #7
0
        //private LuaTable AddNode(XmlNode curnode)
        //{
        //    LuaTable curtbl = LuaEngine.Instance.RunString("return {}").First() as LuaTable;

        //    if (curnode.HasChildNodes)
        //    {
        //        foreach (XmlNode xnode in curnode.ChildNodes)
        //            curtbl[xnode.Name] = AddNode(xnode);
        //    }
        //    else if(!String.IsNullOrEmpty(curnode.Value))
        //    {
        //        //curtbl = LuaEngine.Instance.RunString(@"
        //        //local tbl = {}
        //        //table.insert(tbl,'" + curnode.Value + @"')
        //        //return tbl
        //        //").First() as LuaTable;

        //        //LuaEngine.Instance.CallLuaFunctions("table.insert", curtbl, curnode.Value);
        //        InsertChildNodeType.Call(curtbl, curnode.Name, AddNode(curnode));
        //    }
        //    return curtbl;
        //}

        public override void SetupLuaFunctions(LuaEngine state)
        {
            InsertChildNodeType = state.RunString("return function(tbl, nodename, value) table.insert( tbl[nodename], value); end").First() as LuaFunction;
        }