public void Hide() { mEnabled = false; mModel = null; base.gameObject.SetActive(false); RemoveHover(); }
public void ChangeFocusItemFromModel(SlotitemModel slotItemModel) { bool flag = slotItemModel != null; if (flag) { for (int i = 0; i < this.slots.Length; i++) { if (this.slots[i].GetModel() != null && this.slots[i].GetModel().MemId == slotItemModel.MemId) { this.ChangeFocusItem(this.slots[i]); break; } } } else { for (int j = 0; j < this.slots.Length; j++) { if (this.slots[j].GetModel() == null) { this.ChangeFocusItem(this.slots[j]); break; } } } }
private void Awake() { this.labelName.text = string.Empty; this.ItemIcon.spriteName = string.Empty; this.slotItem = null; base.get_transform().set_localPosition(this.hidePos); }
private void Awake() { labelName.text = string.Empty; ItemIcon.spriteName = string.Empty; slotItem = null; base.transform.localPosition = hidePos; }
public void Hide() { this.mEnabled = false; this.mModel = null; base.get_gameObject().SetActive(false); this.RemoveHover(); }
public void Initialize(KeyControl keyController, ShipModel targetShipModel, SlotitemModel srcSlotItemModel, SlotitemModel dstSlotItemModel, int slotIndex) { mKeyController = keyController; mTargetShipModel = targetShipModel; this.dstSlotItemModel = dstSlotItemModel; mSlotIndex = slotIndex; Texture slotItemTexture = srcItemPane.GetSlotItemTexture(); Texture slotItemTexture2 = dstItemPane.GetSlotItemTexture(); if (slotItemTexture != null && slotItemTexture2 != null && slotItemTexture.Equals(slotItemTexture2)) { srcItemPane.UnloadSlotItemTexture(unloadTexture: true); dstItemPane.UnloadSlotItemTexture(); } else { srcItemPane.UnloadSlotItemTexture(unloadTexture: true); dstItemPane.UnloadSlotItemTexture(unloadTexture: true); } srcItemPane.Init4Upper(srcSlotItemModel); dstItemPane.Init4Lower(dstSlotItemModel, srcSlotItemModel); if (srcSlotItemModel != null) { srcItemPane.BackGround.mainTexture = Resources.Load <Texture2D>("Textures/remodel/PlaneSkillTex/weapon_info_lv" + srcSlotItemModel.SkillLevel); } if (dstSlotItemModel != null) { dstItemPane.BackGround.mainTexture = Resources.Load <Texture2D>("Textures/remodel/PlaneSkillTex/weapon_info_lv" + dstSlotItemModel.SkillLevel); } }
private void InitializeItemInfo(SlotitemModel slotItemModel) { this.mLabel_Rare.text = Util.RareToString(slotItemModel.Rare); this.mLabel_Name.text = slotItemModel.Name; this.mSprite_SlotItem.spriteName = "icon_slot" + slotItemModel.Type4; this.mSprite_LockIcon.spriteName = ((!slotItemModel.IsLocked()) ? null : "lock_on"); }
public void InitViews(SlotitemModel dstSlotItem) { if (dstSlotItem == null) { this.SwitchActive(false); this.weaponName.text = "\u3000-"; this.mLock_Icon.get_transform().set_localScale(Vector3.get_zero()); } else { this.SwitchActive(true); this.weaponName.text = dstSlotItem.Name; this.weaponTypeIcon.spriteName = string.Format("icon_slot{0}", dstSlotItem.Type4); this.UnloadSlotItemTexture(false); this.weaponImage.mainTexture = this.BgTextureResourceLoad(dstSlotItem.MstId); if (dstSlotItem.IsLocked()) { this.mLock_Icon.get_transform().set_localScale(Vector3.get_one()); } else { this.mLock_Icon.get_transform().set_localScale(Vector3.get_zero()); } this.paramTable.GetChildList().ForEach(delegate(Transform e) { NGUITools.Destroy(e); }); } }
public void InitViews(SlotitemModel dstSlotItem) { if (dstSlotItem == null) { SwitchActive(active: false); weaponName.text = "\u3000-"; mLock_Icon.transform.localScale = Vector3.zero; return; } SwitchActive(active: true); weaponName.text = dstSlotItem.Name; weaponTypeIcon.spriteName = $"icon_slot{dstSlotItem.Type4}"; UnloadSlotItemTexture(); weaponImage.mainTexture = BgTextureResourceLoad(dstSlotItem.MstId); if (dstSlotItem.IsLocked()) { mLock_Icon.transform.localScale = Vector3.one; } else { mLock_Icon.transform.localScale = Vector3.zero; } paramTable.GetChildList().ForEach(delegate(Transform e) { NGUITools.Destroy(e); }); }
private void _UpdateUnsetSlotitems() { this._unset_slotitems = new Dictionary <int, List <SlotitemModel> >(); Api_Result <Dictionary <int, Mem_slotitem> > api_Result = new Api_get_Member().Slotitem(); if (api_Result.state == Api_Result_State.Success) { using (Dictionary <int, Mem_slotitem> .KeyCollection.Enumerator enumerator = api_Result.data.get_Keys().GetEnumerator()) { while (enumerator.MoveNext()) { int current = enumerator.get_Current(); SlotitemModel slotitemModel = new SlotitemModel(api_Result.data.get_Item(current)); if (!slotitemModel.IsEauiped()) { if (!this._unset_slotitems.ContainsKey(slotitemModel.Type3)) { this._unset_slotitems.set_Item(slotitemModel.Type3, new List <SlotitemModel>()); } this._unset_slotitems.get_Item(slotitemModel.Type3).Add(slotitemModel); } } } } }
private void OnDestroy() { UserInterfacePortManager.ReleaseUtils.Release(ref this.labelName); UserInterfacePortManager.ReleaseUtils.Release(ref this.ItemIcon); UserInterfacePortManager.ReleaseUtils.Release(ref this.mLock_Icon); this.slotItem = null; }
public void ProcessChangeSlotItem(int slotIndex, SlotitemModel slotItem, int voiceType, bool isExSlot) { if (status != ScreenStatus.MODE_SOUBI_HENKOU_PREVIEW) { return; } mRemodelManager.GetSlotitemInfoToChange(focusedShipModel.MemId, slotItem.MemId, slotIndex); SlotSetChkResult_Slot slotSetChkResult_Slot = isExSlot ? mRemodelManager.IsValidChangeSlotitemEx(focusedShipModel.MemId, slotItem.MemId) : mRemodelManager.IsValidChangeSlotitem(focusedShipModel.MemId, slotItem.MemId, slotIndex); bool flag = false; switch (slotSetChkResult_Slot) { case SlotSetChkResult_Slot.Ok: case SlotSetChkResult_Slot.OkBauxiteUse: case SlotSetChkResult_Slot.OkBauxiteUseHighCost: flag = true; break; case SlotSetChkResult_Slot.NgBauxiteShort: AnimateBauxite(ngBauxiteShortMessage); break; case SlotSetChkResult_Slot.NgBausiteShortHighCost: AnimateBauxite(ngBausiteShortHighCostMessage); break; } SlotSetChkResult_Slot slotSetChkResult_Slot2 = isExSlot ? mRemodelManager.ChangeSlotitemEx(focusedShipModel.MemId, slotItem.MemId) : mRemodelManager.ChangeSlotitem(focusedShipModel.MemId, slotItem.MemId, slotIndex); if (flag) { bool flag2 = true; switch (slotSetChkResult_Slot2) { case SlotSetChkResult_Slot.OkBauxiteUse: AnimateBauxite(okBauxiteUseMessage); break; case SlotSetChkResult_Slot.OkBauxiteUseHighCost: AnimateBauxite(okBauxiteUseHighCostMessage); break; default: flag2 = false; break; case SlotSetChkResult_Slot.Ok: break; } if (flag2) { ShipUtils.PlayShipVoice(focusedShipModel, voiceType); } if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.UpdateHeaderInfo(mRemodelManager); } } Back2SoubiHenkou(); }
public void Init4Upper(SlotitemModel dstSlotItem) { this.InitViews(dstSlotItem); if (dstSlotItem != null) { this.processWithoutComparison(dstSlotItem, 0); } }
public static double GetLevelCoefficient(SlotitemModel slot) { if (_LEVEL_COEFFICIENT == null) { _CreateLevelCoefficient(); } _LEVEL_COEFFICIENT.TryGetValue(slot.Type3, out double value); return(value); }
private void UpdateHaikiInfo() { int[] array = new int[4]; for (int i = 0; i < 4; i++) { array[i] = 0; } MaterialInfo materialsForBreakItem = this.mArsenalManager.GetMaterialsForBreakItem(); array[0] = materialsForBreakItem.Fuel; array[1] = materialsForBreakItem.Ammo; array[2] = materialsForBreakItem.Steel; array[3] = materialsForBreakItem.Baux; for (int j = 0; j < 4; j++) { if (array[j] > 0) { this._materialObj[j].SetActive(true); UILabel component = this._materialObj[j].get_transform().FindChild("LabelMaterial").GetComponent <UILabel>(); component.SetActive(true); component.textInt = array[j]; } else { this._materialObj[j].SetActive(false); } } List <SlotitemModel> selectedItemsForDetroy = this.mArsenalManager.GetSelectedItemsForDetroy(); int count = selectedItemsForDetroy.get_Count(); if (count != 0) { if (count != 1) { this._slotItemTex.mainTexture = (Resources.Load("Textures/Arsenal/kaitai_haiki/icon_haiki") as Texture2D); this._slotItemTex.width = 162; this._slotItemTex.height = 102; this._slotItemTex.alpha = 1f; } else { SlotitemModel slotitemModel = selectedItemsForDetroy.get_Item(0); this.UnloadSlotItemTex(); this._slotItemTex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(slotitemModel.MstId, 2); this._slotItemTex.width = 144; this._slotItemTex.height = 215; this._slotItemTex.alpha = 1f; } } else { this._slotItemTex.alpha = 0f; } }
private void UpdateHaikiInfo() { int[] array = new int[4]; for (int i = 0; i < 4; i++) { array[i] = 0; } MaterialInfo materialsForBreakItem = mArsenalManager.GetMaterialsForBreakItem(); array[0] = materialsForBreakItem.Fuel; array[1] = materialsForBreakItem.Ammo; array[2] = materialsForBreakItem.Steel; array[3] = materialsForBreakItem.Baux; for (int j = 0; j < 4; j++) { if (array[j] > 0) { _materialObj[j].SetActive(true); UILabel component = ((Component)_materialObj[j].transform.FindChild("LabelMaterial")).GetComponent <UILabel>(); component.SetActive(isActive: true); component.textInt = array[j]; } else { _materialObj[j].SetActive(false); } } List <SlotitemModel> selectedItemsForDetroy = mArsenalManager.GetSelectedItemsForDetroy(); switch (selectedItemsForDetroy.Count) { case 0: _slotItemTex.alpha = 0f; break; case 1: { SlotitemModel slotitemModel = selectedItemsForDetroy[0]; UnloadSlotItemTex(); _slotItemTex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(slotitemModel.MstId, 2); _slotItemTex.width = 144; _slotItemTex.height = 215; _slotItemTex.alpha = 1f; break; } default: _slotItemTex.mainTexture = (Resources.Load("Textures/Arsenal/kaitai_haiki/icon_haiki") as Texture2D); _slotItemTex.width = 162; _slotItemTex.height = 102; _slotItemTex.alpha = 1f; break; } }
public static double GetLevelCoefficient(SlotitemModel slot) { if (SearchValueUtil._LEVEL_COEFFICIENT == null) { SearchValueUtil._CreateLevelCoefficient(); } double result; SearchValueUtil._LEVEL_COEFFICIENT.TryGetValue(slot.Type3, ref result); return(result); }
public static void log(SlotitemModel[] items) { string text = string.Empty; for (int i = 0; i < items.Length; i++) { SlotitemModel slotitemModel = items[i]; text = ((slotitemModel != null) ? (text + $"[{i}]{slotitemModel.ShortName}\n") : (text + $"[{i}] - \n")); } log(text); }
public void Init4Lower(SlotitemModel dstSlotItem, SlotitemModel srcSlotItem) { this.InitViews(dstSlotItem); if (srcSlotItem == null) { this.processWithoutComparison(dstSlotItem, 0); } else { this.processWithComparison(dstSlotItem, srcSlotItem); } }
private void SetPlaneNum(SlotitemModel item, ShipModel ship) { if (item.IsPlane()) { PlaneNum.text = ship.Tousai[SlotItemNo - 1].ToString(); PlaneNumParent.SetActive(isActive: true); } else { PlaneNumParent.SetActive(isActive: false); } }
private static int _CompType3(SlotitemModel a, SlotitemModel b) { if (a.Type3 > b.Type3) { return(1); } if (a.Type3 < b.Type3) { return(-1); } return(0); }
private static int _CompGetNo(SlotitemModel a, SlotitemModel b) { if (a.GetNo > b.GetNo) { return(1); } if (a.GetNo < b.GetNo) { return(-1); } return(0); }
private static int _CompMemId(SlotitemModel a, SlotitemModel b) { if (a.MemId > b.MemId) { return(1); } if (a.MemId < b.MemId) { return(-1); } return(0); }
private static int _CompLevel(SlotitemModel a, SlotitemModel b) { if (a.Level > b.Level) { return(1); } if (a.Level < b.Level) { return(-1); } return(0); }
private void SetPlaneNum(SlotitemModel item, ShipModel ship) { if (item.IsPlane()) { this.PlaneNum.text = ship.Tousai[this.SlotItemNo - 1].ToString(); this.PlaneNumParent.SetActive(true); } else { this.PlaneNumParent.SetActive(false); } }
private void OnDestroy() { UserInterfacePortManager.ReleaseUtils.Release(ref this.mWidget); UserInterfacePortManager.ReleaseUtils.Release(ref this.mSprite_TypeIcon); UserInterfacePortManager.ReleaseUtils.Release(ref this.mLabel_Name); UserInterfacePortManager.ReleaseUtils.Release(ref this.mLabel_PlaneCount); UserInterfacePortManager.ReleaseUtils.Release(ref this.mButton_Action); UserInterfacePortManager.ReleaseUtils.Release(ref this.mLock_Icon); this.levelStar = null; this.mUIRemodelEquipSlotItemAction = null; this.mModel = null; }
internal void Forward2SoubiHenkouShortCut(SlotitemModel slotitemModel) { instance.Forward2ModeSelect(); if (mUIRemodelModeSelectMenu.IsValidSlotItemChange()) { instance.Forward2SoubiHenkou(slotitemModel, requestChangeMode: true); instance.Forward2SoubiHenkouTypeSelect(); } else { mUIRemodelModeSelectMenu.PopUpFailOpenSummary(); } }
private ArsenalScrollSlotItemListChoiceModel[] GenerateModels(ArsenalManager manager, SlotitemModel[] slotItemModels) { List <ArsenalScrollSlotItemListChoiceModel> list = new List <ArsenalScrollSlotItemListChoiceModel>(); for (int i = 0; i < slotItemModels.Length; i++) { SlotitemModel slotitemModel = slotItemModels[i]; bool selected = manager.IsSelected(slotitemModel.MemId); ArsenalScrollSlotItemListChoiceModel arsenalScrollSlotItemListChoiceModel = new ArsenalScrollSlotItemListChoiceModel(slotitemModel, selected); list.Add(arsenalScrollSlotItemListChoiceModel); } return(list.ToArray()); }
private void OnDestroy() { mPreafab_ProdRevampReceiveItem = null; mTexture_Icon = null; mTexture_Icon2 = null; mGameObject_LevelBackgroundTextImage = null; mGameObject_LevelTag = null; mGameObject_LevelMaxTag = null; mLabel_Level = null; mAnimation_Effect = null; mPanelThis = null; mSlotitemModel = null; mCameraProduction = null; }
public static double GetSlotValue(MapBranchResult.enumScoutingKind type, SlotitemModel slot) { if (slot == null) { return(0.0); } double type3Coefficient = GetType3Coefficient(type, slot); double otherCoefficient = GetOtherCoefficient(type); double levelCoefficient = GetLevelCoefficient(slot); double num = Math.Sqrt(slot.Level) * levelCoefficient; double num2 = (!(type3Coefficient > 0.0)) ? otherCoefficient : type3Coefficient; return(((double)slot.Sakuteki + num) * num2); }