protected override void SetupInventoryTypeToggole() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); SortBase.TYPE selectCreateEquipItemType = smithData.selectCreateEquipItemType; bool flag = false; if (selectCreateEquipItemType < SortBase.TYPE.ARMOR || selectCreateEquipItemType == SortBase.TYPE.WEAPON_ALL) { flag = true; } SetActive((Enum)UI.OBJ_ATK_ROOT, flag); SetActive((Enum)UI.OBJ_DEF_ROOT, !flag); SetToggleButton((Enum)UI.TGL_BUTTON_ROOT, flag, (Action <bool>) delegate(bool is_active) { SmithManager.SmithCreateData smithData2 = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); smithData2.selectCreateEquipItemType = (is_active ? SortBase.TYPE.ONE_HAND_SWORD : SortBase.TYPE.HELM); int num = (!is_active) ? 1 : 0; ResetTween((Enum)tabAnimTarget[num], 0); PlayTween((Enum)tabAnimTarget[num], true, (EventDelegate.Callback)null, false, 0); SetActive((Enum)UI.OBJ_ATK_ROOT, is_active); SetActive((Enum)UI.OBJ_DEF_ROOT, !is_active); selectTypeIndex = (int)Mathf.Log((float)smithData2.selectCreateEquipItemType, 2f); SetDirty(InventoryUI); InitSort(); InitLocalInventory(); LocalInventory(); UpdateTabButton(); if (!TutorialStep.HasAllTutorialCompleted() && smithData2.selectCreateEquipItemType == SortBase.TYPE.HELM) { MonoBehaviourSingleton <UIManager> .I.tutorialMessage.ForceRun(MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSceneName(), "SelectArmor", null); } }); }
protected override void InitNeedMaterialData() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); needMaterial = MaterialSort(smithData.createEquipItemTable.needMaterial); needMoney = smithData.createEquipItemTable.needMoney; CheckNeedMaterialNumFromInventory(); }
protected void OnQuery_LOTTERY_LIST() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); GameSection.SetEventData(new object[2] { smithData, SmithType.GENERATE }); }
protected override void OnQuery_SELECT_ITEM() { TryOn(); SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); if (smithData.createEquipItemTable == null || smithData.generateTableData == null) { GameSection.StopEvent(); } }
public override void Initialize() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); smithType = SmithType.GENERATE; GameSection.SetEventData(smithData.generateTableData); base.Initialize(); EquipItemTable.EquipItemData equipTableData = GetEquipTableData(); if (equipTableData != null) { string caption = (!equipTableData.IsWeapon()) ? base.sectionData.GetText("CAPTION_DEFENCE") : base.sectionData.GetText("CAPTION_WEAPON"); MonoBehaviourSingleton <UIManager> .I.common.AttachCaption(this, base.sectionData.backButtonIndex, caption); } }
private void TryOn() { if (localInventoryEquipData != null && localInventoryEquipData.Length != 0) { selectInventoryIndex = (int)GameSection.GetEventData(); SmithCreateSortData smithCreateSortData = localInventoryEquipData[selectInventoryIndex] as SmithCreateSortData; SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); if (smithCreateSortData != null && smithData != null) { smithData.createEquipItemTable = smithCreateSortData.createData.smithCreateTableData; smithData.generateTableData = smithCreateSortData.createData.equipTableData; } } }
protected override void SelectingInventoryFirst() { if (localInventoryEquipData != null && localInventoryEquipData.Length != 0 && localInventoryEquipData[0] != null) { SmithCreateItemInfo smithCreateItemInfo = localInventoryEquipData[0].GetItemData() as SmithCreateItemInfo; if (smithCreateItemInfo != null) { selectInventoryIndex = 0; SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); smithData.generateTableData = smithCreateItemInfo.equipTableData; smithData.createEquipItemTable = smithCreateItemInfo.smithCreateTableData; } } }
protected override void OnQuery_TYPE_TAB() { int selectTypeIndex = base.selectTypeIndex; base.selectTypeIndex = (int)GameSection.GetEventData(); RemoveCreateNewIcon(selectTypeIndex); SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); SortBase.TYPE tYPE = smithData.selectCreateEquipItemType = TranslateInventoryType(base.selectTypeIndex); Debug.Log((object)("old_type_index:" + selectTypeIndex)); Debug.Log((object)("selectTypeIndex:" + base.selectTypeIndex)); if ((selectTypeIndex >= 9 && base.selectTypeIndex < 9) || (selectTypeIndex < 9 && base.selectTypeIndex >= 9)) { InitSort(); } SetDirty(InventoryUI); InitLocalInventory(); RefreshUI(); }
protected override int GetSelectItemIndex() { if (localInventoryEquipData == null || localInventoryEquipData.Length == 0 || localInventoryEquipData[0] == null) { return(-1); } SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); int i = 0; for (int num = localInventoryEquipData.Length; i < num; i++) { SmithCreateItemInfo smithCreateItemInfo = localInventoryEquipData[i].GetItemData() as SmithCreateItemInfo; if (smithCreateItemInfo != null && smithCreateItemInfo.equipTableData.id == smithData.generateTableData.id && smithCreateItemInfo.smithCreateTableData.id == smithData.createEquipItemTable.id) { return(i); } } return(-1); }
protected override void InitLocalInventory() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); SortBase.TYPE selectCreateEquipItemType = smithData.selectCreateEquipItemType; switch (selectCreateEquipItemType) { case SortBase.TYPE.WEAPON_ALL: localInventoryEquipData = SortCompareData.CreateSortDataAry <SmithCreateItemInfo, SmithCreateSortData>(pickupWeapon, sortSettings, null); break; case SortBase.TYPE.ARMOR_ALL: localInventoryEquipData = SortCompareData.CreateSortDataAry <SmithCreateItemInfo, SmithCreateSortData>(pickupArmor, sortSettings, null); break; default: localInventoryEquipData = sortSettings.CreateSortAry <SmithCreateItemInfo, SmithCreateSortData>(Singleton <CreateEquipItemTable> .I.GetCreateEquipItemDataAry(SortBaseTypeToEquipmentType(selectCreateEquipItemType))); break; } SelectingInventoryFirst(); }
public override void Initialize() { EQUIPMENT_TYPE eQUIPMENT_TYPE = (EQUIPMENT_TYPE)(int)GameSection.GetEventData(); SmithManager.SmithCreateData smithCreateData = MonoBehaviourSingleton <SmithManager> .I.CreateSmithData <SmithManager.SmithCreateData>(); smithCreateData.selectCreateEquipItemType = TranslateInventoryType(UIBehaviour.GetEquipmentTypeIndex(eQUIPMENT_TYPE)); smithType = SmithType.GENERATE; GameSection.SetEventData(eQUIPMENT_TYPE); base.Initialize(); pickupWeapon = Singleton <CreatePickupItemTable> .I.GetPickupItemAry(SortBase.TYPE.WEAPON_ALL); pickupArmor = Singleton <CreatePickupItemTable> .I.GetPickupItemAry(SortBase.TYPE.ARMOR_ALL); SetActive((Enum)UI.BTN_WEAPON_PICKUP, pickupWeapon.Length > 0); SetActive((Enum)UI.BTN_ARMOR_PICKUP, pickupArmor.Length > 0); selectTypeIndex = (int)Mathf.Log((float)smithCreateData.selectCreateEquipItemType, 2f); string caption = (!MonoBehaviourSingleton <InventoryManager> .I.IsWeaponInventoryType(base.selectInventoryType)) ? base.sectionData.GetText("CAPTION_DEFENCE") : base.sectionData.GetText("CAPTION_WEAPON"); InitializeCaption(caption); }
protected virtual IEnumerator DoInitialize() { object[] datas = GameSection.GetEventData() as object[]; EquipItemInfo info = datas[0] as EquipItemInfo; SmithEquipBase.SmithType smithType = (SmithEquipBase.SmithType)(int) datas[1]; bool wait = true; switch (smithType) { case SmithEquipBase.SmithType.ABILITY_CHANGE: MonoBehaviourSingleton <SmithManager> .I.SendGetAbilityList(info.uniqueID, delegate(Error error, List <SmithGetAbilityList.Param> list) { ((_003CDoInitialize_003Ec__IteratorC4) /*Error near IL_0087: stateMachine*/)._003Cwait_003E__3 = false; ((_003CDoInitialize_003Ec__IteratorC4) /*Error near IL_0087: stateMachine*/)._003C_003Ef__this.SetAbilities(list); }); break; case SmithEquipBase.SmithType.GENERATE: { SmithManager.SmithCreateData createdata = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); MonoBehaviourSingleton <SmithManager> .I.SendGetAbilityListPreGenerate(createdata.createEquipItemTable.id, delegate(Error error, List <SmithGetAbilityListForCreateModel.Param> list) { ((_003CDoInitialize_003Ec__IteratorC4) /*Error near IL_00c2: stateMachine*/)._003Cwait_003E__3 = false; ((_003CDoInitialize_003Ec__IteratorC4) /*Error near IL_00c2: stateMachine*/)._003C_003Ef__this.SetAbilities(list); }); break; } } while (wait) { yield return((object)null); } base.Initialize(); }
protected override void InitSort() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); if (smithData.selectCreateEquipItemType < SortBase.TYPE.ARMOR || smithData.selectCreateEquipItemType == SortBase.TYPE.WEAPON_ALL) { if (smithData.selectCreateEquipItemType == SortBase.TYPE.WEAPON_ALL) { sortSettings = SortSettings.CreateMemSortSettings(SortBase.DIALOG_TYPE.SMITH_CREATE_PICKUP_WEAPON, SortSettings.SETTINGS_TYPE.CREATE_EQUIP_ITEM); } else { sortSettings = SortSettings.CreateMemSortSettings(SortBase.DIALOG_TYPE.SMITH_CREATE_WEAPON, SortSettings.SETTINGS_TYPE.CREATE_EQUIP_ITEM); } } else if (smithData.selectCreateEquipItemType == SortBase.TYPE.ARMOR_ALL) { sortSettings = SortSettings.CreateMemSortSettings(SortBase.DIALOG_TYPE.SMITH_CREATE_PICKUP_ARMOR, SortSettings.SETTINGS_TYPE.CREATE_EQUIP_ITEM); } else { sortSettings = SortSettings.CreateMemSortSettings(SortBase.DIALOG_TYPE.SMITH_CREATE_ARMOR, SortSettings.SETTINGS_TYPE.CREATE_EQUIP_ITEM); } }
protected override uint GetCreateEquiptableID() { SmithManager.SmithCreateData smithData = MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithCreateData>(); return(smithData.createEquipItemTable.id); }