public void OpenTattooSelectionWindow(TattooBodySlot slot) { main.SetActive(false); popupSelection.SetActive(true); buttonClose.SetActive(false); popupSelection.GetComponent <UITattooChoose>().Initialize(slot.part, this); }
public void Initialize(TattooBodySlot slot, string tattooID, UITattoo uiTattoo) { _uiTattooMain = uiTattoo; _slot = slot; ItemData itemData; TattooData td; if (slot == null) //called from recipe clicking { itemData = DataManager.Instance.GetItemData(tattooID); //show goto button buttonGotoMake.SetActive(true); buttonReplace.SetActive(false); buttonRemove.SetActive(false); } else { itemData = slot.item.ItemData; buttonGotoMake.SetActive(false); buttonReplace.SetActive(true); buttonRemove.SetActive(true); } td = DataManager.Instance.GetTattooData(itemData.id); _tattooData = td; icon.mainTexture = InJoy.AssetBundles.AssetBundles.Load(itemData.iconPath) as Texture2D; labelName.text = Localization.instance.Get(itemData.nameIds); labelBearPoint.text = td.bearingPoint.ToString(); labelPos.text = Utils.GetTattooApplicablePositions(td.applicableParts); labelEffect.text = Localization.instance.Get(itemData.descriptionIds); if (string.IsNullOrEmpty(td.suiteID)) { labelSuiteEffect.text = string.Empty; } else { labelSuiteEffect.text = Localization.instance.Get(DataManager.Instance.GetTattooSuiteData(td.suiteID).descIDS); } }
//called when clicking on a slot public void OnClickOnSlot(TattooBodySlot slot) { _selectedPart = slot.part; if (slot.IsLocked) { UIMessageBoxManager.Instance.ShowMessageBox(string.Format(Localization.instance.Get("IDS_TATTOO_WILL_UNLOCK_AT_LEVEL"), Localization.instance.Get(Utils.k_tattoo_part_names[(int)slot.part]), slot.UnlockLevel), null, MB_TYPE.MB_OK, null); } else if (slot.item == null) //empty slot { _uiTattoo.OpenTattooSelectionWindow(slot); } else //occupied { _uiTattoo.ShowTattooDetailWindow(slot, null); } }
public void ShowTattooDetailWindow(TattooBodySlot slot, string tattooID) { popupRemove.SetActive(true); popupRemove.GetComponent <UITattooRemove>().Initialize(slot, tattooID, this); }