private void OnCanelRevampSetting(UIRevampSetting calledObject) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true; SoundUtils.PlaySE(mAudioClip_SE_017); KeyControl nextFocusKeyController = null; calledObject.Hide(delegate { RevampRecipeModel[] recipes = mRevampManager.GetRecipes(); RevampRecipeDetailModel detail = mRevampManager.GetDetail(mRevampContext.RevampRecipe.RecipeId, mRevampContext.GetBeforeSlotItemInfo().MemId); int num = 0; RevampRecipeModel[] array = recipes; foreach (RevampRecipeModel revampRecipeModel in array) { if (revampRecipeModel.RecipeId == detail.RecipeId) { break; } num++; } mRevampInfoBalloon.alpha = 1f; mRevampInfoBalloon.SayMessage("[000000]どの装備の改修を試みますか?"); if (num <= recipes.Length) { nextFocusKeyController = ShowUIRevampRecipeList(num); } else { nextFocusKeyController = ShowUIRevampRecipeList(0); } ChangeFocusKeyController(nextFocusKeyController); UnityEngine.Object.Destroy(calledObject.gameObject); }); }
private RevampValidationResult UIRevampRecipeSettingCheckDelegate(RevampRecipeDetailModel targetModel) { RevampValidationResult revampValidationResult = mRevampManager.IsValidRevamp(targetModel); mRevampInfoBalloon.SayMessage(LocalUtils.GenerateRevampSettingMessage(revampValidationResult, targetModel)); return(revampValidationResult); }
private void OnDestroy() { mUIRevampSettingActionCallBack = null; mRevampSettingStateCheckDelegate = null; mSprite_RequireSlotItemState = null; mLabel_Name = null; mLabel_Fuel = null; mLabel_Steel = null; mLabel_Devkit = null; mLabel_Ammo = null; mLabel_Bauxite = null; mLabel_RevampKit = null; mButton_Start = null; mButton_Cancel = null; mButton_Switch = null; mRevampIcon = null; mYousei_Switch = null; mSprites_Star = null; mPanelThis = null; mButtonsFocusable = null; mRevampRecipeDetailModel = null; mButtonFocus = null; mKeyController = null; _uiOverlayButton = null; }
private void UpdateRevampRecipeDetail(RevampRecipeDetailModel recipeDetail) { RevampValidationResult revampValidationResult = mRevampSettingStateCheckDelegate(recipeDetail); List <UIButton> list = new List <UIButton>(); if (revampValidationResult == RevampValidationResult.OK) { mButton_Start.SetState(UIButtonColor.State.Normal, immediate: true); mButton_Start.isEnabled = true; list.Add(mButton_Cancel); list.Add(mButton_Switch); list.Add(mButton_Start); mButtonsFocusable = list.ToArray(); SoundUtils.PlaySE(SEFIleInfos.SE_005); } else { mButton_Start.SetState(UIButtonColor.State.Disabled, immediate: true); mButton_Start.isEnabled = false; list.Add(mButton_Cancel); list.Add(mButton_Switch); mButtonsFocusable = list.ToArray(); SoundUtils.PlaySE(SEFIleInfos.SE_006); } mLabel_Fuel.text = recipeDetail.Fuel.ToString(); mLabel_Steel.text = recipeDetail.Steel.ToString(); mLabel_Devkit.text = recipeDetail.DevKit.ToString(); mLabel_Ammo.text = recipeDetail.Ammo.ToString(); mLabel_Bauxite.text = recipeDetail.Baux.ToString(); mLabel_RevampKit.text = recipeDetail.RevKit.ToString(); }
private UIRevampSetting ShowUIRevampSetting(RevampContext revampContext) { RevampRecipeDetailModel detail = mRevampManager.GetDetail(revampContext.RevampRecipe.RecipeId, revampContext.GetBeforeSlotItemInfo().MemId); mRevampManager.IsValidRevamp(detail); UIRevampSetting component = Util.Instantiate(mPrefab_RevampSetting.gameObject, base.gameObject).GetComponent <UIRevampSetting>(); component.SetOnRevampSettingActionCallBack(UIRevampSettingActionCallBack); component.Initialize(detail, UIRevampRecipeSettingCheckDelegate, mCameraProduction); return(component); }
public void SetLines(RevampValidationResult iResult, RevampRecipeDetailModel model) { if (model == null) { return; } string text = "[000000]"; switch (iResult) { case RevampValidationResult.OK: text += string.Format("[1DBDC0]\u3000{0}[-]\nを改修しますね![-]\n\n", model.Slotitem.Name); text += string.Format("[000000]\u3000この改修には、無改修の\n[1DBDC0]{0}×{1}[-]\nが必要です。[-]", model.Slotitem.Name, model.RequiredSlotitemCount); text += string.Format("[000000]\u3000(※改修で消費します)[-]", new object[0]); break; case RevampValidationResult.Max_Level: text += string.Format("[FF0000]\u3000現在、選択された装備[-]\n", new object[0]); text += string.Format("[1DBDC0]\u3000{0}[-]\n", model.Slotitem.Name); text += string.Format("[FF0000]\u3000は、これ以上の改修ができません。[-]", new object[0]); break; case RevampValidationResult.Lock: text += string.Format("[1DBDC0]\u3000{0}[-]\nを改修しますね!\n\n", model.Slotitem.Name); text += string.Format("[FF0000]\u3000この装備を改修するには\n\u3000同装備のロック解除が必要です。[-]", new object[0]); break; case RevampValidationResult.Less_Fuel: case RevampValidationResult.Less_Ammo: case RevampValidationResult.Less_Steel: case RevampValidationResult.Less_Baux: case RevampValidationResult.Less_Devkit: case RevampValidationResult.Less_Revkit: text += string.Format("[FF0000]\u3000資材が足りません。", new object[0]); break; case RevampValidationResult.Less_Slotitem: text += string.Format("[1DBDC0]\u3000{0}[-]\nを改修しますね!\n\n", model.Slotitem.Name); text += string.Format("[FF0000]\u3000この改修に必要となる\n(無改修)\n[-]", new object[0]); text += string.Format("[1DBDC0]\u3000{0}×{1}[-]", model.Slotitem.Name, model.RequiredSlotitemCount); text += string.Format("[FF0000]\u3000が足りません。[-]", new object[0]); break; case RevampValidationResult.Less_Slotitem_No_Lock: text += string.Format("[1DBDC0]\u3000{0}[-]\nを改修しますね!\n\n", model.Slotitem.Name); text += string.Format("[FF0000]\u3000この改修に必要となる\n(無改修)\n[-]", new object[0]); text += string.Format("[1DBDC0]\u3000{0}x{1}[-]", model.Slotitem.Name, model.RequiredSlotitemCount); text += string.Format("[FF0000]\u3000が足りません。[-]", new object[0]); break; } text += "[-]"; this._uiLines.SetLines(text); }
public RevampValidationResult IsValidRevamp(RevampRecipeDetailModel detail) { if (detail.Slotitem.Level >= 10) { if (!detail.IsChange()) { return(RevampValidationResult.Max_Level); } if (detail.Slotitem.IsLocked()) { return(RevampValidationResult.Lock); } } if (base.Material.Fuel < detail.Fuel) { return(RevampValidationResult.Less_Fuel); } if (base.Material.Ammo < detail.Ammo) { return(RevampValidationResult.Less_Ammo); } if (base.Material.Steel < detail.Steel) { return(RevampValidationResult.Less_Steel); } if (base.Material.Baux < detail.Baux) { return(RevampValidationResult.Less_Baux); } if (base.Material.Devkit < detail.DevKit) { return(RevampValidationResult.Less_Devkit); } if (base.Material.Revkit < detail.RevKit) { return(RevampValidationResult.Less_Revkit); } if (detail.RequiredSlotitemCount > 0) { List <Mem_slotitem> list = this._all_items.FindAll((Mem_slotitem item) => item.Slotitem_id == detail.RequiredSlotitemId && item.Level == 0 && item.Equip_flag == Mem_slotitem.enumEquipSts.Unset && item.Rid != detail.Slotitem.MemId); if (list.get_Count() < detail.RequiredSlotitemCount) { return(RevampValidationResult.Less_Slotitem); } list = list.FindAll((Mem_slotitem item) => !item.Lock); if (list.get_Count() < detail.RequiredSlotitemCount) { return(RevampValidationResult.Less_Slotitem_No_Lock); } } return(RevampValidationResult.OK); }
public SlotitemModel Revamp(RevampRecipeDetailModel detail) { Api_Result <bool> api_Result = this._req.RemodelSlot(detail.__mst_detail__, this.Deck.Id, detail.Slotitem.MemId, detail.Determined); this._all_items = null; this._InitializeSlotitems(); if (api_Result.state != Api_Result_State.Success || !api_Result.data) { return(null); } Comm_UserDatas.Instance.User_trophy.Revamp_count++; detail.Slotitem.__update__(); return(detail.Slotitem); }
public void Initialize(RevampRecipeDetailModel recipeDetail, UIRevampSettingStateCheck stateCheckDelegate, Camera prodCamera) { mSwitchState = UIYouseiSwitch.ActionType.OFF; mRevampSettingStateCheckDelegate = stateCheckDelegate; mRevampRecipeDetailModel = recipeDetail; mLabel_Name.text = recipeDetail.Slotitem.Name; if (0 < recipeDetail.RequiredSlotitemCount) { mSprite_RequireSlotItemState.spriteName = "txt_need_on"; } else { mSprite_RequireSlotItemState.spriteName = "txt_need_off"; } for (int i = 0; i < mRevampRecipeDetailModel.Slotitem.Level; i++) { mSprites_Star[i].spriteName = "icon_star"; } mRevampIcon.Initialize(recipeDetail.Slotitem.MstId, recipeDetail.Slotitem.Level, prodCamera); UpdateRevampRecipeDetail(mRevampRecipeDetailModel); ChangeFocusButton(mButtonsFocusable[0]); }
public ShipModel GetConsortShip(RevampRecipeDetailModel detail, out int ResourceID, out int voiceID) { ResourceID = 0; voiceID = 0; if (this.Deck.Count < 2) { return(null); } ShipModel shipModel = this.Deck.GetShips()[1]; if (shipModel == null) { return(null); } voiceID = detail.__mst__.Voice_id; if (voiceID == 0) { return(null); } ResourceID = detail.__mst__.GetVoiceShipId(shipModel.MstId); ResourceID = local.utils.Utils.GetResourceMstId(ResourceID); return(shipModel); }
private IEnumerator OnStartRevampCoroutine(UIRevampSetting calledObject) { if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = false; } _isAnimation = true; SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = false; SoundUtils.PlaySE(mAudioClip_SE_020); RevampRecipeDetailModel revampRecipeDetail = mRevampManager.GetDetail(mRevampContext.RevampRecipe.RecipeId, mRevampContext.GetBeforeSlotItemInfo().MemId); revampRecipeDetail.Determined = calledObject.IsDetermined(); SlotitemModel revampedSlotItemModel = mRevampManager.Revamp(revampRecipeDetail); List <int> ids = new List <int>(); ids.AddRange(TrophyUtil.Unlock_At_Revamp()); ids.AddRange(TrophyUtil.Unlock_AlbumSlotNum()); SingletonMonoBehaviour <TrophyManager> .Instance.UnlockTrophies(ids); if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.UpdateHeaderInfo(mRevampManager); } if (revampedSlotItemModel != null) { mRevampContext.SetSuccess(success: true); mRevampContext.SetAfterSlotItemInfo(revampedSlotItemModel); } else { mRevampContext.SetSuccess(success: false); } UpdateInfo(mRevampManager); int consortShipResourceId = -1; int consortShipVoiceId = -1; ShipModel consortShipModel = mRevampManager.GetConsortShip(revampRecipeDetail, out consortShipResourceId, out consortShipVoiceId); if (consortShipModel != null) { int mstId = mRevampManager.UserInfo.GetDeck(mDeckId).GetShip(1).MstId; mTexture_AssistantShip.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(consortShipModel.GetGraphicsMstId(), (!consortShipModel.IsDamaged())? 9 : 10); mTexture_AssistantShip.MakePixelPerfect(); } yield return(new WaitForEndOfFrame()); calledObject.Hide(delegate { throw new NotImplementedException("なにこれ"); //if (base._003CexistConsortShip_003E__6) //{ // this.mTransform_AssistantShipParent.DOLocalMove(this.mVector3_AssistantShipShowLocalPosition, 0.3f).OnComplete(delegate // { // ShipUtils.PlayShipVoice(consortShipModel, consortShipVoiceId); // }); //} this.ChangeFocusKeyController(null); UnityEngine.Object.Destroy(calledObject.gameObject); this.mRevampAkashi.ChangeBodyTo(UIRevampAkashi.BodyType.Making); this.mRevampInfoBalloon.SayMessage("[000000]改修中・・・[-]"); this.OnStartRevampAnimation(this.mRevampContext); }); }
public static string GenerateRevampSettingMessage(RevampValidationResult iResult, RevampRecipeDetailModel model) { if (model == null) { return(null); } string str = "[000000]"; switch (iResult) { case RevampValidationResult.Max_Level: str += $"[FF0000]現在、選択された装備[-]\n"; str += $"[329ad6]{model.Slotitem.Name}[-]\n"; str += $"[FF0000]は、これ以上の改修ができません。[-]"; break; case RevampValidationResult.Lock: str += $"[FF0000]この装備を改修するには\n\u3000同装備のロック解除が必要です。[-]"; break; case RevampValidationResult.Less_Slotitem_No_Lock: str += $"[FF0000]この改修に必要となる\n(無改修)\n[-]"; str = ((0 >= model.RequiredSlotitemId) ? (str + $"[329ad6]{model.Slotitem.Name}x{model.RequiredSlotitemCount}[-]") : (str + $"[329ad6]{new SlotitemModel_Mst(model.RequiredSlotitemId).Name}x{model.RequiredSlotitemCount}[-]")); str += $"[FF0000]が足りません。[-]"; break; case RevampValidationResult.Less_Slotitem: str += "[FF0000]この改修に必要となる\n(無改修)\n[-]"; str = ((0 >= model.RequiredSlotitemId) ? (str + $"[329ad6]{model.Slotitem.Name}×{model.RequiredSlotitemCount}[-]") : (str + $"[329ad6]{new SlotitemModel_Mst(model.RequiredSlotitemId).Name}×{model.RequiredSlotitemCount}[-]")); str += "\n"; str += "[FF0000]が足りません。[-]"; break; case RevampValidationResult.OK: { if (model.RequiredSlotitemId == 0) { str += $"[329ad6]{model.Slotitem.Name}[-]\n"; str += $"を改修しますね![-]"; break; } SlotitemModel_Mst slotitemModel_Mst = new SlotitemModel_Mst(model.RequiredSlotitemId); str += $"[329ad6]{model.Slotitem.Name}[-]\n"; str += $"を改修しますね![-]"; if (0 < model.RequiredSlotitemCount) { str += "\n"; str += "[000000]この改修には、無改修の\n"; str += $"[329ad6]{slotitemModel_Mst.Name}×{model.RequiredSlotitemCount}[-]"; str += "\n\nが必要です。[-]"; str += "\n[666666](※改修で消費します)[-]"; } break; } case RevampValidationResult.Less_Fuel: case RevampValidationResult.Less_Ammo: case RevampValidationResult.Less_Steel: case RevampValidationResult.Less_Baux: case RevampValidationResult.Less_Devkit: case RevampValidationResult.Less_Revkit: str += $"[FF0000]\u3000資材が足りません。"; break; } return(str + "[-]"); }
public static string GenerateRevampSettingMessage(RevampValidationResult iResult, RevampRecipeDetailModel model) { if (model == null) { return(null); } string text = "[000000]"; switch (iResult) { case RevampValidationResult.OK: if (model.RequiredSlotitemId == 0) { text += string.Format("[329ad6]{0}[-]\n", model.Slotitem.Name); text += string.Format("を改修しますね![-]", new object[0]); } else { SlotitemModel_Mst slotitemModel_Mst = new SlotitemModel_Mst(model.RequiredSlotitemId); text += string.Format("[329ad6]{0}[-]\n", model.Slotitem.Name); text += string.Format("を改修しますね![-]", new object[0]); if (0 < model.RequiredSlotitemCount) { text += "\n"; text += "[000000]この改修には、無改修の\n"; text += string.Format("[329ad6]{0}×{1}[-]", slotitemModel_Mst.Name, model.RequiredSlotitemCount); text += "\n\nが必要です。[-]"; text += "\n[666666](※改修で消費します)[-]"; } } break; case RevampValidationResult.Max_Level: text += string.Format("[FF0000]現在、選択された装備[-]\n", new object[0]); text += string.Format("[329ad6]{0}[-]\n", model.Slotitem.Name); text += string.Format("[FF0000]は、これ以上の改修ができません。[-]", new object[0]); break; case RevampValidationResult.Lock: text += string.Format("[FF0000]この装備を改修するには\n\u3000同装備のロック解除が必要です。[-]", new object[0]); break; case RevampValidationResult.Less_Fuel: case RevampValidationResult.Less_Ammo: case RevampValidationResult.Less_Steel: case RevampValidationResult.Less_Baux: case RevampValidationResult.Less_Devkit: case RevampValidationResult.Less_Revkit: text += string.Format("[FF0000]\u3000資材が足りません。", new object[0]); break; case RevampValidationResult.Less_Slotitem: text += "[FF0000]この改修に必要となる\n(無改修)\n[-]"; if (0 < model.RequiredSlotitemId) { text += string.Format("[329ad6]{0}×{1}[-]", new SlotitemModel_Mst(model.RequiredSlotitemId).Name, model.RequiredSlotitemCount); } else { text += string.Format("[329ad6]{0}×{1}[-]", model.Slotitem.Name, model.RequiredSlotitemCount); } text += "\n"; text += "[FF0000]が足りません。[-]"; break; case RevampValidationResult.Less_Slotitem_No_Lock: text += string.Format("[FF0000]この改修に必要となる\n(無改修)\n[-]", new object[0]); if (0 < model.RequiredSlotitemId) { text += string.Format("[329ad6]{0}x{1}[-]", new SlotitemModel_Mst(model.RequiredSlotitemId).Name, model.RequiredSlotitemCount); } else { text += string.Format("[329ad6]{0}x{1}[-]", model.Slotitem.Name, model.RequiredSlotitemCount); } text += string.Format("[FF0000]が足りません。[-]", new object[0]); break; } return(text + "[-]"); }