Example #1
0
        private void ChangeScene()
        {
            Application.LoadLevel("Loading");
            Resources.UnloadUnusedAssets();
            GC.Collect();
            Application.LoadLevel(NextScene);
            SoundLib.StopAllSoundEffects();
            if (CurrentScene != NextScene)
            {
                if (String.Equals(CurrentScene, "QuadMist"))
                {
                    FF9Wipe_FadeInEx(30);
                }
                if (String.Equals(NextScene, "MainMenu"))
                {
                    SoundLib.StopAllSounds();
                }
                if (String.Equals(NextScene, FieldMapSceneName))
                {
                    FF9Snd.sndFuncPtr = FF9Snd.FF9FieldSoundDispatch;
                    if (String.Equals(CurrentScene, WorldMapSceneName))
                    {
                        FF9Snd.HasJustChangedBetweenWorldAndField = true;
                    }
                }
                else if (String.Equals(NextScene, WorldMapSceneName))
                {
                    AllSoundDispatchPlayer soundDispatchPlayer = SoundLib.GetAllSoundDispatchPlayer();
                    soundDispatchPlayer.FF9SOUND_SNDEFFECTRES_STOPCURRENT();
                    HashSet <Int32> exceptObjNo = new HashSet <Int32> {
                        1261
                    };
                    soundDispatchPlayer.FF9SOUND_SNDEFFECT_STOP_ALL(exceptObjNo);
                    soundDispatchPlayer.FF9SOUND_STREAM_STOP();

                    FF9Snd.sndFuncPtr = FF9Snd.FF9WorldSoundDispatch;
                    if (String.Equals(CurrentScene, FieldMapSceneName))
                    {
                        FF9Snd.HasJustChangedBetweenWorldAndField = true;
                    }
                }
                else if (!String.Equals(NextScene, BattleMapSceneName))
                {
                    FF9Snd.sndFuncPtr = !String.Equals(NextScene, "QuadMist") ? FF9Snd.FF9AllSoundDispatch : (FF9Snd.SoundDispatchDelegate)FF9Snd.FF9MiniGameSoundDispatch;
                }
                if (String.IsNullOrEmpty(PendingCurrentScene))
                {
                    LastScene = CurrentScene;
                }
                else
                {
                    LastScene           = PendingCurrentScene;
                    PendingCurrentScene = String.Empty;
                }
                CurrentScene = NextScene;
                UnityEngine.Debug.Log("---------- Current Scene : " + Instance.CurrentScene + " ----------");
            }
            NextScene = String.Empty;
            SetTargetFrameRateForCurrentScene();
        }
Example #2
0
	private void changeScenePanel()
	{
		GUILayout.BeginHorizontal(new GUILayoutOption[0]);
		if (GUILayout.Button("(<)", new GUILayoutOption[0]))
		{
			Int32 num = EventEngine.FindArrayIDFromEventID((Int32)this.FF9.fldMapNo);
			num--;
			if (num < 0)
			{
				num = EventEngine.testEventIDs.GetUpperBound(0);
			}
			this.FF9.fldMapNo = (Int16)EventEngine.testEventIDs[num];
			this.shutdownField();
			SoundLib.StopAllSounds();
			SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
		}
		this.stringToEdit = GUILayout.TextField(this.stringToEdit, new GUILayoutOption[]
		{
			GUILayout.Width(90f)
		});
		if (GUILayout.Button("(>)", new GUILayoutOption[0]))
		{
			Int32 num2 = EventEngine.FindArrayIDFromEventID((Int32)this.FF9.fldMapNo);
			num2++;
			if (num2 > EventEngine.testEventIDs.GetUpperBound(0))
			{
				num2 = 0;
			}
			this.FF9.fldMapNo = (Int16)EventEngine.testEventIDs[num2];
			this.shutdownField();
			SoundLib.StopAllSounds();
			SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
		}
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal(new GUILayoutOption[0]);
		if (GUILayout.Button("Jump", new GUILayoutOption[0]))
		{
			Int32 num3;
			Int32.TryParse(this.stringToEdit, out num3);
			num3 = EventEngine.FindArrayIDFromEventID(num3);
			if (num3 == -1)
			{
				this.stringToEdit = this.FF9.fldMapNo.ToString();
				return;
			}
			if (num3 < 0 || num3 > EventEngine.testEventIDs.GetUpperBound(0))
			{
				num3 = 0;
			}
			this.FF9.fldMapNo = (Int16)EventEngine.testEventIDs[num3];
			this.shutdownField();
			SoundLib.StopAllSounds();
			SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
		}
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
	}
