public void HideAllHUD() { if (this.UnityScene == UIManager.Scene.Field || this.UnityScene == UIManager.Scene.World) { Singleton <DialogManager> .Instance.CloseAll(); EIcon.SetHereIcon(0); } }
public void StartEvents(Byte[] ebFileData) { EventEngine.resyncBGMSignal = 0; //Debug.Log("Reset resyncBGMSignal = " + (object)EventEngine.resyncBGMSignal); this._ff9 = FF9StateSystem.Common.FF9; this._ff9.charArray.Clear(); this._ff9Sys = PersistenSingleton <FF9StateSystem> .Instance; BinaryReader br = new BinaryReader(new MemoryStream(ebFileData)); this.SetupCodeParam(br); this._ff9.mapNameStr = FF9TextTool.LocationName(this._ff9.fldMapNo); this._defaultMapName = this._ff9.mapNameStr; switch (this._ff9Sys.mode) { case 1: this.gMode = 1; break; case 2: this.gMode = 2; break; case 3: this.gMode = 3; UIManager.World.EnableMapButton = true; break; case 8: this.gMode = 4; break; } EventInput.IsProcessingInput = this.gMode != 2 && this.gMode != 4; EMinigame.GetTheAirShipAchievement(); EMinigame.GetHelpAllVictimsInCleyraTown(); TimerUI.SetEnable(this._ff9.timerDisplay); TimerUI.SetDisplay(this._ff9.timerDisplay); TimerUI.SetPlay(this._ff9.timerControl); this.allObjsEBData = new Byte[this.sSourceObjN][]; this.toBeAddedObjUIDList.Clear(); for (Int32 index = 0; index < this.sSourceObjN; ++index) { br.BaseStream.Seek(128L, SeekOrigin.Begin); Int32 num = (Int32)this.sObjTable[index].ofs; Int32 count = (Int32)this.sObjTable[index].size; br.BaseStream.Seek((Int64)num, SeekOrigin.Current); this.allObjsEBData[index] = br.ReadBytes(count); //if (count < 4) //; } if ((this.sEventContext0.inited == 1 || this.sEventContext0.inited == 3) && this.gMode == 2) { this.sEventContext1.copy(this.sEventContext0); } this._context = this.sEventContext0; this.InitMP(); this.InitObj(); EventInput.IsProcessingInput = true; EIcon.InitFIcon(); EIcon.SetAIcon(0); for (Int32 index = 0; index < 80; ++index) { this._context.mapvar[index] = 0; } this._context.usercontrol = 0; this._context.controlUID = 0; this._context.idletimer = 0; EIcon.SetHereIcon(0); this.gStopObj = null; this._context.dashinh = 0; this._context.twist_a = 0; this._context.twist_d = 0; this.eTb.gMesCount = this.gAnimCount = 10; this._noEvents = false; this.InitEncount(); NewThread(0, 0); this._context.activeObj.obj.state = EventEngine.stateInit; this.SetupPartyUID(); for (Int32 index = 0; index < 8; ++index) { this._objPtrList[index] = null; } this._opLStart = 0; if (this.gMode == 2) { for (Int32 index = 0; index < 4; ++index) { Int32 partyMember = this.eTb.GetPartyMember(index); if (partyMember >= 0) { Actor actor = new Actor(this.sSourceObjN - 9 + partyMember, 0, EventEngine.sizeOfActor); } } this._context.partyObjTail = this._context.activeObjTail; } else { this._ff9.btl_rain = 0; } this._opLStart = 4; if (this.gMode == 1 && this.sEventContext1.inited == 1 && this.sEventContext1.lastmap == this._ff9.fldMapNo || this.gMode == 3 && this.sEventContext1.inited == 3 && this.sEventContext1.lastmap == this._ff9.wldMapNo || this._ff9Sys.prevMode == 9 && this.sEventContext1.inited != 0) { this.sEventContext0.copy(this.sEventContext1); this.Request(this.FindObjByUID(0), 0, 10, false); this.EnterBattleEnd(); } else { if (this.gMode != 2 && this.gMode != 4) { Boolean flag1 = this._ff9.fldMapNo == 70; Boolean flag2 = this._ff9.fldMapNo == 2200 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 9450 && this.eBin.getVarManually(EBin.MAP_INDEX_SVR) == 9999; Boolean flag3 = this._ff9.fldMapNo == 150 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 1155 && this.eBin.getVarManually(EBin.MAP_INDEX_SVR) == 325; Boolean flag4 = this._ff9.fldMapNo == 1251 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 5400; Boolean flag5 = this._ff9.fldMapNo == 1602 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 6645 && this.eBin.getVarManually(EBin.MAP_INDEX_SVR) == 16; Boolean flag6 = this._ff9.fldMapNo == 1757 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 6740; Boolean flag7 = this._ff9.fldMapNo == 2752 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 11100 && this.eBin.getVarManually(EBin.MAP_INDEX_SVR) == 9999; Boolean flag8 = this._ff9.fldMapNo == 3001 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 12000 && this.eBin.getVarManually(EBin.MAP_INDEX_SVR) == 0; Boolean flag9 = this._ff9.fldMapNo == 2161 && this.eBin.getVarManually(EBin.SC_COUNTER_SVR) == 10000 && this.eBin.getVarManually(EBin.MAP_INDEX_SVR) == 32; if (!flag1 && !flag4 && (!flag5 && !flag6) && (!flag3 && !flag2 && (!flag7 && !flag8)) && !flag9) { FF9StateSystem.Settings.UpdateTickTime(); ISharedDataSerializer serializer = FF9StateSystem.Serializer; serializer.Autosave(null, (e, s) => { }); } } this.ProcessEvents(); } this._context.inited = (Byte)this.gMode; this._context.lastmap = this.gMode != 1 ? (this.gMode != 3 ? (UInt16)0 : (UInt16)this._ff9.wldMapNo) : (UInt16)this._ff9.fldMapNo; br.Close(); SpawnCustomChatacters(); PersistenSingleton <CheatingManager> .Instance.ApplyDataWhenEventStart(); }
public void NewMesWin(Int32 mes, Int32 num, Int32 flags, PosObj targetPo) { EventEngine instance = PersistenSingleton <EventEngine> .Instance; if (this.IsSkipped(instance, mes, num, flags, targetPo)) { return; } this.DisposWindowByID(num); Dialog.CaptionType captionType = Dialog.CaptionType.None; Dialog.WindowStyle windowStyle; if ((flags & 128) > 0) { windowStyle = Dialog.WindowStyle.WindowStyleAuto; } else { windowStyle = Dialog.WindowStyle.WindowStylePlain; if ((flags & 8) > 0) { captionType = Dialog.CaptionType.Mognet; } else if ((flags & 64) > 0) { captionType = Dialog.CaptionType.ActiveTimeEvent; } } if (windowStyle == Dialog.WindowStyle.WindowStylePlain) { targetPo = (PosObj)null; } if ((flags & 16) > 0) { windowStyle = Dialog.WindowStyle.WindowStyleTransparent; } else if ((flags & 4) > 0) { windowStyle = Dialog.WindowStyle.WindowStyleNoTail; } if ((flags & 1) <= 0) { ETb.sChoose = ETb.sChooseInit; ETb.sChooseInit = 0; } if (instance.gMode == 3) { targetPo = (PosObj)null; if (mes != 40) { if (mes == 41) { EIcon.ShowDialogBubble(true); } } else { EIcon.ShowDialogBubble(false); } } EventHUD.CheckSpecialHUDFromMesId(mes, true); if (FF9StateSystem.Common.FF9.fldMapNo == 1850 && FF9StateSystem.AndroidTVPlatform && (mes == 147 || mes == 148)) { NGUIText.ForceShowButton = true; } Dialog dialog = Singleton <DialogManager> .Instance.AttachDialog(num, windowStyle, mes, targetPo, this.OnDialogFinish, captionType); if (FF9StateSystem.Common.FF9.fldMapNo == 1657) { switch (FF9StateSystem.Settings.CurrentLanguage) { case "English(US)": case "English(UK)": case "Spanish": case "German": case "Italian": if (mes == 183 || mes == 166) { dialog.FocusToActor = false; } break; case "Japanese": if (mes == 187 || mes == 170) { dialog.FocusToActor = false; } break; case "French": if (mes == 185 || mes == 168) { dialog.FocusToActor = false; } break; } } if (dialog == (UnityEngine.Object)null) { return; } if ((flags & 32) > 0) { dialog.FocusToActor = false; } if (ETb.isMessageDebug) { global::Debug.Log(String.Concat(new Object[] { "NewMesWin => sid:", instance.gCur.sid, ", mes: ", mes, ", field id:", FF9TextTool.FieldZoneId, ", num: ", num, ", flags: ", flags, ", text:", dialog.Phrase })); } this.gMesCount++; EIcon.SetHereIcon(0); String currentLanguage = FF9StateSystem.Settings.CurrentLanguage; EMinigame.EidolonMuralAchievement(currentLanguage, mes); EMinigame.ExcellentLuckColorFortuneTellingAchievement(currentLanguage, mes); EMinigame.ProvokeMogAchievement(currentLanguage, mes); EMinigame.JumpingRopeAchievement(currentLanguage, mes); EMinigame.GetRewardFromQueenStellaAchievement(); EMinigame.ShuffleGameAchievement(currentLanguage, mes); EMinigame.ChocoboBeakLV99Achievement(currentLanguage, mes); EMinigame.AtleteQueenAchievement_Debug(currentLanguage, mes); EMinigame.TreasureHunterSAchievement(currentLanguage, mes); ETb.FixChocoAccidenlyFly(dialog); }