public static void ShowEquipWindowByPos(EPosType posType, int pos) { GTWindowManager.Instance.OpenWindow(EWindowID.UIEquip); UIEquip window = (UIEquip)GTWindowManager.Instance.GetWindow(EWindowID.UIEquip); window.ShowEquipWindowByPos(posType, pos); }
public static bool AssessoryPatch_UI2(UIEquip __instance) { WGBtn[] componentsInChildren = __instance.GetComponentsInChildren <WGBtn>(); WGBtn wgbtn = componentsInChildren[componentsInChildren.Length - 1]; var trans = wgbtn.transform.parent.Find("switchAcc"); if (trans == null) { GameObject gameObject = new GameObject("switchAcc"); gameObject.transform.SetParent(wgbtn.transform.parent, false); gameObject.transform.localPosition = wgbtn.transform.localPosition + new Vector3(-180f, 0f, 0f); gameObject.transform.localScale *= 0.5f; var accSwitch = gameObject.AddComponent <WGBtn>(); gameObject.AddComponent <Image>().sprite = Game.Resource.Load <Sprite>("Image/UI/UICharacter/Info_btn_next.png"); accSwitch.PointerClick = new WGBtn.TriggerEvent(); accSwitch.PointerClick.AddListener(delegate(BaseEventData eventData) { var controller = Traverse.Create(__instance).Field("controller").GetValue <CtrlEquip>(); _accessoryIndex = (_accessoryIndex + 1) % (1 + moreAccessories.Value); var mapping = Traverse.Create(controller).Field("mapping").GetValue <CharacterMapping>(); controller.ShowEquip(EquipType.Jewelry, Game.GameData.Character[mapping.InfoId].Equip.GetEquip(EquipType.Jewelry)); }); gameObject.SetActive(moreAccessories.Value > 0); AssessoryPatch_UI3(__instance); } return(true); }
private bool isLeft = true; //面板显示在左边 void Awake() { Instance = this; mSprite_Equip = Global.FindChild <UISprite>(transform, "Sprite_Equip"); mLabel_Name = Global.FindChild <UILabel>(transform, "Label_Name"); mLabel_Quality = Global.FindChild <UILabel>(transform, "Label_Quality"); mLabel_Damage = Global.FindChild <UILabel>(transform, "Label_Damage"); mLabel_Hp = Global.FindChild <UILabel>(transform, "Label_Hp"); mLabel_Lv = Global.FindChild <UILabel>(transform, "Label_Lv"); mLabel_Des = Global.FindChild <UILabel>(transform, "Label_Des"); mLabel_Equip = Global.FindChild <UILabel>(transform, "Label_Equip"); mButton_Exit = GetWidget("Button_Exit"); if (mButton_Exit != null) { mButton_Exit.OnMouseClick = this.ButtonExitOnClick; } mButton_Equip = GetWidget("Button_Equip"); if (mButton_Equip != null) { mButton_Equip.OnMouseClick = this.ButtonEquipOnClick; } mButton_Upgrade = GetWidget("Button_Upgrade"); if (mButton_Upgrade != null) { mButton_Upgrade.OnMouseClick = this.ButtonUpgradeOnClick; } }
public static bool AssessoryPatch_UI3(UIEquip __instance) { var accessories = Traverse.Create(__instance).Field("accessories").GetValue <WGPropsIntroduction>(); Text[] componentsInChildren = accessories.GetComponentsInChildren <Text>(); var accIdText = componentsInChildren[0]; if (moreAccessories.Value > 0) { accIdText.text = StringTool.GetStringTable("Equip_CurrentAccessories") + " " + (_accessoryIndex + 1); } else { accIdText.text = StringTool.GetStringTable("Equip_CurrentAccessories"); } return(true); }
public static void AssessoryPatch_UI4(UIEquip __instance) { _accessoryIndex = 0; }