Example #3
0
 private void BuildBattleMapDebugBottomPanel()
 {
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (GUILayout.Button("(   <   )", new GUILayoutOption[0]))
     {
         this.index--;
         if (this.index < 0)
         {
             this.index = this._sceneList.Count - 1;
         }
         FF9StateSystem.Field.SceneName = this._sceneList[this.index].name;
         FF9StateSystem.Field.index     = this.index;
         SceneDirector.Replace("FieldMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
     }
     this.stringToEdit = GUILayout.TextField(this.stringToEdit, new GUILayoutOption[]
     {
         GUILayout.Width(200f)
     });
     if (GUILayout.Button("Jump", new GUILayoutOption[0]))
     {
         if (this.stringToEdit == (this.index + 1).ToString())
         {
             return;
         }
         if (Int32.TryParse(this.stringToEdit, out this.index))
         {
             this.index--;
             if (this.index < 0 || this.index > this._sceneList.Count - 1)
             {
                 this.index = 0;
             }
             FF9StateSystem.Field.SceneName = this._sceneList[this.index].name;
             FF9StateSystem.Field.index     = this.index;
             SoundLib.StopAllSounds();
             SceneDirector.Replace("FieldMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
         }
     }
     GUILayout.FlexibleSpace();
     GUILayout.BeginHorizontal("Box", new GUILayoutOption[0]);
     GUILayout.Label(this._sceneList[this.index].name, new GUILayoutOption[0]);
     GUILayout.EndHorizontal();
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("(   >   )", new GUILayoutOption[0]))
     {
         this.index++;
         if (this.index > this._sceneList.Count - 1)
         {
             this.index = 0;
         }
         FF9StateSystem.Field.SceneName = this._sceneList[this.index].name;
         FF9StateSystem.Field.index     = this.index;
         SceneDirector.Replace("FieldMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
     }
     GUILayout.EndHorizontal();
 }
Example #4
0
    private void BuildBattleMapDebugPanel()
    {
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        if (GUILayout.Button(" < ", new GUILayoutOption[0]))
        {
            this.mapIndex--;
            if (this.mapIndex < 0)
            {
                this.mapIndex = (Int32)this.mapIDs.Length - 1;
            }
            FF9StateSystem.Battle.battleMapIndex = this.mapIDs[this.mapIndex];
            FF9StateSystem.Battle.patternIndex   = 0;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        this.battleMapString = GUILayout.TextField(this.battleMapString, new GUILayoutOption[]
        {
            GUILayout.Width(200f)
        });
        if (GUILayout.Button(" > ", new GUILayoutOption[0]))
        {
            this.mapIndex++;
            if (this.mapIndex > (Int32)this.mapIDs.Length)
            {
                this.mapIndex = 0;
            }
            FF9StateSystem.Battle.battleMapIndex = this.mapIDs[this.mapIndex];
            FF9StateSystem.Battle.patternIndex   = 0;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        if (GUILayout.Button("Jump", new GUILayoutOption[0]))
        {
            Int32 num = 0;
            Int32.TryParse(this.battleMapString, out num);
            if (!this.mapIDs.Contains(num))
            {
                return;
            }
            FF9StateSystem.Battle.battleMapIndex = num;
            FF9StateSystem.Battle.patternIndex   = 0;
            SoundLib.StopAllSounds();
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        if (GUILayout.Button(" < ", new GUILayoutOption[0]))
        {
            if (this.battleMain.btlScene.header.PatCount == 1)
            {
                return;
            }
            BTL_SCENE btl_scene = FF9StateSystem.Battle.FF9Battle.btl_scene;
            btl_scene.PatNum = (Byte)(btl_scene.PatNum - 1);
            if (FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum < 0 || FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum == 255)
            {
                FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum = (Byte)(this.battleMain.btlScene.header.PatCount - 1);
            }
            this.patternIndex = String.Concat(new Object[]
            {
                "Pattern ",
                (Int32)(FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum + 1),
                " / ",
                this.battleMain.btlScene.header.PatCount
            });
            FF9StateSystem.Battle.patternIndex = FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        GUILayout.Label(this.patternIndex, new GUILayoutOption[]
        {
            GUILayout.Width(200f)
        });
        if (GUILayout.Button(" > ", new GUILayoutOption[0]))
        {
            if (this.battleMain.btlScene.header.PatCount == 1)
            {
                return;
            }
            BTL_SCENE btl_scene2 = FF9StateSystem.Battle.FF9Battle.btl_scene;
            btl_scene2.PatNum = (Byte)(btl_scene2.PatNum + 1);
            if (FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum >= this.battleMain.btlScene.header.PatCount)
            {
                FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum = 0;
            }
            this.patternIndex = String.Concat(new Object[]
            {
                "Pattern ",
                (Int32)(FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum + 1),
                " / ",
                this.battleMain.btlScene.header.PatCount
            });
            FF9StateSystem.Battle.patternIndex = FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUI.enabled = (btlseq.seq_work_set.SeqWork[0] != null && btlseq.seq_work_set.SeqWork[0].CmdPtr == null);
        if (GUILayout.Button(" < ", new GUILayoutOption[0]))
        {
            this.seqNo--;
            if (this.seqNo < 0)
            {
                this.seqNo = this.seqList.Count - 1;
            }
        }
        GUILayout.Label("sequence: " + (this.seqNo + 1), new GUILayoutOption[]
        {
            GUILayout.Width(150f)
        });
        if (GUILayout.Button(" > ", new GUILayoutOption[0]))
        {
            this.seqNo++;
            if (this.seqNo >= this.seqList.Count)
            {
                this.seqNo = 0;
            }
        }
        if (GUILayout.Button(" Play ", new GUILayoutOption[0]))
        {
            btl_cmd.SetEnemyCommandBySequence(1, 47u, (UInt32)this.seqList[this.seqNo]);
        }
        GUI.enabled = true;
        GUILayout.EndHorizontal();
        this.OnUiCamera();
        Boolean flag = GUILayout.Toggle(FF9StateSystem.Battle.isFrontRow, "Front Row", new GUILayoutOption[0]);

        if (flag != FF9StateSystem.Battle.isFrontRow)
        {
            FF9StateSystem.Battle.isFrontRow = flag;
            this.battleMain.SetFrontRow();
        }
        Boolean flag2 = GUILayout.Toggle(FF9StateSystem.Battle.isLevitate, "Levitate", new GUILayoutOption[0]);

        if (flag2 != FF9StateSystem.Battle.isLevitate)
        {
            FF9StateSystem.Battle.isLevitate = flag2;
            if (!flag2)
            {
                for (BTL_DATA next = FF9StateSystem.Battle.FF9Battle.btl_list.next; next != null; next = next.next)
                {
                    if (next.bi.player != 0)
                    {
                        Vector3 pos = next.pos;
                        pos.y    = 0f;
                        next.pos = pos;
                    }
                }
            }
        }
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        if (GUILayout.Button("Normal Attack", new GUILayoutOption[0]))
        {
            FF9StateSystem.Battle.debugStartType = 2;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        if (GUILayout.Button("First Attack", new GUILayoutOption[0]))
        {
            FF9StateSystem.Battle.debugStartType = 1;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        if (GUILayout.Button("Back Attack", new GUILayoutOption[0]))
        {
            FF9StateSystem.Battle.debugStartType = 0;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        GUILayout.EndHorizontal();
    }
Example #5
0
    public void HonoUpdate20FPS()
    {
        if ((this.FF9.attr & 256u) == 0u)
        {
            if (ff9.w_frameCounter >= 5)
            {
                UIManager.World.SetPerspectiveToggle(ff9.w_cameraSysDataCamera.upperCounter == 4096);
                UIManager.World.SetRotationLockToggle(!ff9.w_cameraSysData.cameraNotrot);
            }
            if (this.FF9WorldMap.nextMode != 2)
            {
                switch (ff9.w_frameMainRoutine())
                {
                case 3:
                    this.FF9WorldMap.nextMode = 2;
                    ff9.ff9worldInternalBattleEncountStart();
                    PersistenSingleton <HonoInputManager> .Instance.IgnoreCheckingDirectionSources = false;
                    break;

                case 4:
                    this.FF9WorldMap.nextMode = 1;
                    PersistenSingleton <HonoInputManager> .Instance.IgnoreCheckingDirectionSources = false;
                    this.FF9Sys.attr |= 4096u;
                    break;
                }
            }
            this.RenderTextureBank.OnUpdate20FPS();
            if ((this.FF9World.attr & 512u) == 0u)
            {
                SceneDirector.ServiceFade();
            }
            if ((this.FF9World.attr & 1024u) == 0u)
            {
                ff9.ff9worldInternalBattleEncountService();
            }
            if (HonoBehaviorSystem.Instance.IsFastForwardModeActive())
            {
                this.fastForwardFrameCounter20FPS++;
                if (this.fastForwardFrameCounter20FPS == HonoBehaviorSystem.Instance.GetFastForwardFactor())
                {
                    this.UpdateTexture_Render();
                    this.fastForwardFrameCounter20FPS = 0;
                }
            }
            else
            {
                this.UpdateTexture_Render();
            }
        }
        if ((this.FF9Sys.attr & 12289u) != 0u || (this.FF9Sys.attr & 4097u) != 0u)
        {
            ff9.ff9ShutdownStateWorldMap();
            ff9.ff9ShutdownStateWorldSystem();
            if (this.FF9Sys.mode == 1)
            {
                AllSoundDispatchPlayer allSoundDispatchPlayer = SoundLib.GetAllSoundDispatchPlayer();
                allSoundDispatchPlayer.FF9SOUND_SNDEFFECTRES_STOPCURRENT();
                allSoundDispatchPlayer.FF9SOUND_SNDEFFECT_STOP_ALL(null);
                allSoundDispatchPlayer.FF9SOUND_STREAM_STOP();
                SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
            }
            else if (this.FF9Sys.mode == 2)
            {
                EventEngine eventEngine = PersistenSingleton <EventEngine> .Instance;
                Obj         objUID      = eventEngine.GetObjUID(250);
                PosObj      posObj      = (PosObj)objUID;
                EventInput.IsProcessingInput = false;
                SoundLib.StopAllSounds();
                SFX_Rush.SetCenterPosition(1);
                SceneDirector.Replace("BattleMap", SceneTransition.SwirlInBlack, true);
            }
            else if (this.FF9Sys.mode == 3)
            {
                SoundLib.StopAllSounds();
                SceneDirector.Replace("WorldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
            }
        }
        if (!FF9StateSystem.World.IsBeeScene)
        {
            for (ObjList objList = ff9.GetActiveObjList(); objList != null; objList = objList.next)
            {
                Obj obj = objList.obj;
                if (PersistenSingleton <EventEngine> .Instance.isPosObj(obj))
                {
                    WMActor wmActor = ((Actor)obj).wmActor;
                    if (obj.cid == 4 && wmActor != (UnityEngine.Object)null)
                    {
                        wmActor.UpdateAnimationViaScript();
                    }
                }
            }
        }
        for (ObjList objList2 = this.World.ActorList; objList2 != null; objList2 = objList2.next)
        {
            if (objList2.obj.cid == 4)
            {
                WMActor wmActor2 = ((Actor)objList2.obj).wmActor;
                wmActor2.LateUpdateFunction();
            }
        }
    }
Example #6
0
 private void ChangeScene()
 {
     Application.LoadLevel("Loading");
     Resources.UnloadUnusedAssets();
     //GC.Collect();
     LoadNextScene();
     SoundLib.StopAllSoundEffects();
     if (this.CurrentScene != this.NextScene)
     {
         if (String.Equals(this.CurrentScene, "QuadMist"))
         {
             SceneDirector.FF9Wipe_FadeInEx(30);
         }
         if (String.Equals(this.NextScene, "MainMenu"))
         {
             SoundLib.StopAllSounds();
         }
         if (String.Equals(this.NextScene, SceneDirector.FieldMapSceneName))
         {
             FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9FieldSoundDispatch);
             if (String.Equals(this.CurrentScene, SceneDirector.WorldMapSceneName))
             {
                 FF9Snd.HasJustChangedBetweenWorldAndField = true;
             }
         }
         else if (String.Equals(this.NextScene, SceneDirector.WorldMapSceneName))
         {
             AllSoundDispatchPlayer allSoundDispatchPlayer = SoundLib.GetAllSoundDispatchPlayer();
             allSoundDispatchPlayer.FF9SOUND_SNDEFFECTRES_STOPCURRENT();
             allSoundDispatchPlayer.FF9SOUND_SNDEFFECT_STOP_ALL(new HashSet <Int32>
             {
                 1261
             });
             allSoundDispatchPlayer.FF9SOUND_STREAM_STOP();
             FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9WorldSoundDispatch);
             if (String.Equals(this.CurrentScene, SceneDirector.FieldMapSceneName))
             {
                 FF9Snd.HasJustChangedBetweenWorldAndField = true;
             }
         }
         else if (!String.Equals(this.NextScene, SceneDirector.BattleMapSceneName))
         {
             if (String.Equals(this.NextScene, "QuadMist"))
             {
                 FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9MiniGameSoundDispatch);
             }
             else
             {
                 FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9AllSoundDispatch);
             }
         }
         if (String.IsNullOrEmpty(this.PendingCurrentScene))
         {
             this.LastScene = this.CurrentScene;
         }
         else
         {
             this.LastScene           = this.PendingCurrentScene;
             this.PendingCurrentScene = String.Empty;
         }
         this.CurrentScene = this.NextScene;
         global::Debug.Log("---------- Current Scene : " + PersistenSingleton <SceneDirector> .Instance.CurrentScene + " ----------");
     }
     this.NextScene = String.Empty;
     SceneDirector.SetTargetFrameRateForCurrentScene();
 }
Example #7
0
	private void jumpingScenePanel()
	{
		GUILayout.BeginHorizontal(new GUILayoutOption[0]);
		if (GUILayout.Button("(<)", new GUILayoutOption[0]))
		{
			Int32 num = EventEngine.FindArrayIDFromEventID((Int32)this.FF9.fldMapNo);
			num--;
			if (num < 0)
			{
				num = EventEngine.testEventIDs.GetUpperBound(0);
			}
			this.FF9.fldMapNo = (Int16)EventEngine.testEventIDs[num];
			this.shutdownField();
			SoundLib.StopAllSounds();
			SceneDirector.FF9Wipe_FadeIn();
			SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
		}
		this.stringToEdit = GUILayout.TextField(this.stringToEdit, new GUILayoutOption[]
		{
			GUILayout.Width(90f)
		});
		if (GUILayout.Button("(>)", new GUILayoutOption[0]))
		{
			Int32 num2 = EventEngine.FindArrayIDFromEventID((Int32)this.FF9.fldMapNo);
			num2++;
			if (num2 > EventEngine.testEventIDs.GetUpperBound(0))
			{
				num2 = 0;
			}
			this.FF9.fldMapNo = (Int16)EventEngine.testEventIDs[num2];
			this.shutdownField();
			SoundLib.StopAllSounds();
			SceneDirector.FF9Wipe_FadeIn();
			SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
		}
		if (GUILayout.Button("Jump", new GUILayoutOption[0]))
		{
			Int32 num3;
			Int32.TryParse(this.stringToEdit, out num3);
			num3 = EventEngine.FindArrayIDFromEventID(num3);
			if (num3 == -1)
			{
				this.stringToEdit = this.FF9.fldMapNo.ToString();
				return;
			}
			EBin eBin = PersistenSingleton<EventEngine>.Instance.eBin;
			Int32 num4 = 0;
			if (Int32.TryParse(this.scString, out num4))
			{
				eBin.setVarManually(EBin.SC_COUNTER_SVR, num4);
			}
			Int32 num5;
			if (Int32.TryParse(this.mapIDString, out num5))
			{
				eBin.setVarManually(EBin.MAP_INDEX_SVR, num5);
			}
			if (num3 < 0 || num3 > EventEngine.testEventIDs.GetUpperBound(0))
			{
				num3 = 0;
			}
			this.FF9.fldMapNo = (Int16)EventEngine.testEventIDs[num3];
			this.shutdownField();
			SoundLib.StopAllSounds();
			SceneDirector.FF9Wipe_FadeIn();
			SceneDirector.Replace("FieldMap", SceneTransition.FadeOutToBlack_FadeIn, true);
			global::Debug.Log(String.Concat(new Object[]
			{
				"----- Jump to : ",
				this.FF9.fldMapNo,
				"/",
				num4,
				"/",
				num5,
				" -----"
			}));
		}
		GUILayout.FlexibleSpace();
	}